Skip to content

Commit 95599d2

Browse files
author
chenf
committed
Deploy to mainnet
1 parent 7ba15cc commit 95599d2

File tree

3 files changed

+105
-23
lines changed

3 files changed

+105
-23
lines changed

hardhat.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ task("accounts", "Prints the list of accounts", async () => {
2121
*/
2222
module.exports = {
2323
solidity: {
24-
version: '0.8.16',
24+
version: '0.8.17',
2525
settings: {
2626
optimizer: {
2727
enabled: true,

scripts/mainnet@20221012.js

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
// We require the Hardhat Runtime Environment explicitly here. This is optional
2+
// but useful for running the script in a standalone fashion through `node <script>`.
3+
//
4+
// When running the script with `hardhat run <script>` you'll find the Hardhat
5+
// Runtime Environment's members available in the global scope.
6+
const { ethers, upgrades } = require('hardhat');
7+
8+
exports.deploy = async function() {
9+
10+
const eth = { address: '0x0000000000000000000000000000000000000000' };
11+
const TestERC20 = await ethers.getContractFactory('TestERC20');
12+
const NestGovernance = await ethers.getContractFactory('NestGovernance');
13+
const NestBatchPlatform2 = await ethers.getContractFactory('NestBatchPlatform2');
14+
15+
console.log('** Deploy: mainnet@20221012.js **');
16+
/*
17+
2021-04-27
18+
proxy
19+
nest: 0x04abEdA201850aC0124161F037Efd70c74ddC74C
20+
usdt: 0xdAC17F958D2ee523a2206206994597C13D831ec7
21+
nestGovernance: 0xA2eFe217eD1E56C743aeEe1257914104Cf523cf5
22+
nestLedger: 0x34B931C7e5Dc45dDc9098A1f588A0EA0dA45025D
23+
nTokenController: 0xc4f1690eCe0145ed544f0aee0E2Fa886DFD66B62
24+
nestVote: 0xDa52f53a5bE4cb876DE79DcfF16F34B95e2D38e9
25+
nestMining: 0x03dF236EaCfCEf4457Ff7d6B88E8f00823014bcd
26+
ntokenMining: 0xC2058Dd4D55Ae1F3e1b0744Bdb69386c9fD902CA
27+
nestPriceFacade: 0xB5D2890c061c321A5B6A4a4254bb1522425BAF0A
28+
nestRedeeming: 0xF48D58649dDb13E6e29e03059Ea518741169ceC8
29+
nnIncome: 0x95557DE67444B556FE6ff8D7939316DA0Aa340B2
30+
nn: 0xC028E81e11F374f7c1A3bE6b8D2a815fa3E96E6e
31+
32+
implementation
33+
nestGovernance: 0x6D76935090FB8b8B73B39F03243fAd047B0794C0
34+
nestLedger: 0x09CE0e021195BA2c1CDE62A8B187abf810951540
35+
nTokenController: 0x6C4BD6148F72b525f72b8033D6dD5C5aC4C9DCB7
36+
nestVote: 0xBBf3E1B2901AcCc3fDe5A4971903a0aBC6CA04CA
37+
nestMining: 0xE34A736290548227415329962705a6ee17c5f1a5
38+
ntokenMining: 0xE34A736290548227415329962705a6ee17c5f1a5
39+
nestPriceFacade: 0xD0B5532Cd0Ae1a14dAdf94f8562679A48aDa3643
40+
nestRedeeming: 0x5441B24FA3a2347Ac6EE70431dD3BfD0c224B4B7
41+
nnIncome: 0x718626a4b78e0ECfA60dE1D4C386302e68fac8cD
42+
43+
ProxyAdmin: 0x7DBe94A4D6530F411A1E7337c7eb84185c4396e6
44+
*/
45+
46+
// PUSD: 0xCCEcC702Ec67309Bc3DDAF6a42E9e5a6b8Da58f0
47+
48+
// ** Deploy: mainnet@20211218.js **
49+
// nest: 0x04abEdA201850aC0124161F037Efd70c74ddC74C
50+
// usdt: 0xdAC17F958D2ee523a2206206994597C13D831ec7
51+
// hbtc: 0x0316EB71485b0Ab14103307bf65a021042c6d380
52+
// pusd: 0xCCEcC702Ec67309Bc3DDAF6a42E9e5a6b8Da58f0
53+
// nestGovernance: 0xA2eFe217eD1E56C743aeEe1257914104Cf523cf5
54+
// nestBatchPlatform2: 0xE544cF993C7d477C7ef8E91D28aCA250D135aa03
55+
56+
// 1. Deploy dependent contract
57+
//const nest = await IBNEST.deploy();
58+
const nest = await TestERC20.attach('0x04abEdA201850aC0124161F037Efd70c74ddC74C');
59+
console.log('nest: ' + nest.address);
60+
61+
//const usdt = await TestERC20.deploy('USDT', 'USDT', 18);
62+
const usdt = await TestERC20.attach('0xdAC17F958D2ee523a2206206994597C13D831ec7');
63+
console.log('usdt: ' + usdt.address);
64+
65+
//const hbtc = await TestERC20.deploy('HBTC', 'HBTC', 18);
66+
const hbtc = await TestERC20.attach('0x0316EB71485b0Ab14103307bf65a021042c6d380');
67+
console.log('hbtc: ' + hbtc.address);
68+
69+
//const pusd = await TestERC20.deploy('PUSD', 'PUSD', 18);
70+
const pusd = await TestERC20.attach('0xCCEcC702Ec67309Bc3DDAF6a42E9e5a6b8Da58f0');
71+
console.log('pusd: ' + pusd.address);
72+
73+
//const nestGovernance = await upgrades.deployProxy(NestGovernance, ['0x0000000000000000000000000000000000000000'], { initializer: 'initialize' });
74+
const nestGovernance = await NestGovernance.attach('0xA2eFe217eD1E56C743aeEe1257914104Cf523cf5');
75+
console.log('nestGovernance: ' + nestGovernance.address);
76+
77+
//const nestBatchPlatform2 = await upgrades.deployProxy(NestBatchPlatform2, [nestGovernance.address], { initializer: 'initialize' });
78+
const nestBatchPlatform2 = await NestBatchPlatform2.attach('0xE544cF993C7d477C7ef8E91D28aCA250D135aa03');
79+
console.log('nestBatchPlatform2: ' + nestBatchPlatform2.address);
80+
81+
// const newNestBatchPlatform2 = await NestBatchPlatform2.deploy({ nonce: 53});
82+
// console.log('newNestBatchPlatform2: ' + newNestBatchPlatform2.address);
83+
84+
console.log('---------- OK ----------');
85+
86+
const contracts = {
87+
nest: nest,
88+
usdt: usdt,
89+
hbtc: hbtc,
90+
pusd: pusd,
91+
92+
nestGovernance: nestGovernance,
93+
nestBatchPlatform2: nestBatchPlatform2
94+
};
95+
96+
return contracts;
97+
};

test/update.js

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -16,37 +16,22 @@ describe('update', function() {
1616
const ci = await nestBatchPlatform2.getChannelInfo(0);
1717
console.log(UI(ci));
1818

19+
// 0x0316EB71485b0Ab14103307bf65a021042c6d380
1920
// await nestBatchPlatform2.modifyToken(0, 0, '0x102E6BBb1eBfe2305Ee6B9E9fd5547d0d39CE3B4');
2021
// await nestBatchPlatform2.modify(0, {
2122
// rewardPerBlock: 20000000000000000000n,
2223
// postFeeUnit: 0,
2324
// singleFee: 0,
2425
// reductionRate: 8000
2526
// });
26-
27-
// // Price channel configuration
28-
// struct ChannelConfig {
29-
30-
// // Reward per block standard
31-
// uint96 rewardPerBlock;
32-
33-
// // Post fee(0.0001eth, DIMI_ETHER). 1000
34-
// uint16 postFeeUnit;
35-
36-
// // Single query fee (0.0001 ether, DIMI_ETHER). 100
37-
// uint16 singleFee;
38-
39-
// // Reduction rate(10000 based). 8000
40-
// uint16 reductionRate;
41-
// }
4227
}
4328

44-
{
45-
const config = await nestBatchPlatform2.getConfig();
46-
console.log(UI(config));
29+
// {
30+
// const config = await nestBatchPlatform2.getConfig();
31+
// console.log(UI(config));
4732

48-
const ci = await nestBatchPlatform2.getChannelInfo(0);
49-
console.log(UI(ci));
50-
}
33+
// const ci = await nestBatchPlatform2.getChannelInfo(0);
34+
// console.log(UI(ci));
35+
// }
5136
});
5237
});

0 commit comments

Comments
 (0)