@@ -13,6 +13,7 @@ import {
13
13
14
14
import {UInt256Lib} from "./UInt256Lib.sol " ;
15
15
import {IXCAmple} from "../../_interfaces/IXCAmple.sol " ;
16
+ import {IXCAmpleSupplyPolicy} from "../../_interfaces/IXCAmpleSupplyPolicy.sol " ;
16
17
import {IBatchTxExecutor} from "../../_interfaces/IBatchTxExecutor.sol " ;
17
18
18
19
/**
@@ -113,7 +114,7 @@ contract XCAmpleController is OwnableUpgradeable {
113
114
* @param xcAmpleAmount The amount of xcAmples to be mint on this chain.
114
115
*/
115
116
function mint (address recipient , uint256 xcAmpleAmount ) external onlyBridgeGateway {
116
- IXCAmple (xcAmple).mint (recipient, xcAmpleAmount);
117
+ IXCAmpleSupplyPolicy (xcAmple).mint (recipient, xcAmpleAmount);
117
118
emit GatewayMint (msg .sender , recipient, xcAmpleAmount);
118
119
}
119
120
@@ -125,7 +126,7 @@ contract XCAmpleController is OwnableUpgradeable {
125
126
* @param xcAmpleAmount The amount of xcAmples to be burnt on this chain.
126
127
*/
127
128
function burn (address depositor , uint256 xcAmpleAmount ) external onlyBridgeGateway {
128
- IXCAmple (xcAmple).burn (depositor, xcAmpleAmount);
129
+ IXCAmpleSupplyPolicy (xcAmple).burn (depositor, xcAmpleAmount);
129
130
emit GatewayBurn (msg .sender , depositor, xcAmpleAmount);
130
131
}
131
132
@@ -149,6 +150,19 @@ contract XCAmpleController is OwnableUpgradeable {
149
150
);
150
151
}
151
152
153
+ /**
154
+ * @notice A multi-chain AMPL interface method. The Ampleforth monetary policy contract
155
+ * on the base-chain and XCAmpleController contracts on the satellite-chains
156
+ * implement this method. It atomically returns two values:
157
+ * what the current contract believes to be,
158
+ * the globalAmpleforthEpoch and globalAMPLSupply.
159
+ * @return globalAmpleforthEpoch The recorded global Ampleforth epoch.
160
+ * @return globalAMPLSupply The recorded global AMPL supply.
161
+ */
162
+ function globalAmpleforthEpochAndAMPLSupply () external view returns (uint256 , uint256 ) {
163
+ return (globalAmpleforthEpoch, IXCAmple (xcAmple).globalAMPLSupply ());
164
+ }
165
+
152
166
/**
153
167
* @notice Initiate a new rebase operation.
154
168
* @dev Once the Bridge gateway reports new epoch and total supply Rebase can be triggered on this satellite chain.
@@ -168,7 +182,7 @@ contract XCAmpleController is OwnableUpgradeable {
168
182
int256 recordedGlobalAMPLSupply = IXCAmple (xcAmple).globalAMPLSupply ().toInt256Safe ();
169
183
170
184
// execute rebase on this chain
171
- IXCAmple (xcAmple).rebase (nextGlobalAmpleforthEpoch, nextGlobalAMPLSupply);
185
+ IXCAmpleSupplyPolicy (xcAmple).rebase (nextGlobalAmpleforthEpoch, nextGlobalAMPLSupply);
172
186
173
187
// calculate supply delta
174
188
int256 supplyDelta = nextGlobalAMPLSupply.toInt256Safe ().sub (recordedGlobalAMPLSupply);
0 commit comments