From a63f7ff0a45daed835819480245eef4d85cecba3 Mon Sep 17 00:00:00 2001 From: owen05 Date: Fri, 28 May 2021 12:42:23 +0800 Subject: [PATCH] change drops contract name --- config/kovan-config.js | 4 +-- .../{BaseDrops.sol => DODODrops.sol} | 6 +++- deploy-drops.txt | 16 ++++++++++ migrations/6_deploy_dropsV2.js | 31 ++++++++++--------- test/utils/Contracts.ts | 2 +- 5 files changed, 41 insertions(+), 18 deletions(-) rename contracts/DODODrops/DODODropsV2/{BaseDrops.sol => DODODrops.sol} (98%) diff --git a/config/kovan-config.js b/config/kovan-config.js index 159200b..4088a47 100644 --- a/config/kovan-config.js +++ b/config/kovan-config.js @@ -70,8 +70,8 @@ module.exports = { InitializableERC1155: "0xc4d86FFB26EB6EcAe80D3f1e2c8519832Fd478B2", NFTTokenFactory: "0x834D13Ca0322Ccfe67596f09Cc26Ee3584297B94", - DodoNftErc721: "", - DodoNftErc1155: "", + DodoNftErc721: "0x98f2A8d6100635Ecb40ADA1B1FFb1ff4f0b3c5D8", + DodoNftErc1155: "0xE9C572287936dB1B0a951ca0768C1b0d26b62A04", DODONFTRegistry: "0x579eBcC668b5517F733587091C35D495FE8d6b68", DODONFTProxy: "0xe121c6C90735e2Ca12e21708F2F379A55Ce61426", diff --git a/contracts/DODODrops/DODODropsV2/BaseDrops.sol b/contracts/DODODrops/DODODropsV2/DODODrops.sol similarity index 98% rename from contracts/DODODrops/DODODropsV2/BaseDrops.sol rename to contracts/DODODrops/DODODropsV2/DODODrops.sol index 77ef6fc..5c57c82 100644 --- a/contracts/DODODrops/DODODropsV2/BaseDrops.sol +++ b/contracts/DODODrops/DODODropsV2/DODODrops.sol @@ -23,7 +23,7 @@ interface IDropsNft { function mint(address account, uint256 id, uint256 amount, bytes memory data) external; } -contract BaseDrops is InitializableMintableERC20, ReentrancyGuard { +contract DODODrops is InitializableMintableERC20, ReentrancyGuard { using SafeMath for uint256; using Address for address; using UniversalERC20 for IERC20; @@ -267,6 +267,10 @@ contract BaseDrops is InitializableMintableERC20, ReentrancyGuard { // ================= View =================== + function getSellingStage() public view returns (uint256 stageLen) { + stageLen = _SELLING_TIME_INTERVAL_.length; + } + function getSellingInfo() public view returns (uint256 curPrice, uint256 sellAmount, uint256 index) { uint256 curBlockTime = block.timestamp; if(curBlockTime >= _SELLING_TIME_INTERVAL_[0] && _SELLING_TIME_INTERVAL_[0] != 0) { diff --git a/deploy-drops.txt b/deploy-drops.txt index a45d080..f449707 100644 --- a/deploy-drops.txt +++ b/deploy-drops.txt @@ -12,3 +12,19 @@ Init BaseDrops Tx: 0x53876ec779656923d19304c951f9eee3de7c12b22d7bc0e33e185a0f307 DODOApproveProxy unlockAddProxy tx: 0x4bdefa4cdd3ea157228532b881816343bc08e6b4997085ba12340311f1756802 DODOApproveProxy addDODOProxy tx: 0xfded36432e52dd6b631e0f9ed375a38b9d921ac7a8a848b54082c95c34e63bca AddMinter DropsERC721 Tx: 0x3b1272e13bd90268b25d03732f1719b7fcc5e4f4ba74981ca32f3062c24fc36e +==================================================== +network type: kovan +Deploy time: 2021/5/28 上午10:55:05 +Deploy type: Drops_V2 +DropsERC721Address: 0xAD1d3ff765e49988745cE74A47eAEE09163a769b +Init DropsERC721 Tx: 0x78b5e5f67efa5aa6de90c4329155f81e9c6449f203312ae752fdcd92db625d79 +BaseDropsAddress: 0x9382c0657FfECB304F2Df61B693776D3dbf6A3f5 +Init BaseDrops Tx: 0x32adb679b49b94b60968cfb48753f048663af40e5fe652df5acc8fb24f24d349 +DODOApproveProxy unlockAddProxy tx: 0x4361331e73a927e4b24296f7b241743cd29577f92f47bae1ded1bfd7af4bd42b +DODOApproveProxy addDODOProxy tx: 0xed88b36a3d8d542b75907749c4bceb68debbc0c9052a62688c1c2ff32a246195 +AddMinter DropsERC721 Tx: 0xb513035977baa77edcd61d3e92f42573d16ea21149d3eff5155cafbf2510e07e +==================================================== +network type: development +Deploy time: 2021/5/28 上午11:10:04 +Deploy type: Drops_V2 +DropsERC721Address: 0x26ac0c147B77304a1f6BD3627F20aB6D375dc3CE diff --git a/migrations/6_deploy_dropsV2.js b/migrations/6_deploy_dropsV2.js index 4a1d87b..24dd891 100644 --- a/migrations/6_deploy_dropsV2.js +++ b/migrations/6_deploy_dropsV2.js @@ -9,7 +9,7 @@ const DropsFeeModel = artifacts.require("DropsFeeModel"); const DropsERC721 = artifacts.require("DropsERC721"); const DropsERC1155 = artifacts.require("DropsERC1155"); const DODODropsProxy = artifacts.require("DODODropsProxy") -const BaseDrops = artifacts.require("BaseDrops"); +const DODODrops = artifacts.require("DODODrops"); const RandomGenerator = artifacts.require("RandomGenerator"); module.exports = async (deployer, network, accounts) => { @@ -39,10 +39,10 @@ module.exports = async (deployer, network, accounts) => { var name = "DROPS" var symbol = "DROPS" var buyToken = "0x854b0f89BAa9101e49Bfb357A38071C9db5d0DFa" //Kovan DODO - var sellTimeIntervals = [curTime + 60 * 10, curTime + 60 * 60, curTime + 60 * 120] + var sellTimeIntervals = [curTime + 60 * 10, curTime + 60 * 60 * 24 * 2, curTime + 60 * 60 * 24 * 7] var sellPrices = ["1000000000000000000", "2000000000000000000", "0"] - var sellAmount = [30, 30, 0] - var redeemTime = curTime + 60 * 10 + var sellAmount = [30, 50, 0] + var redeemTime = curTime + 60 * 30 var probIntervals = [4, 10, 50, 100, 105] var tokenIdMaps = [ [0], @@ -51,7 +51,10 @@ module.exports = async (deployer, network, accounts) => { [6, 7], [19, 30, 35, 40] ] - var tokenIdList = [1, 2, 3, 4, 5, 6, 7, 8] + var tokenIdList = [] + for (var i = 0; i < 80; i++) { + tokenIdList.push(i + 1); + } if (deploySwitch.Drops_V2) { logger.log("===================================================="); @@ -106,9 +109,9 @@ module.exports = async (deployer, network, accounts) => { logger.log("DropsProxyAddress: ", DropsProxyAddress); } - await deployer.deploy(BaseDrops); - BaseDropsAddress = BaseDrops.address; - logger.log("BaseDropsAddress: ", BaseDropsAddress); + await deployer.deploy(DODODrops); + DODODropsAddress = DODODrops.address; + logger.log("DODODropsAddress: ", DODODropsAddress); //drops init var addrList = [ @@ -120,8 +123,8 @@ module.exports = async (deployer, network, accounts) => { nftContractAddress ] - const BaseDropsInstance = await BaseDrops.at(BaseDropsAddress); - var tx = await BaseDropsInstance.init( + const DODODropsInstance = await DODODrops.at(DODODropsAddress); + var tx = await DODODropsInstance.init( addrList, sellTimeIntervals, sellPrices, @@ -130,7 +133,7 @@ module.exports = async (deployer, network, accounts) => { isReveal, isProb ); - logger.log("Init BaseDrops Tx:", tx.tx); + logger.log("Init DODODrops Tx:", tx.tx); if (network == 'kovan') { @@ -148,14 +151,14 @@ module.exports = async (deployer, network, accounts) => { var tx = await DropsERC1155Instance.addMintAccount(DropsProxyAddress); logger.log("AddMinter DropsERC1155 Tx:", tx.tx); - await BaseDropsInstance.setProbInfo(probIntervals, tokenIdMaps); + await DODODropsInstance.setProbInfo(probIntervals, tokenIdMaps); } else { const DropsERC721Instance = await DropsERC721.at(DropsERC721Address); var tx = await DropsERC721Instance.addMintAccount(DropsProxyAddress); logger.log("AddMinter DropsERC721 Tx:", tx.tx); - - await BaseDropsInstance.setFixedAmountInfo(tokenIdList); + + await DODODropsInstance.setFixedAmountInfo(tokenIdList); } } } diff --git a/test/utils/Contracts.ts b/test/utils/Contracts.ts index 1c7a2a5..8c14e0c 100644 --- a/test/utils/Contracts.ts +++ b/test/utils/Contracts.ts @@ -67,7 +67,7 @@ export const NFT_PROXY = "DODONFTProxy" export const RANDOM_GENERATOR = "RandomGenerator" export const MYSTERY_BOX_V1 = "DODODropsV1" -export const DROPS_V2 = "BaseDrops" +export const DROPS_V2 = "DODODrops" export const DROPS_ERC721 = "DropsERC721" export const DROPS_ERC1155 = "DropsERC1155" export const DROPS_FEE_MODEL = "DropsFeeModel"