@@ -13,6 +13,7 @@ import {
1313
1414import {UInt256Lib} from "./UInt256Lib.sol " ;
1515import {IXCAmple} from "../../_interfaces/IXCAmple.sol " ;
16+ import {IXCAmpleSupplyPolicy} from "../../_interfaces/IXCAmpleSupplyPolicy.sol " ;
1617import {IBatchTxExecutor} from "../../_interfaces/IBatchTxExecutor.sol " ;
1718
1819/**
@@ -113,7 +114,7 @@ contract XCAmpleController is OwnableUpgradeable {
113114 * @param xcAmpleAmount The amount of xcAmples to be mint on this chain.
114115 */
115116 function mint (address recipient , uint256 xcAmpleAmount ) external onlyBridgeGateway {
116- IXCAmple (xcAmple).mint (recipient, xcAmpleAmount);
117+ IXCAmpleSupplyPolicy (xcAmple).mint (recipient, xcAmpleAmount);
117118 emit GatewayMint (msg .sender , recipient, xcAmpleAmount);
118119 }
119120
@@ -125,7 +126,7 @@ contract XCAmpleController is OwnableUpgradeable {
125126 * @param xcAmpleAmount The amount of xcAmples to be burnt on this chain.
126127 */
127128 function burn (address depositor , uint256 xcAmpleAmount ) external onlyBridgeGateway {
128- IXCAmple (xcAmple).burn (depositor, xcAmpleAmount);
129+ IXCAmpleSupplyPolicy (xcAmple).burn (depositor, xcAmpleAmount);
129130 emit GatewayBurn (msg .sender , depositor, xcAmpleAmount);
130131 }
131132
@@ -149,6 +150,19 @@ contract XCAmpleController is OwnableUpgradeable {
149150 );
150151 }
151152
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+
152166 /**
153167 * @notice Initiate a new rebase operation.
154168 * @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 {
168182 int256 recordedGlobalAMPLSupply = IXCAmple (xcAmple).globalAMPLSupply ().toInt256Safe ();
169183
170184 // execute rebase on this chain
171- IXCAmple (xcAmple).rebase (nextGlobalAmpleforthEpoch, nextGlobalAMPLSupply);
185+ IXCAmpleSupplyPolicy (xcAmple).rebase (nextGlobalAmpleforthEpoch, nextGlobalAMPLSupply);
172186
173187 // calculate supply delta
174188 int256 supplyDelta = nextGlobalAMPLSupply.toInt256Safe ().sub (recordedGlobalAMPLSupply);
0 commit comments