From c5020bb0d52de626e54f4bb2246e6b63abfe45cf Mon Sep 17 00:00:00 2001 From: nickkatsios Date: Mon, 30 Oct 2023 21:39:50 +0200 Subject: [PATCH 01/30] Add deploy + contract additions --- contracts/ERC721ABeanBasin.sol | 31 ++++++++++-- qualification/qualification/qualification.py | 1 + scripts/deploy.js | 51 +++++++++----------- 3 files changed, 52 insertions(+), 31 deletions(-) diff --git a/contracts/ERC721ABeanBasin.sol b/contracts/ERC721ABeanBasin.sol index 48a1a7a..eb08272 100644 --- a/contracts/ERC721ABeanBasin.sol +++ b/contracts/ERC721ABeanBasin.sol @@ -31,7 +31,7 @@ contract ERC721ABeanBasin is ERC721AUpgradeable, OwnableUpgradeable, UUPSUpgrade function initialize(string memory name_, string memory symbol_,address[] calldata addresses_, uint256[] calldata amounts_) initializerERC721A initializer public { __ERC721A_init(name_, symbol_); __Ownable_init(); - __adminMintAllInit(addresses_,amounts_); + __batchMintAllInit(addresses_,amounts_); } /* @@ -43,7 +43,7 @@ contract ERC721ABeanBasin is ERC721AUpgradeable, OwnableUpgradeable, UUPSUpgrade function _authorizeUpgrade(address) internal override onlyOwner {} /* - * @dev adminMintAllInit function used to mint NFT(s) to addresses + * @dev __batchMintAllInit function used to mint NFT(s) to addresses * @param addresses_ array of addresses to mint to * @param amt_ array of amounts to mint to each address * This function can only be called on initialization of the contract @@ -54,7 +54,7 @@ contract ERC721ABeanBasin is ERC721AUpgradeable, OwnableUpgradeable, UUPSUpgrade * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309), * instead of a sequence of {Transfer} event(s). */ - function __adminMintAllInit(address[] calldata addresses, uint256[] calldata amount) internal onlyInitializingERC721A{ + function __batchMintAllInit(address[] calldata addresses, uint256[] calldata amount) internal onlyInitializingERC721A{ // check that length of addresses == length of amount require(addresses.length == amount.length); @@ -68,6 +68,7 @@ contract ERC721ABeanBasin is ERC721AUpgradeable, OwnableUpgradeable, UUPSUpgrade } function _baseURI() internal view virtual override returns (string memory) { + // TODO: change to ipfs baseURI return 'mybaseURI'; } @@ -109,5 +110,29 @@ contract ERC721ABeanBasin is ERC721AUpgradeable, OwnableUpgradeable, UUPSUpgrade tokenUpgraded[tokenIds[i]] = true; } } + + function numberMinted(address owner) public view returns (uint256) { + return _numberMinted(owner); + } + + function totalMinted() public view returns (uint256) { + return _totalMinted(); + } + + function totalBurned() public view returns (uint256) { + return _totalBurned(); + } + + function nextTokenId() public view returns (uint256) { + return _nextTokenId(); + } + + function getAux(address owner) public view returns (uint64) { + return _getAux(owner); + } + + function setAux(address owner, uint64 aux) public { + _setAux(owner, aux); + } } diff --git a/qualification/qualification/qualification.py b/qualification/qualification/qualification.py index 1ba0966..e35101f 100644 --- a/qualification/qualification/qualification.py +++ b/qualification/qualification/qualification.py @@ -68,6 +68,7 @@ def filter_qualified_accounts(qualified_accounts_stats): print("Account: " + account + " removed " + str(bdv) + " bdv") accounts_visited.add(account) # Filter the qualified accounts dictionary + # TODO: Improve the filtering logic for account in account_bdv_removed: # If the account removed more than 20% of the bdv they deposited # Subtract 1 from the nfts qualified count and subtract the bdv removed from the cummulative deposited bdv diff --git a/scripts/deploy.js b/scripts/deploy.js index 39c08d6..d378802 100644 --- a/scripts/deploy.js +++ b/scripts/deploy.js @@ -1,33 +1,28 @@ -// We require the Hardhat Runtime Environment explicitly here. This is optional -// but useful for running the script in a standalone fashion through `node