diff --git a/package.json b/package.json index b6d888889..3fdc258fe 100644 --- a/package.json +++ b/package.json @@ -20,10 +20,10 @@ "deploy-fl-online-amoy": "source .env && forge script script/deploy-fl-online-control.s.sol:DeployFLOnlineControlScript --rpc-url ${AMOY_RPC_URL} --broadcast --etherscan-api-key ${POLYGONSCAN_API_KEY} --verify", "deploy-fl-online-polygon": "source .env && forge script script/deploy-fl-online-control.s.sol:DeployFLOnlineControlScript --rpc-url ${POLYGON_RPC_URL} --broadcast --etherscan-api-key ${POLYGONSCAN_API_KEY} --verify", - + "deploy-atlas-bsc": "source .env && forge script script/deploy-atlas.s.sol:DeployAtlasScript --rpc-url ${BSC_RPC_URL} --legacy --broadcast --etherscan-api-key ${BSCSCAN_API_KEY} --verify --delay 30", "deploy-atlas-bsc-testnet": "source .env && forge script script/deploy-atlas.s.sol:DeployAtlasScript --rpc-url ${BSC_TESTNET_RPC_URL} --legacy --broadcast --etherscan-api-key ${BSCSCAN_API_KEY} --verify --delay 30", - + "deploy-atlas-sepolia": "source .env && forge script script/deploy-atlas.s.sol:DeployAtlasScript --rpc-url ${SEPOLIA_RPC_URL} --legacy --gas-estimate-multiplier 150 --broadcast --etherscan-api-key ${ETHERSCAN_API_KEY} --verify --delay 30", "deploy-atlas-local": "source .env && forge script script/deploy-atlas.s.sol:DeployAtlasScript --fork-url http://localhost:8545 --broadcast", @@ -60,6 +60,8 @@ "solver-deposit": "source .env && forge script script/solver-deposit.s.sol:SolverAtlasDepositScript --fork-url http://localhost:8545 --broadcast --non-interactive", "setup-demo": "npm run deploy-atlas-swap-intent-tx-builder && npm run deploy-solver && npm run solver-deposit", + "transfer-surcharge-recipient:sepolia": ". ./.env && forge script script/transfer-surcharge-recipient.s.sol:TransferSurchargeRecipientScript --rpc-url ${SEPOLIA_RPC_URL} --sig 'run(string)' --broadcast --non-interactive", + "atlas-addr": "echo 'ATLAS:' && jq -r '.ATLAS' deployments.json", "swap-intent-addr": "echo 'SWAP INTENT DAPP CONTROL:' && jq -r '.SWAP_INTENT_DAPP_CONTROL' deployments.json", "tx-builder-addr": "echo 'TX BUILDER:' && jq -r '.TX_BUILDER' deployments.json", @@ -78,4 +80,3 @@ "solc": "solc-select install 0.8.18 && solc-select use 0.8.18" } } - \ No newline at end of file diff --git a/script/transfer-surcharge-recipient.s.sol b/script/transfer-surcharge-recipient.s.sol new file mode 100644 index 000000000..d64782b01 --- /dev/null +++ b/script/transfer-surcharge-recipient.s.sol @@ -0,0 +1,37 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity 0.8.25; + +import "forge-std/Script.sol"; + +import { DeployBaseScript } from "script/base/deploy-base.s.sol"; + +import { Atlas } from "src/contracts/atlas/Atlas.sol"; + +/// @dev npm run transfer-surcharge-recipient:sepolia --
+contract TransferSurchargeRecipientScript is DeployBaseScript { + function run(string calldata _newRecipient) external { + console.log("\n=== Transferring Atlas Surcharge Recipient ===\n"); + + // Hex string to address. + address newRecipient = vm.parseAddress(_newRecipient); + + // Get the deployer's private key from environment. + uint256 deployerPrivateKey = vm.envUint("GOV_PRIVATE_KEY"); + address deployer = vm.addr(deployerPrivateKey); + + // Get Atlas contract address from deployments. + address atlasAddress = _getAddressFromDeploymentsJson(".ATLAS"); + Atlas atlas = Atlas(payable(atlasAddress)); + + console.log("Deployer address: \t\t\t", deployer); + console.log("Atlas address: \t\t\t\t", atlasAddress); + console.log("New surcharge recipient: \t\t\t", newRecipient); + + // Transfer the surcharge recipient role to the new address. + vm.startBroadcast(deployerPrivateKey); + atlas.transferSurchargeRecipient(newRecipient); + vm.stopBroadcast(); + + console.log("\nSurcharge recipient successfully transferred to:", newRecipient); + } +}