From 2fe76d34a467733b3f763974884e6018585d4c3b Mon Sep 17 00:00:00 2001 From: owen05 Date: Mon, 21 Feb 2022 16:31:27 +0800 Subject: [PATCH] deploy erc20V3 --- config/arb-config.js | 4 +++- config/aurora-config.js | 4 +++- config/avax-config.js | 4 +++- config/boba-config.js | 4 +++- config/bsc-config.js | 5 +++-- config/eth-config.js | 5 +++-- config/heco-config.js | 5 +++-- config/matic-config.js | 5 +++-- config/moonriver-config.js | 4 +++- config/ok-config.js | 5 +++-- config/rinkeby-config.js | 4 ++-- contracts/external/ERC20/CustomERC20.sol | 9 +++++--- .../external/ERC20/CustomMintableERC20.sol | 9 +++++--- migrations/2_deploy_erc20V3.js | 2 +- truffle-config.js | 22 ++++++++++++++----- 15 files changed, 61 insertions(+), 30 deletions(-) diff --git a/config/arb-config.js b/config/arb-config.js index fff9f32..b3972a7 100644 --- a/config/arb-config.js +++ b/config/arb-config.js @@ -35,7 +35,8 @@ module.exports = { ERC20MineV2: "0xe91067189C71dB0696bD6fBC14535CB159F98b5C", ERC20MineV3: "0x973CAB76C35BB1da47e044A63546c69A8Ac1143c", ERC20: "0xBb245F54569841906eC7eDFFf72a910557B81378", - CustomERC20: "0xcE2a934933465E187c95AcAce60BC650a06aD373", + CustomERC20: "0x62c64E744BCB041339840f965bd3E5E9F423C3DF", + CustomMintableERC20: "0xdcE65928396788512c737879953eAA08E7A3BEDA", //Factory DVMFactory: "0xDa4c4411c55B0785e501332354A036c04833B72b", @@ -44,6 +45,7 @@ module.exports = { UpCpFactory: "0xE92787F457F541a9D5Ae17C1dbdBffA8D3BA3C25", CrowdPoolingFactory: "0x6E5f239f729c83E976a7A280F81Dd1685dd89218", ERC20V2Factory: "0x750B153E6a69DCA16eb12D5aEdDFD80ca3f10d1C", + ERC20V3Factory: "0x5CA5e03228a3C16EF262d29E588Adb6c2445fDbC", DODOMineV2Factory: "0x5a2E2278A0fACcf224cEd1ce809eC4e4b1708759", DODOMineV3Registry: "0x2B40bC6c9C12c18787436aa1E2B761f684F42999", diff --git a/config/aurora-config.js b/config/aurora-config.js index 4d74afe..252d9a8 100644 --- a/config/aurora-config.js +++ b/config/aurora-config.js @@ -32,7 +32,8 @@ module.exports = { ERC20MineV3: "0x9B64c81ba54eA51e1f6B7fefb3cfF8AA6F1e2A09", ERC20: "0x6373ceB657C83C91088d328622573FB766064Ac4", - CustomERC20: "0x3CD6D7F5fF977bf8069548eA1F9441b061162b42", + CustomERC20: "0xEE6d41C38B954E3B1E54A499553e9afF3AB2636B", + CustomMintableERC20: "0x5E7878d700C9c667eD17Eb2D62d8c394Ebf7c94F", //Factory @@ -42,6 +43,7 @@ module.exports = { UpCpFactory: "0xa356867fDCEa8e71AEaF87805808803806231FdC", CrowdPoolingFactory: "0xc6962a577A3Be5311f9f9Ab9B8b6A69a25bBc817", ERC20V2Factory: "0xDfaf9584F5d229A9DBE5978523317820A8897C5A", + ERC20V3Factory: "0xD6Bd9f3d4ad1b4464e8DdfF2da2bcAC1ff55D868", //DODOMineV2Factory: "0x9aE501385Bc7996A2A4a1FBb00c8d3820611BCB5", DODOMineV3Registry: "0xfDDCA6ffCE24dF5bE3e8AaD32081822f86178048", diff --git a/config/avax-config.js b/config/avax-config.js index 7f835f2..62859ac 100644 --- a/config/avax-config.js +++ b/config/avax-config.js @@ -31,7 +31,8 @@ module.exports = { ERC20MineV3: "0xF31162ef57b61D2FBA4f64dBbaC536bFc782D37c", ERC20: "0xf94435Ad7Edc3D5aDd1C1345622Bb745D0387416", - CustomERC20: "0x1cC529DB2a7D45F68B698A7019D4eE1e6FB2D58F", + CustomERC20: "0xe91067189C71dB0696bD6fBC14535CB159F98b5C", + CustomMintableERC20: "0x77dec47f415614f0038948a0D9f54a638b58fdc8", //Approve DODOApprove: "0xCFea63e3DE31De53D68780Dd65675F169439e470", @@ -45,6 +46,7 @@ module.exports = { UpCpFactory: "0x55793C2c8A796cCE00EF2D1a86CCA2E0399BF285", CrowdPoolingFactory: "0x25B2f945Fec30F34b05d416C7c0b5c6c51A3ADdC", ERC20V2Factory: "0x141b4497a298340E8B451ac4eeE947B00aDbe07A", + ERC20V3Factory: "0x00971e21955F1bb8021a5eF2546beC2Ff896EE42", //DODOMineV2Factory: "0xCDFD45f965De9932367833Ca7187e4c9C43A2380", DODOMineV3Registry: "0x0fe261aeE0d1C4DFdDee4102E82Dd425999065F4", diff --git a/config/boba-config.js b/config/boba-config.js index c6caa1b..edfc636 100644 --- a/config/boba-config.js +++ b/config/boba-config.js @@ -32,7 +32,8 @@ module.exports = { ERC20MineV3: "0x1c31c6d0032768463EaBABe1A47D04c6470d31fE", ERC20: "0x1e0D4043C0CD3ed15F3c2AfE60B0F213c9b5E30d", - CustomERC20: "0x18AA6Bb215CDBd179E7beAE10F66C21B26971306", + CustomERC20: "0x3902e65A204f4081cC9f41Cc47a0dE3D9c1F582C", + CustomMintableERC20: "0x2014f3C6085A2Be5672160376108Ce52596106AC", //Factory @@ -42,6 +43,7 @@ module.exports = { UpCpFactory: "0xCFea63e3DE31De53D68780Dd65675F169439e470", CrowdPoolingFactory: "0x96a75d73b3de29c009863fA6329D96b2181D3Dc4", ERC20V2Factory: "0x313fcb27BD83607C33998AA60E409C79Fb2251fd", + ERC20V3Factory: "0x2DdAD36517d5795120bd38F1d87E434C25f60Eca", //DODOMineV2Factory: "0xb7865a5ceE051d35B09A48b624D7057d3362655a", DODOMineV3Registry: "0x2b0d94Eb7A63B8a2909dE1CB3951ecF7Ae76D2fE", diff --git a/config/bsc-config.js b/config/bsc-config.js index 2b38888..d67990d 100644 --- a/config/bsc-config.js +++ b/config/bsc-config.js @@ -27,8 +27,8 @@ module.exports = { ERC20MineV3: "0xBA428FC3c5ce457c236869787c26f725Ff5168D8", ERC20: "0x99155E68aC1523B6f461F6427A90607ecCF7bDF5", - MintableERC20: "0x6373ceb657c83c91088d328622573fb766064ac4", - CustomERC20: "0x4777A6f28c8Bb260D9a945dddeFabB942aE10f1f", + CustomERC20: "0x2aabD11FD4f681636E38C2ee3CA785603598051b", + CustomMintableERC20: "0xFF739f9743e14f8846452690f669F730b97eaff3", //Factory DVMFactory: "0x790B4A80Fb1094589A3c0eFC8740aA9b0C1733fB", @@ -38,6 +38,7 @@ module.exports = { CrowdPoolingFactory: "0x778DF5B12170e8af8dF94356BfC864E57CE185DC", ERC20Factory: "0x5e84190a270333aCe5B9202a3F4ceBf11b81bB01", ERC20V2Factory: "0x652C09785c15db4adAce871eD8874b8968A19A4D", + ERC20V3Factory: "0x5eD22a48Fee263207f5cAAE1A1f1a27011e7Dc92", DODOMineV3Registry: "0x2A5aa99095E3724b8955BF7b5E47dbe2730dabD8", //Approve diff --git a/config/eth-config.js b/config/eth-config.js index 1d36b2b..b78827c 100644 --- a/config/eth-config.js +++ b/config/eth-config.js @@ -25,8 +25,8 @@ module.exports = { CP: "0x327344B382EE1b44FB0a72945fCDCC7243200dD7", ERC20MineV3: "0xD57f29B297e33c977e2186a751414BFeD6A38c5a", ERC20: "0x8443a5bD91C8f68582F90dD3354f750900C5E8Cc", - MintableERC20: "0x0596908263ef2724fbfbcafa1c983fcd7a629038", - CustomERC20: "0x9Cd85f012050FE030271dCB7c0a0C1e2043Ce4a9", + CustomERC20: "0xf439E39614c304Aa218345a538c92756484BF75b", + CustomMintableERC20: "0x234E86cfD20962aE802AaFE38590EC84372fd4e5", //Factory DVMFactory: "0x72d220cE168C4f361dD4deE5D826a01AD8598f6C", @@ -36,6 +36,7 @@ module.exports = { CrowdPoolingFactory: "0xE8C9A78725D0451FA19878D5f8A3dC0D55FECF25", ERC20Factory: "0x44D5dF24d5Ef52A791D6436Fa45A8D426f6de34e", ERC20V2Factory: "0xAA810cd0363d3378F0a13e327EC2Aee7051aDa73", + ERC20V3Factory: "0x7466C6FE28180c33e2a35989FD6833C8dD5A7E16", DODOMineV3Registry: "0xf8ab09b3D2d5EfA603f4646E5a8A12588E852195", //Approve diff --git a/config/heco-config.js b/config/heco-config.js index 9419be2..0ed7365 100644 --- a/config/heco-config.js +++ b/config/heco-config.js @@ -26,8 +26,8 @@ module.exports = { CP: "0x5B67cF070ce4303Ff4d450f21Cc371F9f0549335", ERC20MineV3: "0xBE227f1383C1c5f96948e1939EFaC011FAba56D8", ERC20: "0x2870fB656C7D245dc74afbA34B0d453FA67Ce4fA", - MintableERC20: "0xdd9de5ed7a11b1ed3314cd7f754f27a15dedc63f", - CustomERC20: "0x2cE80F95eD3d2a76694896843F18413ae83baF40", + CustomERC20: "0x69F14b9ADC440F645822937968a03Eab42e085Dc", + CustomMintableERC20: "0x83c68Fd10Df02F07c2208B4a32E83C657CE74e5E", //Factory DVMFactory: "0xd8c77CF0F01222b07B8343A681C46eFA3faEa985", @@ -37,6 +37,7 @@ module.exports = { CrowdPoolingFactory: "0x56133d0b63abf7A15D5697dD2dB9e04730f1A9C2", ERC20Factory: "0x2cCDF6F742afBe813B68Ec6bb421C1BEa74fBd46", ERC20V2Factory: "0x1297264617bd34270B77c2fFD3aA110D3fd2f7aF", + ERC20V3Factory: "0x08928cC8bfE3Fb166ed16864953829205f214689", DODOMineV3Registry: "0xeA73542FbF76b35e46901e0Ca19BcC5A0361F5BF", //Approve DODOApprove: "0x68b6c06Ac8Aa359868393724d25D871921E97293", diff --git a/config/matic-config.js b/config/matic-config.js index 242c671..eb148ea 100644 --- a/config/matic-config.js +++ b/config/matic-config.js @@ -27,8 +27,8 @@ module.exports = { CP: "0x4BFa49b0a0B6B08D3D82b8AB45feC0c737880155", ERC20MineV3: "0xda59427Bd9d4827Ec9f751719eb79b0a3e74FA4D", ERC20: "0x34b9Dc29AaDc313F2BF828B7Be1e0DEe393D28e3", - MintableERC20: "0x7737fd30535c69545deeEa54AB8Dd590ccaEBD3c", - CustomERC20: "0xaF49DBAaf177beE57f84731260a9eb8819d25eff", + CustomERC20: "0xD4F77342a08EFF87B67D2F0Cfd34ed8c8E6Aa49e", + CustomMintableERC20: "0x5f3178c155cB96f3Fd42E66933efF941a1122D79", //Factory DVMFactory: "0x79887f65f83bdf15Bcc8736b5e5BcDB48fb8fE13", @@ -38,6 +38,7 @@ module.exports = { CrowdPoolingFactory: "0x42ddEc68db70F5992eB7AB22dfaD8A57109841C9", ERC20Factory: "0xaeB5CF31b97dce6134e416129845e01106fFB177", ERC20V2Factory: "0x8e2f666F316b614c76676215F16F0A9746f96a90", + ERC20V3Factory: "0x5258Db198f6E39889bfCA6016786AF562Ab8bE91", DODOMineV3Registry: "0x27566bf9504466F6f3a1571E1863Da42fff4D25E", //Approve diff --git a/config/moonriver-config.js b/config/moonriver-config.js index a1d691a..51ff19f 100644 --- a/config/moonriver-config.js +++ b/config/moonriver-config.js @@ -33,7 +33,8 @@ module.exports = { ERC20MineV3: "0x4599ed18F34cFE06820E3684bF0aACB8D75c644d", ERC20: "0x80930Cb1849F7D42531506fF45E66724338A821b", - CustomERC20: "0xB5Dc5E183c2aCf02aB879A8569aB4EDAf147d537", + CustomERC20: "0x914Dcc2760b93e912180978C2B6330562AA4e7c9", + CustomMintableERC20: "0xf2a87022CE8D672969873C3baFd2281122b2EA93", //Factory @@ -43,6 +44,7 @@ module.exports = { UpCpFactory: "0x043957f7554275b90c5178872faE851dcfC1089D", CrowdPoolingFactory: "0x0596908263Ef2724fBfBcAfA1c983FCD7a629038", ERC20V2Factory: "0xaeB5CF31b97dce6134e416129845e01106fFB177", + ERC20V3Factory: "0x1518e34156F12049b387620a7778685bf4d0D61B", //DODOMineV2Factory: "0xe71C0660CEC20F74CcB243d6c33AFC12419e8f41", DODOMineV3Registry: "0x5515363c0412AdD5c72d3E302fE1bD7dCBCF93Fe", diff --git a/config/ok-config.js b/config/ok-config.js index 71ca551..f6faa0a 100644 --- a/config/ok-config.js +++ b/config/ok-config.js @@ -27,8 +27,8 @@ module.exports = { ERC20MineV3: "0xc4436fBAE6eBa5d95bf7d53Ae515F8A707Bd402A", ERC20: "0xB5Dc5E183c2aCf02aB879A8569aB4EDAf147d537", - MintableERC20: "0xf50BDc9E90B7a1c138cb7935071b85c417C4cb8e", - CustomERC20: "0xa2CB66EBB947D217f61510882096F6e95c1DE97D", + CustomERC20: "0xfa7b786a1A2CC4461ff78B549Ced7943808109E4", + CustomMintableERC20: "0x471e1A083D76C4FC9e088FD259F64Eff0A37DAbD", //Factory DVMFactory: "0x9aE501385Bc7996A2A4a1FBb00c8d3820611BCB5", @@ -38,6 +38,7 @@ module.exports = { CrowdPoolingFactory: "0x85351262f7474Ebe23FfAcD633cf20A491F1325D", ERC20Factory: "0xE8C9A78725D0451FA19878D5f8A3dC0D55FECF25", ERC20V2Factory: "0xfDDCA6ffCE24dF5bE3e8AaD32081822f86178048", + ERC20V3Factory: "0x48D77f44416fD0b08f1Eca90Bc437D0a3e4e550d", DODOMineV3Registry: "0xb159260989012fA98af560A3Fa6D9cd11a64cf6E", //Approve diff --git a/config/rinkeby-config.js b/config/rinkeby-config.js index f7973ed..7b4bc06 100644 --- a/config/rinkeby-config.js +++ b/config/rinkeby-config.js @@ -24,8 +24,8 @@ module.exports = { CP: "0x6850eE8cF963B913a8eC3610B5f128C3100178E5", ERC20MineV3: "0xd5Bbb5497d0503a8d0CB5A9410EcFfF840Fe0012", ERC20: "0x7119D1Ec8235bd0a82289fDb1cCAa4bD4D1e0605", - CustomERC20: "0x0cAe1660A490145C23A9393096CC58DD05f17a47",//0x0Cd57DC8367362314C510446FD106B66989Eb81a - CustomMintableERC20: "0xa22Af2C70D4b81fD6e74a0Ff20807DE9b3088F31", + CustomERC20: "0xBcCd9698CF3Be0b37d227406699aEaa3D6C413A1", + CustomMintableERC20: "0xb1289c136866b089637032E40499a3A065629AC1", //Factory diff --git a/contracts/external/ERC20/CustomERC20.sol b/contracts/external/ERC20/CustomERC20.sol index d21ad67..b0bbfd2 100644 --- a/contracts/external/ERC20/CustomERC20.sol +++ b/contracts/external/ERC20/CustomERC20.sol @@ -102,16 +102,19 @@ contract CustomERC20 is InitializableOwnable { if(tradeBurnRatio > 0) { burnAmount = amount.mul(tradeBurnRatio).div(10000); balances[address(0)] = balances[address(0)].add(burnAmount); + emit Transfer(sender, address(0), burnAmount); } if(tradeFeeRatio > 0) { feeAmount = amount.mul(tradeFeeRatio).div(10000); balances[team] = balances[team].add(feeAmount); + emit Transfer(sender, team, feeAmount); } + + uint256 receiveAmount = amount.sub(burnAmount).sub(feeAmount); + balances[recipient] = balances[recipient].add(receiveAmount); - balances[recipient] = balances[recipient].add(amount.sub(burnAmount).sub(feeAmount)); - - emit Transfer(sender, recipient, amount); + emit Transfer(sender, recipient, receiveAmount); } diff --git a/contracts/external/ERC20/CustomMintableERC20.sol b/contracts/external/ERC20/CustomMintableERC20.sol index c456451..345cece 100644 --- a/contracts/external/ERC20/CustomMintableERC20.sol +++ b/contracts/external/ERC20/CustomMintableERC20.sol @@ -104,16 +104,19 @@ contract CustomMintableERC20 is InitializableOwnable { if(tradeBurnRatio > 0) { burnAmount = amount.mul(tradeBurnRatio).div(10000); balances[address(0)] = balances[address(0)].add(burnAmount); + emit Transfer(sender, address(0), burnAmount); } if(tradeFeeRatio > 0) { feeAmount = amount.mul(tradeFeeRatio).div(10000); balances[team] = balances[team].add(feeAmount); + emit Transfer(sender, team, feeAmount); } + + uint256 receiveAmount = amount.sub(burnAmount).sub(feeAmount); + balances[recipient] = balances[recipient].add(receiveAmount); - balances[recipient] = balances[recipient].add(amount.sub(burnAmount).sub(feeAmount)); - - emit Transfer(sender, recipient, amount); + emit Transfer(sender, recipient, receiveAmount); } function burn(uint256 value) external { diff --git a/migrations/2_deploy_erc20V3.js b/migrations/2_deploy_erc20V3.js index 9df31c2..856289e 100644 --- a/migrations/2_deploy_erc20V3.js +++ b/migrations/2_deploy_erc20V3.js @@ -48,7 +48,7 @@ module.exports = async (deployer, network, accounts) => { ERC20Address, CustomERC20Address, CustomMintableERC20Address, - "100000000000000000" //0.1 + "2000000000000000" //0.002 ); ERC20V3FactoryAddress = ERC20V3Factory.address; logger.log("ERC20V3FactoryAddress: ", ERC20V3FactoryAddress); diff --git a/truffle-config.js b/truffle-config.js index 7f6d014..5e87037 100755 --- a/truffle-config.js +++ b/truffle-config.js @@ -112,7 +112,7 @@ module.exports = { return new HDWalletProvider(privKey, "https://mainnet.infura.io/v3/" + infuraId); }, gas: 4000000, - gasPrice: 65000000000, + gasPrice: 60000000000, network_id: 1, skipDryRun: true }, @@ -142,9 +142,18 @@ module.exports = { provider: () => { return new HDWalletProvider(privKey, 'https://rpc.moonriver.moonbeam.network'); }, + gasPrice: 2000000000, network_id: 1285 }, + avax: { + provider: () => { + return new HDWalletProvider(privKey, 'https://api.avax.network/ext/bc/C/rpc'); + }, + gasPrice: 30000000000, + network_id: 43114 + }, + aurora: { networkCheckTimeout: 100000, provider: () => { @@ -153,7 +162,8 @@ module.exports = { return hdWalletProvider }, network_id: 0x4e454152, - gas: 10000000 + gas: 10000000, + gasPrice: 30000000, }, ok: { @@ -178,7 +188,7 @@ module.exports = { }) }, network_id: 288, - gasPrice: 10000000000, + gasPrice: 1000000000, timeoutBlocks: 200, skipDryRun: true }, @@ -198,8 +208,8 @@ module.exports = { return new HDWalletProvider(privKey, "https://arb1.arbitrum.io/rpc") }, network_id: '42161', - gas: 1200000, - gasPrice: 700000000, + gas: 2000000, + gasPrice: 1000000000, skipDryRun: true }, @@ -210,7 +220,7 @@ module.exports = { }, network_id: 137, gas: 6000000, - gasPrice: 3000000000, + gasPrice: 35000000000, // confirmations: 2, // timeoutBlocks: 200, skipDryRun: true