Skip to content

Commit 81c955e

Browse files
committed
avax deployment
1 parent c373975 commit 81c955e

File tree

3 files changed

+253
-2
lines changed

3 files changed

+253
-2
lines changed

hardhat.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ module.exports = {
103103
prodBscSatChain: {
104104
url: 'https://bsc-dataseed.binance.org'
105105
},
106+
prodAvaxSatChain: {
107+
url: 'https://api.avax.network/ext/bc/C/rpc'
108+
},
106109
prodMaticSatChain: {
107110
url: 'https://polygon-mainnet.infura.io/v3/' + process.env.INFURA_SECRET
108111
}

sdk/deployments/prodAvaxSatChain.json

Lines changed: 246 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,246 @@
1+
{
2+
"proxyAdmin": {
3+
"address": "0xC9DcF34C93032E4799912ddA196796A35C856576",
4+
"abi": [
5+
"event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)",
6+
"function changeProxyAdmin(address proxy, address newAdmin)",
7+
"function getProxyAdmin(address proxy) view returns (address)",
8+
"function getProxyImplementation(address proxy) view returns (address)",
9+
"function isOwner() view returns (bool)",
10+
"function owner() view returns (address)",
11+
"function renounceOwnership()",
12+
"function transferOwnership(address newOwner)",
13+
"function upgrade(address proxy, address implementation)",
14+
"function upgradeAndCall(address proxy, address implementation, bytes data) payable"
15+
],
16+
"hash": "0x527f4a10c8e1d5ae5ef83cd462be4a12564f3c22c5fb61053835bb8796c165ea",
17+
"blockNumber": 4799736
18+
},
19+
"xcAmple": {
20+
"address": "0x027dbcA046ca156De9622cD1e2D907d375e53aa7",
21+
"abi": [
22+
"event Approval(address indexed owner, address indexed spender, uint256 value)",
23+
"event ControllerUpdated(address controller)",
24+
"event LogRebase(uint256 indexed epoch, uint256 globalAMPLSupply)",
25+
"event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)",
26+
"event Transfer(address indexed from, address indexed to, uint256 value)",
27+
"function DOMAIN_SEPARATOR() view returns (bytes32)",
28+
"function EIP712_DOMAIN() view returns (bytes32)",
29+
"function EIP712_REVISION() view returns (string)",
30+
"function PERMIT_TYPEHASH() view returns (bytes32)",
31+
"function allowance(address owner_, address spender) view returns (uint256)",
32+
"function approve(address spender, uint256 value) returns (bool)",
33+
"function balanceOf(address who) view returns (uint256)",
34+
"function burnFrom(address who, uint256 xcAmpleAmount)",
35+
"function controller() view returns (address)",
36+
"function decimals() view returns (uint8)",
37+
"function decreaseAllowance(address spender, uint256 subtractedValue) returns (bool)",
38+
"function globalAMPLSupply() view returns (uint256)",
39+
"function increaseAllowance(address spender, uint256 addedValue) returns (bool)",
40+
"function initialize(string name, string symbol, uint256 globalAMPLSupply_)",
41+
"function mint(address who, uint256 xcAmpleAmount)",
42+
"function name() view returns (string)",
43+
"function nonces(address who) view returns (uint256)",
44+
"function owner() view returns (address)",
45+
"function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s)",
46+
"function rebase(uint256 epoch, uint256 newGlobalAMPLSupply) returns (uint256)",
47+
"function renounceOwnership()",
48+
"function scaledBalanceOf(address who) view returns (uint256)",
49+
"function scaledTotalSupply() pure returns (uint256)",
50+
"function setController(address controller_)",
51+
"function symbol() view returns (string)",
52+
"function totalSupply() view returns (uint256)",
53+
"function transfer(address to, uint256 value) returns (bool)",
54+
"function transferAll(address to) returns (bool)",
55+
"function transferAllFrom(address from, address to) returns (bool)",
56+
"function transferFrom(address from, address to, uint256 value) returns (bool)",
57+
"function transferOwnership(address newOwner)"
58+
],
59+
"hash": "0x11bf4f392a991ae1e52a250722ed49fb0b159424f892ad0e04391479c018895c",
60+
"blockNumber": 4799745
61+
},
62+
"xcAmpleController": {
63+
"address": "0x24232ccAf8bB87908C419aD7dDCca8cc9e74746d",
64+
"abi": [
65+
"event GatewayBurn(address indexed bridgeGateway, address indexed depositor, uint256 xcAmpleAmount)",
66+
"event GatewayMint(address indexed bridgeGateway, address indexed recipient, uint256 xcAmpleAmount)",
67+
"event GatewayRebaseReported(address indexed bridgeGateway, uint256 indexed epoch, uint256 globalAMPLSupply, uint256 timestampSec)",
68+
"event GatewayWhitelistUpdated(address indexed bridgeGateway, bool active)",
69+
"event LogRebase(uint256 indexed epoch, int256 requestedSupplyAdjustment, uint256 timestampSec)",
70+
"event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)",
71+
"function addBridgeGateway(address bridgeGateway)",
72+
"function burn(address depositor, uint256 xcAmpleAmount)",
73+
"function globalAmpleforthEpoch() view returns (uint256)",
74+
"function globalAmpleforthEpochAndAMPLSupply() view returns (uint256, uint256)",
75+
"function initialize(address xcAmple_, uint256 globalAmpleforthEpoch_)",
76+
"function lastRebaseTimestampSec() view returns (uint256)",
77+
"function mint(address recipient, uint256 xcAmpleAmount)",
78+
"function nextGlobalAMPLSupply() view returns (uint256)",
79+
"function nextGlobalAmpleforthEpoch() view returns (uint256)",
80+
"function owner() view returns (address)",
81+
"function rebase()",
82+
"function rebaseRelayer() view returns (address)",
83+
"function removeBridgeGateway(address bridgeGateway)",
84+
"function renounceOwnership()",
85+
"function reportRebase(uint256 nextGlobalAmpleforthEpoch_, uint256 nextGlobalAMPLSupply_)",
86+
"function setRebaseRelayer(address rebaseRelayer_)",
87+
"function transferOwnership(address newOwner)",
88+
"function whitelistedBridgeGateways(address) view returns (bool)",
89+
"function xcAmple() view returns (address)"
90+
],
91+
"hash": "0xaaed74679df37939fa0ce77d0eed794983a07d65fa0ae4acdfcc5996a3340b3b",
92+
"blockNumber": 4799754
93+
},
94+
"rebaseRelayer": {
95+
"address": "0xE3a0B70676ed6e1947140Ff0b332cAe7d7f0364B",
96+
"abi": [
97+
"event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)",
98+
"event TransactionFailed(address indexed destination, uint256 index, bytes data, bytes reason)",
99+
"function addTransaction(address destination, uint256 value, bytes data)",
100+
"function checkExecution(uint256 index) payable returns (bool)",
101+
"function executeAll() payable returns (bool)",
102+
"function owner() view returns (address)",
103+
"function removeTransaction(uint256 index)",
104+
"function renounceOwnership()",
105+
"function setTransactionEnabled(uint256 index, bool enabled)",
106+
"function totalValue() view returns (uint256)",
107+
"function transactions(uint256) view returns (bool enabled, address destination, uint256 value, bytes data)",
108+
"function transactionsSize() view returns (uint256)",
109+
"function transferOwnership(address newOwner)"
110+
],
111+
"hash": "0xb61f658faaeb7f3c96c6245df76963d4d0929a0a0dea8b0b127b0ed29d2f0667",
112+
"blockNumber": 4799768
113+
},
114+
"isBaseChain": false,
115+
"chainBridge/bridge": {
116+
"address": "0xF41e7FC4eC990298d36f667B93951c9dba65224e",
117+
"abi": [
118+
"constructor(uint8 chainID, address[] initialRelayers, uint256 initialRelayerThreshold, uint256 fee, uint256 expiry)",
119+
"event Deposit(uint8 indexed destinationChainID, bytes32 indexed resourceID, uint64 indexed depositNonce)",
120+
"event Paused(address account)",
121+
"event ProposalEvent(uint8 indexed originChainID, uint64 indexed depositNonce, uint8 indexed status, bytes32 resourceID, bytes32 dataHash)",
122+
"event ProposalVote(uint8 indexed originChainID, uint64 indexed depositNonce, uint8 indexed status, bytes32 resourceID)",
123+
"event RelayerAdded(address indexed relayer)",
124+
"event RelayerRemoved(address indexed relayer)",
125+
"event RelayerThresholdChanged(uint256 indexed newThreshold)",
126+
"event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole)",
127+
"event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender)",
128+
"event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender)",
129+
"event Unpaused(address account)",
130+
"function DEFAULT_ADMIN_ROLE() view returns (bytes32)",
131+
"function RELAYER_ROLE() view returns (bytes32)",
132+
"function _chainID() view returns (uint8)",
133+
"function _depositCounts(uint8) view returns (uint64)",
134+
"function _depositRecords(uint64, uint8) view returns (bytes)",
135+
"function _expiry() view returns (uint256)",
136+
"function _fee() view returns (uint256)",
137+
"function _hasVotedOnProposal(uint72, bytes32, address) view returns (bool)",
138+
"function _proposals(uint72, bytes32) view returns (bytes32 _resourceID, bytes32 _dataHash, uint8 _status, uint256 _proposedBlock)",
139+
"function _relayerThreshold() view returns (uint256)",
140+
"function _resourceIDToHandlerAddress(bytes32) view returns (address)",
141+
"function _specialFee() view returns (uint256)",
142+
"function _specialFeeChainID() view returns (uint8)",
143+
"function _totalProposals() view returns (uint256)",
144+
"function _totalRelayers() view returns (uint256)",
145+
"function _wtokenAddress() view returns (address)",
146+
"function adminAddRelayer(address relayerAddress)",
147+
"function adminChangeFee(uint256 newFee)",
148+
"function adminChangeRelayerThreshold(uint256 newThreshold)",
149+
"function adminChangeSpecialFee(uint256 newFee, uint8 chainID)",
150+
"function adminPauseTransfers()",
151+
"function adminRemoveRelayer(address relayerAddress)",
152+
"function adminSetBurnable(address handlerAddress, address tokenAddress)",
153+
"function adminSetGenericResource(address handlerAddress, bytes32 resourceID, address contractAddress, bytes4 depositFunctionSig, uint256 depositFunctionDepositerOffset, bytes4 executeFunctionSig)",
154+
"function adminSetResource(address handlerAddress, bytes32 resourceID, address tokenAddress)",
155+
"function adminUnpauseTransfers()",
156+
"function adminUpdateBridgeAddress(address handlerAddress, address newBridgeAddress)",
157+
"function adminWithdraw(address handlerAddress, address tokenAddress, address recipient, uint256 amountOrTokenID)",
158+
"function cancelProposal(uint8 chainID, uint64 depositNonce, bytes32 dataHash)",
159+
"function deposit(uint8 destinationChainID, bytes32 resourceID, bytes data) payable",
160+
"function depositETH(uint8 destinationChainID, bytes32 resourceID, bytes data) payable",
161+
"function executeProposal(uint8 chainID, uint64 depositNonce, bytes data, bytes32 resourceID)",
162+
"function getFee(uint8 destinationChainID) view returns (uint256)",
163+
"function getFees() view returns (uint256, uint256, uint8)",
164+
"function getProposal(uint8 originChainID, uint64 depositNonce, bytes32 dataHash) view returns (tuple(bytes32 _resourceID, bytes32 _dataHash, address[] _yesVotes, address[] _noVotes, uint8 _status, uint256 _proposedBlock))",
165+
"function getRoleAdmin(bytes32 role) view returns (bytes32)",
166+
"function getRoleMember(bytes32 role, uint256 index) view returns (address)",
167+
"function getRoleMemberCount(bytes32 role) view returns (uint256)",
168+
"function grantRole(bytes32 role, address account)",
169+
"function hasRole(bytes32 role, address account) view returns (bool)",
170+
"function isRelayer(address relayer) view returns (bool)",
171+
"function paused() view returns (bool)",
172+
"function renounceAdmin(address newAdmin)",
173+
"function renounceRole(bytes32 role, address account)",
174+
"function revokeRole(bytes32 role, address account)",
175+
"function transferFunds(address[] addrs, uint256[] amounts)",
176+
"function voteProposal(uint8 chainID, uint64 depositNonce, bytes32 resourceID, bytes32 dataHash)"
177+
]
178+
},
179+
"chainBridge/genericHandler": {
180+
"address": "0x123455360bE78C9289B38bcb4DbA427D9a6cD440",
181+
"abi": [
182+
"constructor(address bridgeAddress, bytes32[] initialResourceIDs, address[] initialContractAddresses, bytes4[] initialDepositFunctionSignatures, uint256[] initialDepositFunctionDepositerOffsets, bytes4[] initialExecuteFunctionSignatures)",
183+
"function _bridgeAddress() view returns (address)",
184+
"function _contractAddressToDepositFunctionDepositerOffset(address) view returns (uint256)",
185+
"function _contractAddressToDepositFunctionSignature(address) view returns (bytes4)",
186+
"function _contractAddressToExecuteFunctionSignature(address) view returns (bytes4)",
187+
"function _contractAddressToResourceID(address) view returns (bytes32)",
188+
"function _contractWhitelist(address) view returns (bool)",
189+
"function _depositRecords(uint8, uint64) view returns (uint8 _destinationChainID, address _depositer, bytes32 _resourceID, bytes _metaData)",
190+
"function _resourceIDToContractAddress(bytes32) view returns (address)",
191+
"function deposit(bytes32 resourceID, uint8 destinationChainID, uint64 depositNonce, address depositer, bytes data)",
192+
"function executeProposal(bytes32 resourceID, bytes data)",
193+
"function getDepositRecord(uint64 depositNonce, uint8 destId) view returns (tuple(uint8 _destinationChainID, address _depositer, bytes32 _resourceID, bytes _metaData))",
194+
"function setResource(bytes32 resourceID, address contractAddress, bytes4 depositFunctionSig, uint256 depositFunctionDepositerOffset, bytes4 executeFunctionSig)",
195+
"function updateBridgeAddress(address newBridgeAddress)"
196+
]
197+
},
198+
"chainBridge/transferGateway": {
199+
"address": "0x47fB203e1d75FB2c518Cd56f3a8094D22A46aF83",
200+
"abi": [
201+
"constructor(address bridgeHandler, address xcAmple_, address xcController_)",
202+
"event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)",
203+
"event XCRebaseReportIn(uint256 globalAmpleforthEpoch, uint256 globalAMPLSupply, uint256 recordedGlobalAmpleforthEpoch, uint256 recordedGlobalAMPLSupply)",
204+
"event XCRebaseReportOut(uint256 globalAmpleforthEpoch, uint256 globalAMPLSupply)",
205+
"event XCTransferIn(address indexed senderInSourceChain, address indexed recipient, uint256 globalAMPLSupply, uint256 amount, uint256 recordedGlobalAMPLSupply)",
206+
"event XCTransferOut(address indexed sender, address indexed recipientInTargetChain, uint256 amount, uint256 recordedGlobalAMPLSupply)",
207+
"function mint(address senderAddressInSourceChain, address recipient, uint256 amount, uint256 globalAMPLSupply)",
208+
"function owner() view returns (address)",
209+
"function renounceOwnership()",
210+
"function reportRebase(uint256 globalAmpleforthEpoch, uint256 globalAMPLSupply)",
211+
"function transferOwnership(address newOwner)",
212+
"function unlock(address senderAddressInSourceChain, address recipient, uint256 amount, uint256 globalAMPLSupply)",
213+
"function validateAndBurn(address sender, address recipientAddressInTargetChain, uint256 amount, uint256 globalAMPLSupply)",
214+
"function validateAndLock(address sender, address recipientAddressInTargetChain, uint256 amount, uint256 globalAMPLSupply)",
215+
"function validateRebaseReport(uint256 globalAmpleforthEpoch, uint256 globalAMPLSupply)",
216+
"function xcAmple() view returns (address)",
217+
"function xcController() view returns (address)"
218+
],
219+
"hash": "0x1089636ada3401eda26fd545329821157f608105a887de8322dd06e188c7dee4",
220+
"blockNumber": 4799858
221+
},
222+
"chainBridge/rebaseGateway": {
223+
"address": "0x4C6eA1a42ED10Daa1c29965584e6e114915e8366",
224+
"abi": [
225+
"constructor(address bridgeHandler, address xcAmple_, address xcController_)",
226+
"event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)",
227+
"event XCRebaseReportIn(uint256 globalAmpleforthEpoch, uint256 globalAMPLSupply, uint256 recordedGlobalAmpleforthEpoch, uint256 recordedGlobalAMPLSupply)",
228+
"event XCRebaseReportOut(uint256 globalAmpleforthEpoch, uint256 globalAMPLSupply)",
229+
"event XCTransferIn(address indexed senderInSourceChain, address indexed recipient, uint256 globalAMPLSupply, uint256 amount, uint256 recordedGlobalAMPLSupply)",
230+
"event XCTransferOut(address indexed sender, address indexed recipientInTargetChain, uint256 amount, uint256 recordedGlobalAMPLSupply)",
231+
"function mint(address senderAddressInSourceChain, address recipient, uint256 amount, uint256 globalAMPLSupply)",
232+
"function owner() view returns (address)",
233+
"function renounceOwnership()",
234+
"function reportRebase(uint256 globalAmpleforthEpoch, uint256 globalAMPLSupply)",
235+
"function transferOwnership(address newOwner)",
236+
"function unlock(address senderAddressInSourceChain, address recipient, uint256 amount, uint256 globalAMPLSupply)",
237+
"function validateAndBurn(address sender, address recipientAddressInTargetChain, uint256 amount, uint256 globalAMPLSupply)",
238+
"function validateAndLock(address sender, address recipientAddressInTargetChain, uint256 amount, uint256 globalAMPLSupply)",
239+
"function validateRebaseReport(uint256 globalAmpleforthEpoch, uint256 globalAMPLSupply)",
240+
"function xcAmple() view returns (address)",
241+
"function xcController() view returns (address)"
242+
],
243+
"hash": "0x504e352ca4d676c743d28c60f4fdb5a7a0fca689ba3305533ebf005dce1ece15",
244+
"blockNumber": 4799855
245+
}
246+
}

tasks/ops/rebase.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ txTask(
9797
);
9898

9999
const satelliteChainIDs = [];
100+
let totalFee = hre.ethers.BigNumber.from('0');
100101
for (let n in args.satelliteChainNetworks) {
101102
const network = args.satelliteChainNetworks[n];
102103
const provider = await getEthersProvider(network);
@@ -107,11 +108,12 @@ txTask(
107108
);
108109
const satelliteChainID = await satelliteChainBridge._chainID();
109110
satelliteChainIDs.push(satelliteChainID);
111+
const fee = await baseChainBridge.getFee(satelliteChainID);
112+
totalFee = totalFee.add(fee)
110113
}
111114

112115
console.log('Initiating cross-chain rebase', satelliteChainIDs);
113-
const fee = await baseChainBridge._fee();
114-
const totalFee = fee.mul(satelliteChainIDs.length);
116+
console.log('totalFee', totalFee);
115117

116118
const tx = await batchRebaseReporter
117119
.connect(sender)

0 commit comments

Comments
 (0)