From 1a1ef017ee6f6449dc6005815396fd21a968acfe Mon Sep 17 00:00:00 2001 From: RM Date: Thu, 24 Aug 2023 16:22:23 +0700 Subject: [PATCH] BIFI with Permit --- contracts/BIFI/infra/BIFI.sol | 5 +++-- contracts/BIFI/strategies/DCA/BeefyERC721Enumerable.sol | 5 +++-- yarn.lock | 6 +++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/contracts/BIFI/infra/BIFI.sol b/contracts/BIFI/infra/BIFI.sol index e6f467d9..bd3f567f 100644 --- a/contracts/BIFI/infra/BIFI.sol +++ b/contracts/BIFI/infra/BIFI.sol @@ -3,10 +3,11 @@ pragma solidity ^0.8.0; import "@openzeppelin-4/contracts/token/ERC20/ERC20.sol"; +import "@openzeppelin-4/contracts/token/ERC20/extensions/ERC20Permit.sol"; -contract BIFI is ERC20 { +contract BIFI is ERC20, ERC20Permit { - constructor(address treasury) ERC20("Beefy", "BIFI") { + constructor(address treasury) ERC20("Beefy", "BIFI") ERC20Permit("Beefy") { _mint(treasury, 80_000 ether); } diff --git a/contracts/BIFI/strategies/DCA/BeefyERC721Enumerable.sol b/contracts/BIFI/strategies/DCA/BeefyERC721Enumerable.sol index b3d9f183..04ceb6c0 100644 --- a/contracts/BIFI/strategies/DCA/BeefyERC721Enumerable.sol +++ b/contracts/BIFI/strategies/DCA/BeefyERC721Enumerable.sol @@ -52,9 +52,10 @@ abstract contract BeefyERC721Enumerable is ERC721, IERC721Enumerable { function _beforeTokenTransfer( address from, address to, - uint256 tokenId + uint256 tokenId, + uint256 batchSize ) internal virtual override { - super._beforeTokenTransfer(from, to, tokenId); + super._beforeTokenTransfer(from, to, tokenId, batchSize); // Only allow one NFT for each address. require(_ownedTokens[to][0] == 0, "to: address already owns NFT"); diff --git a/yarn.lock b/yarn.lock index 8e951d2c..32d9fc91 100644 --- a/yarn.lock +++ b/yarn.lock @@ -823,9 +823,9 @@ integrity sha512-qIy6tLx8rtybEsIOAlrM4J/85s2q2nPkDqj/Rx46VakBZ0LwtFhXIVub96LXHczQX0vaqmAueDqNPXtbSXSaYQ== "@openzeppelin-4/contracts@npm:@openzeppelin/contracts": - version "4.7.2" - resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.7.2.tgz#7587416fe2d35abf574193515b8971bfe9f64bc7" - integrity sha512-4n/JL9izql8303mPqPdubuna/DWEMbmOzWYUWyCPhjhiEr2w3nQrjE7vZz1fBF+wzzP6dZbIcsgqACk53c9FGA== + version "4.9.3" + resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.9.3.tgz#00d7a8cf35a475b160b3f0293a6403c511099364" + integrity sha512-He3LieZ1pP2TNt5JbkPA4PNT9WC3gOTOlDcFGJW4Le4QKqwmiNJCRt44APfxMxvq7OugU/cqYuPcSBzOw38DAg== "@openzeppelin/contracts-upgradeable@^4.9.3": version "4.9.3"