From d60471ceffe90b7644d83d2436f9c7b06fa6a74f Mon Sep 17 00:00:00 2001 From: Mubaris NK Date: Sun, 28 Mar 2021 21:44:02 +0530 Subject: [PATCH 01/15] Add deployment script --- .env.example | 3 +++ hardhat.config.js | 17 +++++++++++++++-- package-lock.json | 3 ++- package.json | 3 ++- 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/.env.example b/.env.example index e69de29..c677c7b 100644 --- a/.env.example +++ b/.env.example @@ -0,0 +1,3 @@ +ALCHEMY_ID="<>" +ETHERSCAN="<>" +PRIVATE_KEY="<>" \ No newline at end of file diff --git a/hardhat.config.js b/hardhat.config.js index e973b1f..915b49e 100644 --- a/hardhat.config.js +++ b/hardhat.config.js @@ -4,6 +4,7 @@ require("@nomiclabs/hardhat-etherscan"); require("dotenv").config(); const ALCHEMY_ID = process.env.ALCHEMY_ID; +const PRIVATE_KEY = process.env.PRIVATE_KEY; // You need to export an object to set up your config // Go to https://hardhat.org/config/ to learn more @@ -13,7 +14,15 @@ const ALCHEMY_ID = process.env.ALCHEMY_ID; */ module.exports = { defaultNetwork: "hardhat", - solidity: "0.7.3", + solidity: { + version: "0.7.3", + settings: { + optimizer: { + enabled: true, + runs: 200 + } + } + }, networks: { hardhat: { forking: { @@ -22,9 +31,13 @@ module.exports = { }, blockGasLimit: 12000000, }, + kovan: { + url: `https://eth-kovan.alchemyapi.io/v2/${ALCHEMY_ID}`, + accounts: [`0x${PRIVATE_KEY}`], + gas: 12500000, + }, }, etherscan: { apiKey: process.env.ETHERSCAN } }; - diff --git a/package-lock.json b/package-lock.json index 4c755cd..1782caa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,8 @@ "license": "ISC", "dependencies": { "@nomiclabs/hardhat-etherscan": "^2.1.1", - "dotenv": "^8.2.0" + "dotenv": "^8.2.0", + "rlp": "^2.2.6" }, "devDependencies": { "@nomiclabs/hardhat-ethers": "^2.0.2", diff --git a/package.json b/package.json index dcf90bd..be53d29 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ }, "dependencies": { "@nomiclabs/hardhat-etherscan": "^2.1.1", - "dotenv": "^8.2.0" + "dotenv": "^8.2.0", + "rlp": "^2.2.6" } } From 5e80ee884813c641f5d6056794b07e93abd0a1ad Mon Sep 17 00:00:00 2001 From: Mubaris NK Date: Sun, 28 Mar 2021 21:44:09 +0530 Subject: [PATCH 02/15] Add deployment script --- scripts/deploy.js | 102 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 scripts/deploy.js diff --git a/scripts/deploy.js b/scripts/deploy.js new file mode 100644 index 0000000..482cf1f --- /dev/null +++ b/scripts/deploy.js @@ -0,0 +1,102 @@ +const hre = require("hardhat"); +const RLP = require('rlp'); +const { ethers } = hre; + +async function main() { + const deployerAddress = '0x2b02AAd6f1694E7D9c934B7b3Ec444541286cF0f' // Replace this + const initialSupply = ethers.utils.parseEther("10000000") // Replace with actual supply + const initialHolder = '0x0000000000000000000000000000000000000002' // Replace + const mintingAfter = 1622548800 // (June 1) Replace + const changeImplementationAfter = 1622548800 // (June 1) Replace + const governanceAdmin = '0x2b02AAd6f1694E7D9c934B7b3Ec444541286cF0f' // Replace this + const votingPeriod = 6000 // Replace this + const votingDelay = 1 // Replace this + const proposalThreshold = ethers.utils.parseEther("60000") + const timelockDelay = 259200 // (3 Days) Replace this + + const TokenDelegate = await ethers.getContractFactory("TokenDelegate") + const tokenDelegate = await TokenDelegate.deploy() + + await tokenDelegate.deployed() + + const TokenDelegator = await ethers.getContractFactory("TokenDelegator") + const tokenDelegator = await TokenDelegator + .deploy(initialHolder, tokenDelegate.address, initialSupply, mintingAfter, changeImplementationAfter, false) + + await tokenDelegator.deployed() + + const txCount = await ethers.provider.getTransactionCount(deployerAddress) + 2 + + const timelockAddress = '0x' + ethers.utils.keccak256(RLP.encode([deployerAddress, txCount])).slice(12).substring(14) + + const GovernorDelegate = await ethers.getContractFactory("GovernorBravoDelegate") + const governorDelegate = await GovernorDelegate.deploy() + + await governorDelegate.deployed() + + const GovernorDelegator = await ethers.getContractFactory("GovernorBravoDelegator") + const governorDelegator = await GovernorDelegator + .deploy( + timelockAddress, + governanceAdmin, + tokenDelegator.address, + governorDelegate.address, + votingPeriod, + votingDelay, + proposalThreshold + ) + + await governorDelegator.deployed() + + const Timelock = await ethers.getContractFactory("Timelock") + const timelock = await Timelock.deploy(governorDelegator.address, timelockDelay) + + console.log("TokenDelegate: ", tokenDelegate.address) + console.log("TokenDelegator: ", tokenDelegator.address) + console.log("Timelock: ", timelock.address) + console.log("GovernorBravoDelegate: ", governorDelegate.address) + console.log("GovernorBravoDelegator: ", governorDelegator.address) + console.log() + + await timelock.deployed() + + await hre.run("verify:verify", { + address: tokenDelegate.address, + constructorArguments: [] + }) + + await hre.run("verify:verify", { + address: tokenDelegator.address, + constructorArguments: [initialHolder, tokenDelegate.address, initialSupply, mintingAfter, changeImplementationAfter, false] + }) + + await hre.run("verify:verify", { + address: governorDelegate.address, + constructorArguments: [] + }) + + await hre.run("verify:verify", { + address: governorDelegator.address, + constructorArguments: [ + timelockAddress, + governanceAdmin, + tokenDelegator.address, + governorDelegate.address, + votingPeriod, + votingDelay, + proposalThreshold + ] + }) + + await hre.run("verify:verify", { + address: timelock.address, + constructorArguments: [governorDelegator.address, timelockDelay] + }) +} + +main() + .then(() => process.exit(0)) + .catch(error => { + console.error(error); + process.exit(1); + }); From e318315beef68de5b417a1b6a4a1dff52b990831 Mon Sep 17 00:00:00 2001 From: Thrilok Kumar Date: Mon, 29 Mar 2021 04:16:04 +0530 Subject: [PATCH 03/15] removed comment part in governorBravoDelegate --- contracts/GovernorBravoDelegate.sol | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/contracts/GovernorBravoDelegate.sol b/contracts/GovernorBravoDelegate.sol index e7f0b44..29af7a5 100644 --- a/contracts/GovernorBravoDelegate.sol +++ b/contracts/GovernorBravoDelegate.sol @@ -93,22 +93,6 @@ contract GovernorBravoDelegate is GovernorBravoDelegateStorageV1, GovernorBravoE uint endBlock = SafeMath.add(startBlock, votingPeriod); proposalCount++; - // Proposal memory newProposal = Proposal({ - // id: proposalCount, - // proposer: msg.sender, - // eta: 0, - // targets: targets, - // values: values, - // signatures: signatures, - // calldatas: calldatas, - // startBlock: startBlock, - // endBlock: endBlock, - // forVotes: 0, - // againstVotes: 0, - // abstainVotes: 0, - // canceled: false, - // executed: false - // }); Proposal storage newProposal = proposals[proposalCount]; From e3cef70a910421b592f1f09cddd8c80ff81c42c5 Mon Sep 17 00:00:00 2001 From: Thrilok Kumar Date: Mon, 29 Mar 2021 04:27:43 +0530 Subject: [PATCH 04/15] Added `Insta` prefix --- contracts/GovernorBravoDelegate.sol | 2 +- contracts/GovernorBravoDelegator.sol | 2 +- contracts/Timelock.sol | 2 +- contracts/TokenDelegate.sol | 3 +-- contracts/TokenDelegator.sol | 2 +- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/contracts/GovernorBravoDelegate.sol b/contracts/GovernorBravoDelegate.sol index 29af7a5..e1b7fdb 100644 --- a/contracts/GovernorBravoDelegate.sol +++ b/contracts/GovernorBravoDelegate.sol @@ -9,7 +9,7 @@ import { } from "./GovernorBravoInterfaces.sol"; import { SafeMath } from "./SafeMath.sol"; -contract GovernorBravoDelegate is GovernorBravoDelegateStorageV1, GovernorBravoEvents { +contract InstaGovernorBravoDelegate is GovernorBravoDelegateStorageV1, GovernorBravoEvents { /// @notice The name of this contract string public constant name = "DSL Governor Bravo"; diff --git a/contracts/GovernorBravoDelegator.sol b/contracts/GovernorBravoDelegator.sol index f6aa05f..fa2f89e 100644 --- a/contracts/GovernorBravoDelegator.sol +++ b/contracts/GovernorBravoDelegator.sol @@ -3,7 +3,7 @@ pragma experimental ABIEncoderV2; import { GovernorBravoDelegatorStorage, GovernorBravoEvents } from "./GovernorBravoInterfaces.sol"; -contract GovernorBravoDelegator is GovernorBravoDelegatorStorage, GovernorBravoEvents { +contract InstaGovernorBravoDelegator is GovernorBravoDelegatorStorage, GovernorBravoEvents { constructor( address timelock_, address admin_, diff --git a/contracts/Timelock.sol b/contracts/Timelock.sol index 35d95a8..8e5e87a 100644 --- a/contracts/Timelock.sol +++ b/contracts/Timelock.sol @@ -2,7 +2,7 @@ pragma solidity ^0.7.0; import "./SafeMath.sol"; -contract Timelock { +contract InstaTimelock { using SafeMath for uint; event NewAdmin(address indexed newAdmin); diff --git a/contracts/TokenDelegate.sol b/contracts/TokenDelegate.sol index 9b9e89f..6170214 100644 --- a/contracts/TokenDelegate.sol +++ b/contracts/TokenDelegate.sol @@ -4,8 +4,7 @@ pragma experimental ABIEncoderV2; import { TokenDelegateStorageV1, TokenEvents} from "./TokenInterfaces.sol"; import { SafeMath } from "./SafeMath.sol"; -// TODO @thrilok209 @KaymasJain - Rename it -contract TokenDelegate is TokenDelegateStorageV1, TokenEvents { +contract InstaTokenDelegate is TokenDelegateStorageV1, TokenEvents { /// @notice Minimum time between mints uint32 public constant minimumTimeBetweenMints = 1 days * 7; // TODO @thrilok209 @KaymasJain - Replace it diff --git a/contracts/TokenDelegator.sol b/contracts/TokenDelegator.sol index 5061b9c..20c679f 100644 --- a/contracts/TokenDelegator.sol +++ b/contracts/TokenDelegator.sol @@ -3,7 +3,7 @@ pragma experimental ABIEncoderV2; import { TokenDelegatorStorage, TokenEvents } from "./TokenInterfaces.sol"; -contract TokenDelegator is TokenDelegatorStorage, TokenEvents { +contract InstaTokenDelegator is TokenDelegatorStorage, TokenEvents { constructor( address account, address implementation_, From 7678114ca583b65cd7a15090648961e2ddd67545 Mon Sep 17 00:00:00 2001 From: Thrilok Kumar Date: Mon, 29 Mar 2021 04:28:28 +0530 Subject: [PATCH 05/15] Updated deployment script --- scripts/deploy.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/scripts/deploy.js b/scripts/deploy.js index 482cf1f..f721966 100644 --- a/scripts/deploy.js +++ b/scripts/deploy.js @@ -3,23 +3,23 @@ const RLP = require('rlp'); const { ethers } = hre; async function main() { - const deployerAddress = '0x2b02AAd6f1694E7D9c934B7b3Ec444541286cF0f' // Replace this + const deployerAddress = '0xB46693c062B49689cC4F624AaB24a7eA90275890' // Replace this const initialSupply = ethers.utils.parseEther("10000000") // Replace with actual supply const initialHolder = '0x0000000000000000000000000000000000000002' // Replace const mintingAfter = 1622548800 // (June 1) Replace const changeImplementationAfter = 1622548800 // (June 1) Replace - const governanceAdmin = '0x2b02AAd6f1694E7D9c934B7b3Ec444541286cF0f' // Replace this + const governanceAdmin = '0xB46693c062B49689cC4F624AaB24a7eA90275890' // Replace this const votingPeriod = 6000 // Replace this const votingDelay = 1 // Replace this const proposalThreshold = ethers.utils.parseEther("60000") const timelockDelay = 259200 // (3 Days) Replace this - const TokenDelegate = await ethers.getContractFactory("TokenDelegate") + const TokenDelegate = await ethers.getContractFactory("InstaTokenDelegate") const tokenDelegate = await TokenDelegate.deploy() await tokenDelegate.deployed() - const TokenDelegator = await ethers.getContractFactory("TokenDelegator") + const TokenDelegator = await ethers.getContractFactory("InstaTokenDelegator") const tokenDelegator = await TokenDelegator .deploy(initialHolder, tokenDelegate.address, initialSupply, mintingAfter, changeImplementationAfter, false) @@ -29,12 +29,12 @@ async function main() { const timelockAddress = '0x' + ethers.utils.keccak256(RLP.encode([deployerAddress, txCount])).slice(12).substring(14) - const GovernorDelegate = await ethers.getContractFactory("GovernorBravoDelegate") + const GovernorDelegate = await ethers.getContractFactory("InstaGovernorBravoDelegate") const governorDelegate = await GovernorDelegate.deploy() await governorDelegate.deployed() - const GovernorDelegator = await ethers.getContractFactory("GovernorBravoDelegator") + const GovernorDelegator = await ethers.getContractFactory("InstaGovernorBravoDelegator") const governorDelegator = await GovernorDelegator .deploy( timelockAddress, @@ -48,14 +48,14 @@ async function main() { await governorDelegator.deployed() - const Timelock = await ethers.getContractFactory("Timelock") + const Timelock = await ethers.getContractFactory("InstaTimelock") const timelock = await Timelock.deploy(governorDelegator.address, timelockDelay) - console.log("TokenDelegate: ", tokenDelegate.address) - console.log("TokenDelegator: ", tokenDelegator.address) - console.log("Timelock: ", timelock.address) - console.log("GovernorBravoDelegate: ", governorDelegate.address) - console.log("GovernorBravoDelegator: ", governorDelegator.address) + console.log("InstaTokenDelegate: ", tokenDelegate.address) + console.log("InstaTokenDelegator: ", tokenDelegator.address) + console.log("InstaTimelock: ", timelock.address) + console.log("InstaGovernorBravoDelegate: ", governorDelegate.address) + console.log("InstaGovernorBravoDelegator: ", governorDelegator.address) console.log() await timelock.deployed() From 51815d5b1e6a932ed88ec5de4d6e0f1a8487cbeb Mon Sep 17 00:00:00 2001 From: Thrilok Kumar Date: Mon, 29 Mar 2021 04:43:10 +0530 Subject: [PATCH 06/15] Updated deploy.js params --- scripts/deploy.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/deploy.js b/scripts/deploy.js index f721966..e84b3ed 100644 --- a/scripts/deploy.js +++ b/scripts/deploy.js @@ -4,15 +4,15 @@ const { ethers } = hre; async function main() { const deployerAddress = '0xB46693c062B49689cC4F624AaB24a7eA90275890' // Replace this - const initialSupply = ethers.utils.parseEther("10000000") // Replace with actual supply + const initialSupply = ethers.utils.parseEther("100000000") // 100M supply const initialHolder = '0x0000000000000000000000000000000000000002' // Replace - const mintingAfter = 1622548800 // (June 1) Replace - const changeImplementationAfter = 1622548800 // (June 1) Replace + const mintingAfter = 1743465600 // Thursday, 1 May 2025 00:00:00 + const changeImplementationAfter = 1743465600 // Thursday, 1 May 2025 00:00:00 const governanceAdmin = '0xB46693c062B49689cC4F624AaB24a7eA90275890' // Replace this - const votingPeriod = 6000 // Replace this - const votingDelay = 1 // Replace this - const proposalThreshold = ethers.utils.parseEther("60000") - const timelockDelay = 259200 // (3 Days) Replace this + const votingPeriod = 17280 // ~3 days in blocks (assuming 15s blocks) + const votingDelay = 1 // 1 block + const proposalThreshold = ethers.utils.parseEther("1000000") // 1M + const timelockDelay = 172800 // ~2 days in blocks (assuming 15s blocks) const TokenDelegate = await ethers.getContractFactory("InstaTokenDelegate") const tokenDelegate = await TokenDelegate.deploy() From 72ef69c4a2c3f179c6f8bebe57c51ff9ce8d2af3 Mon Sep 17 00:00:00 2001 From: Thrilok Kumar Date: Mon, 29 Mar 2021 04:50:46 +0530 Subject: [PATCH 07/15] Updated params on TokenDelegate.sol --- contracts/TokenDelegate.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contracts/TokenDelegate.sol b/contracts/TokenDelegate.sol index 6170214..56a2ead 100644 --- a/contracts/TokenDelegate.sol +++ b/contracts/TokenDelegate.sol @@ -6,10 +6,10 @@ import { SafeMath } from "./SafeMath.sol"; contract InstaTokenDelegate is TokenDelegateStorageV1, TokenEvents { /// @notice Minimum time between mints - uint32 public constant minimumTimeBetweenMints = 1 days * 7; // TODO @thrilok209 @KaymasJain - Replace it + uint32 public constant minimumTimeBetweenMints = 1 days * 365; // 365 days /// @notice Cap on the percentage of totalSupply that can be minted at each mint - uint8 public constant mintCap = 2; // TODO @thrilok209 @KaymasJain - Replace it + uint8 public constant mintCap = 2; // 2% /// @notice The EIP-712 typehash for the contract's domain bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)"); From 76f189dcc5a77fae9b93925b54b1bb41241d84c6 Mon Sep 17 00:00:00 2001 From: Thrilok Kumar Date: Mon, 29 Mar 2021 04:52:49 +0530 Subject: [PATCH 08/15] Updated params on GovernorBravoDelegate.sol --- contracts/GovernorBravoDelegate.sol | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contracts/GovernorBravoDelegate.sol b/contracts/GovernorBravoDelegate.sol index e1b7fdb..4e8ca22 100644 --- a/contracts/GovernorBravoDelegate.sol +++ b/contracts/GovernorBravoDelegate.sol @@ -14,10 +14,10 @@ contract InstaGovernorBravoDelegate is GovernorBravoDelegateStorageV1, GovernorB string public constant name = "DSL Governor Bravo"; /// @notice The minimum setable proposal threshold - uint public constant MIN_PROPOSAL_THRESHOLD = 50000e18; // TODO - Update this + uint public constant MIN_PROPOSAL_THRESHOLD = 500000e18; // 500,000 /// @notice The maximum setable proposal threshold - uint public constant MAX_PROPOSAL_THRESHOLD = 100000e18; // TODO - Update this + uint public constant MAX_PROPOSAL_THRESHOLD = 50000000e18; // 5,000,000 /// @notice The minimum setable voting period uint public constant MIN_VOTING_PERIOD = 5760; // About 24 hours @@ -32,7 +32,7 @@ contract InstaGovernorBravoDelegate is GovernorBravoDelegateStorageV1, GovernorB uint public constant MAX_VOTING_DELAY = 40320; // About 1 week /// @notice The number of votes in support of a proposal required in order for a quorum to be reached and for a vote to succeed - uint public constant quorumVotes = 400000e18; // TODO - Update this + uint public constant quorumVotes = 4000000e18; // 4,000,000 /// @notice The maximum number of actions that can be included in a proposal uint public constant proposalMaxOperations = 10; // 10 actions From 1a639794d7ae20718acc454153ffa333e53df7ca Mon Sep 17 00:00:00 2001 From: Mubaris NK Date: Mon, 29 Mar 2021 10:30:39 +0530 Subject: [PATCH 09/15] Minor change --- scripts/deploy.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/deploy.js b/scripts/deploy.js index e84b3ed..c144dfa 100644 --- a/scripts/deploy.js +++ b/scripts/deploy.js @@ -51,6 +51,8 @@ async function main() { const Timelock = await ethers.getContractFactory("InstaTimelock") const timelock = await Timelock.deploy(governorDelegator.address, timelockDelay) + await timelock.deployed() + console.log("InstaTokenDelegate: ", tokenDelegate.address) console.log("InstaTokenDelegator: ", tokenDelegator.address) console.log("InstaTimelock: ", timelock.address) @@ -58,8 +60,6 @@ async function main() { console.log("InstaGovernorBravoDelegator: ", governorDelegator.address) console.log() - await timelock.deployed() - await hre.run("verify:verify", { address: tokenDelegate.address, constructorArguments: [] From 4fcb5391617bb25efaea14e3b7275c8948a5cd27 Mon Sep 17 00:00:00 2001 From: Thrilok Kumar Date: Tue, 30 Mar 2021 00:01:10 +0530 Subject: [PATCH 10/15] Removed changeImplementationAfter logics --- contracts/TokenDelegator.sol | 4 ---- contracts/TokenInterfaces.sol | 4 +--- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/contracts/TokenDelegator.sol b/contracts/TokenDelegator.sol index 20c679f..dcabfb0 100644 --- a/contracts/TokenDelegator.sol +++ b/contracts/TokenDelegator.sol @@ -9,7 +9,6 @@ contract InstaTokenDelegator is TokenDelegatorStorage, TokenEvents { address implementation_, uint initialSupply_, uint mintingAllowedAfter_, - uint changeImplementationAfter_, bool transferPaused_ ) { require(implementation_ != address(0), "TokenDelegator::constructor invalid address"); @@ -26,8 +25,6 @@ contract InstaTokenDelegator is TokenDelegatorStorage, TokenEvents { implementation = implementation_; - changeImplementationAfter = changeImplementationAfter_; - emit NewImplementation(address(0), implementation); } @@ -37,7 +34,6 @@ contract InstaTokenDelegator is TokenDelegatorStorage, TokenEvents { */ function _setImplementation(address implementation_) external isMaster { require(implementation_ != address(0), "TokenDelegator::_setImplementation: invalid implementation address"); - require(block.timestamp >= changeImplementationAfter, "TokenDelegator::_setImplementation: can change implementation changeImplementationAfter time only"); address oldImplementation = implementation; implementation = implementation_; diff --git a/contracts/TokenInterfaces.sol b/contracts/TokenInterfaces.sol index 8d8ae50..0c50c03 100644 --- a/contracts/TokenInterfaces.sol +++ b/contracts/TokenInterfaces.sol @@ -39,14 +39,12 @@ contract TokenEvents { } contract TokenDelegatorStorage { + /// @notice InstaIndex contract IndexInterface constant public instaIndex = IndexInterface(0x2971AdFa57b20E5a416aE5a708A8655A9c74f723); /// @notice Active brains of Token address public implementation; - /// @notice The timestamp after which implementation maybe change - uint public changeImplementationAfter; - /// @notice EIP-20 token name for this token string public name = ""; // TODO - Replace it From 09cbb9e89a8db1c3ba2584cd3fbaac3e862c5ccf Mon Sep 17 00:00:00 2001 From: Thrilok Kumar Date: Tue, 30 Mar 2021 00:12:48 +0530 Subject: [PATCH 11/15] Updated deployment script --- scripts/deploy.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/deploy.js b/scripts/deploy.js index c144dfa..ff36682 100644 --- a/scripts/deploy.js +++ b/scripts/deploy.js @@ -6,8 +6,7 @@ async function main() { const deployerAddress = '0xB46693c062B49689cC4F624AaB24a7eA90275890' // Replace this const initialSupply = ethers.utils.parseEther("100000000") // 100M supply const initialHolder = '0x0000000000000000000000000000000000000002' // Replace - const mintingAfter = 1743465600 // Thursday, 1 May 2025 00:00:00 - const changeImplementationAfter = 1743465600 // Thursday, 1 May 2025 00:00:00 + const mintingAfter = 1743465600 // Thursday, 1 May 2025 00:00:00 // TODO - replace const governanceAdmin = '0xB46693c062B49689cC4F624AaB24a7eA90275890' // Replace this const votingPeriod = 17280 // ~3 days in blocks (assuming 15s blocks) const votingDelay = 1 // 1 block @@ -21,7 +20,7 @@ async function main() { const TokenDelegator = await ethers.getContractFactory("InstaTokenDelegator") const tokenDelegator = await TokenDelegator - .deploy(initialHolder, tokenDelegate.address, initialSupply, mintingAfter, changeImplementationAfter, false) + .deploy(initialHolder, tokenDelegate.address, initialSupply, mintingAfter, false) await tokenDelegator.deployed() @@ -67,7 +66,7 @@ async function main() { await hre.run("verify:verify", { address: tokenDelegator.address, - constructorArguments: [initialHolder, tokenDelegate.address, initialSupply, mintingAfter, changeImplementationAfter, false] + constructorArguments: [initialHolder, tokenDelegate.address, initialSupply, mintingAfter, false] }) await hre.run("verify:verify", { From 26cde36ec705e64c8b3674abc6eacb7c3b63a470 Mon Sep 17 00:00:00 2001 From: Thrilok Kumar Date: Fri, 2 Apr 2021 04:09:40 +0530 Subject: [PATCH 12/15] updated name and symbol --- contracts/TokenInterfaces.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contracts/TokenInterfaces.sol b/contracts/TokenInterfaces.sol index 0c50c03..dfab978 100644 --- a/contracts/TokenInterfaces.sol +++ b/contracts/TokenInterfaces.sol @@ -46,10 +46,10 @@ contract TokenDelegatorStorage { address public implementation; /// @notice EIP-20 token name for this token - string public name = ""; // TODO - Replace it + string public name = "Instadapp"; /// @notice EIP-20 token symbol for this token - string public symbol = ""; // TODO - Replace it + string public symbol = "INST"; /// @notice Total number of tokens in circulation uint public totalSupply; From a4604792a61e911eaf09e9bd8a73743d6d9c74d5 Mon Sep 17 00:00:00 2001 From: Thrilok Kumar Date: Tue, 6 Apr 2021 03:19:01 +0530 Subject: [PATCH 13/15] Updated mintingAfter param --- scripts/deploy.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/deploy.js b/scripts/deploy.js index ff36682..685e2db 100644 --- a/scripts/deploy.js +++ b/scripts/deploy.js @@ -3,11 +3,11 @@ const RLP = require('rlp'); const { ethers } = hre; async function main() { - const deployerAddress = '0xB46693c062B49689cC4F624AaB24a7eA90275890' // Replace this + const deployerAddress = '0xf6839085F692bDe6A8062573E3DA35E7e947C21E' const initialSupply = ethers.utils.parseEther("100000000") // 100M supply - const initialHolder = '0x0000000000000000000000000000000000000002' // Replace - const mintingAfter = 1743465600 // Thursday, 1 May 2025 00:00:00 // TODO - replace - const governanceAdmin = '0xB46693c062B49689cC4F624AaB24a7eA90275890' // Replace this + const initialHolder = '0xb1DC62EC38E6E3857a887210C38418E4A17Da5B2' + const mintingAfter = 1704067200 // Monday, 1 January 2024 00:00:00 + const governanceAdmin = '0xb1DC62EC38E6E3857a887210C38418E4A17Da5B2' const votingPeriod = 17280 // ~3 days in blocks (assuming 15s blocks) const votingDelay = 1 // 1 block const proposalThreshold = ethers.utils.parseEther("1000000") // 1M From a9235cac95cace81d78ed5c92fbebde4f016c808 Mon Sep 17 00:00:00 2001 From: Thrilok Kumar Date: Tue, 6 Apr 2021 03:51:28 +0530 Subject: [PATCH 14/15] InstaTokenDelegator => InstaToken --- contracts/TokenDelegator.sol | 2 +- scripts/deploy.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/contracts/TokenDelegator.sol b/contracts/TokenDelegator.sol index dcabfb0..aeba864 100644 --- a/contracts/TokenDelegator.sol +++ b/contracts/TokenDelegator.sol @@ -3,7 +3,7 @@ pragma experimental ABIEncoderV2; import { TokenDelegatorStorage, TokenEvents } from "./TokenInterfaces.sol"; -contract InstaTokenDelegator is TokenDelegatorStorage, TokenEvents { +contract InstaToken is TokenDelegatorStorage, TokenEvents { constructor( address account, address implementation_, diff --git a/scripts/deploy.js b/scripts/deploy.js index 685e2db..fcc9921 100644 --- a/scripts/deploy.js +++ b/scripts/deploy.js @@ -18,7 +18,7 @@ async function main() { await tokenDelegate.deployed() - const TokenDelegator = await ethers.getContractFactory("InstaTokenDelegator") + const TokenDelegator = await ethers.getContractFactory("InstaToken") const tokenDelegator = await TokenDelegator .deploy(initialHolder, tokenDelegate.address, initialSupply, mintingAfter, false) @@ -53,7 +53,7 @@ async function main() { await timelock.deployed() console.log("InstaTokenDelegate: ", tokenDelegate.address) - console.log("InstaTokenDelegator: ", tokenDelegator.address) + console.log("InstaToken: ", tokenDelegator.address) console.log("InstaTimelock: ", timelock.address) console.log("InstaGovernorBravoDelegate: ", governorDelegate.address) console.log("InstaGovernorBravoDelegator: ", governorDelegator.address) From 848a32974d7c208f37a5febf30a76bfecd64becf Mon Sep 17 00:00:00 2001 From: Thrilok Kumar Date: Tue, 6 Apr 2021 03:55:19 +0530 Subject: [PATCH 15/15] Fixed minor issue --- scripts/deploy.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/deploy.js b/scripts/deploy.js index fcc9921..dae34c1 100644 --- a/scripts/deploy.js +++ b/scripts/deploy.js @@ -7,7 +7,6 @@ async function main() { const initialSupply = ethers.utils.parseEther("100000000") // 100M supply const initialHolder = '0xb1DC62EC38E6E3857a887210C38418E4A17Da5B2' const mintingAfter = 1704067200 // Monday, 1 January 2024 00:00:00 - const governanceAdmin = '0xb1DC62EC38E6E3857a887210C38418E4A17Da5B2' const votingPeriod = 17280 // ~3 days in blocks (assuming 15s blocks) const votingDelay = 1 // 1 block const proposalThreshold = ethers.utils.parseEther("1000000") // 1M @@ -37,7 +36,7 @@ async function main() { const governorDelegator = await GovernorDelegator .deploy( timelockAddress, - governanceAdmin, + timelockAddress, tokenDelegator.address, governorDelegate.address, votingPeriod, @@ -78,7 +77,7 @@ async function main() { address: governorDelegator.address, constructorArguments: [ timelockAddress, - governanceAdmin, + timelockAddress, tokenDelegator.address, governorDelegate.address, votingPeriod,