Skip to content

Commit

Permalink
Merge pull request #117 from valory-xyz/feat/gnosis_token_utility
Browse files Browse the repository at this point in the history
Deploying service registry token utility and manager to gnosis
  • Loading branch information
kupermind authored Sep 22, 2023
2 parents 4639632 + 5241a67 commit 28cbb3c
Show file tree
Hide file tree
Showing 18 changed files with 55 additions and 35 deletions.
2 changes: 2 additions & 0 deletions .gitleaksignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,5 @@ f7b0036b3b5d2be2b81a56d2a4f10a91653fa872:scripts/deployment/l2/bridges/gnosis/te
71afff8bddeb852787f7294d7838832d5bb26a34:scripts/deployment/l2/bridges/gnosis/test_service_registry_token_utility_change_drainer.js:generic-api-key:44
d780294b8dccf047391a71b75dade50a6b89003b:scripts/deployment/l2/globals_gnosis_chiado.json:generic-api-key:2
7d2fbdb1556dc3ed289edf7e116b378b6f6a9d83:scripts/deployment/l2/bridges/gnosis/test_service_registry_token_utility_change_drainer.js:generic-api-key:44
7bb76e80382eff3c538af340289ed8241f4e4551:scripts/deployment/l2/globals_gnosis_mainnet.json:generic-api-key:1
7bb76e80382eff3c538af340289ed8241f4e4551:scripts/deployment/l2/globals_gnosis_mainnet.json:generic-api-key:2
8 changes: 8 additions & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Authors

This is the official list of Valory.xyz authors for copyright purposes.

* Akeksandr Kuperman <[email protected]> [Kupermind](https://github.com/kupermind)
* Andrey Lebedev <[email protected]> [77ph](https://github.com/77ph)
* David Minarsch <[email protected]> [DavidMinarsch](https://github.com/DavidMinarsch)
* Mariapia Moscatiello <[email protected]> [MariapiaMoscatiello](https://github.com/mariapiamo)
16 changes: 13 additions & 3 deletions docs/configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,19 @@
"address": "0x9338b5153AE39BB89f50468E608eD9d764B755fD"
},
{
"name": "ServiceManager",
"artifact": "abis/0.8.19/ServiceManager.json",
"address": "0xE3607b00E75f6405248323A9417ff6b39B244b50"
"name": "ServiceRegistryTokenUtility",
"artifact": "abis/0.8.19/ServiceRegistryTokenUtility.json",
"address": "0xa45E64d13A30a51b91ae0eb182e88a40e9b18eD8"
},
{
"name": "ServiceManagerToken",
"artifact": "abis/0.8.19/ServiceManagerToken.json",
"address": "0x04b0007b2aFb398015B76e5f22993a1fddF83644"
},
{
"name": "OperatorWhitelist",
"artifact": "abis/0.8.19/OperatorWhitelist.json",
"address": "0x526E064cB694E8f5B7DB299158e17F33055B3943"
},
{
"name": "GnosisSafeMultisig",
Expand Down
8 changes: 4 additions & 4 deletions hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ const ALCHEMY_API_KEY_MAINNET = process.env.ALCHEMY_API_KEY_MAINNET;
const ALCHEMY_API_KEY_MATIC = process.env.ALCHEMY_API_KEY_MATIC;
const ALCHEMY_API_KEY_GOERLI = process.env.ALCHEMY_API_KEY_GOERLI;
const ALCHEMY_API_KEY_MUMBAI = process.env.ALCHEMY_API_KEY_MUMBAI;
const GNOSIS_CHAIN_API_KEY = process.env.GNOSIS_CHAIN_API_KEY;
const CHIADO_CHAIN_API_KEY = "10200";
let TESTNET_MNEMONIC = process.env.TESTNET_MNEMONIC;

const accounts = {
Expand All @@ -33,6 +31,8 @@ if (!TESTNET_MNEMONIC) {

const ETHERSCAN_API_KEY = process.env.ETHERSCAN_API_KEY;
const POLYGONSCAN_API_KEY = process.env.POLYGONSCAN_API_KEY;
const GNOSISSCAN_API_KEY = process.env.GNOSISSCAN_API_KEY;
const CHIADOSCAN_API_KEY = "10200";

module.exports = {
networks: {
Expand Down Expand Up @@ -93,10 +93,10 @@ module.exports = {
apiKey: {
mainnet: ETHERSCAN_API_KEY,
polygon: POLYGONSCAN_API_KEY,
gnosis: GNOSIS_CHAIN_API_KEY,
gnosis: GNOSISSCAN_API_KEY,
goerli: ETHERSCAN_API_KEY,
polygonMumbai: POLYGONSCAN_API_KEY,
chiado: CHIADO_CHAIN_API_KEY,
chiado: CHIADOSCAN_API_KEY,
}
},
solidity: {
Expand Down
8 changes: 4 additions & 4 deletions scripts/audit_chains/audit_contracts_setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ async function checkServiceRegistry(chainId, provider, globalsInstance, configCo

// Check manager
const manager = await serviceRegistry.manager();
if (chainId === "1" || chainId === "5" || chainId === "10200") {
if (chainId === "1" || chainId === "5" || chainId === "100" || chainId === "10200") {
// ServiceRegistryManagerToken for L1 and L2 that currently have the full setup
customExpect(manager, globalsInstance["serviceManagerTokenAddress"], log + ", function: manager()");
} else {
Expand Down Expand Up @@ -218,7 +218,7 @@ async function checkServiceManager(chainId, provider, globalsInstance, configCon
customExpect(paused, false, log + ", function: paused()");

// Checks for L1 and L2 that currently have the full setup
if (chainId === "1" || chainId === "5" || chainId === "10200") {
if (chainId === "1" || chainId === "5" || chainId === "100" || chainId === "10200") {
// Version
const version = await serviceManager.version();
customExpect(version, "1.1.1", log + ", function: version()");
Expand Down Expand Up @@ -427,8 +427,8 @@ async function main() {
let log = initLog + ", contract: " + "ServiceRegistryL2";
await checkServiceRegistry(configs[i]["chainId"], providers[i], globals[i], configs[i]["contracts"], "ServiceRegistryL2", log);

// Make an exception for the chiado network for now as it operates with the ServiceManagerToken
if (configs[i]["chainId"] === "10200") {
// Path for L2 chains that operate with the ServiceManagerToken
if (configs[i]["chainId"] === "100" || configs[i]["chainId"] === "10200") {
log = initLog + ", contract: " + "ServiceManagerToken";
await checkServiceManager(configs[i]["chainId"], providers[i], globals[i], configs[i]["contracts"], "ServiceManagerToken", log);

Expand Down
4 changes: 2 additions & 2 deletions scripts/deployment/l2/deploy_01_service_registry_l2.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ async function main() {
}
networkURL = "https://polygon-mumbai.g.alchemy.com/v2/" + process.env.ALCHEMY_API_KEY_MUMBAI;
} else if (providerName === "gnosis") {
if (!process.env.GNOSIS_CHAIN_API_KEY) {
console.log("set GNOSIS_CHAIN_API_KEY env variable");
if (!process.env.GNOSISSCAN_API_KEY) {
console.log("set GNOSISSCAN_API_KEY env variable");
return;
}
networkURL = "https://rpc.gnosischain.com";
Expand Down
4 changes: 2 additions & 2 deletions scripts/deployment/l2/deploy_02_service_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ async function main() {
}
networkURL = "https://polygon-mumbai.g.alchemy.com/v2/" + process.env.ALCHEMY_API_KEY_MUMBAI;
} else if (providerName === "gnosis") {
if (!process.env.GNOSIS_CHAIN_API_KEY) {
console.log("set GNOSIS_CHAIN_API_KEY env variable");
if (!process.env.GNOSISSCAN_API_KEY) {
console.log("set GNOSISSCAN_API_KEY env variable");
return;
}
networkURL = "https://rpc.gnosischain.com";
Expand Down
4 changes: 2 additions & 2 deletions scripts/deployment/l2/deploy_03_gnosis_safe_multisig.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ async function main() {
}
networkURL = "https://polygon-mumbai.g.alchemy.com/v2/" + process.env.ALCHEMY_API_KEY_MUMBAI;
} else if (providerName === "gnosis") {
if (!process.env.GNOSIS_CHAIN_API_KEY) {
console.log("set GNOSIS_CHAIN_API_KEY env variable");
if (!process.env.GNOSISSCAN_API_KEY) {
console.log("set GNOSISSCAN_API_KEY env variable");
return;
}
networkURL = "https://rpc.gnosischain.com";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ async function main() {
}
networkURL = "https://polygon-mumbai.g.alchemy.com/v2/" + process.env.ALCHEMY_API_KEY_MUMBAI;
} else if (providerName === "gnosis") {
if (!process.env.GNOSIS_CHAIN_API_KEY) {
console.log("set GNOSIS_CHAIN_API_KEY env variable");
if (!process.env.GNOSISSCAN_API_KEY) {
console.log("set GNOSISSCAN_API_KEY env variable");
return;
}
networkURL = "https://rpc.gnosischain.com";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ async function main() {
}
networkURL = "https://polygon-mumbai.g.alchemy.com/v2/" + process.env.ALCHEMY_API_KEY_MUMBAI;
} else if (providerName === "gnosis") {
if (!process.env.GNOSIS_CHAIN_API_KEY) {
console.log("set GNOSIS_CHAIN_API_KEY env variable");
if (!process.env.GNOSISSCAN_API_KEY) {
console.log("set GNOSISSCAN_API_KEY env variable");
return;
}
networkURL = "https://rpc.gnosischain.com";
Expand Down
4 changes: 2 additions & 2 deletions scripts/deployment/l2/deploy_08_09_change_ownerships.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ async function main() {
}
networkURL = "https://polygon-mumbai.g.alchemy.com/v2/" + process.env.ALCHEMY_API_KEY_MUMBAI;
} else if (providerName === "gnosis") {
if (!process.env.GNOSIS_CHAIN_API_KEY) {
console.log("set GNOSIS_CHAIN_API_KEY env variable");
if (!process.env.GNOSISSCAN_API_KEY) {
console.log("set GNOSISSCAN_API_KEY env variable");
return;
}
networkURL = "https://rpc.gnosischain.com";
Expand Down
4 changes: 2 additions & 2 deletions scripts/deployment/l2/deploy_10_operator_whitelist.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ async function main() {
}
networkURL = "https://polygon-mumbai.g.alchemy.com/v2/" + process.env.ALCHEMY_API_KEY_MUMBAI;
} else if (providerName === "gnosis") {
if (!process.env.GNOSIS_CHAIN_API_KEY) {
console.log("set GNOSIS_CHAIN_API_KEY env variable");
if (!process.env.GNOSISSCAN_API_KEY) {
console.log("set GNOSISSCAN_API_KEY env variable");
return;
}
networkURL = "https://rpc.gnosischain.com";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ async function main() {
}
networkURL = "https://polygon-mumbai.g.alchemy.com/v2/" + process.env.ALCHEMY_API_KEY_MUMBAI;
} else if (providerName === "gnosis") {
if (!process.env.GNOSIS_CHAIN_API_KEY) {
console.log("set GNOSIS_CHAIN_API_KEY env variable");
if (!process.env.GNOSISSCAN_API_KEY) {
console.log("set GNOSISSCAN_API_KEY env variable");
return;
}
networkURL = "https://rpc.gnosischain.com";
Expand Down
4 changes: 2 additions & 2 deletions scripts/deployment/l2/deploy_12_service_manager_token.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ async function main() {
}
networkURL = "https://polygon-mumbai.g.alchemy.com/v2/" + process.env.ALCHEMY_API_KEY_MUMBAI;
} else if (providerName === "gnosis") {
if (!process.env.GNOSIS_CHAIN_API_KEY) {
console.log("set GNOSIS_CHAIN_API_KEY env variable");
if (!process.env.GNOSISSCAN_API_KEY) {
console.log("set GNOSISSCAN_API_KEY env variable");
return;
}
networkURL = "https://rpc.gnosischain.com";
Expand Down
4 changes: 2 additions & 2 deletions scripts/deployment/l2/deploy_13_change_managers.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ async function main() {
}
networkURL = "https://polygon-mumbai.g.alchemy.com/v2/" + process.env.ALCHEMY_API_KEY_MUMBAI;
} else if (providerName === "gnosis") {
if (!process.env.GNOSIS_CHAIN_API_KEY) {
console.log("set GNOSIS_CHAIN_API_KEY env variable");
if (!process.env.GNOSISSCAN_API_KEY) {
console.log("set GNOSISSCAN_API_KEY env variable");
return;
}
networkURL = "https://rpc.gnosischain.com";
Expand Down
4 changes: 2 additions & 2 deletions scripts/deployment/l2/deploy_14_15_change_ownerships.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ async function main() {
}
networkURL = "https://polygon-mumbai.g.alchemy.com/v2/" + process.env.ALCHEMY_API_KEY_MUMBAI;
} else if (providerName === "gnosis") {
if (!process.env.GNOSIS_CHAIN_API_KEY) {
console.log("set GNOSIS_CHAIN_API_KEY env variable");
if (!process.env.GNOSISSCAN_API_KEY) {
console.log("set GNOSISSCAN_API_KEY env variable");
return;
}
networkURL = "https://rpc.gnosischain.com";
Expand Down
2 changes: 1 addition & 1 deletion scripts/deployment/l2/globals_gnosis_mainnet.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"contractVerification":true,"useLedger":true,"derivationPath":"m/44'/60'/2'/0/0","providerName":"gnosis","gasPriceInGwei":"5","timelockAddress":"0x3C1fF68f5aa342D296d4DEe4Bb1cACCA912D95fE","gnosisSafeAddress":"0xd9Db270c1B5E3Bd161E8c8503c55cEABeE709552","gnosisSafeProxyFactoryAddress":"0xa6B71E26C5e0845f74c812102Ca7114b6a896AB2","baseURI":"https://gateway.autonolas.tech/ipfs/","serviceRegistryName":"Service Registry L2","serviceRegistrySymbol":"AUTONOLAS-SERVICE-L2-V1","AMBContractProxyForeignAddress":"0x4C36d2919e407f0Cc2Ee3c993ccF8ac26d9CE64e","bridgeMediatorAddress":"0x15bd56669F57192a97dF41A2aa8f4403e9491776","serviceRegistryAddress":"0x9338b5153AE39BB89f50468E608eD9d764B755fD","serviceManagerAddress":"0xE3607b00E75f6405248323A9417ff6b39B244b50","gnosisSafeMultisigImplementationAddress":"0x3C1fF68f5aa342D296d4DEe4Bb1cACCA912D95fE","gnosisSafeSameAddressMultisigImplementationAddress":"0x3d77596beb0f130a4415df3D2D8232B3d3D31e44"}
{"contractVerification":true,"useLedger":true,"derivationPath":"m/44'/60'/2'/0/0","providerName":"gnosis","gasPriceInGwei":"5","timelockAddress":"0x3C1fF68f5aa342D296d4DEe4Bb1cACCA912D95fE","gnosisSafeAddress":"0xd9Db270c1B5E3Bd161E8c8503c55cEABeE709552","gnosisSafeProxyFactoryAddress":"0xa6B71E26C5e0845f74c812102Ca7114b6a896AB2","baseURI":"https://gateway.autonolas.tech/ipfs/","serviceRegistryName":"Service Registry L2","serviceRegistrySymbol":"AUTONOLAS-SERVICE-L2-V1","AMBContractProxyForeignAddress":"0x4C36d2919e407f0Cc2Ee3c993ccF8ac26d9CE64e","bridgeMediatorAddress":"0x15bd56669F57192a97dF41A2aa8f4403e9491776","serviceRegistryAddress":"0x9338b5153AE39BB89f50468E608eD9d764B755fD","serviceManagerAddress":"0xE3607b00E75f6405248323A9417ff6b39B244b50","gnosisSafeMultisigImplementationAddress":"0x3C1fF68f5aa342D296d4DEe4Bb1cACCA912D95fE","gnosisSafeSameAddressMultisigImplementationAddress":"0x3d77596beb0f130a4415df3D2D8232B3d3D31e44","operatorWhitelistAddress":"0x526E064cB694E8f5B7DB299158e17F33055B3943","serviceRegistryTokenUtilityAddress":"0xa45E64d13A30a51b91ae0eb182e88a40e9b18eD8","serviceManagerTokenAddress":"0x04b0007b2aFb398015B76e5f22993a1fddF83644"}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ async function main() {
const serviceRegistry = new ethers.Contract(serviceRegistryAddress, serviceRegistryABI, gnosisProvider);

// Timelock contract across the bridge must change the manager address
const rawPayload = serviceRegistry.interface.encodeFunctionData("changeManager", [parsedFile.serviceManagerTokenAddress]);
const rawPayload = serviceRegistry.interface.encodeFunctionData("changeManager", [parsedData.serviceManagerTokenAddress]);
// Pack the second part of data
const target = serviceRegistryAddress;
const value = 0;
Expand Down

0 comments on commit 28cbb3c

Please sign in to comment.