From 4807453749ccb3d613bc037a1ee8890cf7d92f98 Mon Sep 17 00:00:00 2001 From: Ben Sparks <52714090+BenSparksCode@users.noreply.github.com> Date: Tue, 12 Nov 2024 16:24:00 +0200 Subject: [PATCH 1/2] feat: add surcharge settings to deploy script --- script/base/deploy-base.s.sol | 13 +++++++++++++ script/deploy-atlas.s.sol | 6 ++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/script/base/deploy-base.s.sol b/script/base/deploy-base.s.sol index 0b5059d45..ca7a4b748 100644 --- a/script/base/deploy-base.s.sol +++ b/script/base/deploy-base.s.sol @@ -70,6 +70,19 @@ contract DeployBaseScript is Script { } } + function _getSurchargeRates() internal view returns (uint256 atlasSurchargeRate, uint256 bundlerSurchargeRate) { + uint256 chainId = block.chainid; + if (chainId == 137 || chainId == 80_002) { + // POLYGON and AMOY + atlasSurchargeRate = 5_000_000; // 50% + bundlerSurchargeRate = 5_000_000; // 50% + } else { + // Default - for all other chains + atlasSurchargeRate = 1_000_000; // 10% + bundlerSurchargeRate = 1_000_000; // 10% + } + } + // NOTE: When handling JSON with StdJson, prefix keys with '.' e.g. '.ATLAS' // These 2 functions abstract away the '.' thing though. // Pass in a key like 'ATLAS', and the current chain will be detected via `block.chainid` in `_getDeployChain()` diff --git a/script/deploy-atlas.s.sol b/script/deploy-atlas.s.sol index b60e37e1b..da8f07b95 100644 --- a/script/deploy-atlas.s.sol +++ b/script/deploy-atlas.s.sol @@ -16,8 +16,8 @@ import { ExecutionEnvironment } from "../src/contracts/common/ExecutionEnvironme contract DeployAtlasScript is DeployBaseScript { uint256 ESCROW_DURATION = 64; - uint256 ATLAS_SURCHARGE_RATE = 1_000_000; // 10% - uint256 BUNDLER_SURCHARGE_RATE = 1_000_000; // 10% + uint256 ATLAS_SURCHARGE_RATE; // Set below + uint256 BUNDLER_SURCHARGE_RATE; // Set below function run() external { console.log("\n=== DEPLOYING Atlas ===\n"); @@ -27,6 +27,8 @@ contract DeployAtlasScript is DeployBaseScript { uint256 deployerPrivateKey = vm.envUint("GOV_PRIVATE_KEY"); address deployer = vm.addr(deployerPrivateKey); + (ATLAS_SURCHARGE_RATE, BUNDLER_SURCHARGE_RATE) = _getSurchargeRates(); + // Computes the addresses at which AtlasVerification will be deployed address expectedAtlasAddr = vm.computeCreateAddress(deployer, vm.getNonce(deployer) + 2); address expectedAtlasVerificationAddr = vm.computeCreateAddress(deployer, vm.getNonce(deployer) + 3); From 60a70b3e7d886677ef7a0759cee4a87a818334c0 Mon Sep 17 00:00:00 2001 From: Ben Sparks <52714090+BenSparksCode@users.noreply.github.com> Date: Wed, 13 Nov 2024 08:50:18 +0200 Subject: [PATCH 2/2] chore: deploy Atlas v1.1 on Polygon --- deployments.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/deployments.json b/deployments.json index 005f6f6f9..a11867c80 100644 --- a/deployments.json +++ b/deployments.json @@ -18,10 +18,10 @@ "FL_ONLINE_DAPP_CONTROL": "0xf0E388C7DFfE14a61280a4E5b84d77be3d2875e3" }, "POLYGON": { - "ATLAS": "0x912AceADa1b9c9B378894D0610C5684167710FDD", - "ATLAS_VERIFICATION": "0x2fBF38a38D753E4ce398000CCC552Efa50702e1e", - "SIMULATOR": "0x1244E4B8D93D2A72692Bf3600f7f5a494e24895a", - "SORTER": "0xFac7bf300E7eb17A2eD0Be67b60f5FeDd2E28E90", + "ATLAS": "0xB363f4D32DdB0b43622eA07Ae9145726941272B4", + "ATLAS_VERIFICATION": "0x621c6970fD9F124230feE35117d318069056819a", + "SIMULATOR": "0x82A3460920582968688FD887F21c5F3155A3BBd4", + "SORTER": "0xf8Bd19064A77297A691a29d9a40dF76F32fc86ad", "FL_ONLINE_DAPP_CONTROL": "0x498aC70345AD6b161eEf4AFBEA8F010401cfa780" }, "BSC": { @@ -54,4 +54,4 @@ "SORTER": "", "FL_ONLINE_DAPP_CONTROL": "" } -} +} \ No newline at end of file