diff --git a/.gitleaksignore b/.gitleaksignore index cc23e812..ec28b402 100644 --- a/.gitleaksignore +++ b/.gitleaksignore @@ -136,3 +136,9 @@ f78d4539c80abb33ea04dce4d561af5302033235:scripts/deployment/staking/globals_sepo 9fa4b1fb81ba553ed48ef4a9b22c53ecdf4d2242:scripts/deployment/staking/globals_sepolia.json:generic-api-key:2 001d71fc7c216c593faebdd3d6f353efaf80605f:scripts/deployment/staking/globals_sepolia.json:generic-api-key:1 001d71fc7c216c593faebdd3d6f353efaf80605f:scripts/deployment/staking/globals_sepolia.json:generic-api-key:2 +ea6713128995ac18f3911c0214163e2b82896a7f:scripts/deployment/globals_mainnet.json:generic-api-key:1 +ea6713128995ac18f3911c0214163e2b82896a7f:scripts/deployment/globals_mainnet.json:generic-api-key:2 +1a7a855a853d2bc21e1e9178754a22dae54439f3:scripts/deployment/staking/globals_mainnet.json:generic-api-key:1 +1a7a855a853d2bc21e1e9178754a22dae54439f3:scripts/deployment/staking/globals_mainnet.json:generic-api-key:2 +3c5c0643bfa60605d7b91eb4b7a4b80c6f7a1b43:scripts/deployment/staking/globals_mainnet.json:generic-api-key:1 +3c5c0643bfa60605d7b91eb4b7a4b80c6f7a1b43:scripts/deployment/staking/globals_mainnet.json:generic-api-key:2 diff --git a/docs/deployment_v1.2.md b/docs/deployment_v1.2.md index 0925d4d0..3e534d1e 100644 --- a/docs/deployment_v1.2.md +++ b/docs/deployment_v1.2.md @@ -3,12 +3,17 @@ Steps for deploying the tokenomics version 1.2 contracts are as follows: 1. EOA to deploy Tokenomics implementation (`TokenomicsThree`); 2. TokenomicsProxy to change Tokenomics implementation calling `changeTokenomicsImplementation(TokenomicsThree)`; 3. EOA to deploy Dispenser (`DispenserTwo`) with VoteWeighting contract being deployed before that in `autonolas-governance`; -4. EOA to deploy staking bridging contracts; -5. EOA to set up correct L1->L2 links for all the bridging contracts calling `setL2TargetDispenser(L2 corresponding contract)`; -6. EOA to transfer ownership rights of Dispenser to Timelock calling `changeOwner(Timelock)`; -7. DAO to change Tokenomics managers calling `changeManagers(ZeroAddress, ZeroAddress, DispenserTwo)`; -8. DAO to change staking parameters in Tokenomics calling `changeStakingParams()`; -9. DAO to enable bridge deposit processors in Dispenser calling `setDepositProcessorChainIds()`. +4. EOA to change Dispenser address in VoteWeighting calling `changeDispenser(DispenserTwo)`; +5. EOA to add a retainer address as a nominee in VoteWeighting; +6. EOA to deploy staking bridging contracts with StakingFactory contract being deployed before that in `autonolas-registries`; +7. EOA to set up correct L1->L2 links for all the bridging contracts calling `setL2TargetDispenser(L2 corresponding contract)`; +8. EOA to transfer ownership rights of Dispenser to Timelock calling `changeOwner(Timelock)`; +9. DAO to change Tokenomics managers calling `changeManagers(ZeroAddress, ZeroAddress, DispenserTwo)`; +10. DAO to change staking parameters in Tokenomics calling `changeStakingParams()`; +11. DAO to change Treasury managers calling `changeManagers(ZeroAddress, ZeroAddress, DispenserTwo)`; +12. DAO to enable bridge deposit processors in Dispenser calling `setDepositProcessorChainIds()`; +13. DAO to unpause staking incentives in Dispenser calling `setPauseState(3)`; +14. EOA to transfer ownership rights of all the L2 bridging contracts to Timelock representation calling `changeOwner(Timelock)`. Note for updating VoteWeighting contract address in Dispenser, if required at some point of time. As outlined in the C4R [issue 59](https://github.com/code-423n4/2024-05-olas-findings/issues/59), the following set of diff --git a/scripts/deployment/deploy_07_dispenser.js b/scripts/deployment/deploy_07_dispenser.js index f62d53f7..9fb45ef4 100644 --- a/scripts/deployment/deploy_07_dispenser.js +++ b/scripts/deployment/deploy_07_dispenser.js @@ -26,25 +26,35 @@ async function main() { console.log("EOA is:", deployer); // Get all the necessary contract addresses + const olasAddress = parsedData.olasAddress; const tokenomicsProxyAddress = parsedData.tokenomicsProxyAddress; const treasuryAddress = parsedData.treasuryAddress; + const voteWeightingAddress = parsedData.voteWeightingAddress; + const retainerAddress = parsedData.retainerAddress; + const maxNumClaimingEpochs = parsedData.maxNumClaimingEpochs; + const maxNumStakingTargets = parsedData.maxNumStakingTargets; + const minStakingWeight = parsedData.minStakingWeight; + const maxStakingIncentive = parsedData.maxStakingIncentive; // Transaction signing and execution console.log("7. EOA to deploy Dispenser"); const Dispenser = await ethers.getContractFactory("Dispenser"); console.log("You are signing the following transaction: Dispenser.connect(EOA).deploy()"); - const dispenser = await Dispenser.connect(EOA).deploy(tokenomicsProxyAddress, treasuryAddress); + const dispenser = await Dispenser.connect(EOA).deploy(olasAddress, tokenomicsProxyAddress, treasuryAddress, + voteWeightingAddress, retainerAddress, maxNumClaimingEpochs, maxNumStakingTargets, minStakingWeight, + maxStakingIncentive); const result = await dispenser.deployed(); - // If on goerli, wait a minute for the transaction completion - if (providerName === "goerli") { - await new Promise(r => setTimeout(r, 60000)); - } // Transaction details console.log("Contract deployment: Dispenser"); console.log("Contract address:", dispenser.address); console.log("Transaction:", result.deployTransaction.hash); + // If on sepolia, wait half a minute for the transaction completion + if (providerName === "sepolia") { + await new Promise(r => setTimeout(r, 30000)); + } + // Contract verification if (parsedData.contractVerification) { const execSync = require("child_process").execSync; diff --git a/scripts/deployment/globals_mainnet.json b/scripts/deployment/globals_mainnet.json index 3f165c8f..a8ef5b0b 100644 --- a/scripts/deployment/globals_mainnet.json +++ b/scripts/deployment/globals_mainnet.json @@ -1 +1 @@ -{"contractVerification":true,"useLedger":true,"derivationPath":"m/44'/60'/2'/0/0","providerName":"mainnet","olasAddress":"0x0001A500A6B18995B03f44bb040A5fFc28E45CB0","timelockAddress":"0x3C1fF68f5aa342D296d4DEe4Bb1cACCA912D95fE","veOLASAddress":"0x7e01A500805f8A52Fad229b3015AD130A332B7b3","governorAddress":"0x34C895f302D0b5cf52ec0Edd3945321EB0f83dd5","governorTwoAddress":"0x4E3e48bA826b15214FDe72a50BFd17aB286B584E","componentRegistryAddress":"0x15bd56669F57192a97dF41A2aa8f4403e9491776","agentRegistryAddress":"0x2F1f7D38e4772884b88f3eCd8B6b9faCdC319112","serviceRegistryAddress":"0x48b6af7B12C71f09e2fC8aF4855De4Ff54e775cA","epochLen":"2592000","donatorBlacklistAddress":"0xE85791B18F5df42163092Acc5C9da1c479AFEa9d","tokenomicsAddress":"0x87f89F94033305791B6269AE2F9cF4e09983E56e","tokenomicsProxyAddress":"0xc096362fa6f4A4B1a9ea68b1043416f3381ce300","treasuryAddress":"0xa0DA53447C0f6C4987964d8463da7e6628B30f82","genericBondCalculatorAddress":"0x1521918961bDBC9Ed4C67a7103D5999e4130E6CB","depositoryAddress":"0x52A043bcebdB2f939BaEF2E8b6F01652290eAB3f","dispenserAddress":"0xeED0000fE94d7cfeF4Dc0CA86a223f0F603A61B8","tokenomicsTwoAddress":"0xD599ED4a5c45Fa66AA3C474b00701Fd452a2C30e","OLAS_ETH_PairAddress":"0x09D1d767eDF8Fa23A64C51fa559E0688E526812F","depositoryTwoAddress":"0xfF8697d8d2998d6AA2e09B405795C6F4BEeB0C81","XOLAS_WXDAI_PairAddress":"0x27df632fd0dcf191C418c803801D521cd579F18e","tokenomicsThreeAddress":"0x2C1633765c66a7CF0EC801a1046347bBee7344C9"} \ No newline at end of file +{"contractVerification":true,"useLedger":true,"derivationPath":"m/44'/60'/2'/0/0","providerName":"mainnet","olasAddress":"0x0001A500A6B18995B03f44bb040A5fFc28E45CB0","timelockAddress":"0x3C1fF68f5aa342D296d4DEe4Bb1cACCA912D95fE","veOLASAddress":"0x7e01A500805f8A52Fad229b3015AD130A332B7b3","governorAddress":"0x34C895f302D0b5cf52ec0Edd3945321EB0f83dd5","governorTwoAddress":"0x4E3e48bA826b15214FDe72a50BFd17aB286B584E","componentRegistryAddress":"0x15bd56669F57192a97dF41A2aa8f4403e9491776","agentRegistryAddress":"0x2F1f7D38e4772884b88f3eCd8B6b9faCdC319112","serviceRegistryAddress":"0x48b6af7B12C71f09e2fC8aF4855De4Ff54e775cA","epochLen":"2592000","donatorBlacklistAddress":"0xE85791B18F5df42163092Acc5C9da1c479AFEa9d","tokenomicsAddress":"0x87f89F94033305791B6269AE2F9cF4e09983E56e","tokenomicsProxyAddress":"0xc096362fa6f4A4B1a9ea68b1043416f3381ce300","treasuryAddress":"0xa0DA53447C0f6C4987964d8463da7e6628B30f82","genericBondCalculatorAddress":"0x1521918961bDBC9Ed4C67a7103D5999e4130E6CB","depositoryAddress":"0x52A043bcebdB2f939BaEF2E8b6F01652290eAB3f","dispenserAddress":"0xeED0000fE94d7cfeF4Dc0CA86a223f0F603A61B8","tokenomicsTwoAddress":"0xD599ED4a5c45Fa66AA3C474b00701Fd452a2C30e","OLAS_ETH_PairAddress":"0x09D1d767eDF8Fa23A64C51fa559E0688E526812F","depositoryTwoAddress":"0xfF8697d8d2998d6AA2e09B405795C6F4BEeB0C81","XOLAS_WXDAI_PairAddress":"0x27df632fd0dcf191C418c803801D521cd579F18e","tokenomicsThreeAddress":"0x2C1633765c66a7CF0EC801a1046347bBee7344C9","voteWeightingAddress":"","retainerAddress":"0x000000000000000000000000000000000000000000000000000000000000dEaD","maxNumClaimingEpochs":"1","maxNumStakingTargets":"10","minStakingWeight":"","maxStakingIncentive":""} \ No newline at end of file diff --git a/scripts/deployment/staking/arbitrum/globals_arbitrum_mainnet.json b/scripts/deployment/staking/arbitrum/globals_arbitrum_mainnet.json new file mode 100644 index 00000000..a1476ba6 --- /dev/null +++ b/scripts/deployment/staking/arbitrum/globals_arbitrum_mainnet.json @@ -0,0 +1 @@ +{"contractVerification":true,"useLedger":true,"derivationPath":"m/44'/60'/2'/0/0","providerName":"arbitrumOne","networkURL":"https://arb1.arbitrum.io/rpc","gasPriceInGwei":"5","olasAddress":"0x064F8B858C2A603e1b106a2039f5446D32dc81c1","serviceStakingFactoryAddress":"","timelockAddress":"","arbitrumArbSysAddress":"0x0000000000000000000000000000000000000064","l1ChainId":"1","arbitrumDepositProcessorL1Address":"","arbitrumTargetDispenserL2Address":""} \ No newline at end of file diff --git a/scripts/deployment/staking/globals_mainnet.json b/scripts/deployment/staking/globals_mainnet.json new file mode 100644 index 00000000..8a20c59b --- /dev/null +++ b/scripts/deployment/staking/globals_mainnet.json @@ -0,0 +1 @@ +{"contractVerification":true,"useLedger":true,"derivationPath":"m/44'/60'/2'/0/0","providerName":"mainnet","olasAddress":"0x0001A500A6B18995B03f44bb040A5fFc28E45CB0","dispenserAddress":"","arbitrumL1ERC20GatewayRouterAddress":"0x72Ce9c846789fdB6fC1f34aC4AD25Dd9ef7031ef","arbitrumL1ERC20GatewayAddress":"0xa3A7B6F88361F48403514059F1F16C8E78d60EeC","arbitrumInboxAddress":"0x4Dbd4fc535Ac27206064B68FfCf827b0A60BAB3f","arbitrumOutboxAddress":"0x0B9857ae2D4A3DBe74ffE1d7DF045bb7F96E4840","arbitrumBridgeAddress":"0x8315177aB297bA92A06054cE80a67Ed4DBd7ed3a","arbitrumL2TargetChainId":"42161","arbitrumDepositProcessorL1Address":"","gnosisOmniBridgeAddress":"0x88ad09518695c6c3712AC10a214bE5109a655671","gnosisAMBForeignAddress":"0x4C36d2919e407f0Cc2Ee3c993ccF8ac26d9CE64e","gnosisL2TargetChainId":"100","gnosisDepositProcessorL1Address":"","optimisticL1StandardBridgeProxyAddress":"0x99C9fc46f92E8a1c0deC1b1747d010903E884bE1","optimisticL1CrossDomainMessengerProxyAddress":"0x25ace71c97B33Cc4729CF772ae268934F7ab5fA1","optimisticOLASAddress":"0xFC2E6e6BCbd49ccf3A5f029c79984372DcBFE527","optimisticL2TargetChainId":"10","optimismDepositProcessorL1Address":"","wormholeL1CoreAddress":"0x98f3c9e6E3fAce36bAAd05FE09d375Ef1464288B","wormholeL1TokenRelayerAddress":"0x3ee18B2214AFF97000D974cf647E7C347E8fa585","wormholeL1MessageRelayerAddress":"0x27428DD2d3DD32A4D7f7C497eAaa23130d894911","celoL2TargetChainId":"42220","celoWormholeL2TargetChainId":"14","celoWormholeDepositProcessorL1Address":"","polygonRootChainManagerProxyAddress":"0xA0c68C638235ee32657e8f720a23ceC1bFc77C77","polygonFXRootAddress":"0xfe5e5D361b2ad62c541bAb87C45a0B9B018389a2","polygonCheckpointManagerAddress":"0x86E4Dc95c7FBdBf52e33D563BbDB00823894C287","polygonERC20PredicateAddress":"0x40ec5B33f54e0E8A33A975908C5BA1c14e5BbbDf","polygonL2TargetChainId":"137","polygonDepositProcessorL1Address":""} \ No newline at end of file diff --git a/scripts/deployment/staking/gnosis/globals_gnosis_mainnet.json b/scripts/deployment/staking/gnosis/globals_gnosis_mainnet.json new file mode 100644 index 00000000..6cfea4ef --- /dev/null +++ b/scripts/deployment/staking/gnosis/globals_gnosis_mainnet.json @@ -0,0 +1 @@ +{"contractVerification":true,"useLedger":true,"derivationPath":"m/44'/60'/2'/0/0","providerName":"gnosis","networkURL":"https://rpc.gnosischain.com","gasPriceInGwei":"5","olasAddress":"0xcE11e14225575945b8E6Dc0D4F2dD4C570f79d9f","serviceStakingFactoryAddress":"","timelockAddress":"","gnosisAMBHomeAddress":"0x75Df5AF045d91108662D8080fD1FEFAd6aA0bb59","l1ChainId":"1","gnosisDepositProcessorL1Address":"","gnosisTargetDispenserL2Address":""} \ No newline at end of file diff --git a/scripts/deployment/staking/optimistic/globals_optimistic_mainnet.json b/scripts/deployment/staking/optimistic/globals_optimistic_mainnet.json new file mode 100644 index 00000000..f22c6d15 --- /dev/null +++ b/scripts/deployment/staking/optimistic/globals_optimistic_mainnet.json @@ -0,0 +1 @@ +{"contractVerification":true,"useLedger":false,"derivationPath":"m/44'/60'/2'/0/0","providerName":"optimistic","networkURL":"https://optimism.drpc.org","gasPriceInGwei":"2","olasAddress":"0xFC2E6e6BCbd49ccf3A5f029c79984372DcBFE527","serviceStakingFactoryAddress":"","timelockAddress":"","optimisticL2CrossDomainMessengerAddress":"0x4200000000000000000000000000000000000007","l1ChainId":"1","optimismDepositProcessorL1Address":"","optimismTargetDispenserL2Address":""} \ No newline at end of file diff --git a/scripts/deployment/staking/polygon/globals_polygon_mainnet.json b/scripts/deployment/staking/polygon/globals_polygon_mainnet.json new file mode 100644 index 00000000..e3f6b464 --- /dev/null +++ b/scripts/deployment/staking/polygon/globals_polygon_mainnet.json @@ -0,0 +1 @@ +{"contractVerification":true,"useLedger":true,"derivationPath":"m/44'/60'/2'/0/0","providerName":"polygon","networkURL":"https://polygon-mainnet.g.alchemy.com/v2/","gasPriceInGwei":"5","olasAddress":"0xFEF5d947472e72Efbb2E388c730B7428406F2F95","serviceStakingFactoryAddress":"","timelockAddress":"","polygonFXChildAddress":"0x8397259c983751DAf40400790063935a11afa28a","l1ChainId":"1","polygonDepositProcessorL1Address":"","polygonTargetDispenserL2Address":""} \ No newline at end of file diff --git a/scripts/deployment/verify_07_dispenser.js b/scripts/deployment/verify_07_dispenser.js index f8cc6de3..b5cdd7e7 100644 --- a/scripts/deployment/verify_07_dispenser.js +++ b/scripts/deployment/verify_07_dispenser.js @@ -4,8 +4,22 @@ const dataFromJSON = fs.readFileSync(globalsFile, "utf8"); const parsedData = JSON.parse(dataFromJSON); const tokenomicsProxyAddress = parsedData.tokenomicsProxyAddress; const treasuryAddress = parsedData.treasuryAddress; +const olasAddress = parsedData.olasAddress; +const voteWeightingAddress = parsedData.voteWeightingAddress; +const retainerAddress = parsedData.retainerAddress; +const maxNumClaimingEpochs = parsedData.maxNumClaimingEpochs; +const maxNumStakingTargets = parsedData.maxNumStakingTargets; +const minStakingWeight = parsedData.minStakingWeight; +const maxStakingIncentive = parsedData.maxStakingIncentive; module.exports = [ + olasAddress, tokenomicsProxyAddress, - treasuryAddress + treasuryAddress, + voteWeightingAddress, + retainerAddress, + maxNumClaimingEpochs, + maxNumStakingTargets, + minStakingWeight, + maxStakingIncentive ]; \ No newline at end of file