File tree Expand file tree Collapse file tree 8 files changed +101
-23
lines changed Expand file tree Collapse file tree 8 files changed +101
-23
lines changed Original file line number Diff line number Diff line change
1
+ // SPDX-License-Identifier: GPL-3.0-or-later
2
+ pragma solidity 0.6.12 ;
3
+
4
+ interface IAMPL {
5
+ // ERC20
6
+ function totalSupply () external view returns (uint256 );
7
+
8
+ function balanceOf (address who ) external view returns (uint256 );
9
+
10
+ function allowance (address owner_ , address spender ) external view returns (uint256 );
11
+
12
+ function transfer (address to , uint256 value ) external returns (bool );
13
+
14
+ function approve (address spender , uint256 value ) external returns (bool );
15
+
16
+ function increaseAllowance (address spender , uint256 addedValue ) external returns (bool );
17
+
18
+ function decreaseAllowance (address spender , uint256 subtractedValue ) external returns (bool );
19
+
20
+ function transferFrom (
21
+ address from ,
22
+ address to ,
23
+ uint256 value
24
+ ) external returns (bool );
25
+
26
+ // EIP-2612
27
+ function permit (
28
+ address owner ,
29
+ address spender ,
30
+ uint256 value ,
31
+ uint256 deadline ,
32
+ uint8 v ,
33
+ bytes32 r ,
34
+ bytes32 s
35
+ ) external ;
36
+
37
+ function nonces (address owner ) external view returns (uint256 );
38
+
39
+ function DOMAIN_SEPARATOR () external view returns (bytes32 );
40
+
41
+ // Elastic token interface
42
+ function scaledBalanceOf (address who ) external view returns (uint256 );
43
+
44
+ function scaledTotalSupply () external view returns (uint256 );
45
+
46
+ function transferAll (address to ) external returns (bool );
47
+
48
+ function transferAllFrom (address from , address to ) external returns (bool );
49
+ }
Original file line number Diff line number Diff line change
1
+ // SPDX-License-Identifier: GPL-3.0-or-later
2
+ pragma solidity 0.6.12 ;
3
+
4
+ interface IAmpleforth {
5
+ function epoch () external view returns (uint256 );
6
+
7
+ function lastRebaseTimestampSec () external view returns (uint256 );
8
+
9
+ function inRebaseWindow () external view returns (bool );
10
+
11
+ function globalAmpleforthEpochAndAMPLSupply () external view returns (uint256 , uint256 );
12
+ }
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
// SPDX-License-Identifier: GPL-3.0-or-later
2
2
pragma solidity 0.6.12 ;
3
3
4
- interface IXCAmple {
5
- function globalAMPLSupply () external returns (uint256 );
4
+ import "./IAMPL.sol " ;
6
5
7
- function mint (address who , uint256 value ) external ;
8
-
9
- function burn (address who , uint256 value ) external ;
10
-
11
- function rebase (uint256 globalAmpleforthEpoch_ , uint256 globalAMPLSupply_ )
12
- external
13
- returns (uint256 );
6
+ interface IXCAmple is IAMPL {
7
+ function globalAMPLSupply () external view returns (uint256 );
14
8
}
Original file line number Diff line number Diff line change 2
2
pragma solidity 0.6.12 ;
3
3
4
4
interface IXCAmpleController {
5
- function globalAmpleforthEpoch () external returns ( uint256 ) ;
5
+ function rebase () external ;
6
6
7
- function mint ( address recipient , uint256 xcAmplAmount ) external ;
7
+ function lastRebaseTimestampSec () external view returns ( uint256 ) ;
8
8
9
- function burn ( address depositor , uint256 xcAmplAmount ) external ;
9
+ function globalAmpleforthEpoch () external view returns ( uint256 ) ;
10
10
11
- function reportRebase ( uint256 nextGlobalAmpleforthEpoch , uint256 nextGlobalAMPLSupply ) external ;
11
+ function globalAmpleforthEpochAndAMPLSupply () external view returns ( uint256 , uint256 ) ;
12
12
}
Original file line number Diff line number Diff line change
1
+ // SPDX-License-Identifier: GPL-3.0-or-later
2
+ pragma solidity 0.6.12 ;
3
+
4
+ interface IXCAmpleControllerGateway {
5
+ function nextGlobalAmpleforthEpoch () external view returns (uint256 );
6
+
7
+ function nextGlobalAMPLSupply () external view returns (uint256 );
8
+
9
+ function mint (address recipient , uint256 xcAmplAmount ) external ;
10
+
11
+ function burn (address depositor , uint256 xcAmplAmount ) external ;
12
+
13
+ function reportRebase (uint256 nextGlobalAmpleforthEpoch_ , uint256 nextGlobalAMPLSupply_ )
14
+ external ;
15
+ }
Original file line number Diff line number Diff line change
1
+ // SPDX-License-Identifier: GPL-3.0-or-later
2
+ pragma solidity 0.6.12 ;
3
+
4
+ interface IXCAmpleSupplyPolicy {
5
+ function rebase (uint256 globalAmpleforthEpoch_ , uint256 globalAMPLSupply_ )
6
+ external
7
+ returns (uint256 );
8
+
9
+ function mint (address who , uint256 value ) external ;
10
+
11
+ function burn (address who , uint256 value ) external ;
12
+ }
Original file line number Diff line number Diff line change @@ -87,8 +87,9 @@ async function setupAMPLContracts (deployer) {
87
87
} ;
88
88
89
89
const getCurrentState = async ( ) => {
90
- const epoch = await policy . epoch ( ) ;
91
- const totalSupply = await ampl . totalSupply ( ) ;
90
+ const r = await policy . globalAmpleforthEpochAndAMPLSupply ( ) ;
91
+ const epoch = r [ 0 ] ;
92
+ const totalSupply = r [ 1 ] ;
92
93
return { epoch, totalSupply } ;
93
94
} ;
94
95
@@ -141,8 +142,9 @@ async function setupXCAMPLContracts (deployer) {
141
142
await xcController . setRebaseRelayer ( xcRebaseRelayer . address ) ;
142
143
143
144
const getCurrentState = async ( ) => {
144
- const epoch = await xcController . globalAmpleforthEpoch ( ) ;
145
- const totalSupply = await xcAmple . globalAMPLSupply ( ) ;
145
+ const r = await xcController . globalAmpleforthEpochAndAMPLSupply ( ) ;
146
+ const epoch = r [ 0 ] ;
147
+ const totalSupply = r [ 1 ] ;
146
148
return { epoch, totalSupply } ;
147
149
} ;
148
150
You can’t perform that action at this time.
0 commit comments