Skip to content

Commit 9e06338

Browse files
committed
updated batch job
1 parent 111190e commit 9e06338

File tree

4 files changed

+13
-10
lines changed

4 files changed

+13
-10
lines changed

contracts/_utilities/ChainBridgeBatchRebaseReport.sol

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ interface IBridge {
66
uint8 destinationChainID,
77
bytes32 resourceID,
88
bytes calldata data
9-
) external;
9+
) external payable;
1010
}
1111

1212
interface IPolicy {
@@ -22,8 +22,9 @@ contract ChainBridgeBatchRebaseReport {
2222
address policy,
2323
address bridge,
2424
uint8[] memory destinationChainIDs,
25-
bytes32 resourceID
26-
) external {
25+
bytes32 resourceID,
26+
uint128 bridgeFee
27+
) external payable {
2728
for (uint256 i = 0; i < destinationChainIDs.length; i++) {
2829
uint8 destinationChainID = destinationChainIDs[i];
2930

@@ -32,7 +33,7 @@ contract ChainBridgeBatchRebaseReport {
3233
(epoch, totalSupply) = IPolicy(policy).globalAmpleforthEpochAndAMPLSupply();
3334

3435
uint256 dataLen = 64;
35-
IBridge(bridge).deposit(
36+
IBridge(bridge).deposit{value:bridgeFee}(
3637
destinationChainID,
3738
resourceID,
3839
abi.encode(dataLen, epoch, totalSupply)

sdk/ampleforth.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ const BigNumber = require('bignumber.js');
44
const AMPL_DECIMALS = 9;
55

66
const toAmplFloatingPt = (ample) =>
7-
ethers.utils.formatUnits(`${ample}`, AMPL_DECIMALS);
7+
ethers.utils.formatUnits(`${ample.toFixed ? ample.toFixed(AMPL_DECIMALS) : ample}`, AMPL_DECIMALS);
88

99
const toAmplFixedPt = (ample) =>
10-
ethers.utils.parseUnits(`${ample.toFixed(AMPL_DECIMALS)}`, AMPL_DECIMALS);
10+
ethers.utils.parseUnits(`${ample.toFixed ? ample.toFixed(AMPL_DECIMALS) : ample}`, AMPL_DECIMALS);
1111

1212
const INITIAL_SUPPLY = ethers.utils.parseUnits('50', 6 + AMPL_DECIMALS);
1313
const AMPL_ORACLE_DECIMALS = 18;

sdk/deployments/ropstenBaseChain.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -321,11 +321,11 @@
321321
"blockNumber": 10165259
322322
},
323323
"chainBridge/batchRebaseReporter": {
324-
"address": "0xCCc7bB32f2c693edd8bBE5326ebf676F1ad86Eec",
324+
"address": "0xeeC0f9370732fD0ccD374d1c9fFB6C818E5d03bb",
325325
"abi": [
326-
"function execute(address policy, address bridge, uint8[] destinationChainIDs, bytes32 resourceID)"
326+
"function execute(address policy, address bridge, uint8[] destinationChainIDs, bytes32 resourceID, uint128 bridgeFee) payable"
327327
],
328-
"hash": "0x4d7c68d2ef06e6f222be9c4b5da94305d6a7ac5a59d6ce163043b1c5d487ff3a",
329-
"blockNumber": 10165257
328+
"hash": "0x56395e830441701c7145c78d0327de9a6d6232c050f8f85cf39b26ed5ba60d34",
329+
"blockNumber": 10235930
330330
}
331331
}

tasks/ops/rebase.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,15 @@ txTask(
104104
}
105105

106106
console.log('Initiating cross-chain rebase', satelliteChainIDs);
107+
const fee = await baseChainBridge._fee();
107108
const tx = await batchRebaseReporter
108109
.connect(sender)
109110
.execute(
110111
policy.address,
111112
baseChainBridge.address,
112113
satelliteChainIDs,
113114
XC_REBASE_RESOURCE_ID,
115+
fee,
114116
);
115117

116118
const txR = await tx.wait();

0 commit comments

Comments
 (0)