Skip to content

Commit

Permalink
feat: Add Sonic network deployments
Browse files Browse the repository at this point in the history
  • Loading branch information
sendra committed Feb 10, 2025
1 parent 026a762 commit c554e63
Show file tree
Hide file tree
Showing 8 changed files with 96 additions and 0 deletions.
7 changes: 7 additions & 0 deletions safe.csv
Original file line number Diff line number Diff line change
Expand Up @@ -1396,6 +1396,13 @@ address,name,chainId
0xEB0682d148e874553008730f0686ea89db7DA412,MiscPolygon TRANSPARENT_PROXY_FACTORY,137
0xdEd6C522d803E35f65318a9a4d7333a22d582199,MiscPolygon stMATIC_RATE_PROVIDER,137
0x3Ea1eC855fBda8bA0396975eC260AD2e9B2Bc01c,MiscPolygon wstETH_stETH_AGGREGATOR,137
0xECB564e91f620fBFb59d0C4A41d7f10aDb0D1934,GovernanceV3Sonic CL_EMERGENCY_ORACLE,146
0x58e003a3C6f2Aeed6a2a6Bc77B504566523cb15c,GovernanceV3Sonic CROSS_CHAIN_CONTROLLER,146
0x7b62461a3570c6AC8a9f8330421576e417B71EE7,GovernanceV3Sonic EXECUTOR_LVL_1,146
0x63C4422D6cc849549daeb600B7EcE52bD18fAd7f,GovernanceV3Sonic GOVERNANCE_GUARDIAN,146
0x10078c1D8E46dd1ed5D8df2C42d5ABb969b11566,GovernanceV3Sonic GRANULAR_GUARDIAN,146
0x0846C28Dd54DEA4Fd7Fb31bcc5EB81673D68c695,GovernanceV3Sonic PAYLOADS_CONTROLLER,146
0x6fD45D32375d5aDB8D76275A3932c740F03a8718,GovernanceV3Sonic PC_DATA_HELPER,146
0xEB0682d148e874553008730f0686ea89db7DA412,MiscSonic TRANSPARENT_PROXY_FACTORY,146
0x69FA688f1Dc47d4B5d8029D5a35FB7a548310654,AaveV3Fantom AAVE_PROTOCOL_DATA_PROVIDER,250
0x39CB97b105173b56b5a2b4b33AD25d6a50E6c949,AaveV3Fantom ACL_ADMIN,250
Expand Down
15 changes: 15 additions & 0 deletions scripts/configs/governance/sonic.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import {ChainId} from '@bgd-labs/rpc-env';
import {GovernanceConfig} from '../types';

export const governanceConfigSonic: GovernanceConfig = {
name: 'Sonic',
CHAIN_ID: ChainId.sonic,
ADDRESSES: {
CROSS_CHAIN_CONTROLLER: '0x58e003a3C6f2Aeed6a2a6Bc77B504566523cb15c',
PAYLOADS_CONTROLLER: '0x0846C28Dd54DEA4Fd7Fb31bcc5EB81673D68c695',
PC_DATA_HELPER: '0x6fD45D32375d5aDB8D76275A3932c740F03a8718',
GRANULAR_GUARDIAN: '0x10078c1D8E46dd1ed5D8df2C42d5ABb969b11566',
GOVERNANCE_GUARDIAN: '0x63C4422D6cc849549daeb600B7EcE52bD18fAd7f',
CL_EMERGENCY_ORACLE: '0xECB564e91f620fBFb59d0C4A41d7f10aDb0D1934'
},
};
2 changes: 2 additions & 0 deletions scripts/generateAddresses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ import {generateGho} from './generator/ghoGenerator';
import {governanceConfigLinea} from './configs/governance/linea';
import {mantleAddresses} from './configs/networks/mantle';
import {sonicAddresses} from './configs/networks/sonic';
import { governanceConfigSonic } from './configs/governance/sonic';

async function main() {
// cleanup ts artifacts
Expand Down Expand Up @@ -100,6 +101,7 @@ async function main() {
governanceConfigPolygonZkEvm,
governanceConfigZkSync,
governanceConfigLinea,
governanceConfigSonic,
].map((config) => generateGovernanceLibrary(config)),
);
const v1Library = generateAaveV1();
Expand Down
28 changes: 28 additions & 0 deletions src/GovernanceV3Sonic.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 GovernanceV3Sonic {
// https://sonicscan.org/address/0x58e003a3C6f2Aeed6a2a6Bc77B504566523cb15c
address internal constant CROSS_CHAIN_CONTROLLER = 0x58e003a3C6f2Aeed6a2a6Bc77B504566523cb15c;

// https://sonicscan.org/address/0x0846C28Dd54DEA4Fd7Fb31bcc5EB81673D68c695
IPayloadsControllerCore internal constant PAYLOADS_CONTROLLER =
IPayloadsControllerCore(0x0846C28Dd54DEA4Fd7Fb31bcc5EB81673D68c695);

// https://sonicscan.org/address/0x6fD45D32375d5aDB8D76275A3932c740F03a8718
address internal constant PC_DATA_HELPER = 0x6fD45D32375d5aDB8D76275A3932c740F03a8718;

// https://sonicscan.org/address/0x10078c1D8E46dd1ed5D8df2C42d5ABb969b11566
address internal constant GRANULAR_GUARDIAN = 0x10078c1D8E46dd1ed5D8df2C42d5ABb969b11566;

// https://sonicscan.org/address/0x63C4422D6cc849549daeb600B7EcE52bD18fAd7f
address internal constant GOVERNANCE_GUARDIAN = 0x63C4422D6cc849549daeb600B7EcE52bD18fAd7f;

// https://sonicscan.org/address/0xECB564e91f620fBFb59d0C4A41d7f10aDb0D1934
address internal constant CL_EMERGENCY_ORACLE = 0xECB564e91f620fBFb59d0C4A41d7f10aDb0D1934;

// https://sonicscan.org/address/0x7b62461a3570c6AC8a9f8330421576e417B71EE7
address internal constant EXECUTOR_LVL_1 = 0x7b62461a3570c6AC8a9f8330421576e417B71EE7;
}
1 change: 1 addition & 0 deletions src/ts/AaveAddressBook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export * as GovernanceV3Scroll from './GovernanceV3Scroll';
export * as GovernanceV3PolygonZkEvm from './GovernanceV3PolygonZkEvm';
export * as GovernanceV3ZkSync from './GovernanceV3ZkSync';
export * as GovernanceV3Linea from './GovernanceV3Linea';
export * as GovernanceV3Sonic from './GovernanceV3Sonic';
export * as AaveV1 from './AaveV1';
export * as AaveV2EthereumAMM from './AaveV2EthereumAMM';
export * as AaveV2EthereumArc from './AaveV2EthereumArc';
Expand Down
22 changes: 22 additions & 0 deletions src/ts/GovernanceV3Sonic.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// https://sonicscan.org/address/0x58e003a3C6f2Aeed6a2a6Bc77B504566523cb15c
export const CROSS_CHAIN_CONTROLLER = '0x58e003a3C6f2Aeed6a2a6Bc77B504566523cb15c';

// IPayloadsControllerCore https://sonicscan.org/address/0x0846C28Dd54DEA4Fd7Fb31bcc5EB81673D68c695
export const PAYLOADS_CONTROLLER = '0x0846C28Dd54DEA4Fd7Fb31bcc5EB81673D68c695';

// https://sonicscan.org/address/0x6fD45D32375d5aDB8D76275A3932c740F03a8718
export const PC_DATA_HELPER = '0x6fD45D32375d5aDB8D76275A3932c740F03a8718';

// https://sonicscan.org/address/0x10078c1D8E46dd1ed5D8df2C42d5ABb969b11566
export const GRANULAR_GUARDIAN = '0x10078c1D8E46dd1ed5D8df2C42d5ABb969b11566';

// https://sonicscan.org/address/0x63C4422D6cc849549daeb600B7EcE52bD18fAd7f
export const GOVERNANCE_GUARDIAN = '0x63C4422D6cc849549daeb600B7EcE52bD18fAd7f';

// https://sonicscan.org/address/0xECB564e91f620fBFb59d0C4A41d7f10aDb0D1934
export const CL_EMERGENCY_ORACLE = '0xECB564e91f620fBFb59d0C4A41d7f10aDb0D1934';

// https://sonicscan.org/address/0x7b62461a3570c6AC8a9f8330421576e417B71EE7
export const EXECUTOR_LVL_1 = '0x7b62461a3570c6AC8a9f8330421576e417B71EE7';

export const CHAIN_ID = 146;
18 changes: 18 additions & 0 deletions tests/cache/verified.json
Original file line number Diff line number Diff line change
Expand Up @@ -4398,6 +4398,24 @@
"146": {
"0xEB0682d148e874553008730f0686ea89db7DA412": {
"name": "TransparentProxyFactory"
},
"0x58e003a3C6f2Aeed6a2a6Bc77B504566523cb15c": {
"name": "TransparentUpgradeableProxy"
},
"0x6fD45D32375d5aDB8D76275A3932c740F03a8718": {
"name": "PayloadsControllerDataHelper"
},
"0x10078c1D8E46dd1ed5D8df2C42d5ABb969b11566": {
"name": "GranularGuardianAccessControl"
},
"0x63C4422D6cc849549daeb600B7EcE52bD18fAd7f": {
"name": "GnosisSafeProxy"
},
"0xECB564e91f620fBFb59d0C4A41d7f10aDb0D1934": {
"name": "EACAggregatorProxy"
},
"0x7b62461a3570c6AC8a9f8330421576e417B71EE7": {
"name": "Executor"
}
},
"324": {
Expand Down
3 changes: 3 additions & 0 deletions tests/verification.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ const knownErrors = {
43114: {
'0x11979886A6dBAE27D7a72c49fCF3F23240D647bF': true, // very old contracts we know will never be verified
},
146: {
'0x0846C28Dd54DEA4Fd7Fb31bcc5EB81673D68c695': true, // etherscan issue - not detecting that it's verified
},
};

describe(
Expand Down

0 comments on commit c554e63

Please sign in to comment.