-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #149 from valory-xyz/post_deployment
chore: polygon and arbitrum post deployment setup
- Loading branch information
Showing
6 changed files
with
187 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ then | |
EXIT_CODE=0 | ||
else | ||
>&2 echo "FAILED: $2 ($3) on $1 NOT eq contracts" | ||
>&2 echo $r | ||
EXIT_CODE=1 | ||
fi | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"contractVerification":true,"useLedger":false,"derivationPath":"m/44'/60'/2'/0/0","providerName":"arbitrumSepolia","gasPriceInGwei":"0.2","gnosisSafeAddress":"0xd9Db270c1B5E3Bd161E8c8503c55cEABeE709552","gnosisSafeProxyFactoryAddress":"0xa6B71E26C5e0845f74c812102Ca7114b6a896AB2","baseURI":"https://gateway.autonolas.tech/ipfs/","serviceRegistryName":"Service Registry","serviceRegistrySymbol":"AUTONOLAS-SERVICE-V1","serviceRegistryAddress":"0x31D3202d8744B16A120117A053459DDFAE93c855","gnosisSafeMultisigImplementationAddress":"0x19936159B528C66750992C3cBcEd2e71cF4E4824","gnosisSafeSameAddressMultisigImplementationAddress":"0x10100e74b7F706222F8A7C0be9FC7Ae1717Ad8B2","operatorWhitelistAddress":"0x29086141ecdc310058fc23273F8ef7881d20C2f7","serviceRegistryTokenUtilityAddress":"0xeB49bE5DF00F74bd240DE4535DDe6Bc89CEfb994","serviceManagerTokenAddress":"0x5BA58970c2Ae16Cf6218783018100aF2dCcFc915","olasAddress":"","multisigProxyHash130":"0xb89c1b3bdf2cf8827818646bce9a8f6e372885f8c55e5c07acbd307cb133b000"} | ||
{"contractVerification":true,"useLedger":false,"derivationPath":"m/44'/60'/2'/0/0","providerName":"arbitrumSepolia","gasPriceInGwei":"0.2","gnosisSafeAddress":"0xd9Db270c1B5E3Bd161E8c8503c55cEABeE709552","gnosisSafeProxyFactoryAddress":"0xa6B71E26C5e0845f74c812102Ca7114b6a896AB2","baseURI":"https://gateway.autonolas.tech/ipfs/","serviceRegistryName":"Service Registry","serviceRegistrySymbol":"AUTONOLAS-SERVICE-V1","bridgeMediatorAddress":"0x45d995F302D0B5cF52ec0eDD3945321Eb0f84ee6","serviceRegistryAddress":"0x31D3202d8744B16A120117A053459DDFAE93c855","gnosisSafeMultisigImplementationAddress":"0x19936159B528C66750992C3cBcEd2e71cF4E4824","gnosisSafeSameAddressMultisigImplementationAddress":"0x10100e74b7F706222F8A7C0be9FC7Ae1717Ad8B2","operatorWhitelistAddress":"0x29086141ecdc310058fc23273F8ef7881d20C2f7","serviceRegistryTokenUtilityAddress":"0xeB49bE5DF00F74bd240DE4535DDe6Bc89CEfb994","serviceManagerTokenAddress":"0x5BA58970c2Ae16Cf6218783018100aF2dCcFc915","olasAddress":"","multisigProxyHash130":"0xb89c1b3bdf2cf8827818646bce9a8f6e372885f8c55e5c07acbd307cb133b000"} |
83 changes: 83 additions & 0 deletions
83
scripts/proposals/proposal_08_service_registry_l2_change_manager_polygon.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
/*global process*/ | ||
|
||
const { ethers } = require("ethers"); | ||
|
||
async function main() { | ||
const fs = require("fs"); | ||
// Polygon mainnet globals file | ||
const globalsFile = "globals.json"; | ||
const dataFromJSON = fs.readFileSync(globalsFile, "utf8"); | ||
const parsedData = JSON.parse(dataFromJSON); | ||
|
||
const ALCHEMY_API_KEY_MAINNET = process.env.ALCHEMY_API_KEY_MAINNET; | ||
const mainnetURL = "https://eth-mainnet.g.alchemy.com/v2/" + ALCHEMY_API_KEY_MAINNET; | ||
const mainnetProvider = new ethers.providers.JsonRpcProvider(mainnetURL); | ||
await mainnetProvider.getBlockNumber().then((result) => { | ||
console.log("Current block number mainnet: " + result); | ||
}); | ||
|
||
const ALCHEMY_API_KEY_MATIC = process.env.ALCHEMY_API_KEY_MATIC; | ||
const polygonURL = "https://polygon-mainnet.g.alchemy.com/v2/" + ALCHEMY_API_KEY_MATIC; | ||
const polygonProvider = new ethers.providers.JsonRpcProvider(polygonURL); | ||
await polygonProvider.getBlockNumber().then((result) => { | ||
console.log("Current block number polygon: " + result); | ||
}); | ||
|
||
// FxRoot address on mainnet | ||
const fxRootAddress = parsedData.fxRootAddress; | ||
const fxRootJSON = "abis/bridges/polygon/FxRoot.json"; | ||
let contractFromJSON = fs.readFileSync(fxRootJSON, "utf8"); | ||
let parsedFile = JSON.parse(contractFromJSON); | ||
const fxRootABI = parsedFile["abi"]; | ||
const fxRoot = new ethers.Contract(fxRootAddress, fxRootABI, mainnetProvider); | ||
|
||
// serviceRegistry address on polygon | ||
const serviceRegistryAddress = parsedData.serviceRegistryAddress; | ||
const serviceRegistryJSON = "artifacts/contracts/ServiceRegistryL2.sol/ServiceRegistryL2.json"; | ||
contractFromJSON = fs.readFileSync(serviceRegistryJSON, "utf8"); | ||
parsedFile = JSON.parse(contractFromJSON); | ||
const serviceRegistryABI = parsedFile["abi"]; | ||
const serviceRegistry = new ethers.Contract(serviceRegistryAddress, serviceRegistryABI, polygonProvider); | ||
|
||
// Service manager token address on polygon | ||
const bridgeMediatorAddress = parsedData.bridgeMediatorAddress; | ||
const serviceManagerTokenAddress = parsedData.serviceManagerTokenAddress; | ||
|
||
// Proposal preparation | ||
console.log("Proposal 8. Change manager for polygon ServiceRegistryL2\n"); | ||
const rawPayload = serviceRegistry.interface.encodeFunctionData("changeManager", [serviceManagerTokenAddress]); | ||
// Pack the second part of data | ||
const target = serviceRegistryAddress; | ||
const value = 0; | ||
const payload = ethers.utils.arrayify(rawPayload); | ||
const data = ethers.utils.solidityPack( | ||
["address", "uint96", "uint32", "bytes"], | ||
[target, value, payload.length, payload] | ||
); | ||
|
||
// fxChild address polygon mainnet: 0x8397259c983751DAf40400790063935a11afa28a | ||
// Function to call by bridgeMediatorAddress: processMessageFromRoot | ||
// state Id: any; rootMessageSender = timelockAddress | ||
console.log("Polygon side payload from the fxChild to check on the bridgeMediatorAddress in processMessageFromRoot function:", data); | ||
|
||
// Send the message to mumbai receiver from the timelock | ||
const timelockPayload = await fxRoot.interface.encodeFunctionData("sendMessageToChild", [bridgeMediatorAddress, data]); | ||
|
||
const targets = [fxRootAddress]; | ||
const values = [0]; | ||
const callDatas = [timelockPayload]; | ||
const description = "Change manager in ServiceRegistryL2 on polygon"; | ||
|
||
// Proposal details | ||
console.log("targets:", targets); | ||
console.log("values:", values); | ||
console.log("call datas:", callDatas); | ||
console.log("description:", description); | ||
} | ||
|
||
main() | ||
.then(() => process.exit(0)) | ||
.catch((error) => { | ||
console.error(error); | ||
process.exit(1); | ||
}); |