Skip to content

Commit

Permalink
Rename param in stake function
Browse files Browse the repository at this point in the history
`referrer` -> `referral`
  • Loading branch information
r-czajkowski committed Nov 28, 2023
1 parent 684d667 commit 829c3ed
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions core/contracts/Acre.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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);
}
Expand Down
6 changes: 3 additions & 3 deletions core/test/Acre.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand All @@ -47,7 +47,7 @@ describe("Acre", () => {
await expect(
acre
.connect(tokenHolder)
.stake(amountToStake, tokenHolderAddress, referrer),
.stake(amountToStake, tokenHolderAddress, referral),
)
.to.emit(acre, "Deposit")
.withArgs(
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 829c3ed

Please sign in to comment.