From 829c3ed5d76ba032699497ddf8348eb7598fe058 Mon Sep 17 00:00:00 2001 From: Rafal Czajkowski Date: Tue, 28 Nov 2023 14:34:55 +0100 Subject: [PATCH] Rename param in `stake` function `referrer` -> `referral` --- core/contracts/Acre.sol | 8 ++++---- core/test/Acre.test.ts | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/core/contracts/Acre.sol b/core/contracts/Acre.sol index 91c2fc714..a25e2252a 100644 --- a/core/contracts/Acre.sol +++ b/core/contracts/Acre.sol @@ -18,7 +18,7 @@ contract Acre is ERC4626, IReceiveApproval { /// @param token Token contract address. /// @param extraData Extra data for stake. This byte array must have the /// following values concatenated: - /// - referrer ID (32 bytes) + /// - referral (32 bytes) function receiveApproval( address from, uint256 amount, @@ -37,14 +37,14 @@ contract Acre is ERC4626, IReceiveApproval { /// @dev This function calls `deposit` function from `ERC4626` contract. /// @param assets Approved amount for the transfer and stake. /// @param receiver The address to which the shares will be minted. - /// @param referrer Data used for refferal program. + /// @param referral Data used for referral program. /// @return shares Minted shares. function stake( uint256 assets, address receiver, - bytes32 referrer + bytes32 referral ) public returns (uint256 shares) { - require(referrer != bytes32(0), "Referrer can not be empty"); + require(referral != bytes32(0), "Referral can not be empty"); return deposit(assets, receiver); } diff --git a/core/test/Acre.test.ts b/core/test/Acre.test.ts index c82ef81eb..03f40393f 100644 --- a/core/test/Acre.test.ts +++ b/core/test/Acre.test.ts @@ -30,7 +30,7 @@ describe("Acre", () => { }) describe("Staking", () => { - const referrer = ethers.encodeBytes32String("referrer") + const referral = ethers.encodeBytes32String("referral") context("when staking via Acre contract", () => { beforeEach(async () => { @@ -47,7 +47,7 @@ describe("Acre", () => { await expect( acre .connect(tokenHolder) - .stake(amountToStake, tokenHolderAddress, referrer), + .stake(amountToStake, tokenHolderAddress, referral), ) .to.emit(acre, "Deposit") .withArgs( @@ -103,7 +103,7 @@ describe("Acre", () => { const acreAddress = await acre.getAddress() const invalidExtraData = ethers.AbiCoder.defaultAbiCoder().encode( ["bytes32", "address"], - [referrer, tokenHolder.address], + [referral, tokenHolder.address], ) await expect(