diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 83e6841..46cf3e0 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -18,5 +18,5 @@ RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/ # && apt-get -y install --no-install-recommends # [Optional] Uncomment this line to install global node packages. -RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g truffle@5.4.5 ganache" 2>&1 +RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g truffle@5.4.5 ganache@7.0.3" 2>&1 diff --git a/migrations/18_inflation_vesting_team.js b/migrations/18_inflation_vesting_team.js new file mode 100644 index 0000000..584b773 --- /dev/null +++ b/migrations/18_inflation_vesting_team.js @@ -0,0 +1,23 @@ +var AkropolisTokenVesting = artifacts.require('./AkropolisTokenVesting.sol'); + +module.exports = async function (deployer, network, accounts) { + const owner = accounts[0]; + + const token = + network === 'mainnet' + ? '0x8ab7404063ec4dbcfd4598215992dc3f8ec853d7' + : '0xcbB03b0247688552ca34a4cE910b3254A420c523'; + const start = 1719964800; // 2024-07-03T00:00:00.000Z + const cliffDuration = 31536000; // 2025-07-03T00:00:00.000Z - 2024-07-03T00:00:00.000Z + const duration = 126230400; // 2028-07-03T00:00:00.000Z - 2024-07-03T00:00:00.000Z + + console.log('owner of storage contracts: ', owner); + + await deployer.deploy(AkropolisTokenVesting, token, start, cliffDuration, duration, { + from: owner, + }); +}; + +// commands: +// truffle migrate --f 18 --network mainnet +// truffle run verify AkropolisTokenVesting@0xc04...70f --network mainnet --verifiers=etherscan diff --git a/migrations/19_inflation_vesting_foundation.js b/migrations/19_inflation_vesting_foundation.js new file mode 100644 index 0000000..0ebd5c9 --- /dev/null +++ b/migrations/19_inflation_vesting_foundation.js @@ -0,0 +1,23 @@ +var AkropolisTokenVesting = artifacts.require('./AkropolisTokenVesting.sol'); + +module.exports = async function (deployer, network, accounts) { + const owner = accounts[0]; + + const token = + network === 'mainnet' + ? '0x8ab7404063ec4dbcfd4598215992dc3f8ec853d7' + : '0xcbB03b0247688552ca34a4cE910b3254A420c523'; + const start = 1719964800; // 2024-07-03T00:00:00.000Z + const cliffDuration = 0; + const duration = 126230400; // 2028-07-03T00:00:00.000Z - 2024-07-03T00:00:00.000Z + + console.log('owner of storage contracts: ', owner); + + await deployer.deploy(AkropolisTokenVesting, token, start, cliffDuration, duration, { + from: owner, + }); +}; + +// commands: +// truffle migrate --f 19 --network mainnet +// truffle run verify AkropolisTokenVesting@0xc04...70f --network mainnet --verifiers=etherscan diff --git a/migrations/20_inflation_vesting_ecosystem.js b/migrations/20_inflation_vesting_ecosystem.js new file mode 100644 index 0000000..3f871d2 --- /dev/null +++ b/migrations/20_inflation_vesting_ecosystem.js @@ -0,0 +1,23 @@ +var AkropolisTokenVesting = artifacts.require('./AkropolisTokenVesting.sol'); + +module.exports = async function (deployer, network, accounts) { + const owner = accounts[0]; + + const token = + network === 'mainnet' + ? '0x8ab7404063ec4dbcfd4598215992dc3f8ec853d7' + : '0xcbB03b0247688552ca34a4cE910b3254A420c523'; + const start = 1719964800; // 2024-07-03T00:00:00.000Z + const cliffDuration = 0; + const duration = 126230400; // 2028-07-03T00:00:00.000Z - 2024-07-03T00:00:00.000Z + + console.log('owner of storage contracts: ', owner); + + await deployer.deploy(AkropolisTokenVesting, token, start, cliffDuration, duration, { + from: owner, + }); +}; + +// commands: +// truffle migrate --f 20 --network mainnet +// truffle run verify AkropolisTokenVesting@0xc04...70f --network mainnet --verifiers=etherscan diff --git a/package-lock.json b/package-lock.json index 7019f85..a8f50b6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1963,7 +1963,7 @@ "circular": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/circular/-/circular-1.0.5.tgz", - "integrity": "sha1-fad6+Yu96c5LWzWM1Va13e0tMUk=" + "integrity": "sha512-n4Sspha+wxUl5zeA3JYp1zFCjsLz2VfXIe2gRKNQBrIX+7iPdGcCGZOF8W8IULtllZ/aejXtySfdFFt1wy/3JQ==" }, "class-utils": { "version": "0.3.6", @@ -2002,7 +2002,7 @@ "cli-logger": { "version": "0.5.40", "resolved": "https://registry.npmjs.org/cli-logger/-/cli-logger-0.5.40.tgz", - "integrity": "sha1-CX8OEbByx8aYomxH9YiinCC0iws=", + "integrity": "sha512-piXVCa0TLm/+A7xdVEhw7t4OSrsmJaZIekWcoGrVMY1bHtLJTXgiNzgHlKT0EVHQ14sCKWorQJazU7UWgZhXOQ==", "requires": { "circular": "^1.0.5", "cli-util": "~1.1.27" @@ -2011,7 +2011,7 @@ "cli-regexp": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/cli-regexp/-/cli-regexp-0.1.2.tgz", - "integrity": "sha1-a82TsJ+y7RAl0woRVdWZeVSlNRI=" + "integrity": "sha512-L++cAQ5g0Nu6aV56B3uaR+c7jEGSAa4WApY1ZN7XiD8niJ5jRfXE/qvMwgz3uZBG0rft4hJS75Vpz2F3mSm4Mg==" }, "cli-table": { "version": "0.3.1", @@ -2024,7 +2024,7 @@ "cli-util": { "version": "1.1.27", "resolved": "https://registry.npmjs.org/cli-util/-/cli-util-1.1.27.tgz", - "integrity": "sha1-QtaeNqBAoyH8nPhRwVE8rcUJMFQ=", + "integrity": "sha512-Z6+zI0kIrqf9Oi+PmUm8J9AELp8bTf2vCLYseudYtdOPNJvzpNiExO95aHIm477IbPdu/8SE9Wvc/M1kJl4Anw==", "requires": { "cli-regexp": "~0.1.0" } @@ -16971,9 +16971,9 @@ } }, "truffle-plugin-verify": { - "version": "0.5.25", - "resolved": "https://registry.npmjs.org/truffle-plugin-verify/-/truffle-plugin-verify-0.5.25.tgz", - "integrity": "sha512-LWx1mPKSP+eiiE0/VgTL9tixVdnHXwhd7eVV3zBhyuR1sJwecvEMrRbDqxDz9fAzcDzXyf43xmsi/MaR2h1EVg==", + "version": "0.5.33", + "resolved": "https://registry.npmjs.org/truffle-plugin-verify/-/truffle-plugin-verify-0.5.33.tgz", + "integrity": "sha512-NonyWylAVAjqHsvBe61iUpWmHQoN6wvz7OaNzIfyHO8+O5ZErPT/lhv+zRT31OLeFOanM403FySY3A/kzpl6fg==", "requires": { "axios": "^0.26.1", "cli-logger": "^0.5.40", @@ -16991,9 +16991,9 @@ } }, "follow-redirects": { - "version": "1.14.9", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.9.tgz", - "integrity": "sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w==" + "version": "1.15.6", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", + "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==" } } }, diff --git a/package.json b/package.json index 9a7a731..73a6b62 100644 --- a/package.json +++ b/package.json @@ -30,8 +30,8 @@ "openzeppelin-solidity": "2.3.0", "truffle-contract": "4.0.23", "truffle-hdwallet-provider": "1.0.8", - "truffle-plugin-verify": "^0.5.25", + "truffle-plugin-verify": "^0.5.33", "web3": "v1.0.0-beta.37", "zos-lib": "2.4.1" } -} \ No newline at end of file +} diff --git a/truffle-config.js b/truffle-config.js index b58a406..836ed6b 100644 --- a/truffle-config.js +++ b/truffle-config.js @@ -3,6 +3,11 @@ require('dotenv').config(); // Stores environment-specific variable from '.env' require('babel-register'); require('babel-polyfill'); +// because truffle-plugin-verify uses Array.at +Array.prototype.at = function (pos) { + return pos >= 0 ? this[pos] : this[this.length + pos]; +}; + console.log(process.env.METAMASK_MNEMONIC); console.log(process.env.INFURA_API_KEY); module.exports = { @@ -27,15 +32,29 @@ module.exports = { return new HDWalletProvider( process.env.METAMASK_MNEMONIC, 'https://mainnet.infura.io/v3/' + process.env.INFURA_API_KEY, - 0 + 8 ); }, network_id: 1, - gas: 7000000, + gas: 4000000, gasPrice: 30000000000, skipDryRun: true, }, + sepolia: { + provider: function () { + return new HDWalletProvider( + process.env.METAMASK_MNEMONIC, + 'https://sepolia.infura.io/v3/' + process.env.INFURA_API_KEY, + 8 + ); + }, + network_id: 11155111, + gas: 4000000, + gasPrice: 130166207251, + skipDryRun: true, + }, + kovan: { provider: function () { return new HDWalletProvider(