@@ -6,12 +6,12 @@ describe('NestOpenMining', function() {
6
6
it ( 'First' , async function ( ) {
7
7
var [ owner , addr1 , addr2 ] = await ethers . getSigners ( ) ;
8
8
9
- const {
10
- eth, nest, pusd, peth, hbtc,
9
+ // const {
10
+ // eth, nest, pusd, peth, hbtc,
11
11
12
- nestGovernance, nestLedger,
13
- nestOpenMining, nestBatchPlatform2
14
- } = await deploy ( ) ;
12
+ // nestGovernance, nestLedger,
13
+ // nestOpenMining, nestBatchPlatform2
14
+ // } = await deploy();
15
15
16
16
console . log ( 'ok' ) ;
17
17
@@ -53,109 +53,114 @@ describe('NestOpenMining', function() {
53
53
} ;
54
54
}
55
55
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
+ // }
98
100
99
101
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
100
102
101
103
// 2022-05-08 10:00 Adjust nest reward speed
102
104
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);
108
110
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));
114
116
115
- // Update
116
- // await nestBatchPlatform.modify(ci);
117
+ // // Update
118
+ // // await nestBatchPlatform.modify(0, ci);
117
119
118
- // Check
119
- }
120
+ // // Check
121
+ // return;
122
+ // }
120
123
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);
126
129
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));
132
135
133
- // Update
134
- // await nestBatchPlatform.modify(ci);
136
+ // // Update
137
+ // // await nestBatchPlatform.modify(0, ci);
135
138
136
- // Check
137
- }
139
+ // // Check
138
140
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
+ // }
144
143
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 );
150
149
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));
153
155
154
- // Check
155
- }
156
+ // // Update
157
+ // //await nestBatchPlatform.modify(0, ci);
158
+
159
+ // // Check
160
+ // }
156
161
157
162
// KCC
158
- if ( false ) {
163
+ if ( true ) {
159
164
const nestBatchPlatform = await NestBatchPlatform2 . attach ( '0x7DBe94A4D6530F411A1E7337c7eb84185c4396e6' ) ;
160
165
const c = await nestBatchPlatform . getChannelInfo ( 0 ) ;
161
166
const ci = toCi ( c ) ;
@@ -167,9 +172,30 @@ describe('NestOpenMining', function() {
167
172
console . log ( toChannelConfig ( ci ) ) ;
168
173
169
174
// Update
170
- // await nestBatchPlatform.modify(ci);
175
+ //await nestBatchPlatform.modify(0, ci);
171
176
172
177
// Check
173
178
}
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;
174
200
} ) ;
175
201
} ) ;
0 commit comments