Skip to content

Commit

Permalink
Update deploy settings
Browse files Browse the repository at this point in the history
  • Loading branch information
sydneyitguy committed Nov 20, 2020
1 parent 61926eb commit 89b35aa
Show file tree
Hide file tree
Showing 8 changed files with 786 additions and 212 deletions.
552 changes: 552 additions & 0 deletions .openzeppelin/goerli.json

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ A governance token distribution contract on top of LockUpPool. A maximum of 1.2M

## Görli (goerli) Testnet
- ETH faucet (to pay gas): https://faucet.goerli.mudit.blog/
- Contract: 0xD5B9A9dB6E11E216e08bF10B0C0e53478315E8C3
- Lock-up contract: 0x8f62599Ce9E93Cda072EA4F4E86dbaBF3CCC2bC9
- Test tokens
- WRN: 0x64B45af8ED1ABA874144802B34e99262E444202f
- HUNT: 0x3cCc84296b4dDf99d628e1472F697c4649A9962F
- WETH: 0x0370789664eCBc83a9a44766c2384b9d5A638Dfb
- WBTC: 0xF0aa78e4Ea6C717891085879Bd78Fd87a98D8572
- WRN: 0xdAecEce4b065595907F04b8a9C96A9B7929Ee626
- HUNT: 0xD409b07cC381c3D831F7fD71C4141c86DdC2a5c6
- WETH: 0x608f8CeB3Af57Dd3b56b480B51dcfd7E7096acA3
- WBTC: 0x48A32932F3BD2Fd7Bb31c97570290dE9d1e8827C

## Gas consumption
```
Expand Down
3 changes: 2 additions & 1 deletion contracts/LockUpPool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ contract LockUpPool is Initializable, OwnableUpgradeSafe {
SECONDS_IN_MONTH = 3600; // For TEST: 1 month = 1 hour
// SECONDS_IN_MONTH = 2592000; // TODO: Uncomment it on production

fundAddress = address(0x82CA6d313BffE56E9096b16633dfD414148D66b1);
// fundAddress = address(0x82CA6d313BffE56E9096b16633dfD414148D66b1); // TODO: Uncomment it on production
fundAddress = address(0xFC7041F1d7346e24D0De183a98CC08Eb4DF482B1); // Testnet
}

modifier _checkPoolExists(address tokenAddress) {
Expand Down
19 changes: 10 additions & 9 deletions migrations/2_deploy_wrn_reward_pool.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,24 @@ module.exports = async function (deployer, network, [creator]) {
// NOTE: Use of `unsafeAllowCustomTypes` as UpgradesPlugins currently do not support validating custom types (enums or structs)
// REF: https://docs.openzeppelin.com/upgrades-plugins/1.x/faq#what-does-it-mean-for-an-implementation-to-be-compatible
const wrnToken = await deployProxy(ERC20Token, ['TEST WARREN', 'WRN', 18, toBN(0)], { deployer, unsafeAllowCustomTypes: true });
const hunt = await deployProxy(ERC20Token, ['TEST HUNT Token', 'HUNT', 18, toBN(1000000)], { deployer, unsafeAllowCustomTypes: true });
const weth = await deployProxy(ERC20Token, ['TEST Wrapped ETH', 'WETH', 18, toBN(10000)], { deployer, unsafeAllowCustomTypes: true });
const wbtc = await deployProxy(ERC20Token, ['TEST Wrapped BTC', 'WBTC', 8, toBN(1000, 8)], { deployer, unsafeAllowCustomTypes: true });
const hunt = await deployProxy(ERC20Token, ['TEST HUNT Token', 'HUNT', 18, toBN(500000 * 200)], { deployer, unsafeAllowCustomTypes: true });
const weth = await deployProxy(ERC20Token, ['TEST Wrapped ETH', 'WETH', 18, toBN(40 * 200)], { deployer, unsafeAllowCustomTypes: true });
const wbtc = await deployProxy(ERC20Token, ['TEST Wrapped BTC', 'WBTC', 8, toBN(1 * 200, 8)], { deployer, unsafeAllowCustomTypes: true });

const block = await web3.eth.getBlock("latest");
const wrnRewardPool = await deployProxy(WRNRewardPool, [wrnToken.address, block.number, 8800000, 500000], { deployer, unsafeAllowCustomTypes: true });
// Reward period will be: 14 days, bonus period: 7 days
const wrnRewardPool = await deployProxy(WRNRewardPool, [wrnToken.address, block.number, 100000, 50000], { deployer, unsafeAllowCustomTypes: true });

await wrnToken.addMinter(wrnRewardPool.address, { from: creator });

await wrnRewardPool.addLockUpRewardPool(hunt.address, 2, toBN(10000), false);
await wrnRewardPool.addLockUpRewardPool(weth.address, 1, toBN(10000), false);
await wrnRewardPool.addLockUpRewardPool(wbtc.address, 1, toBN(10000, 8), false);
await wrnRewardPool.addLockUpRewardPool(hunt.address, 2, toBN(100000000), false);
await wrnRewardPool.addLockUpRewardPool(weth.address, 1, toBN(1000000), false);
await wrnRewardPool.addLockUpRewardPool(wbtc.address, 1, toBN(100000, 8), false);

console.log(`- Lock-up Contract: ${wrnRewardPool.address}`);
console.log('- Test tokens');
console.log(` - WRN: ${wrnToken.address}\n - HUNT: ${hunt.address}\n - WETH: ${weth.address}\n - WBTC: ${wbtc.address}`);
console.log(`Owner: ${await wrnRewardPool.owner()} / Dev: ${await wrnRewardPool.devAddress()}`);
console.log(`Owner: ${await wrnRewardPool.owner()} / Fund: ${await wrnRewardPool.fundAddress()}`);
console.log(`Sum of reward pool multiplers: ${await wrnRewardPool.totalMultiplier()}`);
console.log(`Owner HUNT balance: ${await hunt.balanceOf(creator)}`);
} else if (network === 'mainnet') {
Expand All @@ -51,7 +52,7 @@ module.exports = async function (deployer, network, [creator]) {

console.log(`-> Lock-up Contract: ${wrnRewardPool.address}`);
console.log(`-> WRN: ${wrnToken.address}`);
console.log(`- Owner: ${await wrnRewardPool.owner()} / Dev: ${await wrnRewardPool.devAddress()}`);
console.log(`- Owner: ${await wrnRewardPool.owner()} / Fund: ${await wrnRewardPool.fundAddress()}`);
console.log(`- Sum of reward pool multiplers: ${await wrnRewardPool.totalMultiplier()}`);
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"devDependencies": {
"@openzeppelin/contracts-ethereum-package": "^3.0.0",
"@openzeppelin/test-helpers": "^0.5.6",
"@openzeppelin/truffle-upgrades": "^1.2.1",
"@openzeppelin/truffle-upgrades": "^1.2.5",
"@truffle/hdwallet-provider": "^1.1.1",
"dotenv": "^8.2.0",
"eth-gas-reporter": "^0.2.17",
Expand Down
10 changes: 5 additions & 5 deletions scripts/send-test-tokens.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ const infuraProvider = (network) => {
const web3 = new Web3(infuraProvider('goerli'));

const tokenAddresses = {
HUNT: '0x853bCea4C256873d848072a207cc07dEf695faC8',
WETH: '0xf4540e848448AF2357D5ba6210b88CcD8e7B1b4E',
WBTC: '0xc0f4FC816968283D52a096d951094a9C1c037B13'
HUNT: '0xD409b07cC381c3D831F7fD71C4141c86DdC2a5c6',
WETH: '0x608f8CeB3Af57Dd3b56b480B51dcfd7E7096acA3',
WBTC: '0x48A32932F3BD2Fd7Bb31c97570290dE9d1e8827C'
}

async function sendETH(from, to, amount) {
Expand Down Expand Up @@ -69,9 +69,9 @@ async function sendAll(to) {
await sendETH(owner, to, 1);

for (let token in tokenAddresses) {
let amount = 10000;
let amount = 500000;
if(token === 'WETH') {
amount = 10;
amount = 40;
} else if (token === 'WBTC') {
amount = 1;
}
Expand Down
4 changes: 2 additions & 2 deletions truffle-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ module.exports = {
goerli: {
provider: infuraProvider('goerli'),
network_id: '5',
gas: 5000000,
gas: 7000000,
gasPrice: 5000000000 // 5 gwei
},
mainnet: {
provider: infuraProvider('mainnet'),
network_id: '1',
gas: 5000000,
gas: 7000000,
gasPrice: 31000000000 // 31 gwei
},
},
Expand Down
Loading

0 comments on commit 89b35aa

Please sign in to comment.