From 67752119123798e342364819524a966b28190531 Mon Sep 17 00:00:00 2001 From: Jaxcoder Date: Thu, 4 Jan 2024 14:52:06 -0500 Subject: [PATCH 1/2] setup scroll deploy configs --- .env.example | 1 + hardhat.config.ts | 46 ++++++++++++++++++++---- scripts/config/allo.config.ts | 19 +++++++--- scripts/config/payoutStrategy.config.ts | 28 ++++++++++++--- scripts/config/program.config.ts | 22 ++++++++---- scripts/config/projectRegistry.config.ts | 31 +++++++++------- scripts/config/round.config.ts | 14 ++++++-- scripts/config/votingStrategy.config.ts | 25 ++++++++++--- 8 files changed, 145 insertions(+), 41 deletions(-) diff --git a/.env.example b/.env.example index 530c6d80..cb488aca 100644 --- a/.env.example +++ b/.env.example @@ -7,5 +7,6 @@ ZKSYNC_API_KEY=ZKSYNC_API_KEY PGNSCAN_API_KEY=PGNSCAN_API_KEY ARBITRUM_API_KEY=ARBITRUM_API_KEY AVALANCHE_API_KEY=AVALANCHE_API_KEY +SCROLLSCAN_API_KEY=SCROLLSCAN_API_KEY USE_HARDWARE_WALLET=FALSE FORK_RPC_URL=YOUR_FORK_RPC_URL diff --git a/hardhat.config.ts b/hardhat.config.ts index d06ab5ad..730bd76e 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -18,6 +18,7 @@ dotenv.config(); const chainIds = { // local localhost: 31337, + // testnet goerli: 5, "optimism-goerli": 420, @@ -25,8 +26,8 @@ const chainIds = { "pgn-sepolia": 58008, "arbitrum-goerli": 421613, "fuji-testnet": 43113, - polygon: 137, - base: 8453, + mumbai: 80001, + "scroll-sepolia": 534351, // mainnet mainnet: 1, @@ -35,7 +36,9 @@ const chainIds = { "fantom-mainnet": 250, "arbitrumOne-mainnet": 42161, "avalanche-mainnet": 43114, - mumbai: 80001, + polygon: 137, + base: 8453, + scroll: 534352, }; // This is a sample Hardhat task. To learn how to create your own go to @@ -160,6 +163,11 @@ const config: HardhatUserConfig = { chainId: chainIds["polygon"], gas: "auto", }, + scroll: { + accounts: [deployPrivateKey], + url: "https://rpc.scroll.io/", + chainId: chainIds["scroll"], + }, // Test Networks goerli: createTestnetConfig("goerli"), @@ -199,7 +207,13 @@ const config: HardhatUserConfig = { ...createMainnetConfig("base"), url: `https://base-mainnet.g.alchemy.com/v2/${alchemyKey}`, }, + "scroll-sepolia": { + accounts: [deployPrivateKey], + url: "https://sepolia-rpc.scroll.io/", + chainId: chainIds["scroll-sepolia"], + }, + // Local Networks localhost: createTestnetConfig("localhost", "http://localhost:8545"), hardhat: { forking: { @@ -245,7 +259,11 @@ const config: HardhatUserConfig = { // @ts-ignore mumbai: process.env.POLYGONSCAN_API_KEY, // @ts-ignore - base: process.env.BASESCAN_API_KEY + base: process.env.BASESCAN_API_KEY, + // @ts-ignore + scroll: process.env.SCROLLSCAN_API_KEY, + // @ts-ignore + "scroll-sepolia": process.env.SCROLLSCAN_API_KEY, }, customChains: [ { @@ -303,11 +321,27 @@ const config: HardhatUserConfig = { apiURL: "https://api.basescan.org/api", browserURL: "https://basescan.org/", }, - } + }, + { + network: "scroll", + chainId: chainIds["scroll"], + urls: { + apiURL: "https://api.scrollscan.com/api", + browserURL: "https://scrollscan.com/", + }, + }, + { + network: "scroll-sepolia", + chainId: chainIds["scroll-sepolia"], + urls: { + apiURL: "https://api-sepolia.scrollscan.com/api", + browserURL: "https://sepolia.scrollscan.com/", + }, + }, ], }, abiExporter: abiExporter, dodoc: dodoc, }; -export default config; \ No newline at end of file +export default config; diff --git a/scripts/config/allo.config.ts b/scripts/config/allo.config.ts index 21030bc2..2301b64b 100644 --- a/scripts/config/allo.config.ts +++ b/scripts/config/allo.config.ts @@ -56,14 +56,14 @@ export const AlloSettingsParams: DeployParams = { "fuji-testnet": { alloSettingsContract: "0xdf25423c9ec15347197Aa5D3a41c2ebE27587D59", newProtocolFeePercentage: 0, - newProtocolTreasury: "0xB8cEF765721A6da910f14Be93e7684e9a3714123" + newProtocolTreasury: "0xB8cEF765721A6da910f14Be93e7684e9a3714123", }, - "mumbai": { + mumbai: { alloSettingsContract: "0xF2a07728107B04266015E67b1468cA0a536956C8", newProtocolFeePercentage: 0, newProtocolTreasury: "0x1fd06f088c720ba3b7a3634a8f021fdd485dca42", }, - "polygon": { + polygon: { alloSettingsContract: "0x359c9fD5ef57D4eDD6C8b42a351e12352DB0DaBC", newProtocolFeePercentage: 0, newProtocolTreasury: "0xbF91bfa8c0Bcd130cDf0a7d9C01A4Db4842B1532", @@ -78,10 +78,19 @@ export const AlloSettingsParams: DeployParams = { newProtocolFeePercentage: 0, newProtocolTreasury: "0x0000000000000000000000000000000000000000", }, - "base": { + base: { alloSettingsContract: "0x7ac74Be34b1A27E48a2525259719F877a57B2Aa4", newProtocolFeePercentage: 0, newProtocolTreasury: "0x1fD06f088c720bA3b7a3634a8F021Fdd485DcA42", }, + scroll: { + alloSettingsContract: "0x", + newProtocolFeePercentage: 0, + newProtocolTreasury: "0x", + }, + "scroll-sepolia": { + alloSettingsContract: "0x", + newProtocolFeePercentage: 0, + newProtocolTreasury: "0x", + }, }; - diff --git a/scripts/config/payoutStrategy.config.ts b/scripts/config/payoutStrategy.config.ts index a8879dfe..9c53aa85 100644 --- a/scripts/config/payoutStrategy.config.ts +++ b/scripts/config/payoutStrategy.config.ts @@ -58,7 +58,7 @@ export const MerklePayoutParams: DeployParams = { implementation: "0xCF50D794c639D57bA8D6BB8FaE34fBd1B89D7112", contract: "", }, - "mumbai": { + mumbai: { factory: "0xc1a26b0789C3E93b07713e90596Cad8d0442C826", implementation: "0x74c3665540FC8B92Dd06a7e56a51eCa038C18180", contract: "", @@ -78,11 +78,21 @@ export const MerklePayoutParams: DeployParams = { implementation: "", contract: "", }, - "base": { + base: { factory: "0xF7c101A95Ea4cBD5DA0Ab9827D7B2C9857440143", implementation: "0x04b194b14532070F5cc8D3A760c9a0957D85ad5B", contract: "", }, + scroll: { + factory: "0x", + implementation: "0x", + contract: "", + }, + "scroll-sepolia": { + factory: "0x", + implementation: "0x", + contract: "", + }, }; // TODO: Update this file any time a new dummy voting contract has been deployed @@ -142,7 +152,7 @@ export const DirectPayoutParams: DeployParams = { implementation: "0x64ab6F2E11dF8B3Be5c8838eDe3951AC928daE9C", contract: "", }, - "mumbai": { + mumbai: { factory: "0xD9B7Ce1F68A93dF783A8519ed52b74f5DcF5AFE1", implementation: "0xD0e19DBF9b896199F35Df255A1bf8dB3C787531c", contract: "", @@ -162,9 +172,19 @@ export const DirectPayoutParams: DeployParams = { implementation: "", contract: "", }, - "base": { + base: { factory: "0x74c3665540FC8B92Dd06a7e56a51eCa038C18180", implementation: "0x8AdFcF226dfb2fA73788Ad711C958Ba251369cb3", contract: "", }, + scroll: { + factory: "0x", + implementation: "0x", + contract: "", + }, + "scroll-sepolia": { + factory: "0x", + implementation: "0x", + contract: "", + }, }; diff --git a/scripts/config/program.config.ts b/scripts/config/program.config.ts index 04b8d28b..04b042a2 100644 --- a/scripts/config/program.config.ts +++ b/scripts/config/program.config.ts @@ -2,7 +2,7 @@ type ProgramParams = { programFactoryContract: string; programImplementationContract: string; - programContract: string + programContract: string; }; type DeployParams = Record; @@ -56,12 +56,12 @@ export const programParams: DeployParams = { "fuji-testnet": { programFactoryContract: "0x862D7F621409cF572f179367DdF1B7144AcE1c76", programImplementationContract: "0x56296242CA408bA36393f3981879fF9692F193cC", - programContract: "" + programContract: "", }, - "mumbai": { + mumbai: { programFactoryContract: "0xDF9BF58Aa1A1B73F0e214d79C652a7dd37a6074e", programImplementationContract: "0x424C5C175fbd46CA0b27866044A5B956c6AbEe0D", - programContract: "" + programContract: "", }, polygon: { programFactoryContract: "0xF7c101A95Ea4cBD5DA0Ab9827D7B2C9857440143", @@ -78,9 +78,19 @@ export const programParams: DeployParams = { programImplementationContract: "", programContract: "", }, - "base": { + base: { programFactoryContract: "0xDF9BF58Aa1A1B73F0e214d79C652a7dd37a6074e", programImplementationContract: "0x424C5C175fbd46CA0b27866044A5B956c6AbEe0D", programContract: "", - } + }, + scroll: { + programFactoryContract: "0x", + programImplementationContract: "0x", + programContract: "", + }, + "scroll-sepolia": { + programFactoryContract: "0x", + programImplementationContract: "0x", + programContract: "", + }, }; diff --git a/scripts/config/projectRegistry.config.ts b/scripts/config/projectRegistry.config.ts index 9eee4105..b5256fd4 100644 --- a/scripts/config/projectRegistry.config.ts +++ b/scripts/config/projectRegistry.config.ts @@ -7,34 +7,34 @@ type DeployParams = Record; export const projectRegistryParams: DeployParams = { mainnet: { - proxyContractAddress: "" + proxyContractAddress: "", }, goerli: { - proxyContractAddress: "0x9C789Ad2457A605a0ea1aaBEEf16585633530069" + proxyContractAddress: "0x9C789Ad2457A605a0ea1aaBEEf16585633530069", }, "optimism-mainnet": { proxyContractAddress: "", }, "fantom-mainnet": { - proxyContractAddress: "0xAdcB64860902A29c3e408586C782A2221d595B55" + proxyContractAddress: "0xAdcB64860902A29c3e408586C782A2221d595B55", }, "fantom-testnet": { - proxyContractAddress: "0x5e5b7D871efDE8224390a334045e1dcb7daAf4E2" + proxyContractAddress: "0x5e5b7D871efDE8224390a334045e1dcb7daAf4E2", }, "pgn-mainnet": { - proxyContractAddress: "0xDF9BF58Aa1A1B73F0e214d79C652a7dd37a6074e" + proxyContractAddress: "0xDF9BF58Aa1A1B73F0e214d79C652a7dd37a6074e", }, arbitrumGoerli: { - proxyContractAddress: "0x0CD135777dEaB6D0Bb150bDB0592aC9Baa4d0871" + proxyContractAddress: "0x0CD135777dEaB6D0Bb150bDB0592aC9Baa4d0871", }, arbitrumOne: { - proxyContractAddress: "0x73AB205af1476Dc22104A6B8b3d4c273B58C6E27" + proxyContractAddress: "0x73AB205af1476Dc22104A6B8b3d4c273B58C6E27", }, "fuji-testnet": { - proxyContractAddress: "0x8918401DD47f1645fF1111D8E513c0404b84d5bB" + proxyContractAddress: "0x8918401DD47f1645fF1111D8E513c0404b84d5bB", }, "avalanche-mainnet": { - proxyContractAddress: "0xDF9BF58Aa1A1B73F0e214d79C652a7dd37a6074e" + proxyContractAddress: "0xDF9BF58Aa1A1B73F0e214d79C652a7dd37a6074e", }, mumbai: { proxyContractAddress: "0x545B282A50EaeA01A619914d44105437036CbB36", @@ -48,8 +48,13 @@ export const projectRegistryParams: DeployParams = { "zksync-mainnet": { proxyContractAddress: "0xe6CCEe93c97E20644431647B306F48e278aFFdb9", }, - "base": { - proxyContractAddress: "0xA78Daa89fE9C1eC66c5cB1c5833bC8C6Cb307918" - } + base: { + proxyContractAddress: "0xA78Daa89fE9C1eC66c5cB1c5833bC8C6Cb307918", + }, + scroll: { + proxyContractAddress: "0x", + }, + "scroll-sepolia": { + proxyContractAddress: "0x", + }, }; - diff --git a/scripts/config/round.config.ts b/scripts/config/round.config.ts index ec7a17f6..fc78c931 100644 --- a/scripts/config/round.config.ts +++ b/scripts/config/round.config.ts @@ -60,7 +60,7 @@ export const roundParams: DeployParams = { roundImplementationContract: "0x292285C40E966520D5Fd8e4Ab91583C70bBa3dc0", roundContract: "", }, - "mumbai": { + mumbai: { roundFactoryContract: "0xE1c5812e9831bc1d5BDcF50AAEc1a47C4508F3fA", roundImplementationContract: "0x359c9fD5ef57D4eDD6C8b42a351e12352DB0DaBC", roundContract: "", @@ -80,9 +80,19 @@ export const roundParams: DeployParams = { roundImplementationContract: "", roundContract: "", }, - "base": { + base: { roundFactoryContract: "0xc7722909fEBf7880E15e67d563E2736D9Bb9c1Ab", roundImplementationContract: "0x8eC471f30cA797FD52F9D37A47Be2517a7BD6912", roundContract: "", }, + scroll: { + roundFactoryContract: "0x", + roundImplementationContract: "0x", + roundContract: "0x", + }, + "scroll-sepolia": { + roundFactoryContract: "0x", + roundImplementationContract: "0x", + roundContract: "0x", + }, }; diff --git a/scripts/config/votingStrategy.config.ts b/scripts/config/votingStrategy.config.ts index c4413611..e8a01675 100644 --- a/scripts/config/votingStrategy.config.ts +++ b/scripts/config/votingStrategy.config.ts @@ -78,11 +78,21 @@ export const QFVotingParams: DeployParams = { implementation: "", contract: "", }, - "base": { + base: { factory: "0xC3A195EEa198e74D67671732E1B8F8A23781D735", implementation: "0x545B282A50EaeA01A619914d44105437036CbB36", contract: "", }, + scroll: { + factory: "0x", + implementation: "0x", + contract: "0x", + }, + "scroll-sepolia": { + factory: "0x", + implementation: "0x", + contract: "0x", + }, }; // TODO: Update this file any time a new dummy voting contract has been deployed @@ -138,8 +148,13 @@ export const DummyVotingParams: Record = { "zksync-mainnet": { contract: "0x787D662D19C9528EB33FdaBb3cBEcBeAb2a7F15a", }, - "base": { - contract: "0x73AB205af1476Dc22104A6B8b3d4c273B58C6E27" - } + base: { + contract: "0x73AB205af1476Dc22104A6B8b3d4c273B58C6E27", + }, + scroll: { + contract: "0x", + }, + "scroll-sepolia": { + contract: "0x", + }, }; - From fa20d002b76994463ebea0a80ffd483ed22e75cc Mon Sep 17 00:00:00 2001 From: Jaxcoder Date: Thu, 4 Jan 2024 18:04:22 -0500 Subject: [PATCH 2/2] deploy to scroll-sepolia --- .openzeppelin/unknown-534351.json | 656 +++++++++++++++++++++++ docs/CHAINS.md | 20 +- docs/DEPLOY_STEPS.md | 4 +- scripts/config/allo.config.ts | 4 +- scripts/config/payoutStrategy.config.ts | 10 +- scripts/config/program.config.ts | 6 +- scripts/config/projectRegistry.config.ts | 2 +- scripts/config/round.config.ts | 4 +- scripts/config/votingStrategy.config.ts | 8 +- scripts/round/createRound.ts | 79 +-- 10 files changed, 736 insertions(+), 57 deletions(-) create mode 100644 .openzeppelin/unknown-534351.json diff --git a/.openzeppelin/unknown-534351.json b/.openzeppelin/unknown-534351.json new file mode 100644 index 00000000..86db428f --- /dev/null +++ b/.openzeppelin/unknown-534351.json @@ -0,0 +1,656 @@ +{ + "manifestVersion": "3.2", + "admin": { + "address": "0x5e5b7D871efDE8224390a334045e1dcb7daAf4E2", + "txHash": "0xe77a430d0b3d73d8ff2823682bed0b01f2a599ad32db19645447f4cded174b5b" + }, + "proxies": [ + { + "address": "0xDF9BF58Aa1A1B73F0e214d79C652a7dd37a6074e", + "txHash": "0xdc3b34dec5efa353ea1cacbf1fed65ec16d748c250656ee21fdbcc1526d5e106", + "kind": "transparent" + }, + { + "address": "0xd07D54b0231088Ca9BF7DA6291c911B885cBC140", + "txHash": "0xace655efafeb881121c8d3388fef1b049153fcb7987da795e71ae8be74aa0bde", + "kind": "transparent" + }, + { + "address": "0x545B282A50EaeA01A619914d44105437036CbB36", + "txHash": "0x60ae7b3d7bf381bd23d080b79b5c4bee412300906489a532a3119777ef21c952", + "kind": "transparent" + }, + { + "address": "0xc1a26b0789C3E93b07713e90596Cad8d0442C826", + "txHash": "0x5214d964ca216330da55ac462765f7082151318b5805c9ba68b3b9856c6dc436", + "kind": "transparent" + }, + { + "address": "0xD9B7Ce1F68A93dF783A8519ed52b74f5DcF5AFE1", + "txHash": "0xb5506610712dcd8e021a5d16949869eba2f533b24ab47bce1ee715eeb85da619", + "kind": "transparent" + }, + { + "address": "0xF2a07728107B04266015E67b1468cA0a536956C8", + "txHash": "0x5d3cb3fb882a1df8dcc7cdcee2fce1867bdca54279c25c4befd3fbba3a8bd288", + "kind": "transparent" + }, + { + "address": "0x359c9fD5ef57D4eDD6C8b42a351e12352DB0DaBC", + "txHash": "0xfefb76b9a69e2adbe6bdc425b1aef4f843a8325f60956fba5b46b769cd826e75", + "kind": "transparent" + } + ], + "impls": { + "094d8f3a0bf92c7d9dd1bcf3e1993ce604a860205623927e1b22ede5fe9c4c4c": { + "address": "0x5C5E2D94b107C7691B08E43169fDe76EAAB6D48b", + "txHash": "0x7af85d587a30f43bf38420a7b5fd0e9644debe16067b45329a1805dbd51523e9", + "layout": { + "solcVersion": "0.8.17", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:63", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:68" + }, + { + "label": "projectsCount", + "offset": 0, + "slot": "1", + "type": "t_uint256", + "contract": "ProjectRegistry", + "src": "contracts/projectRegistry/ProjectRegistry.sol:43" + }, + { + "label": "projects", + "offset": 0, + "slot": "2", + "type": "t_mapping(t_uint256,t_struct(Project)511_storage)", + "contract": "ProjectRegistry", + "src": "contracts/projectRegistry/ProjectRegistry.sol:46" + }, + { + "label": "projectsOwners", + "offset": 0, + "slot": "3", + "type": "t_mapping(t_uint256,t_struct(OwnerList)518_storage)", + "contract": "ProjectRegistry", + "src": "contracts/projectRegistry/ProjectRegistry.sol:49" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_mapping(t_address,t_address)": { + "label": "mapping(address => address)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_struct(OwnerList)518_storage)": { + "label": "mapping(uint256 => struct ProjectRegistry.OwnerList)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint256,t_struct(Project)511_storage)": { + "label": "mapping(uint256 => struct ProjectRegistry.Project)", + "numberOfBytes": "32" + }, + "t_string_storage": { + "label": "string", + "numberOfBytes": "32" + }, + "t_struct(MetaPtr)960_storage": { + "label": "struct MetaPtr", + "members": [ + { + "label": "protocol", + "type": "t_uint256", + "offset": 0, + "slot": "0" + }, + { + "label": "pointer", + "type": "t_string_storage", + "offset": 0, + "slot": "1" + } + ], + "numberOfBytes": "64" + }, + "t_struct(OwnerList)518_storage": { + "label": "struct ProjectRegistry.OwnerList", + "members": [ + { + "label": "count", + "type": "t_uint256", + "offset": 0, + "slot": "0" + }, + { + "label": "list", + "type": "t_mapping(t_address,t_address)", + "offset": 0, + "slot": "1" + } + ], + "numberOfBytes": "64" + }, + "t_struct(Project)511_storage": { + "label": "struct ProjectRegistry.Project", + "members": [ + { + "label": "id", + "type": "t_uint256", + "offset": 0, + "slot": "0" + }, + { + "label": "metadata", + "type": "t_struct(MetaPtr)960_storage", + "offset": 0, + "slot": "1" + } + ], + "numberOfBytes": "96" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + } + } + }, + "d6cad864bee7d4183f11eb60bc8562f63cd064dd64ceb0cd5eb28937afefa981": { + "address": "0x424C5C175fbd46CA0b27866044A5B956c6AbEe0D", + "txHash": "0xc272cfc023307a3c7a3f02d23d9ece945c778361165dd7e1da567f84ad85c5dc", + "layout": { + "solcVersion": "0.8.17", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:63", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:68" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:36" + }, + { + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:22" + }, + { + "label": "__gap", + "offset": 0, + "slot": "52", + "type": "t_array(t_uint256)49_storage", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:94" + }, + { + "label": "programContract", + "offset": 0, + "slot": "101", + "type": "t_address", + "contract": "ProgramFactory", + "src": "contracts/program/ProgramFactory.sol:12" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + } + } + }, + "85fb214ebcdd584f44a6a82b623ca8dffe10d1c30090a42c2e97c3c604622e01": { + "address": "0xC3A195EEa198e74D67671732E1B8F8A23781D735", + "txHash": "0x623ea6470eb18c4dd97a3e83d63697dd2fd5e41115929a7f3fca00c1b4901f65", + "layout": { + "solcVersion": "0.8.17", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:63", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:68" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:36" + }, + { + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:22" + }, + { + "label": "__gap", + "offset": 0, + "slot": "52", + "type": "t_array(t_uint256)49_storage", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:94" + }, + { + "label": "votingContract", + "offset": 0, + "slot": "101", + "type": "t_address", + "contract": "QuadraticFundingVotingStrategyFactory", + "src": "contracts/votingStrategy/QuadraticFundingStrategy/QuadraticFundingVotingStrategyFactory.sol:13" + }, + { + "label": "nonce", + "offset": 0, + "slot": "102", + "type": "t_uint256", + "contract": "QuadraticFundingVotingStrategyFactory", + "src": "contracts/votingStrategy/QuadraticFundingStrategy/QuadraticFundingVotingStrategyFactory.sol:15" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + } + } + }, + "a36cf49fd516c08806a27c0b932fd0ea57d0980e0d2acc596776c2292d83a9cf": { + "address": "0x27efa1C90e097c980c669AB1a6e326AD4164f1Cb", + "txHash": "0x85c6982b4f1f8e683f2bebd9ac1c86d336358f5087714f8e553f266142858517", + "layout": { + "solcVersion": "0.8.17", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:63", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:68" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:36" + }, + { + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:22" + }, + { + "label": "__gap", + "offset": 0, + "slot": "52", + "type": "t_array(t_uint256)49_storage", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:94" + }, + { + "label": "payoutImplementation", + "offset": 0, + "slot": "101", + "type": "t_address_payable", + "contract": "MerklePayoutStrategyFactory", + "src": "contracts/payoutStrategy/MerklePayoutStrategy/MerklePayoutStrategyFactory.sol:15" + }, + { + "label": "nonce", + "offset": 0, + "slot": "102", + "type": "t_uint256", + "contract": "MerklePayoutStrategyFactory", + "src": "contracts/payoutStrategy/MerklePayoutStrategy/MerklePayoutStrategyFactory.sol:17" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_address_payable": { + "label": "address payable", + "numberOfBytes": "20" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + } + } + }, + "96865c174eef7f8315380a3ef530172be2dda3472c66e8976749ea6c77eaa870": { + "address": "0xc6B90f42Ea395898B4C1B33e5C8Fa351829BCD90", + "txHash": "0xbb05992e2d004f2e5817f9152fef8682ea56f3999896ba936015f295f786d239", + "layout": { + "solcVersion": "0.8.17", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:63", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:68" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:36" + }, + { + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:22" + }, + { + "label": "__gap", + "offset": 0, + "slot": "52", + "type": "t_array(t_uint256)49_storage", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:94" + }, + { + "label": "roundImplementation", + "offset": 0, + "slot": "101", + "type": "t_address", + "contract": "RoundFactory", + "src": "contracts/round/RoundFactory.sol:30" + }, + { + "label": "alloSettings", + "offset": 0, + "slot": "102", + "type": "t_address", + "contract": "RoundFactory", + "src": "contracts/round/RoundFactory.sol:33" + }, + { + "label": "nonce", + "offset": 0, + "slot": "103", + "type": "t_uint256", + "contract": "RoundFactory", + "src": "contracts/round/RoundFactory.sol:36" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + } + } + }, + "777deeff9d03cd6e376d1feca8a0c01b6bf75339df9cacbb788c98f548a864e6": { + "address": "0xE1c5812e9831bc1d5BDcF50AAEc1a47C4508F3fA", + "txHash": "0x1900958d861453c0da2539e875ec94c51411931160bc055556125e550eb334d4", + "layout": { + "solcVersion": "0.8.17", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:63", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:68" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:36" + }, + { + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:22" + }, + { + "label": "__gap", + "offset": 0, + "slot": "52", + "type": "t_array(t_uint256)49_storage", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:94" + }, + { + "label": "protocolTreasury", + "offset": 0, + "slot": "101", + "type": "t_address_payable", + "contract": "AlloSettings", + "src": "contracts/settings/AlloSettings.sol:16" + }, + { + "label": "protocolFeePercentage", + "offset": 20, + "slot": "101", + "type": "t_uint24", + "contract": "AlloSettings", + "src": "contracts/settings/AlloSettings.sol:20" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_address_payable": { + "label": "address payable", + "numberOfBytes": "20" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_uint24": { + "label": "uint24", + "numberOfBytes": "3" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + } + } + } + } +} diff --git a/docs/CHAINS.md b/docs/CHAINS.md index 67bb213b..1b8e232d 100644 --- a/docs/CHAINS.md +++ b/docs/CHAINS.md @@ -357,4 +357,22 @@ These are contracts that are created/deployed once for goerli | RoundFactory | 0xc7722909fEBf7880E15e67d563E2736D9Bb9c1Ab | | RoundImplementation | 0x8eC471f30cA797FD52F9D37A47Be2517a7BD6912 | | ProjectRegistry | 0xA78Daa89fE9C1eC66c5cB1c5833bC8C6Cb307918 | -| DummyVotingStrategy | 0x73AB205af1476Dc22104A6B8b3d4c273B58C6E27 | \ No newline at end of file +| DummyVotingStrategy | 0x73AB205af1476Dc22104A6B8b3d4c273B58C6E27 | + +## Scroll Sepolia + +| Contract | Address | +|---------------------------------------|--------------------------------------------| +| ProgramFactory | 0xd07D54b0231088Ca9BF7DA6291c911B885cBC140 | +| ProgramImplementation | 0x2AFA4bE0f2468347A2F086c2167630fb1E58b725 | +| QuadraticFundingVotingStrategyFactory | 0x545B282A50EaeA01A619914d44105437036CbB36 | +| QFVotingStrategyImplementation | 0x04b194b14532070F5cc8D3A760c9a0957D85ad5B | +| MerklePayoutStrategyFactory | 0xc1a26b0789C3E93b07713e90596Cad8d0442C826 | +| MerklePayouStrategyImplementation | 0x74c3665540FC8B92Dd06a7e56a51eCa038C18180 | +| DirectPayoutStrategyFactory | 0xD9B7Ce1F68A93dF783A8519ed52b74f5DcF5AFE1 | +| DirectPayoutStrategyImplementation | 0xD0e19DBF9b896199F35Df255A1bf8dB3C787531c | +| AlloSettings | 0x359c9fD5ef57D4eDD6C8b42a351e12352DB0DaBC | +| RoundFactory | 0xF2a07728107B04266015E67b1468cA0a536956C8 | +| RoundImplementation | 0xc7722909fEBf7880E15e67d563E2736D9Bb9c1Ab | +| ProjectRegistry | 0xA78Daa89fE9C1eC66c5cB1c5833bC8C6Cb307918 | +| DummyVotingStrategy | 0x53f93b998d845c55B90E806CD81d86a6c2aE20Cc | \ No newline at end of file diff --git a/docs/DEPLOY_STEPS.md b/docs/DEPLOY_STEPS.md index d3b378d1..f6f4192a 100644 --- a/docs/DEPLOY_STEPS.md +++ b/docs/DEPLOY_STEPS.md @@ -17,7 +17,9 @@ All the deploy scripts will expect network param to know which network the contr | `zksync-mainnet` | | `zksync-testnet` | | `base` | - +| `scroll` | +| `scroll-sepolia` | + ### Project Registry diff --git a/scripts/config/allo.config.ts b/scripts/config/allo.config.ts index 2301b64b..828dfa01 100644 --- a/scripts/config/allo.config.ts +++ b/scripts/config/allo.config.ts @@ -89,8 +89,8 @@ export const AlloSettingsParams: DeployParams = { newProtocolTreasury: "0x", }, "scroll-sepolia": { - alloSettingsContract: "0x", + alloSettingsContract: "0x359c9fD5ef57D4eDD6C8b42a351e12352DB0DaBC", newProtocolFeePercentage: 0, - newProtocolTreasury: "0x", + newProtocolTreasury: "0x1fD06f088c720bA3b7a3634a8F021Fdd485DcA42", }, }; diff --git a/scripts/config/payoutStrategy.config.ts b/scripts/config/payoutStrategy.config.ts index 9c53aa85..7d211fc2 100644 --- a/scripts/config/payoutStrategy.config.ts +++ b/scripts/config/payoutStrategy.config.ts @@ -89,9 +89,9 @@ export const MerklePayoutParams: DeployParams = { contract: "", }, "scroll-sepolia": { - factory: "0x", - implementation: "0x", - contract: "", + factory: "0xc1a26b0789C3E93b07713e90596Cad8d0442C826", + implementation: "0x74c3665540FC8B92Dd06a7e56a51eCa038C18180", + contract: "0xE5fC63716272DF418b247d1Db72f260a2d4b3d90", }, }; @@ -183,8 +183,8 @@ export const DirectPayoutParams: DeployParams = { contract: "", }, "scroll-sepolia": { - factory: "0x", - implementation: "0x", + factory: "0xD9B7Ce1F68A93dF783A8519ed52b74f5DcF5AFE1", + implementation: "0xD0e19DBF9b896199F35Df255A1bf8dB3C787531c", contract: "", }, }; diff --git a/scripts/config/program.config.ts b/scripts/config/program.config.ts index 04b042a2..3d8e9c26 100644 --- a/scripts/config/program.config.ts +++ b/scripts/config/program.config.ts @@ -89,8 +89,8 @@ export const programParams: DeployParams = { programContract: "", }, "scroll-sepolia": { - programFactoryContract: "0x", - programImplementationContract: "0x", - programContract: "", + programFactoryContract: "0xd07D54b0231088Ca9BF7DA6291c911B885cBC140", + programImplementationContract: "0x2AFA4bE0f2468347A2F086c2167630fb1E58b725", + programContract: "0xC1569818C16048398F1d799Bfe9270dD3279f2d7", }, }; diff --git a/scripts/config/projectRegistry.config.ts b/scripts/config/projectRegistry.config.ts index b5256fd4..f9118c5a 100644 --- a/scripts/config/projectRegistry.config.ts +++ b/scripts/config/projectRegistry.config.ts @@ -55,6 +55,6 @@ export const projectRegistryParams: DeployParams = { proxyContractAddress: "0x", }, "scroll-sepolia": { - proxyContractAddress: "0x", + proxyContractAddress: "0xDF9BF58Aa1A1B73F0e214d79C652a7dd37a6074e", }, }; diff --git a/scripts/config/round.config.ts b/scripts/config/round.config.ts index fc78c931..31245939 100644 --- a/scripts/config/round.config.ts +++ b/scripts/config/round.config.ts @@ -91,8 +91,8 @@ export const roundParams: DeployParams = { roundContract: "0x", }, "scroll-sepolia": { - roundFactoryContract: "0x", - roundImplementationContract: "0x", + roundFactoryContract: "0xF2a07728107B04266015E67b1468cA0a536956C8", + roundImplementationContract: "0xc7722909fEBf7880E15e67d563E2736D9Bb9c1Ab", roundContract: "0x", }, }; diff --git a/scripts/config/votingStrategy.config.ts b/scripts/config/votingStrategy.config.ts index e8a01675..90397b9f 100644 --- a/scripts/config/votingStrategy.config.ts +++ b/scripts/config/votingStrategy.config.ts @@ -89,9 +89,9 @@ export const QFVotingParams: DeployParams = { contract: "0x", }, "scroll-sepolia": { - factory: "0x", - implementation: "0x", - contract: "0x", + factory: "0x545B282A50EaeA01A619914d44105437036CbB36", + implementation: "0x04b194b14532070F5cc8D3A760c9a0957D85ad5B", + contract: "0x1C12A9182d39dd79cB68A036a3eBc4a0986D722b", }, }; @@ -155,6 +155,6 @@ export const DummyVotingParams: Record = { contract: "0x", }, "scroll-sepolia": { - contract: "0x", + contract: "0x53f93b998d845c55B90E806CD81d86a6c2aE20Cc", }, }; diff --git a/scripts/round/createRound.ts b/scripts/round/createRound.ts index 24c35374..18dd3129 100644 --- a/scripts/round/createRound.ts +++ b/scripts/round/createRound.ts @@ -6,7 +6,7 @@ import hre, { ethers } from "hardhat"; import { confirmContinue } from "../../utils/script-utils"; import { MerklePayoutParams } from "../config/payoutStrategy.config"; import { programParams } from "../config/program.config"; -import { roundParams } from '../config/round.config'; +import { roundParams } from "../config/round.config"; import { QFVotingParams } from "../config/votingStrategy.config"; import * as utils from "../utils"; import { encodeRoundParameters } from "../utils"; @@ -14,7 +14,6 @@ import { encodeRoundParameters } from "../utils"; utils.assertEnvironment(); export async function main() { - const network = hre.network; const networkParams = roundParams[network.name]; @@ -49,31 +48,37 @@ export async function main() { throw new Error(`error: missing payoutContract`); } - const roundFactory = await ethers.getContractAt('RoundFactory', roundFactoryContract); + const roundFactory = await ethers.getContractAt( + "RoundFactory", + roundFactoryContract + ); await confirmContinue({ - "info" : "create a Round", - "roundFactoryContract" : roundFactoryContract, - "roundImplementationContract" : roundImplementationContract, - "programContractAddress" : programContract, - "votingContractAddress" : votingContract, - "payoutContractAddress" : payoutContract, - "network" : network.name, - "chainId" : network.config.chainId + info: "create a Round", + roundFactoryContract: roundFactoryContract, + roundImplementationContract: roundImplementationContract, + programContractAddress: programContract, + votingContractAddress: votingContract, + payoutContractAddress: payoutContract, + network: network.name, + chainId: network.config.chainId, }); - const encodedParameters = generateAndEncodeRoundParam(votingContract, payoutContract); + const encodedParameters = generateAndEncodeRoundParam( + votingContract, + payoutContract + ); const roundTx = await roundFactory.create( await encodedParameters, - programContract, // _ownedBy (Program) + programContract // _ownedBy (Program) ); const receipt = await roundTx.wait(); let roundAddress; if (receipt.events) { - const event = receipt.events.find(e => e.event === 'RoundCreated'); + const event = receipt.events.find((e) => e.event === "RoundCreated"); if (event && event.args) { roundAddress = event.args.roundAddress; } @@ -83,35 +88,37 @@ export async function main() { console.log("✅ Round created: ", roundAddress); } -const generateAndEncodeRoundParam = async (votingContract: string, payoutContract: string) => { - - const _currentTimestamp = (await ethers.provider.getBlock( - await ethers.provider.getBlockNumber()) +const generateAndEncodeRoundParam = async ( + votingContract: string, + payoutContract: string +) => { + const _currentTimestamp = ( + await ethers.provider.getBlock(await ethers.provider.getBlockNumber()) ).timestamp; const roundMetaPtr = { protocol: 1, - pointer: "bafybeia4khbew3r2mkflyn7nzlvfzcb3qpfeftz5ivpzfwn77ollj47gqi" + pointer: "bafybeia4khbew3r2mkflyn7nzlvfzcb3qpfeftz5ivpzfwn77ollj47gqi", }; const applicationMetaPtr = { protocol: 1, - pointer: "bafkreih3mbwctlrnimkiizqvu3zu3blszn5uylqts22yvsrdh5y2kbxaia" + pointer: "bafkreih3mbwctlrnimkiizqvu3zu3blszn5uylqts22yvsrdh5y2kbxaia", }; const roles = [ - '0x5cdb35fADB8262A3f88863254c870c2e6A848CcA', - '0xB8cEF765721A6da910f14Be93e7684e9a3714123', - '0xA2A6460f20E43dcC5F8f55714A969500c342d7CE', - '0xf4c5c4deDde7A86b25E7430796441e209e23eBFB', - '0x4873178BeA2DCd7022f0eF6c70048b0e05Bf9017', - '0x6e8C1ADaEDb9A0A801dD50aFD95b5c07e9629C1E' - ] + "0x5cdb35fADB8262A3f88863254c870c2e6A848CcA", + "0xB8cEF765721A6da910f14Be93e7684e9a3714123", + "0xA2A6460f20E43dcC5F8f55714A969500c342d7CE", + "0xf4c5c4deDde7A86b25E7430796441e209e23eBFB", + "0x4873178BeA2DCd7022f0eF6c70048b0e05Bf9017", + "0x6e8C1ADaEDb9A0A801dD50aFD95b5c07e9629C1E", + ]; const matchAmount = 1; const token = AddressZero; const roundFeePercentage = 0; - const roundFeeAddress = '0x5cdb35fADB8262A3f88863254c870c2e6A848CcA'; + const roundFeeAddress = "0x1fD06f088c720bA3b7a3634a8F021Fdd485DcA42"; const initAddress = [ votingContract, // votingStrategy @@ -119,20 +126,17 @@ const generateAndEncodeRoundParam = async (votingContract: string, payoutContrac ]; const initRoundTime = [ - _currentTimestamp + 3600, // 1 hour later appStartTime + _currentTimestamp + 3600, // 1 hour later appStartTime _currentTimestamp + 432000, // 5 days later appEndTime - _currentTimestamp + 7200, // 2 hours later roundStartTime + _currentTimestamp + 7200, // 2 hours later roundStartTime _currentTimestamp + 864000, // 10 days later roundEndTime ]; - const initMetaPtr = [ - roundMetaPtr, - applicationMetaPtr, - ]; + const initMetaPtr = [roundMetaPtr, applicationMetaPtr]; const initRoles = [ - roles, // adminRoles - roles // roundOperators + roles, // adminRoles + roles, // roundOperators ]; let params = [ @@ -147,8 +151,7 @@ const generateAndEncodeRoundParam = async (votingContract: string, payoutContrac ]; return encodeRoundParameters(params); - -} +}; main().catch((error) => { console.error(error);