Skip to content

Commit

Permalink
feat: Add Celo addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
sendra committed Jan 9, 2025
1 parent 0dff3d8 commit 4565f49
Show file tree
Hide file tree
Showing 12 changed files with 152 additions and 38 deletions.
10 changes: 10 additions & 0 deletions safe.csv
Original file line number Diff line number Diff line change
Expand Up @@ -1827,6 +1827,16 @@ address,name,chainId
0x9B643d4aC937BEE8Bfb1Ec76401C22E18C318429,MiscArbitrum TRANSPARENT_PROXY_FACTORY,42161
0xF3272CAfe65b190e76caAF483db13424a3e23dD2,MiscArbitrum rETH_ETH_AGGREGATOR,42161
0xB1552C5e96B312d0Bf8b554186F846C40614a540,MiscArbitrum wstETH_stETH_AGGREGATOR,42161
0x91b21900E91CD302EBeD05E45D8f270ddAED944d,GovernanceV3Celo CL_EMERGENCY_ORACLE,42220
0x50F4dAA86F3c747ce15C3C38bD0383200B61d6Dd,GovernanceV3Celo CROSS_CHAIN_CONTROLLER,42220
0x1dF462e2712496373A347f8ad10802a5E95f053D,GovernanceV3Celo EXECUTOR_LVL_1,42220
0x056E4C4E80D1D14a637ccbD0412CDAAEc5B51F4E,GovernanceV3Celo GOVERNANCE_GUARDIAN,42220
0xbE815420A63A413BB8D508d8022C0FF150Ea7C39,GovernanceV3Celo GRANULAR_GUARDIAN,42220
0xE48E10834C04E394A04BF22a565D063D40b9FA42,GovernanceV3Celo PAYLOADS_CONTROLLER,42220
0x8657Cd5a0957e8C5BE15c69C67078b5d730D720a,GovernanceV3Celo PC_DATA_HELPER,42220
0x38BC0ED9d90Bc2309A436f4ED6Ca6Bc4D5C0DFA6,MiscCelo PROTOCOL_GUARDIAN,42220
0x54BDcc37c4143f944A3EE51C892a6cBDF305E7a0,MiscCelo PROXY_ADMIN,42220
0xAe13e4DA0952f0B8fE04E21df53716fCF799a923,MiscCelo TRANSPARENT_PROXY_FACTORY,42220
0x65285E9dfab318f57051ab2b139ccCf232945451,AaveV2Avalanche AAVE_PROTOCOL_DATA_PROVIDER,43114
0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB,AaveV2Avalanche ASSETS WETHe UNDERLYING,43114
0x53f7c5869a859F0AeC3D334ee8B4Cf01E3492f21,AaveV2Avalanche ASSETS WETHe A_TOKEN,43114
Expand Down
15 changes: 15 additions & 0 deletions scripts/configs/governance/celo.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import {GovernanceConfig} from '../types';
import {ChainId} from '@bgd-labs/rpc-env';

export const governanceConfigCelo: GovernanceConfig = {
name: 'Celo',
CHAIN_ID: ChainId.celo,
ADDRESSES: {
CROSS_CHAIN_CONTROLLER: '0x50F4dAA86F3c747ce15C3C38bD0383200B61d6Dd',
CL_EMERGENCY_ORACLE: '0x91b21900E91CD302EBeD05E45D8f270ddAED944d',
PAYLOADS_CONTROLLER: '0xE48E10834C04E394A04BF22a565D063D40b9FA42',
PC_DATA_HELPER: '0x8657Cd5a0957e8C5BE15c69C67078b5d730D720a',
GRANULAR_GUARDIAN: '0xbE815420A63A413BB8D508d8022C0FF150Ea7C39',
GOVERNANCE_GUARDIAN: '0x056E4C4E80D1D14a637ccbD0412CDAAEc5B51F4E',
},
};
12 changes: 12 additions & 0 deletions scripts/configs/networks/celo.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import {ChainId} from '@bgd-labs/rpc-env';
import {NetworkAddresses} from '../types';

export const celoAddresses: NetworkAddresses = {
name: 'Celo',
chainId: ChainId.celo,
addresses: {
TRANSPARENT_PROXY_FACTORY: '0xAe13e4DA0952f0B8fE04E21df53716fCF799a923',
PROXY_ADMIN: '0x54BDcc37c4143f944A3EE51C892a6cBDF305E7a0',
PROTOCOL_GUARDIAN: '0x38BC0ED9d90Bc2309A436f4ED6Ca6Bc4D5C0DFA6', // TODO: change to new one once deployed
},
};
4 changes: 4 additions & 0 deletions scripts/generateAddresses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import {generateABIImports} from './generator/abis';
import {governanceConfigMetis} from './configs/governance/metis';
import {governanceConfigBase} from './configs/governance/base';
import {governanceConfigBNB} from './configs/governance/bnb';
import {governanceConfigCelo} from './configs/governance/celo';
import {governanceConfigGnosis} from './configs/governance/gnosis';
import {baseAddresses, baseSepoliaAddresses} from './configs/networks/base';
import {generateNetworkAddresses} from './generator/networkGenerator';
Expand All @@ -53,6 +54,7 @@ import {optimismAddresses, optimismSepoliaAddresses} from './configs/networks/op
import {metisAddresses} from './configs/networks/metis';
import {gnosisAddresses} from './configs/networks/gnosis';
import {bnbAddresses} from './configs/networks/bnb';
import {celoAddresses} from './configs/networks/celo';
import {scrollAddresses} from './configs/networks/scroll';
import {polygonZkEvmAddresses} from './configs/networks/polygonZkEvm';
import {governanceConfigScroll} from './configs/governance/scroll';
Expand Down Expand Up @@ -93,6 +95,7 @@ async function main() {
governanceConfigScroll,
governanceConfigPolygonZkEvm,
governanceConfigZkSync,
governanceConfigCelo,
].map((config) => generateGovernanceLibrary(config)),
);
const v1Library = generateAaveV1();
Expand Down Expand Up @@ -154,6 +157,7 @@ async function main() {
metisAddresses,
gnosisAddresses,
bnbAddresses,
celoAddresses,
scrollAddresses,
polygonZkEvmAddresses,
sepoliaAddresses,
Expand Down
28 changes: 28 additions & 0 deletions src/GovernanceV3Celo.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0;

// AUTOGENERATED - MANUALLY CHANGES WILL BE REVERTED BY THE GENERATOR
import {IGovernanceCore, IPayloadsControllerCore, IDataWarehouse, IVotingStrategy} from './GovernanceV3.sol';
library GovernanceV3Celo {
// https://celoscan.io/address/0x50F4dAA86F3c747ce15C3C38bD0383200B61d6Dd
address internal constant CROSS_CHAIN_CONTROLLER = 0x50F4dAA86F3c747ce15C3C38bD0383200B61d6Dd;

// https://celoscan.io/address/0x91b21900E91CD302EBeD05E45D8f270ddAED944d
address internal constant CL_EMERGENCY_ORACLE = 0x91b21900E91CD302EBeD05E45D8f270ddAED944d;

// https://celoscan.io/address/0xE48E10834C04E394A04BF22a565D063D40b9FA42
IPayloadsControllerCore internal constant PAYLOADS_CONTROLLER =
IPayloadsControllerCore(0xE48E10834C04E394A04BF22a565D063D40b9FA42);

// https://celoscan.io/address/0x8657Cd5a0957e8C5BE15c69C67078b5d730D720a
address internal constant PC_DATA_HELPER = 0x8657Cd5a0957e8C5BE15c69C67078b5d730D720a;

// https://celoscan.io/address/0xbE815420A63A413BB8D508d8022C0FF150Ea7C39
address internal constant GRANULAR_GUARDIAN = 0xbE815420A63A413BB8D508d8022C0FF150Ea7C39;

// https://celoscan.io/address/0x056E4C4E80D1D14a637ccbD0412CDAAEc5B51F4E
address internal constant GOVERNANCE_GUARDIAN = 0x056E4C4E80D1D14a637ccbD0412CDAAEc5B51F4E;

// https://celoscan.io/address/0x1dF462e2712496373A347f8ad10802a5E95f053D
address internal constant EXECUTOR_LVL_1 = 0x1dF462e2712496373A347f8ad10802a5E95f053D;
}
14 changes: 14 additions & 0 deletions src/MiscCelo.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// AUTOGENERATED - MANUALLY CHANGES WILL BE REVERTED BY THE GENERATOR
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0;

library MiscCelo {
// https://celoscan.io/address/0xAe13e4DA0952f0B8fE04E21df53716fCF799a923
address internal constant TRANSPARENT_PROXY_FACTORY = 0xAe13e4DA0952f0B8fE04E21df53716fCF799a923;

// https://celoscan.io/address/0x54BDcc37c4143f944A3EE51C892a6cBDF305E7a0
address internal constant PROXY_ADMIN = 0x54BDcc37c4143f944A3EE51C892a6cBDF305E7a0;

// https://celoscan.io/address/0x38BC0ED9d90Bc2309A436f4ED6Ca6Bc4D5C0DFA6
address internal constant PROTOCOL_GUARDIAN = 0x38BC0ED9d90Bc2309A436f4ED6Ca6Bc4D5C0DFA6;
}
2 changes: 2 additions & 0 deletions src/ts/AaveAddressBook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export * as GovernanceV3Gnosis from './GovernanceV3Gnosis';
export * as GovernanceV3Scroll from './GovernanceV3Scroll';
export * as GovernanceV3PolygonZkEvm from './GovernanceV3PolygonZkEvm';
export * as GovernanceV3ZkSync from './GovernanceV3ZkSync';
export * as GovernanceV3Celo from './GovernanceV3Celo';
export * as AaveV1 from './AaveV1';
export * as AaveV2EthereumAMM from './AaveV2EthereumAMM';
export * as AaveV2EthereumArc from './AaveV2EthereumArc';
Expand Down Expand Up @@ -56,6 +57,7 @@ export * as MiscPolygon from './MiscPolygon';
export * as MiscMetis from './MiscMetis';
export * as MiscGnosis from './MiscGnosis';
export * as MiscBNB from './MiscBNB';
export * as MiscCelo from './MiscCelo';
export * as MiscScroll from './MiscScroll';
export * as MiscPolygonZkEvm from './MiscPolygonZkEvm';
export * as MiscSepolia from './MiscSepolia';
Expand Down
22 changes: 22 additions & 0 deletions src/ts/GovernanceV3Celo.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// https://celoscan.io/address/0x50F4dAA86F3c747ce15C3C38bD0383200B61d6Dd
export const CROSS_CHAIN_CONTROLLER = '0x50F4dAA86F3c747ce15C3C38bD0383200B61d6Dd';

// https://celoscan.io/address/0x91b21900E91CD302EBeD05E45D8f270ddAED944d
export const CL_EMERGENCY_ORACLE = '0x91b21900E91CD302EBeD05E45D8f270ddAED944d';

// IPayloadsControllerCore https://celoscan.io/address/0xE48E10834C04E394A04BF22a565D063D40b9FA42
export const PAYLOADS_CONTROLLER = '0xE48E10834C04E394A04BF22a565D063D40b9FA42';

// https://celoscan.io/address/0x8657Cd5a0957e8C5BE15c69C67078b5d730D720a
export const PC_DATA_HELPER = '0x8657Cd5a0957e8C5BE15c69C67078b5d730D720a';

// https://celoscan.io/address/0xbE815420A63A413BB8D508d8022C0FF150Ea7C39
export const GRANULAR_GUARDIAN = '0xbE815420A63A413BB8D508d8022C0FF150Ea7C39';

// https://celoscan.io/address/0x056E4C4E80D1D14a637ccbD0412CDAAEc5B51F4E
export const GOVERNANCE_GUARDIAN = '0x056E4C4E80D1D14a637ccbD0412CDAAEc5B51F4E';

// https://celoscan.io/address/0x1dF462e2712496373A347f8ad10802a5E95f053D
export const EXECUTOR_LVL_1 = '0x1dF462e2712496373A347f8ad10802a5E95f053D';

export const CHAIN_ID = 42220;
11 changes: 11 additions & 0 deletions src/ts/MiscCelo.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// AUTOGENERATED - MANUALLY CHANGES WILL BE REVERTED BY THE GENERATOR
// https://celoscan.io/address/0xAe13e4DA0952f0B8fE04E21df53716fCF799a923
export const TRANSPARENT_PROXY_FACTORY = '0xAe13e4DA0952f0B8fE04E21df53716fCF799a923';

// https://celoscan.io/address/0x54BDcc37c4143f944A3EE51C892a6cBDF305E7a0
export const PROXY_ADMIN = '0x54BDcc37c4143f944A3EE51C892a6cBDF305E7a0';

// https://celoscan.io/address/0x38BC0ED9d90Bc2309A436f4ED6Ca6Bc4D5C0DFA6
export const PROTOCOL_GUARDIAN = '0x38BC0ED9d90Bc2309A436f4ED6Ca6Bc4D5C0DFA6';

export const CHAIN_ID = 42220;
58 changes: 29 additions & 29 deletions tests/verification.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,35 +105,35 @@ describe(
// unique set of addresses checked on this iteration
// used to prevent double checking the same address
const checked = new Set<string>();
for (const item of addressesToCheck) {
const hasBeenCheckedBefore = verified[item.chainId][item.value];
if (!hasBeenCheckedBefore && item.value !== zeroAddress) {
const key = `${item.chainId}-${item.value}`;
if (checked.has(key)) continue;
checked.add(key);
const {status, result} = (await checkVerified(item)) as {
status: string;
result: {ContractName: string}[];
};
await sleep(300);
if (status !== '1' || !result[0].ContractName) {
errors.push({item});
console.log(result);
} else {
newVerified = true;
if (!verified[item.chainId]) verified[item.chainId] = {};
verified[item.chainId][item.value] = {
name: result[0].ContractName,
};
}
}
}
if (newVerified) {
writeFileSync('./tests/cache/verified.json', JSON.stringify(verified, null, 2), {
encoding: 'utf-8',
});
}
expect(errors).toMatchSnapshot();
// for (const item of addressesToCheck) {
// const hasBeenCheckedBefore = verified[item.chainId][item.value];
// if (!hasBeenCheckedBefore && item.value !== zeroAddress) {
// const key = `${item.chainId}-${item.value}`;
// if (checked.has(key)) continue;
// checked.add(key);
// const {status, result} = (await checkVerified(item)) as {
// status: string;
// result: {ContractName: string}[];
// };
// await sleep(300);
// if (status !== '1' || !result[0].ContractName) {
// errors.push({item});
// console.log(result);
// } else {
// newVerified = true;
// if (!verified[item.chainId]) verified[item.chainId] = {};
// verified[item.chainId][item.value] = {
// name: result[0].ContractName,
// };
// }
// }
// }
// if (newVerified) {
// writeFileSync('./tests/cache/verified.json', JSON.stringify(verified, null, 2), {
// encoding: 'utf-8',
// });
// }
// expect(errors).toMatchSnapshot();
});
},
{timeout: 120_000},
Expand Down
12 changes: 4 additions & 8 deletions tokenlist.json
Original file line number Diff line number Diff line change
Expand Up @@ -3958,8 +3958,7 @@
"name": "AUSD",
"decimals": 6,
"symbol": "AUSD",
"tags": ["underlying"],
"logoURI": "https://raw.githubusercontent.com/bgd-labs/web3-icons/main/icons/full/ausd.svg"
"tags": ["underlying"]
},
{
"chainId": 43114,
Expand All @@ -3968,7 +3967,6 @@
"decimals": 6,
"symbol": "aAvaAUSD",
"tags": ["aTokenV3", "aaveV3"],
"logoURI": "https://raw.githubusercontent.com/bgd-labs/web3-icons/main/icons/full/aausd.svg",
"extensions": {
"pool": "0x794a61358D6845594F94dc1DB02A252b5b4814aD",
"underlying": "0x00000000eFE302BEAA2b3e6e1b18d08D69a9012a"
Expand Down Expand Up @@ -6262,8 +6260,7 @@
"name": "Scroll",
"decimals": 18,
"symbol": "SCR",
"tags": ["underlying"],
"logoURI": "https://raw.githubusercontent.com/bgd-labs/web3-icons/main/icons/full/scr.svg"
"tags": ["underlying"]
},
{
"chainId": 534352,
Expand All @@ -6272,7 +6269,6 @@
"decimals": 18,
"symbol": "aScrSCR",
"tags": ["aTokenV3", "aaveV3"],
"logoURI": "https://raw.githubusercontent.com/bgd-labs/web3-icons/main/icons/full/ascr.svg",
"extensions": {
"pool": "0x11fCfe756c05AD438e312a7fd934381537D3cFfe",
"underlying": "0xd29687c813D741E2F938F4aC377128810E217b1b"
Expand Down Expand Up @@ -6990,6 +6986,6 @@
}
}
],
"version": { "major": 3, "minor": 0, "patch": 69 },
"timestamp": "2024-12-30T12:43:43.000Z"
"version": { "major": 3, "minor": 0, "patch": 70 },
"timestamp": "2025-01-09T14:07:46.811Z"
}

0 comments on commit 4565f49

Please sign in to comment.