Skip to content

Commit e948aa7

Browse files
author
chenf
committed
Deploy to mainnet
1 parent b4be206 commit e948aa7

File tree

2 files changed

+135
-93
lines changed

2 files changed

+135
-93
lines changed

hardhat.config.js

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ module.exports = {
3333
mainnet: {
3434
url: `${config.infura.mainnet.url}`,
3535
accounts: [config.account.mainnet.key, config.account.mainnet.userA, config.account.mainnet.userB],
36-
gasPrice: 20e9,
36+
gasPrice: 25e9,
3737
timeout: 2000000000
3838
},
3939
ropsten: {
@@ -67,11 +67,27 @@ module.exports = {
6767
bsc_main: {
6868
url: "https://bsc-dataseed1.defibit.io/",
6969
chainId: 56,
70-
gasPrice: 6e9,
70+
gasPrice: 5e9,
7171
gas: 6000000,
7272
accounts: [config.account.bsc_main.key, config.account.bsc_main.userA, config.account.bsc_main.userB],
7373
timeout: 2000000000
7474
},
75+
kcc_main: {
76+
url: "http://127.0.0.1:50000/kcc/",
77+
chainId: 321,
78+
gasPrice: 1e9,
79+
gas: 6000000,
80+
accounts: [config.account.kcc_main.key, config.account.kcc_main.userA, config.account.kcc_main.userB],
81+
timeout: 2000000000
82+
},
83+
polygon_main: {
84+
url: "https://matic-mainnet.chainstacklabs.com",
85+
chainId: 137,
86+
initialBaseFeePerGas: 50e9,
87+
gas: 6000000,
88+
accounts: [config.account.polygon_main.key, config.account.polygon_main.userA, config.account.polygon_main.userB],
89+
timeout: 2000000000
90+
},
7591
hardhat: {
7692
gas: 6000000,
7793
initialBaseFeePerGas: 0,

test/deploy.js

Lines changed: 117 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ describe('NestOpenMining', function() {
66
it('First', async function() {
77
var [owner, addr1, addr2] = await ethers.getSigners();
88

9-
const {
10-
eth, nest, pusd, peth, hbtc,
9+
// const {
10+
// eth, nest, pusd, peth, hbtc,
1111

12-
nestGovernance, nestLedger,
13-
nestOpenMining, nestBatchPlatform2
14-
} = await deploy();
12+
// nestGovernance, nestLedger,
13+
// nestOpenMining, nestBatchPlatform2
14+
// } = await deploy();
1515

1616
console.log('ok');
1717

@@ -53,109 +53,114 @@ describe('NestOpenMining', function() {
5353
};
5454
}
5555

56-
if (false) {
57-
// 2022-05-08 10:00 Deploy and update NNIncome
58-
// 1. Deploy contract
59-
const NNIncome = await ethers.getContractFactory('NNIncome');
60-
const newNNIncome = await NNIncome.deploy();
61-
console.log('newNNIncome: ' + newNNIncome.address);
62-
63-
// 2. Verify contract code
64-
// 3. Update implementation
65-
// Proxy: 0x95557DE67444B556FE6ff8D7939316DA0Aa340B2
66-
// ProxyAdmin: 0x7DBe94A4D6530F411A1E7337c7eb84185c4396e6
67-
68-
// 4. Check view methods, eg. earned
69-
return;
70-
}
71-
72-
if (true) {
73-
// 2022-05-08 10:30 Deploy and update NestBatchMining
74-
// 1. Deploy contract
75-
const newNestBatchPlatform2 = await NestBatchPlatform2.deploy();
76-
console.log('newNestBatchPlatform2: ' + newNestBatchPlatform2.address);
77-
78-
// 2. Verify contract code
79-
// 3. Update implementation
80-
// Proxy: 0xE544cF993C7d477C7ef8E91D28aCA250D135aa03
81-
// ProxyAdmin: 0x7DBe94A4D6530F411A1E7337c7eb84185c4396e6
82-
83-
// 4. Check view methods. eg. earned
84-
return;
85-
}
86-
87-
if (false) {
88-
// 2022-05-08 10:00 Add eth&nest to channel 0
89-
90-
const nestBatchPlatform = await NestBatchPlatform2.attach('0xE544cF993C7d477C7ef8E91D28aCA250D135aa03');
91-
// 1. Add eth pair
92-
await nestBatchPlatform.addPair(0, '0x0000000000000000000000000000000000000000');
93-
// 2. Add nest pair
94-
await nestBatchPlatform.addPair(0, nest.address);
95-
// 3. Check channel info
96-
console.log(toCi(nestBatchPlatform.getChannelInfo(0)));
97-
}
56+
// if (false) {
57+
// // 2022-05-08 10:00 Deploy and update NNIncome
58+
// // 1. Deploy contract
59+
// const NNIncome = await ethers.getContractFactory('NNIncome');
60+
// const newNNIncome = await NNIncome.deploy();
61+
// console.log('newNNIncome: ' + newNNIncome.address);
62+
63+
// // 2. Verify contract code
64+
// // 3. Update implementation
65+
// // Proxy: 0x95557DE67444B556FE6ff8D7939316DA0Aa340B2
66+
// // ProxyAdmin: 0x7DBe94A4D6530F411A1E7337c7eb84185c4396e6
67+
68+
// // 4. Check view methods, eg. earned
69+
// return;
70+
// }
71+
72+
// if (false) {
73+
// // 2022-05-08 10:30 Deploy and update NestBatchMining
74+
// // 1. Deploy contract
75+
// const newNestBatchPlatform2 = await NestBatchPlatform2.deploy();
76+
// console.log('newNestBatchPlatform2: ' + newNestBatchPlatform2.address);
77+
78+
// // 2. Verify contract code
79+
// // 3. Update implementation
80+
// // Proxy: 0xE544cF993C7d477C7ef8E91D28aCA250D135aa03
81+
// // ProxyAdmin: 0x7DBe94A4D6530F411A1E7337c7eb84185c4396e6
82+
83+
// // 4. Check view methods. eg. earned
84+
// return;
85+
// }
86+
87+
// if (true) {
88+
// // 2022-05-08 10:00 Add eth&nest to channel 0
89+
90+
// const nestBatchPlatform = await NestBatchPlatform2.attach('0xE544cF993C7d477C7ef8E91D28aCA250D135aa03');
91+
// // // 1. Add eth pair
92+
// // await nestBatchPlatform.addPair(0, '0x0000000000000000000000000000000000000000');
93+
// // // 2. Add nest pair
94+
// // await nestBatchPlatform.addPair(0, nest.address);
95+
// // 3. Check channel info
96+
// console.log(toCi(await nestBatchPlatform.getChannelInfo(0)));
97+
98+
// return;
99+
// }
98100

99101
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
100102

101103
// 2022-05-08 10:00 Adjust nest reward speed
102104

103-
// ETH
104-
if (false) {
105-
const nestBatchPlatform = await NestBatchPlatform2.attach('0xE544cF993C7d477C7ef8E91D28aCA250D135aa03');
106-
const c = await nestBatchPlatform.getChannelInfo(0);
107-
const ci = toCi(c);
105+
// // ETH
106+
// if (false) {
107+
// const nestBatchPlatform = await NestBatchPlatform2.attach('0xE544cF993C7d477C7ef8E91D28aCA250D135aa03');
108+
// const c = await nestBatchPlatform.getChannelInfo(0);
109+
// const ci = toCi(c);
108110

109-
console.log(ci);
110-
console.log(toChannelConfig(ci));
111-
ci.rewardPerBlock = '24000000000000000000';
112-
ci.singleFee = '0';
113-
console.log(toChannelConfig(ci));
111+
// console.log(ci);
112+
// console.log(toChannelConfig(ci));
113+
// ci.rewardPerBlock = '24000000000000000000';
114+
// ci.singleFee = '0';
115+
// // console.log(toChannelConfig(ci));
114116

115-
// Update
116-
// await nestBatchPlatform.modify(ci);
117+
// // Update
118+
// //await nestBatchPlatform.modify(0, ci);
117119

118-
// Check
119-
}
120+
// // Check
121+
// return;
122+
// }
120123

121-
// BSC
122-
if (false) {
123-
const nestBatchPlatform = await NestBatchPlatform2.attach('0x09CE0e021195BA2c1CDE62A8B187abf810951540');
124-
const c = await nestBatchPlatform.getChannelInfo(0);
125-
const ci = toCi(c);
124+
// // BSC
125+
// if (true) {
126+
// const nestBatchPlatform = await NestBatchPlatform2.attach('0x09CE0e021195BA2c1CDE62A8B187abf810951540');
127+
// const c = await nestBatchPlatform.getChannelInfo(0);
128+
// const ci = toCi(c);
126129

127-
console.log(ci);
128-
console.log(toChannelConfig(ci));
129-
ci.rewardPerBlock = '1000000000000000000';
130-
ci.singleFee = '0';
131-
console.log(toChannelConfig(ci));
130+
// console.log(ci);
131+
// console.log(toChannelConfig(ci));
132+
// ci.rewardPerBlock = '1000000000000000000';
133+
// ci.singleFee = '0';
134+
// console.log(toChannelConfig(ci));
132135

133-
// Update
134-
// await nestBatchPlatform.modify(ci);
136+
// // Update
137+
// //await nestBatchPlatform.modify(0, ci);
135138

136-
// Check
137-
}
139+
// // Check
138140

139-
// Polygon
140-
if (false) {
141-
const nestBatchPlatform = await NestBatchPlatform2.attach('0x09CE0e021195BA2c1CDE62A8B187abf810951540');
142-
const c = await nestBatchPlatform.getChannelInfo(0);
143-
const ci = toCi(c);
141+
// return;
142+
// }
144143

145-
console.log(ci);
146-
console.log(toChannelConfig(ci));
147-
ci.rewardPerBlock = '300000000000000000';
148-
ci.singleFee = '0';
149-
console.log(toChannelConfig(ci));
144+
// // Polygon
145+
// if (true) {
146+
// const nestBatchPlatform = await NestBatchPlatform2.attach('0x09CE0e021195BA2c1CDE62A8B187abf810951540');
147+
// const c = await nestBatchPlatform.getChannelInfo(0);
148+
// const ci = toCi(c);
150149

151-
// Update
152-
// await nestBatchPlatform.modify(ci);
150+
// console.log(ci);
151+
// console.log(toChannelConfig(ci));
152+
// ci.rewardPerBlock = '300000000000000000';
153+
// ci.singleFee = '0';
154+
// console.log(toChannelConfig(ci));
153155

154-
// Check
155-
}
156+
// // Update
157+
// //await nestBatchPlatform.modify(0, ci);
158+
159+
// // Check
160+
// }
156161

157162
// KCC
158-
if (false) {
163+
if (true) {
159164
const nestBatchPlatform = await NestBatchPlatform2.attach('0x7DBe94A4D6530F411A1E7337c7eb84185c4396e6');
160165
const c = await nestBatchPlatform.getChannelInfo(0);
161166
const ci = toCi(c);
@@ -167,9 +172,30 @@ describe('NestOpenMining', function() {
167172
console.log(toChannelConfig(ci));
168173

169174
// Update
170-
// await nestBatchPlatform.modify(ci);
175+
//await nestBatchPlatform.modify(0, ci);
171176

172177
// Check
173178
}
179+
180+
// const nm = await ethers.getContractAt('INestMining', '0x03dF236EaCfCEf4457Ff7d6B88E8f00823014bcd');
181+
// const cfg = await nm.getConfig();
182+
// console.log(cfg);
183+
// const ccc = {
184+
// postEthUnit: cfg.postEthUnit.toString(),
185+
// postFeeUnit: cfg.postFeeUnit.toString(),
186+
// minerNestReward: cfg.minerNestReward.toString(),
187+
// minerNTokenReward: cfg.minerNTokenReward.toString(),
188+
// doublePostThreshold: cfg.doublePostThreshold.toString(),
189+
// ntokenMinedBlockLimit: cfg.ntokenMinedBlockLimit.toString(),
190+
// maxBiteNestedLevel: cfg.maxBiteNestedLevel.toString(),
191+
// priceEffectSpan: cfg.priceEffectSpan.toString(),
192+
// pledgeNest: cfg.pledgeNest.toString()
193+
// };
194+
// console.log(ccc);
195+
// console.log('after modify');
196+
// ccc.postEthUnit = '0';
197+
// console.log(ccc);
198+
// //await nm.setConfig(ccc);
199+
// return;
174200
});
175201
});

0 commit comments

Comments
 (0)