From b261e877da19853115ae3949d495f48de94a1c85 Mon Sep 17 00:00:00 2001 From: Pablo Veyrat Date: Fri, 10 Jan 2025 18:08:39 +0100 Subject: [PATCH 1/4] feat: add fragment contract --- hardhat.config.ts | 696 ++++++++++++++++++++++++++++++++++++++++++++++ lib/forge-std | 1 + 2 files changed, 697 insertions(+) create mode 100644 hardhat.config.ts create mode 160000 lib/forge-std diff --git a/hardhat.config.ts b/hardhat.config.ts new file mode 100644 index 0000000..7b62326 --- /dev/null +++ b/hardhat.config.ts @@ -0,0 +1,696 @@ +/// ENVVAR +// - ENABLE_GAS_REPORT +// - CI +// - RUNS +import 'dotenv/config'; +import 'hardhat-contract-sizer'; +import 'hardhat-spdx-license-identifier'; +import 'hardhat-deploy'; +import 'hardhat-abi-exporter'; +import '@nomicfoundation/hardhat-chai-matchers'; /** NEW FEATURE - https://hardhat.org/hardhat-chai-matchers/docs/reference#.revertedwithcustomerror */ +import '@nomicfoundation/hardhat-toolbox'; /** NEW FEATURE */ +import '@openzeppelin/hardhat-upgrades'; +import '@nomiclabs/hardhat-truffle5'; +import '@nomiclabs/hardhat-solhint'; +import '@tenderly/hardhat-tenderly'; +import '@typechain/hardhat'; + +import { TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS } from 'hardhat/builtin-tasks/task-names'; +import { HardhatUserConfig, subtask } from 'hardhat/config'; +import { HardhatNetworkAccountsUserConfig } from 'hardhat/types'; +import yargs from 'yargs'; + +import { accounts, etherscanKey, getMerklAccount, getMnemonic, getPkey, nodeUrl } from './utils/network'; + +// Otherwise, ".sol" files from "test" are picked up during compilation and throw an error +subtask(TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS).setAction(async (_, __, runSuper) => { + const paths = await runSuper(); + return paths.filter((p: string) => !p.includes('/test/foundry/')); +}); + +const accountsPkey = [getPkey()]; +const accountsMerklDeployer: HardhatNetworkAccountsUserConfig = getMerklAccount(); + + +const config: HardhatUserConfig = { + solidity: { + compilers: [ + { + version: '0.8.24', + settings: { + optimizer: { + enabled: true, + runs: 100000, + }, + viaIR: false, + }, + }, + { + version: '0.8.17', + settings: { + optimizer: { + enabled: true, + runs: 100000, + }, + viaIR: false, + }, + }, + ], + overrides: { + 'contracts/DistributionCreator.sol': { + version: '0.8.17', + settings: { + optimizer: { + enabled: true, + runs: 1, + }, + viaIR: false, + }, + }, + 'contracts/mock/DistributionCreatorUpdatable.sol': { + version: '0.8.17', + settings: { + optimizer: { + enabled: true, + runs: 1, + }, + viaIR: false, + }, + }, + 'contracts/deprecated/OldDistributionCreator.sol': { + version: '0.8.17', + settings: { + optimizer: { + enabled: true, + runs: 1, + }, + viaIR: false, + }, + }, + }, + }, + defaultNetwork: 'hardhat', + // For the lists of Chain ID: https://chainlist.org + networks: { + hardhat: { + live: false, + blockGasLimit: 125e5, + initialBaseFeePerGas: 0, + hardfork: 'london', + accounts: accounts('worldchain'), + forking: { + enabled: false, + // Mainnet + /* + url: nodeUrl('fork'), + blockNumber: 19127150, + */ + // Polygon + /* + url: nodeUrl('forkpolygon'), + blockNumber: 39517477, + */ + // Optimism + /* + url: nodeUrl('optimism'), + blockNumber: 17614765, + */ + // Arbitrum + /* + url: nodeUrl('arbitrum'), + blockNumber: 19356874, + */ + /* + url: nodeUrl('arbitrum'), + blockNumber: 19356874, + */ + /* + url: nodeUrl('polygonzkevm'), + blockNumber: 3214816, + */ + /* + url: nodeUrl('coredao'), + */ + /* + url: nodeUrl('gnosis'), + blockNumber: 14188687, + */ + /* + url: nodeUrl('immutable'), + blockNumber: 3160413, + */ + /* + url: nodeUrl('manta'), + blockNumber: 1479731, + */ + /* + url: nodeUrl('scroll'), + blockNumber: 3670869, + */ + // url: nodeUrl('blast'), + // blockNumber: 421659, + // url: nodeUrl('fraxtal'), + // blockNumber: 6644000, + url: nodeUrl('worldchain'), + blockNumber: 4521455, + }, + mining: + { + auto: false, + interval: 1000, + }, + chainId: 42220, + }, + polygon: { + live: true, + url: nodeUrl('polygon'), + accounts: [getPkey()], + gas: 'auto', + gasMultiplier: 3, + chainId: 137, + gasPrice: 'auto', + verify: { + etherscan: { + apiKey: etherscanKey('polygon'), + }, + }, + }, + fantom: { + live: true, + url: nodeUrl('fantom'), + accounts: [getPkey()], + gas: 'auto', + chainId: 250, + verify: { + etherscan: { + apiKey: etherscanKey('fantom'), + }, + }, + }, + mainnet: { + live: true, + url: nodeUrl('mainnet'), + accounts: [getPkey()], + gas: 'auto', + gasMultiplier: 1.3, + chainId: 1, + verify: { + etherscan: { + apiKey: etherscanKey('mainnet'), + }, + }, + }, + optimism: { + live: true, + url: nodeUrl('optimism'), + accounts: [getPkey()], + gas: 'auto', + chainId: 10, + verify: { + etherscan: { + apiKey: etherscanKey('optimism'), + }, + }, + }, + arbitrum: { + live: true, + url: nodeUrl('arbitrum'), + accounts: [getPkey()], + gas: 'auto', + chainId: 42161, + verify: { + etherscan: { + apiKey: etherscanKey('arbitrum'), + }, + }, + }, + avalanche: { + live: true, + url: nodeUrl('avalanche'), + accounts: [getPkey()], + gas: 'auto', + chainId: 43114, + verify: { + etherscan: { + apiKey: etherscanKey('avalanche'), + }, + }, + }, + aurora: { + live: true, + url: nodeUrl('aurora'), + accounts: [getPkey()], + gas: 'auto', + chainId: 1313161554, + verify: { + etherscan: { + apiKey: etherscanKey('aurora'), + }, + }, + }, + bsc: { + live: true, + url: nodeUrl('bsc'), + accounts: [getPkey()], + gas: 60000000, + gasMultiplier: 3, + gasPrice: 'auto', + chainId: 56, + verify: { + etherscan: { + apiKey: etherscanKey('bsc'), + }, + }, + }, + gnosis: { + live: true, + url: nodeUrl('gnosis'), + accounts: [getPkey()], + gas: 'auto', + gasMultiplier: 3, + chainId: 100, + initialBaseFeePerGas: 2000000000, + verify: { + etherscan: { + apiKey: etherscanKey('gnosis'), + }, + }, + }, + polygonzkevm: { + live: true, + url: nodeUrl('polygonzkevm'), + accounts: [getPkey()], + gas: 'auto', + gasMultiplier: 1.3, + chainId: 1101, + verify: { + etherscan: { + apiKey: etherscanKey('polygonzkevm'), + }, + }, + }, + base: { + live: true, + url: nodeUrl('base'), + accounts: [getPkey()], + gas: 'auto', + gasMultiplier: 1.3, + chainId: 8453, + verify: { + etherscan: { + apiKey: etherscanKey('base'), + }, + }, + }, + bob: { + live: true, + url: nodeUrl('bob'), + accounts: [getPkey()], + gas: 'auto', + gasMultiplier: 1.3, + chainId: 60808, + verify: { + etherscan: { + apiKey: etherscanKey('bob'), + }, + }, + }, + linea: { + live: true, + url: nodeUrl('linea'), + accounts: [getPkey()], + gas: 'auto', + gasMultiplier: 1.3, + chainId: 59144, + verify: { + etherscan: { + apiKey: etherscanKey('linea'), + }, + }, + }, + zksync: { + live: true, + url: nodeUrl('zksync'), + accounts: [getPkey()], + gas: 'auto', + gasMultiplier: 1.3, + chainId: 324, + ethNetwork: nodeUrl('mainnet'), + verifyURL: 'https://zksync2-mainnet-explorer.zksync.io/contract_verification', + verify: { + etherscan: { + apiKey: etherscanKey('zksync'), + }, + }, + zksync: true, + }, + mantle: { + live: true, + url: nodeUrl('mantle'), + accounts: [getPkey()], + gas: 'auto', + gasMultiplier: 1.3, + chainId: 5000, + verify: { + etherscan: { + apiKey: etherscanKey('mantle'), + }, + }, + }, + filecoin: { + live: true, + url: nodeUrl('filecoin'), + accounts: [getPkey()], + gas: 'auto', + gasMultiplier: 1.3, + chainId: 314, + verify: { + etherscan: { + apiKey: etherscanKey('filecoin'), + }, + }, + }, + blast: { + live: true, + url: nodeUrl('blast'), + accounts: [getPkey()], + gas: 'auto', + gasMultiplier: 1.3, + chainId: 81457, + verify: { + etherscan: { + apiKey: etherscanKey('blast'), + }, + }, + }, + mode: { + live: true, + url: nodeUrl('mode'), + accounts: [getPkey()], + gas: 'auto', + gasMultiplier: 1.3, + chainId: 34443, + verify: { + etherscan: { + apiKey: etherscanKey('mode'), + }, + }, + }, + thundercore: { + live: true, + url: nodeUrl('thundercore'), + accounts: [getPkey()], + gas: 'auto', + gasMultiplier: 1.3, + chainId: 108, + verify: { + etherscan: { + apiKey: etherscanKey('thundercore'), + }, + }, + }, + coredao: { + live: true, + url: nodeUrl('coredao'), + accounts: [getPkey()], + gas: 'auto', + gasMultiplier: 1.3, + chainId: 1116, + verify: { + etherscan: { + apiKey: etherscanKey('coredao'), + }, + }, + }, + xlayer: { + live: true, + url: nodeUrl('xlayer'), + accounts: [getPkey()], + gas: 'auto', + chainId: 196, + }, + taiko: { + live: true, + url: nodeUrl('taiko'), + accounts: [getPkey()], + gas: 'auto', + chainId: 167000, + }, + fuse: { + live: true, + url: nodeUrl('fuse'), + accounts: [getPkey()], + gas: 'auto', + chainId: 122, + }, + immutablezkevm: { + live: true, + url: nodeUrl('immutablezkevm'), + accounts: [getPkey()], + gas: 'auto', + gasPrice: 'auto', + gasMultiplier: 1.3, + chainId: 13371, + verify: { + etherscan: { + apiKey: etherscanKey('immutablezkevm'), + }, + }, + }, + immutable: { + live: true, + url: nodeUrl('immutable'), + accounts: [getPkey()], + gas: 'auto', + chainId: 13371, + verify: { + etherscan: { + apiKey: etherscanKey('immutable'), + }, + }, + }, + scroll: { + live: true, + url: nodeUrl('scroll'), + accounts: [getPkey()], + gas: 'auto', + chainId: 534352, + verify: { + etherscan: { + apiKey: etherscanKey('scroll'), + }, + }, + }, + manta: { + live: true, + url: nodeUrl('manta'), + accounts: [getPkey()], + gas: 'auto', + chainId: 169, + verify: { + etherscan: { + apiKey: etherscanKey('manta'), + }, + }, + }, + sei: { + live: true, + url: nodeUrl('sei'), + accounts: [getPkey()], + gas: 'auto', + chainId: 1329, + verify: { + etherscan: { + apiKey: etherscanKey('sei'), + }, + }, + }, + celo: { + live: true, + url: nodeUrl('celo'), + accounts: [getPkey()], + gas: 'auto', + chainId: 42220, + verify: { + etherscan: { + apiKey: etherscanKey('celo'), + }, + }, + }, + fraxtal: { + live: true, + url: nodeUrl('fraxtal'), + accounts: accountsMerklDeployer, + gas: 'auto', + chainId: 252, + verify: { + etherscan: { + apiKey: etherscanKey('fraxtal'), + }, + }, + }, + astar: { + live: true, + url: nodeUrl('astar'), + accounts: [getPkey()], + gas: 'auto', + gasPrice: 'auto', + chainId: 592, + verify: { + etherscan: { + apiKey: etherscanKey('astar'), + }, + }, + }, + astarzkevm: { + live: true, + url: nodeUrl('astarzkevm'), + accounts: [getPkey()], + gas: 'auto', + gasPrice: 'auto', + chainId: 3776, + verify: { + etherscan: { + apiKey: etherscanKey('astarzkevm'), + }, + }, + }, + rootstock: { + live: true, + url: nodeUrl('rootstock'), + accounts: accounts('rootstock'), + gas: 'auto', + chainId: 30, + verify: { + etherscan: { + apiKey: etherscanKey('rootstock'), + }, + }, + }, + moonbeam: { + live: true, + url: nodeUrl('moonbeam'), + accounts: [getPkey()], + gas: 'auto', + gasMultiplier: 1.3, + chainId: 1284, + verify: { + etherscan: { + apiKey: etherscanKey('moonbeam'), + }, + }, + }, + skale: { + live: true, + url: nodeUrl('skale'), + accounts: [getPkey()], + gas: 'auto', + gasMultiplier: 1.3, + chainId: 2046399126, + verify: { + etherscan: { + apiKey: etherscanKey('skale'), + }, + }, + }, + worldchain: { + live: true, + url: nodeUrl('worldchain'), + accounts: accountsMerklDeployer, + gas: 'auto', + chainId: 480, + verify: { + etherscan: { + apiKey: etherscanKey('worldchain'), + }, + }, + }, + }, + paths: { + sources: './contracts', + tests: './test', + cache: 'cache-hh', + }, + namedAccounts: { + deployer: 0, + guardian: 1, + governor: 2, + proxyAdmin: 3, + alice: 4, + bob: 5, + charlie: 6, + }, + contractSizer: { + alphaSort: true, + runOnCompile: false, + disambiguatePaths: false, + }, + gasReporter: { + currency: 'USD', + outputFile: 'gas-report.txt', + }, + spdxLicenseIdentifier: { + overwrite: false, + runOnCompile: true, + }, + abiExporter: { + path: './export/abi', + clear: true, + flat: true, + spacing: 2, + }, + etherscan: { + // apiKey: process.env.ETHERSCAN_API_KEY, + apiKey: { + worldchain: etherscanKey('worldchain'), + }, + customChains: [ + { + network: 'taiko', + chainId: 167000, + urls: { + apiURL: 'https://api.taikoscan.io/api', + browserURL: 'https://taikoscan.io/', + }, + }, + { + network: 'celo', + chainId: 42220, + urls: { + apiURL: 'https://api.celoscan.io/api', + browserURL: 'https://celoscan.io/', + }, + }, + { + network: 'fraxtal', + chainId: 252, + urls: { + apiURL: 'https://api.fraxscan.com/api', + browserURL: 'https://fraxscan.com/', + }, + }, + { + network: 'skale', + chainId: 2046399126, + urls: { + apiURL: 'https://internal-hubs.explorer.mainnet.skalenodes.com:10001/api', + browserURL: 'https://elated-tan-skat.explorer.mainnet.skalenodes.com/', + }, + }, + { + network: 'worldchain', + chainId: 480, + urls: { + apiURL: 'https://worldchain-mainnet.explorer.alchemy.com/api', + browserURL: 'https://worldchain-mainnet.explorer.alchemy.com/', + }, + }, + ], + }, + typechain: { + outDir: 'typechain', + target: 'ethers-v5', + }, +}; + +export default config; diff --git a/lib/forge-std b/lib/forge-std new file mode 160000 index 0000000..cb69e9c --- /dev/null +++ b/lib/forge-std @@ -0,0 +1 @@ +Subproject commit cb69e9c07fbd002819c8c6c8db3caeab76b90d6b From 5195b904a23aa6ae81806f796300ab3a11271a0d Mon Sep 17 00:00:00 2001 From: Pablo Veyrat Date: Fri, 10 Jan 2025 18:09:08 +0100 Subject: [PATCH 2/4] rm: hardhat --- hardhat.config.ts | 696 ---------------------------------------------- 1 file changed, 696 deletions(-) delete mode 100644 hardhat.config.ts diff --git a/hardhat.config.ts b/hardhat.config.ts deleted file mode 100644 index 7b62326..0000000 --- a/hardhat.config.ts +++ /dev/null @@ -1,696 +0,0 @@ -/// ENVVAR -// - ENABLE_GAS_REPORT -// - CI -// - RUNS -import 'dotenv/config'; -import 'hardhat-contract-sizer'; -import 'hardhat-spdx-license-identifier'; -import 'hardhat-deploy'; -import 'hardhat-abi-exporter'; -import '@nomicfoundation/hardhat-chai-matchers'; /** NEW FEATURE - https://hardhat.org/hardhat-chai-matchers/docs/reference#.revertedwithcustomerror */ -import '@nomicfoundation/hardhat-toolbox'; /** NEW FEATURE */ -import '@openzeppelin/hardhat-upgrades'; -import '@nomiclabs/hardhat-truffle5'; -import '@nomiclabs/hardhat-solhint'; -import '@tenderly/hardhat-tenderly'; -import '@typechain/hardhat'; - -import { TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS } from 'hardhat/builtin-tasks/task-names'; -import { HardhatUserConfig, subtask } from 'hardhat/config'; -import { HardhatNetworkAccountsUserConfig } from 'hardhat/types'; -import yargs from 'yargs'; - -import { accounts, etherscanKey, getMerklAccount, getMnemonic, getPkey, nodeUrl } from './utils/network'; - -// Otherwise, ".sol" files from "test" are picked up during compilation and throw an error -subtask(TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS).setAction(async (_, __, runSuper) => { - const paths = await runSuper(); - return paths.filter((p: string) => !p.includes('/test/foundry/')); -}); - -const accountsPkey = [getPkey()]; -const accountsMerklDeployer: HardhatNetworkAccountsUserConfig = getMerklAccount(); - - -const config: HardhatUserConfig = { - solidity: { - compilers: [ - { - version: '0.8.24', - settings: { - optimizer: { - enabled: true, - runs: 100000, - }, - viaIR: false, - }, - }, - { - version: '0.8.17', - settings: { - optimizer: { - enabled: true, - runs: 100000, - }, - viaIR: false, - }, - }, - ], - overrides: { - 'contracts/DistributionCreator.sol': { - version: '0.8.17', - settings: { - optimizer: { - enabled: true, - runs: 1, - }, - viaIR: false, - }, - }, - 'contracts/mock/DistributionCreatorUpdatable.sol': { - version: '0.8.17', - settings: { - optimizer: { - enabled: true, - runs: 1, - }, - viaIR: false, - }, - }, - 'contracts/deprecated/OldDistributionCreator.sol': { - version: '0.8.17', - settings: { - optimizer: { - enabled: true, - runs: 1, - }, - viaIR: false, - }, - }, - }, - }, - defaultNetwork: 'hardhat', - // For the lists of Chain ID: https://chainlist.org - networks: { - hardhat: { - live: false, - blockGasLimit: 125e5, - initialBaseFeePerGas: 0, - hardfork: 'london', - accounts: accounts('worldchain'), - forking: { - enabled: false, - // Mainnet - /* - url: nodeUrl('fork'), - blockNumber: 19127150, - */ - // Polygon - /* - url: nodeUrl('forkpolygon'), - blockNumber: 39517477, - */ - // Optimism - /* - url: nodeUrl('optimism'), - blockNumber: 17614765, - */ - // Arbitrum - /* - url: nodeUrl('arbitrum'), - blockNumber: 19356874, - */ - /* - url: nodeUrl('arbitrum'), - blockNumber: 19356874, - */ - /* - url: nodeUrl('polygonzkevm'), - blockNumber: 3214816, - */ - /* - url: nodeUrl('coredao'), - */ - /* - url: nodeUrl('gnosis'), - blockNumber: 14188687, - */ - /* - url: nodeUrl('immutable'), - blockNumber: 3160413, - */ - /* - url: nodeUrl('manta'), - blockNumber: 1479731, - */ - /* - url: nodeUrl('scroll'), - blockNumber: 3670869, - */ - // url: nodeUrl('blast'), - // blockNumber: 421659, - // url: nodeUrl('fraxtal'), - // blockNumber: 6644000, - url: nodeUrl('worldchain'), - blockNumber: 4521455, - }, - mining: - { - auto: false, - interval: 1000, - }, - chainId: 42220, - }, - polygon: { - live: true, - url: nodeUrl('polygon'), - accounts: [getPkey()], - gas: 'auto', - gasMultiplier: 3, - chainId: 137, - gasPrice: 'auto', - verify: { - etherscan: { - apiKey: etherscanKey('polygon'), - }, - }, - }, - fantom: { - live: true, - url: nodeUrl('fantom'), - accounts: [getPkey()], - gas: 'auto', - chainId: 250, - verify: { - etherscan: { - apiKey: etherscanKey('fantom'), - }, - }, - }, - mainnet: { - live: true, - url: nodeUrl('mainnet'), - accounts: [getPkey()], - gas: 'auto', - gasMultiplier: 1.3, - chainId: 1, - verify: { - etherscan: { - apiKey: etherscanKey('mainnet'), - }, - }, - }, - optimism: { - live: true, - url: nodeUrl('optimism'), - accounts: [getPkey()], - gas: 'auto', - chainId: 10, - verify: { - etherscan: { - apiKey: etherscanKey('optimism'), - }, - }, - }, - arbitrum: { - live: true, - url: nodeUrl('arbitrum'), - accounts: [getPkey()], - gas: 'auto', - chainId: 42161, - verify: { - etherscan: { - apiKey: etherscanKey('arbitrum'), - }, - }, - }, - avalanche: { - live: true, - url: nodeUrl('avalanche'), - accounts: [getPkey()], - gas: 'auto', - chainId: 43114, - verify: { - etherscan: { - apiKey: etherscanKey('avalanche'), - }, - }, - }, - aurora: { - live: true, - url: nodeUrl('aurora'), - accounts: [getPkey()], - gas: 'auto', - chainId: 1313161554, - verify: { - etherscan: { - apiKey: etherscanKey('aurora'), - }, - }, - }, - bsc: { - live: true, - url: nodeUrl('bsc'), - accounts: [getPkey()], - gas: 60000000, - gasMultiplier: 3, - gasPrice: 'auto', - chainId: 56, - verify: { - etherscan: { - apiKey: etherscanKey('bsc'), - }, - }, - }, - gnosis: { - live: true, - url: nodeUrl('gnosis'), - accounts: [getPkey()], - gas: 'auto', - gasMultiplier: 3, - chainId: 100, - initialBaseFeePerGas: 2000000000, - verify: { - etherscan: { - apiKey: etherscanKey('gnosis'), - }, - }, - }, - polygonzkevm: { - live: true, - url: nodeUrl('polygonzkevm'), - accounts: [getPkey()], - gas: 'auto', - gasMultiplier: 1.3, - chainId: 1101, - verify: { - etherscan: { - apiKey: etherscanKey('polygonzkevm'), - }, - }, - }, - base: { - live: true, - url: nodeUrl('base'), - accounts: [getPkey()], - gas: 'auto', - gasMultiplier: 1.3, - chainId: 8453, - verify: { - etherscan: { - apiKey: etherscanKey('base'), - }, - }, - }, - bob: { - live: true, - url: nodeUrl('bob'), - accounts: [getPkey()], - gas: 'auto', - gasMultiplier: 1.3, - chainId: 60808, - verify: { - etherscan: { - apiKey: etherscanKey('bob'), - }, - }, - }, - linea: { - live: true, - url: nodeUrl('linea'), - accounts: [getPkey()], - gas: 'auto', - gasMultiplier: 1.3, - chainId: 59144, - verify: { - etherscan: { - apiKey: etherscanKey('linea'), - }, - }, - }, - zksync: { - live: true, - url: nodeUrl('zksync'), - accounts: [getPkey()], - gas: 'auto', - gasMultiplier: 1.3, - chainId: 324, - ethNetwork: nodeUrl('mainnet'), - verifyURL: 'https://zksync2-mainnet-explorer.zksync.io/contract_verification', - verify: { - etherscan: { - apiKey: etherscanKey('zksync'), - }, - }, - zksync: true, - }, - mantle: { - live: true, - url: nodeUrl('mantle'), - accounts: [getPkey()], - gas: 'auto', - gasMultiplier: 1.3, - chainId: 5000, - verify: { - etherscan: { - apiKey: etherscanKey('mantle'), - }, - }, - }, - filecoin: { - live: true, - url: nodeUrl('filecoin'), - accounts: [getPkey()], - gas: 'auto', - gasMultiplier: 1.3, - chainId: 314, - verify: { - etherscan: { - apiKey: etherscanKey('filecoin'), - }, - }, - }, - blast: { - live: true, - url: nodeUrl('blast'), - accounts: [getPkey()], - gas: 'auto', - gasMultiplier: 1.3, - chainId: 81457, - verify: { - etherscan: { - apiKey: etherscanKey('blast'), - }, - }, - }, - mode: { - live: true, - url: nodeUrl('mode'), - accounts: [getPkey()], - gas: 'auto', - gasMultiplier: 1.3, - chainId: 34443, - verify: { - etherscan: { - apiKey: etherscanKey('mode'), - }, - }, - }, - thundercore: { - live: true, - url: nodeUrl('thundercore'), - accounts: [getPkey()], - gas: 'auto', - gasMultiplier: 1.3, - chainId: 108, - verify: { - etherscan: { - apiKey: etherscanKey('thundercore'), - }, - }, - }, - coredao: { - live: true, - url: nodeUrl('coredao'), - accounts: [getPkey()], - gas: 'auto', - gasMultiplier: 1.3, - chainId: 1116, - verify: { - etherscan: { - apiKey: etherscanKey('coredao'), - }, - }, - }, - xlayer: { - live: true, - url: nodeUrl('xlayer'), - accounts: [getPkey()], - gas: 'auto', - chainId: 196, - }, - taiko: { - live: true, - url: nodeUrl('taiko'), - accounts: [getPkey()], - gas: 'auto', - chainId: 167000, - }, - fuse: { - live: true, - url: nodeUrl('fuse'), - accounts: [getPkey()], - gas: 'auto', - chainId: 122, - }, - immutablezkevm: { - live: true, - url: nodeUrl('immutablezkevm'), - accounts: [getPkey()], - gas: 'auto', - gasPrice: 'auto', - gasMultiplier: 1.3, - chainId: 13371, - verify: { - etherscan: { - apiKey: etherscanKey('immutablezkevm'), - }, - }, - }, - immutable: { - live: true, - url: nodeUrl('immutable'), - accounts: [getPkey()], - gas: 'auto', - chainId: 13371, - verify: { - etherscan: { - apiKey: etherscanKey('immutable'), - }, - }, - }, - scroll: { - live: true, - url: nodeUrl('scroll'), - accounts: [getPkey()], - gas: 'auto', - chainId: 534352, - verify: { - etherscan: { - apiKey: etherscanKey('scroll'), - }, - }, - }, - manta: { - live: true, - url: nodeUrl('manta'), - accounts: [getPkey()], - gas: 'auto', - chainId: 169, - verify: { - etherscan: { - apiKey: etherscanKey('manta'), - }, - }, - }, - sei: { - live: true, - url: nodeUrl('sei'), - accounts: [getPkey()], - gas: 'auto', - chainId: 1329, - verify: { - etherscan: { - apiKey: etherscanKey('sei'), - }, - }, - }, - celo: { - live: true, - url: nodeUrl('celo'), - accounts: [getPkey()], - gas: 'auto', - chainId: 42220, - verify: { - etherscan: { - apiKey: etherscanKey('celo'), - }, - }, - }, - fraxtal: { - live: true, - url: nodeUrl('fraxtal'), - accounts: accountsMerklDeployer, - gas: 'auto', - chainId: 252, - verify: { - etherscan: { - apiKey: etherscanKey('fraxtal'), - }, - }, - }, - astar: { - live: true, - url: nodeUrl('astar'), - accounts: [getPkey()], - gas: 'auto', - gasPrice: 'auto', - chainId: 592, - verify: { - etherscan: { - apiKey: etherscanKey('astar'), - }, - }, - }, - astarzkevm: { - live: true, - url: nodeUrl('astarzkevm'), - accounts: [getPkey()], - gas: 'auto', - gasPrice: 'auto', - chainId: 3776, - verify: { - etherscan: { - apiKey: etherscanKey('astarzkevm'), - }, - }, - }, - rootstock: { - live: true, - url: nodeUrl('rootstock'), - accounts: accounts('rootstock'), - gas: 'auto', - chainId: 30, - verify: { - etherscan: { - apiKey: etherscanKey('rootstock'), - }, - }, - }, - moonbeam: { - live: true, - url: nodeUrl('moonbeam'), - accounts: [getPkey()], - gas: 'auto', - gasMultiplier: 1.3, - chainId: 1284, - verify: { - etherscan: { - apiKey: etherscanKey('moonbeam'), - }, - }, - }, - skale: { - live: true, - url: nodeUrl('skale'), - accounts: [getPkey()], - gas: 'auto', - gasMultiplier: 1.3, - chainId: 2046399126, - verify: { - etherscan: { - apiKey: etherscanKey('skale'), - }, - }, - }, - worldchain: { - live: true, - url: nodeUrl('worldchain'), - accounts: accountsMerklDeployer, - gas: 'auto', - chainId: 480, - verify: { - etherscan: { - apiKey: etherscanKey('worldchain'), - }, - }, - }, - }, - paths: { - sources: './contracts', - tests: './test', - cache: 'cache-hh', - }, - namedAccounts: { - deployer: 0, - guardian: 1, - governor: 2, - proxyAdmin: 3, - alice: 4, - bob: 5, - charlie: 6, - }, - contractSizer: { - alphaSort: true, - runOnCompile: false, - disambiguatePaths: false, - }, - gasReporter: { - currency: 'USD', - outputFile: 'gas-report.txt', - }, - spdxLicenseIdentifier: { - overwrite: false, - runOnCompile: true, - }, - abiExporter: { - path: './export/abi', - clear: true, - flat: true, - spacing: 2, - }, - etherscan: { - // apiKey: process.env.ETHERSCAN_API_KEY, - apiKey: { - worldchain: etherscanKey('worldchain'), - }, - customChains: [ - { - network: 'taiko', - chainId: 167000, - urls: { - apiURL: 'https://api.taikoscan.io/api', - browserURL: 'https://taikoscan.io/', - }, - }, - { - network: 'celo', - chainId: 42220, - urls: { - apiURL: 'https://api.celoscan.io/api', - browserURL: 'https://celoscan.io/', - }, - }, - { - network: 'fraxtal', - chainId: 252, - urls: { - apiURL: 'https://api.fraxscan.com/api', - browserURL: 'https://fraxscan.com/', - }, - }, - { - network: 'skale', - chainId: 2046399126, - urls: { - apiURL: 'https://internal-hubs.explorer.mainnet.skalenodes.com:10001/api', - browserURL: 'https://elated-tan-skat.explorer.mainnet.skalenodes.com/', - }, - }, - { - network: 'worldchain', - chainId: 480, - urls: { - apiURL: 'https://worldchain-mainnet.explorer.alchemy.com/api', - browserURL: 'https://worldchain-mainnet.explorer.alchemy.com/', - }, - }, - ], - }, - typechain: { - outDir: 'typechain', - target: 'ethers-v5', - }, -}; - -export default config; From 3adb307d5712c67dd9f59398797e466fa1602c7d Mon Sep 17 00:00:00 2001 From: Pablo Veyrat Date: Thu, 23 Jan 2025 11:12:27 +0100 Subject: [PATCH 3/4] sonic: deployment script --- bun.lockb | Bin 198320 -> 198320 bytes foundry.toml | 2 ++ package.json | 2 +- scripts/deploySonicFragment.s.sol | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/bun.lockb b/bun.lockb index ea7b5d138e10f97992091a691e37aa1517a4b735..412161c0efdea0db5e5e0fe5653b7ca16c815aa6 100755 GIT binary patch delta 207 zcmV;=05JcsjSR4j43I7$xL9|`UnzADxwaE4P8FAP{hh8p4{j3T(d}!%Pp<0>u}&78 z0Vb0nFDsJ}LJ6~(oD9oAODUwb4v0HK5N+_3S8|Ftyn6NQ4m3OrY&laXR1G*)7r%=` zQv82UC+}$GIrESrFV9!dfhJ@lsb0rc))nanx8-L6NT&lhE;P3=4+0zZEI2MSFEltf zW;tbIGBYz{HZn0`WnnTgGC5&pVq{@sW;Qc4F=RM1GBRajGnZj{0vnf&k^%>p@R9-y Jx1|LG3jy!RO|t+1 delta 207 zcmV;=05JcsjSR4j43I7$R%^y&NlxPXLb7uzcZ$1?$+qmLgI^ZbbU$sco>ti$u}&78 z0V9*qA1jj(LJ6~(oD9oA$ksLjK{8M?b(xx=@`{?f=6ps7BF&FuS}<^T8Taq*P4RfY zmZ-T6y-%Je$Xe(Bx-W9Gb_H>-H9fr(c?z3ox8-L6NT&leE-<$+4+0zZEHy4LFETeU zWMVUBHDfg~V=`ekFfuqYWi(_tV`efiWi~lvFf?H~H8nD1GM8a`0vnf&k^%>p@R9-y Jx1|LG3jt`=Q)d7G diff --git a/foundry.toml b/foundry.toml index 85357db..209ba1c 100644 --- a/foundry.toml +++ b/foundry.toml @@ -67,6 +67,7 @@ etherlink = "${ETHERLINK_NODE_URI}" arthera = "${ARTHERA_NODE_URI}" swell = "${SWELL_NODE_URI}" fork = "${ETH_NODE_URI_FORK}" +sonic = "${SONIC_NODE_URI}" [etherscan] localhost = { url = "http://localhost:4000", key = "none" } @@ -108,3 +109,4 @@ lisk = { chainId = 1135, key = "${LISK_ETHERSCAN_API_KEY}", url = "https://block etherlink = { chainId = 42793, key = "${ETHERLINK_ETHERSCAN_API_KEY}", url= "https://explorer.etherlink.com/api" } arthera = { chainId = 10242, key = "${ARTHERA_ETHERSCAN_API_KEY}", url = "https://explorer.arthera.net/api/" } swell = { chainId = 1923, key = "${SWELL_ETHERSCAN_API_KEY}", url = "https://explorer.swellnetwork.io:443/api/" } +sonic = { chainId = 146, key = "${SONIC_ETHERSCAN_API_KEY}", url = "https://api.sonicscan.org/api/" } diff --git a/package.json b/package.json index 36e1b16..715b416 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "url": "https://github.com/AngleProtocol/merkl-contracts/issues" }, "devDependencies": { - "@angleprotocol/sdk": "2.35.0", + "@angleprotocol/sdk": "2.38.4", "@openzeppelin/contracts": "^4.9.0", "@openzeppelin/contracts-upgradeable": "4.9.0", "prettier": "^2.0.0", diff --git a/scripts/deploySonicFragment.s.sol b/scripts/deploySonicFragment.s.sol index 51bc795..1509e64 100644 --- a/scripts/deploySonicFragment.s.sol +++ b/scripts/deploySonicFragment.s.sol @@ -17,6 +17,7 @@ import { DistributionCreator } from "../contracts/DistributionCreator.sol"; import { IAccessControlManager } from "../contracts/interfaces/IAccessControlManager.sol"; import { MockToken } from "../contracts/mock/MockToken.sol"; +// forge script scripts/deploySonicFragment.s.sol:DeploySonicFragment --rpc-url sonic --sender 0xA9DdD91249DFdd450E81E1c56Ab60E1A62651701 --verify -vvvv --broadcast -i 1 contract DeploySonicFragment is BaseScript { function run() public broadcast { console.log("DEPLOYER_ADDRESS:", broadcaster); From 422a58746503667cf1d68a68d0148c7d04a0c7df Mon Sep 17 00:00:00 2001 From: Pablo Veyrat Date: Fri, 24 Jan 2025 10:24:19 +0100 Subject: [PATCH 4/4] fix: forge-std --- lib/forge-std | 1 - 1 file changed, 1 deletion(-) delete mode 160000 lib/forge-std diff --git a/lib/forge-std b/lib/forge-std deleted file mode 160000 index cb69e9c..0000000 --- a/lib/forge-std +++ /dev/null @@ -1 +0,0 @@ -Subproject commit cb69e9c07fbd002819c8c6c8db3caeab76b90d6b