Skip to content

Commit

Permalink
Merge pull request #56 from ampleforth/avax-deployment
Browse files Browse the repository at this point in the history
Avax deployment
  • Loading branch information
aalavandhan authored Sep 30, 2021
2 parents c373975 + 256d251 commit 7794c0e
Show file tree
Hide file tree
Showing 4 changed files with 259 additions and 2 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ token: 0xDB021b1B247fe2F1fa57e0A87C748Cc1E321F07F
controller: 0x17F084dFF8a71e38521BCBD3Da871753Dc67aa81
rebaseRelayer: 0x0c0144D04594AB99F4C02691B6684e3d871B589e

# AVAX (controlled by Ampleforth Bridge DAO on AVAX)
owner: 0x744ab0D47Ce9650E4d0eD45112d04BaA19dF4260
token: 0x027dbcA046ca156De9622cD1e2D907d375e53aa7
controller: 0x24232ccAf8bB87908C419aD7dDCca8cc9e74746d
rebaseRelayer: 0xE3a0B70676ed6e1947140Ff0b332cAe7d7f0364B

# Matic / Polygon (controlled by Ampleforth Bridge DAO on Matic)
owner: 0x5d96A65E51A78C511C545a0247eb2d006912b636
token: 0xc67238827da94B15F6bA10F3d35f690809919F75
Expand Down
3 changes: 3 additions & 0 deletions hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ module.exports = {
prodBscSatChain: {
url: 'https://bsc-dataseed.binance.org'
},
prodAvaxSatChain: {
url: 'https://api.avax.network/ext/bc/C/rpc'
},
prodMaticSatChain: {
url: 'https://polygon-mainnet.infura.io/v3/' + process.env.INFURA_SECRET
}
Expand Down
246 changes: 246 additions & 0 deletions sdk/deployments/prodAvaxSatChain.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,246 @@
{
"proxyAdmin": {
"address": "0xC9DcF34C93032E4799912ddA196796A35C856576",
"abi": [
"event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)",
"function changeProxyAdmin(address proxy, address newAdmin)",
"function getProxyAdmin(address proxy) view returns (address)",
"function getProxyImplementation(address proxy) view returns (address)",
"function isOwner() view returns (bool)",
"function owner() view returns (address)",
"function renounceOwnership()",
"function transferOwnership(address newOwner)",
"function upgrade(address proxy, address implementation)",
"function upgradeAndCall(address proxy, address implementation, bytes data) payable"
],
"hash": "0x527f4a10c8e1d5ae5ef83cd462be4a12564f3c22c5fb61053835bb8796c165ea",
"blockNumber": 4799736
},
"xcAmple": {
"address": "0x027dbcA046ca156De9622cD1e2D907d375e53aa7",
"abi": [
"event Approval(address indexed owner, address indexed spender, uint256 value)",
"event ControllerUpdated(address controller)",
"event LogRebase(uint256 indexed epoch, uint256 globalAMPLSupply)",
"event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)",
"event Transfer(address indexed from, address indexed to, uint256 value)",
"function DOMAIN_SEPARATOR() view returns (bytes32)",
"function EIP712_DOMAIN() view returns (bytes32)",
"function EIP712_REVISION() view returns (string)",
"function PERMIT_TYPEHASH() view returns (bytes32)",
"function allowance(address owner_, address spender) view returns (uint256)",
"function approve(address spender, uint256 value) returns (bool)",
"function balanceOf(address who) view returns (uint256)",
"function burnFrom(address who, uint256 xcAmpleAmount)",
"function controller() view returns (address)",
"function decimals() view returns (uint8)",
"function decreaseAllowance(address spender, uint256 subtractedValue) returns (bool)",
"function globalAMPLSupply() view returns (uint256)",
"function increaseAllowance(address spender, uint256 addedValue) returns (bool)",
"function initialize(string name, string symbol, uint256 globalAMPLSupply_)",
"function mint(address who, uint256 xcAmpleAmount)",
"function name() view returns (string)",
"function nonces(address who) view returns (uint256)",
"function owner() view returns (address)",
"function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s)",
"function rebase(uint256 epoch, uint256 newGlobalAMPLSupply) returns (uint256)",
"function renounceOwnership()",
"function scaledBalanceOf(address who) view returns (uint256)",
"function scaledTotalSupply() pure returns (uint256)",
"function setController(address controller_)",
"function symbol() view returns (string)",
"function totalSupply() view returns (uint256)",
"function transfer(address to, uint256 value) returns (bool)",
"function transferAll(address to) returns (bool)",
"function transferAllFrom(address from, address to) returns (bool)",
"function transferFrom(address from, address to, uint256 value) returns (bool)",
"function transferOwnership(address newOwner)"
],
"hash": "0x11bf4f392a991ae1e52a250722ed49fb0b159424f892ad0e04391479c018895c",
"blockNumber": 4799745
},
"xcAmpleController": {
"address": "0x24232ccAf8bB87908C419aD7dDCca8cc9e74746d",
"abi": [
"event GatewayBurn(address indexed bridgeGateway, address indexed depositor, uint256 xcAmpleAmount)",
"event GatewayMint(address indexed bridgeGateway, address indexed recipient, uint256 xcAmpleAmount)",
"event GatewayRebaseReported(address indexed bridgeGateway, uint256 indexed epoch, uint256 globalAMPLSupply, uint256 timestampSec)",
"event GatewayWhitelistUpdated(address indexed bridgeGateway, bool active)",
"event LogRebase(uint256 indexed epoch, int256 requestedSupplyAdjustment, uint256 timestampSec)",
"event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)",
"function addBridgeGateway(address bridgeGateway)",
"function burn(address depositor, uint256 xcAmpleAmount)",
"function globalAmpleforthEpoch() view returns (uint256)",
"function globalAmpleforthEpochAndAMPLSupply() view returns (uint256, uint256)",
"function initialize(address xcAmple_, uint256 globalAmpleforthEpoch_)",
"function lastRebaseTimestampSec() view returns (uint256)",
"function mint(address recipient, uint256 xcAmpleAmount)",
"function nextGlobalAMPLSupply() view returns (uint256)",
"function nextGlobalAmpleforthEpoch() view returns (uint256)",
"function owner() view returns (address)",
"function rebase()",
"function rebaseRelayer() view returns (address)",
"function removeBridgeGateway(address bridgeGateway)",
"function renounceOwnership()",
"function reportRebase(uint256 nextGlobalAmpleforthEpoch_, uint256 nextGlobalAMPLSupply_)",
"function setRebaseRelayer(address rebaseRelayer_)",
"function transferOwnership(address newOwner)",
"function whitelistedBridgeGateways(address) view returns (bool)",
"function xcAmple() view returns (address)"
],
"hash": "0xaaed74679df37939fa0ce77d0eed794983a07d65fa0ae4acdfcc5996a3340b3b",
"blockNumber": 4799754
},
"rebaseRelayer": {
"address": "0xE3a0B70676ed6e1947140Ff0b332cAe7d7f0364B",
"abi": [
"event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)",
"event TransactionFailed(address indexed destination, uint256 index, bytes data, bytes reason)",
"function addTransaction(address destination, uint256 value, bytes data)",
"function checkExecution(uint256 index) payable returns (bool)",
"function executeAll() payable returns (bool)",
"function owner() view returns (address)",
"function removeTransaction(uint256 index)",
"function renounceOwnership()",
"function setTransactionEnabled(uint256 index, bool enabled)",
"function totalValue() view returns (uint256)",
"function transactions(uint256) view returns (bool enabled, address destination, uint256 value, bytes data)",
"function transactionsSize() view returns (uint256)",
"function transferOwnership(address newOwner)"
],
"hash": "0xb61f658faaeb7f3c96c6245df76963d4d0929a0a0dea8b0b127b0ed29d2f0667",
"blockNumber": 4799768
},
"isBaseChain": false,
"chainBridge/bridge": {
"address": "0xF41e7FC4eC990298d36f667B93951c9dba65224e",
"abi": [
"constructor(uint8 chainID, address[] initialRelayers, uint256 initialRelayerThreshold, uint256 fee, uint256 expiry)",
"event Deposit(uint8 indexed destinationChainID, bytes32 indexed resourceID, uint64 indexed depositNonce)",
"event Paused(address account)",
"event ProposalEvent(uint8 indexed originChainID, uint64 indexed depositNonce, uint8 indexed status, bytes32 resourceID, bytes32 dataHash)",
"event ProposalVote(uint8 indexed originChainID, uint64 indexed depositNonce, uint8 indexed status, bytes32 resourceID)",
"event RelayerAdded(address indexed relayer)",
"event RelayerRemoved(address indexed relayer)",
"event RelayerThresholdChanged(uint256 indexed newThreshold)",
"event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole)",
"event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender)",
"event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender)",
"event Unpaused(address account)",
"function DEFAULT_ADMIN_ROLE() view returns (bytes32)",
"function RELAYER_ROLE() view returns (bytes32)",
"function _chainID() view returns (uint8)",
"function _depositCounts(uint8) view returns (uint64)",
"function _depositRecords(uint64, uint8) view returns (bytes)",
"function _expiry() view returns (uint256)",
"function _fee() view returns (uint256)",
"function _hasVotedOnProposal(uint72, bytes32, address) view returns (bool)",
"function _proposals(uint72, bytes32) view returns (bytes32 _resourceID, bytes32 _dataHash, uint8 _status, uint256 _proposedBlock)",
"function _relayerThreshold() view returns (uint256)",
"function _resourceIDToHandlerAddress(bytes32) view returns (address)",
"function _specialFee() view returns (uint256)",
"function _specialFeeChainID() view returns (uint8)",
"function _totalProposals() view returns (uint256)",
"function _totalRelayers() view returns (uint256)",
"function _wtokenAddress() view returns (address)",
"function adminAddRelayer(address relayerAddress)",
"function adminChangeFee(uint256 newFee)",
"function adminChangeRelayerThreshold(uint256 newThreshold)",
"function adminChangeSpecialFee(uint256 newFee, uint8 chainID)",
"function adminPauseTransfers()",
"function adminRemoveRelayer(address relayerAddress)",
"function adminSetBurnable(address handlerAddress, address tokenAddress)",
"function adminSetGenericResource(address handlerAddress, bytes32 resourceID, address contractAddress, bytes4 depositFunctionSig, uint256 depositFunctionDepositerOffset, bytes4 executeFunctionSig)",
"function adminSetResource(address handlerAddress, bytes32 resourceID, address tokenAddress)",
"function adminUnpauseTransfers()",
"function adminUpdateBridgeAddress(address handlerAddress, address newBridgeAddress)",
"function adminWithdraw(address handlerAddress, address tokenAddress, address recipient, uint256 amountOrTokenID)",
"function cancelProposal(uint8 chainID, uint64 depositNonce, bytes32 dataHash)",
"function deposit(uint8 destinationChainID, bytes32 resourceID, bytes data) payable",
"function depositETH(uint8 destinationChainID, bytes32 resourceID, bytes data) payable",
"function executeProposal(uint8 chainID, uint64 depositNonce, bytes data, bytes32 resourceID)",
"function getFee(uint8 destinationChainID) view returns (uint256)",
"function getFees() view returns (uint256, uint256, uint8)",
"function getProposal(uint8 originChainID, uint64 depositNonce, bytes32 dataHash) view returns (tuple(bytes32 _resourceID, bytes32 _dataHash, address[] _yesVotes, address[] _noVotes, uint8 _status, uint256 _proposedBlock))",
"function getRoleAdmin(bytes32 role) view returns (bytes32)",
"function getRoleMember(bytes32 role, uint256 index) view returns (address)",
"function getRoleMemberCount(bytes32 role) view returns (uint256)",
"function grantRole(bytes32 role, address account)",
"function hasRole(bytes32 role, address account) view returns (bool)",
"function isRelayer(address relayer) view returns (bool)",
"function paused() view returns (bool)",
"function renounceAdmin(address newAdmin)",
"function renounceRole(bytes32 role, address account)",
"function revokeRole(bytes32 role, address account)",
"function transferFunds(address[] addrs, uint256[] amounts)",
"function voteProposal(uint8 chainID, uint64 depositNonce, bytes32 resourceID, bytes32 dataHash)"
]
},
"chainBridge/genericHandler": {
"address": "0x123455360bE78C9289B38bcb4DbA427D9a6cD440",
"abi": [
"constructor(address bridgeAddress, bytes32[] initialResourceIDs, address[] initialContractAddresses, bytes4[] initialDepositFunctionSignatures, uint256[] initialDepositFunctionDepositerOffsets, bytes4[] initialExecuteFunctionSignatures)",
"function _bridgeAddress() view returns (address)",
"function _contractAddressToDepositFunctionDepositerOffset(address) view returns (uint256)",
"function _contractAddressToDepositFunctionSignature(address) view returns (bytes4)",
"function _contractAddressToExecuteFunctionSignature(address) view returns (bytes4)",
"function _contractAddressToResourceID(address) view returns (bytes32)",
"function _contractWhitelist(address) view returns (bool)",
"function _depositRecords(uint8, uint64) view returns (uint8 _destinationChainID, address _depositer, bytes32 _resourceID, bytes _metaData)",
"function _resourceIDToContractAddress(bytes32) view returns (address)",
"function deposit(bytes32 resourceID, uint8 destinationChainID, uint64 depositNonce, address depositer, bytes data)",
"function executeProposal(bytes32 resourceID, bytes data)",
"function getDepositRecord(uint64 depositNonce, uint8 destId) view returns (tuple(uint8 _destinationChainID, address _depositer, bytes32 _resourceID, bytes _metaData))",
"function setResource(bytes32 resourceID, address contractAddress, bytes4 depositFunctionSig, uint256 depositFunctionDepositerOffset, bytes4 executeFunctionSig)",
"function updateBridgeAddress(address newBridgeAddress)"
]
},
"chainBridge/transferGateway": {
"address": "0x47fB203e1d75FB2c518Cd56f3a8094D22A46aF83",
"abi": [
"constructor(address bridgeHandler, address xcAmple_, address xcController_)",
"event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)",
"event XCRebaseReportIn(uint256 globalAmpleforthEpoch, uint256 globalAMPLSupply, uint256 recordedGlobalAmpleforthEpoch, uint256 recordedGlobalAMPLSupply)",
"event XCRebaseReportOut(uint256 globalAmpleforthEpoch, uint256 globalAMPLSupply)",
"event XCTransferIn(address indexed senderInSourceChain, address indexed recipient, uint256 globalAMPLSupply, uint256 amount, uint256 recordedGlobalAMPLSupply)",
"event XCTransferOut(address indexed sender, address indexed recipientInTargetChain, uint256 amount, uint256 recordedGlobalAMPLSupply)",
"function mint(address senderAddressInSourceChain, address recipient, uint256 amount, uint256 globalAMPLSupply)",
"function owner() view returns (address)",
"function renounceOwnership()",
"function reportRebase(uint256 globalAmpleforthEpoch, uint256 globalAMPLSupply)",
"function transferOwnership(address newOwner)",
"function unlock(address senderAddressInSourceChain, address recipient, uint256 amount, uint256 globalAMPLSupply)",
"function validateAndBurn(address sender, address recipientAddressInTargetChain, uint256 amount, uint256 globalAMPLSupply)",
"function validateAndLock(address sender, address recipientAddressInTargetChain, uint256 amount, uint256 globalAMPLSupply)",
"function validateRebaseReport(uint256 globalAmpleforthEpoch, uint256 globalAMPLSupply)",
"function xcAmple() view returns (address)",
"function xcController() view returns (address)"
],
"hash": "0x1089636ada3401eda26fd545329821157f608105a887de8322dd06e188c7dee4",
"blockNumber": 4799858
},
"chainBridge/rebaseGateway": {
"address": "0x4C6eA1a42ED10Daa1c29965584e6e114915e8366",
"abi": [
"constructor(address bridgeHandler, address xcAmple_, address xcController_)",
"event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)",
"event XCRebaseReportIn(uint256 globalAmpleforthEpoch, uint256 globalAMPLSupply, uint256 recordedGlobalAmpleforthEpoch, uint256 recordedGlobalAMPLSupply)",
"event XCRebaseReportOut(uint256 globalAmpleforthEpoch, uint256 globalAMPLSupply)",
"event XCTransferIn(address indexed senderInSourceChain, address indexed recipient, uint256 globalAMPLSupply, uint256 amount, uint256 recordedGlobalAMPLSupply)",
"event XCTransferOut(address indexed sender, address indexed recipientInTargetChain, uint256 amount, uint256 recordedGlobalAMPLSupply)",
"function mint(address senderAddressInSourceChain, address recipient, uint256 amount, uint256 globalAMPLSupply)",
"function owner() view returns (address)",
"function renounceOwnership()",
"function reportRebase(uint256 globalAmpleforthEpoch, uint256 globalAMPLSupply)",
"function transferOwnership(address newOwner)",
"function unlock(address senderAddressInSourceChain, address recipient, uint256 amount, uint256 globalAMPLSupply)",
"function validateAndBurn(address sender, address recipientAddressInTargetChain, uint256 amount, uint256 globalAMPLSupply)",
"function validateAndLock(address sender, address recipientAddressInTargetChain, uint256 amount, uint256 globalAMPLSupply)",
"function validateRebaseReport(uint256 globalAmpleforthEpoch, uint256 globalAMPLSupply)",
"function xcAmple() view returns (address)",
"function xcController() view returns (address)"
],
"hash": "0x504e352ca4d676c743d28c60f4fdb5a7a0fca689ba3305533ebf005dce1ece15",
"blockNumber": 4799855
}
}
6 changes: 4 additions & 2 deletions tasks/ops/rebase.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ txTask(
);

const satelliteChainIDs = [];
let totalFee = hre.ethers.BigNumber.from('0');
for (let n in args.satelliteChainNetworks) {
const network = args.satelliteChainNetworks[n];
const provider = await getEthersProvider(network);
Expand All @@ -107,11 +108,12 @@ txTask(
);
const satelliteChainID = await satelliteChainBridge._chainID();
satelliteChainIDs.push(satelliteChainID);
const fee = await baseChainBridge.getFee(satelliteChainID);
totalFee = totalFee.add(fee)
}

console.log('Initiating cross-chain rebase', satelliteChainIDs);
const fee = await baseChainBridge._fee();
const totalFee = fee.mul(satelliteChainIDs.length);
console.log('totalFee', totalFee);

const tx = await batchRebaseReporter
.connect(sender)
Expand Down

0 comments on commit 7794c0e

Please sign in to comment.