@@ -2,7 +2,6 @@ import { ethers, upgrades, waffle } from 'hardhat'
2
2
import { Contract , Signer , BigNumber , BigNumberish , Event } from 'ethers'
3
3
import { TransactionResponse } from '@ethersproject/providers'
4
4
import { expect } from 'chai'
5
- import { Result } from 'ethers/lib/utils'
6
5
import { imul , increaseTime } from '../utils/utils'
7
6
8
7
let uFragmentsPolicy : Contract ,
@@ -20,8 +19,8 @@ const INITIAL_TARGET_RATE_25P_LESS = imul(INITIAL_TARGET_RATE, '0.75', 1)
20
19
const INITIAL_RATE = ethers . utils . parseUnits ( '1.05' , 18 )
21
20
const INITIAL_RATE_30P_MORE = imul ( INITIAL_RATE , '1.3' , 1 )
22
21
const INITIAL_RATE_30P_LESS = imul ( INITIAL_RATE , '0.7' , 1 )
23
- const INITIAL_RATE_2P_MORE = imul ( INITIAL_RATE , '1.02 ' , 1 )
24
- const INITIAL_RATE_2P_LESS = imul ( INITIAL_RATE , '0.98 ' , 1 )
22
+ const INITIAL_RATE_2_5_P_MORE = imul ( INITIAL_RATE , '1.025 ' , 1 )
23
+ const INITIAL_RATE_2_5_P_LESS = imul ( INITIAL_RATE , '0.975 ' , 1 )
25
24
const INITIAL_RATE_60P_MORE = imul ( INITIAL_RATE , '1.6' , 1 )
26
25
const INITIAL_RATE_50P_LESS = imul ( INITIAL_RATE , '0.5' , 1 )
27
26
const INITIAL_RATE_2X = INITIAL_RATE . mul ( 2 )
@@ -149,7 +148,7 @@ describe('UFragmentsPolicy:initialize', async function () {
149
148
150
149
it ( 'deviationThreshold' , async function ( ) {
151
150
expect ( await uFragmentsPolicy . deviationThreshold ( ) ) . to . eq (
152
- ethers . utils . parseUnits ( '5 ' , 16 ) ,
151
+ ethers . utils . parseUnits ( '25 ' , 15 ) ,
153
152
)
154
153
} )
155
154
it ( 'rebaseLag' , async function ( ) {
@@ -399,8 +398,8 @@ describe('UFragmentsPolicy:CurveParameters', async function () {
399
398
400
399
describe ( 'when rebaseFunctionGrowth is more than 0' , async function ( ) {
401
400
it ( 'should setRebaseFunctionGrowth' , async function ( ) {
402
- await uFragmentsPolicy . connect ( deployer ) . setRebaseFunctionGrowth ( 1000 )
403
- expect ( await uFragmentsPolicy . rebaseFunctionGrowth ( ) ) . to . eq ( 1000 )
401
+ await uFragmentsPolicy . connect ( deployer ) . setRebaseFunctionGrowth ( '42000000000000000000' )
402
+ expect ( await uFragmentsPolicy . rebaseFunctionGrowth ( ) ) . to . eq ( '42000000000000000000' )
404
403
} )
405
404
} )
406
405
@@ -702,7 +701,7 @@ describe('UFragmentsPolicy:Rebase', async function () {
702
701
await increaseTime ( 60 )
703
702
704
703
await mockExternalData (
705
- INITIAL_RATE_2P_MORE . sub ( 2 ) ,
704
+ INITIAL_RATE_2_5_P_MORE . sub ( 2 ) ,
706
705
INITIAL_TARGET_RATE ,
707
706
1000 ,
708
707
)
@@ -716,7 +715,7 @@ describe('UFragmentsPolicy:Rebase', async function () {
716
715
await increaseTime ( 60 )
717
716
718
717
await mockExternalData (
719
- INITIAL_RATE_2P_LESS . add ( 2 ) ,
718
+ INITIAL_RATE_2_5_P_LESS . add ( 2 ) ,
720
719
INITIAL_TARGET_RATE ,
721
720
1000 ,
722
721
)
@@ -991,7 +990,7 @@ describe('UFragmentsPolicy:Rebase', async function () {
991
990
prevEpoch . add ( 1 ) ,
992
991
INITIAL_RATE_60P_MORE ,
993
992
INITIAL_TARGET_RATE ,
994
- 55 ,
993
+ 50 ,
995
994
)
996
995
} )
997
996
@@ -1014,7 +1013,7 @@ describe('UFragmentsPolicy:Rebase', async function () {
1014
1013
. withArgs ( 'UFragments' , 'rebase' , uFragmentsPolicy . address )
1015
1014
await expect ( r )
1016
1015
. to . emit ( mockUFragments , 'FunctionArguments' )
1017
- . withArgs ( [ prevEpoch . add ( 1 ) ] , [ 55 ] )
1016
+ . withArgs ( [ prevEpoch . add ( 1 ) ] , [ 50 ] )
1018
1017
} )
1019
1018
} )
1020
1019
} )
@@ -1045,7 +1044,7 @@ describe('UFragmentsPolicy:Rebase', async function () {
1045
1044
uFragmentsPolicy . connect ( orchestrator ) . rebase ( ) ,
1046
1045
)
1047
1046
) . requestedSupplyAdjustment ,
1048
- ) . to . eq ( - 29 )
1047
+ ) . to . eq ( - 76 )
1049
1048
} )
1050
1049
} )
1051
1050
@@ -1065,7 +1064,7 @@ describe('UFragmentsPolicy:Rebase', async function () {
1065
1064
uFragmentsPolicy . connect ( orchestrator ) . rebase ( ) ,
1066
1065
)
1067
1066
) . requestedSupplyAdjustment ,
1068
- ) . to . eq ( 100 )
1067
+ ) . to . eq ( 50 )
1069
1068
} )
1070
1069
} )
1071
1070
@@ -1085,7 +1084,7 @@ describe('UFragmentsPolicy:Rebase', async function () {
1085
1084
uFragmentsPolicy . connect ( orchestrator ) . rebase ( ) ,
1086
1085
)
1087
1086
) . requestedSupplyAdjustment ,
1088
- ) . to . eq ( - 100 )
1087
+ ) . to . eq ( - 77 )
1089
1088
} )
1090
1089
} )
1091
1090
@@ -1105,7 +1104,7 @@ describe('UFragmentsPolicy:Rebase', async function () {
1105
1104
uFragmentsPolicy . connect ( orchestrator ) . rebase ( ) ,
1106
1105
)
1107
1106
) . requestedSupplyAdjustment ,
1108
- ) . to . eq ( - 100 )
1107
+ ) . to . eq ( - 77 )
1109
1108
} )
1110
1109
} )
1111
1110
} )
@@ -1137,7 +1136,7 @@ describe('UFragmentsPolicy:Rebase', async function () {
1137
1136
uFragmentsPolicy . connect ( orchestrator ) . rebase ( ) ,
1138
1137
)
1139
1138
) . requestedSupplyAdjustment ,
1140
- ) . to . eq ( - 20 )
1139
+ ) . to . eq ( - 76 )
1141
1140
} )
1142
1141
} )
1143
1142
} )
@@ -1169,7 +1168,7 @@ describe('UFragmentsPolicy:Rebase', async function () {
1169
1168
uFragmentsPolicy . connect ( orchestrator ) . rebase ( ) ,
1170
1169
)
1171
1170
) . requestedSupplyAdjustment ,
1172
- ) . to . eq ( 32 )
1171
+ ) . to . eq ( 49 )
1173
1172
} )
1174
1173
} )
1175
1174
} )
0 commit comments