Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update bridge hardcoded values #542

Merged
merged 12 commits into from
Dec 26, 2024
Merged
2 changes: 1 addition & 1 deletion contracts/scripts/core/DeployCore.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {console} from "forge-std/console.sol";
contract DeployTestnet is Script {

// Amount of ETH to initially fund the oracle account on L1 chain.
uint256 public constant ORACLE_INITIAL_FUNDING = 1 ether;
uint256 public constant ORACLE_INITIAL_FUNDING = 300 gwei;
uint256 public constant PERCENT_MULTIPLIER = 1e16;

error FailedToSendETHToOracle(address addr);
Expand Down
16 changes: 8 additions & 8 deletions contracts/scripts/standard-bridge/DeployStandardBridge.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@ contract BridgeBase is Script {
// Amount of ETH which must be allocated only to the contract deployer on mev-commit chain genesis.
uint256 public constant DEPLOYER_GENESIS_ALLOCATION = type(uint256).max - 500 ether;

// Amount of ETH to initially fund the relayer account on both chains.
uint256 public constant RELAYER_INITIAL_FUNDING = 1 ether;
// Amount of ETH to initially fund the relayer account on the mev-commit chain.
uint256 public constant RELAYER_INITIAL_FUNDING_MEV_COMMIT_CHAIN = 300 gwei; // 256 gwei + buffer

// Amount of ETH to initially fund the oracle account on L1 chain.
uint256 public constant ORACLE_INITIAL_FUNDING = 1 ether;
// Amount of ETH to initially fund the relayer account on L1.
uint256 public constant RELAYER_INITIAL_FUNDING_L1 = 1 ether;
aloknerurkar marked this conversation as resolved.
Show resolved Hide resolved

// Amount of ETH required by the contract deployer to initialize all bridge and core contract state,
// AND initially fund the relayer, all on mev-commit chain.
// This amount of ETH must be initially locked in the L1 gateway contract to ensure a 1:1 peg
// between mev-commit chain ETH and L1 ETH.
uint256 public constant MEV_COMMIT_CHAIN_SETUP_COST = 1 ether + RELAYER_INITIAL_FUNDING + ORACLE_INITIAL_FUNDING;
aloknerurkar marked this conversation as resolved.
Show resolved Hide resolved
uint256 public constant MEV_COMMIT_CHAIN_SETUP_COST = 0.01 ether + RELAYER_INITIAL_FUNDING_MEV_COMMIT_CHAIN;

// Amount of ETH required on L1 to initialize the L1 gateway, make transfer calls, and initially fund the relayer on L1.
uint256 public constant L1_SETUP_COST = 1 ether + RELAYER_INITIAL_FUNDING;
uint256 public constant L1_SETUP_COST = 0.01 ether + RELAYER_INITIAL_FUNDING_L1;

error RelayerAddressNotSet(address addr);
error L1FinalizationFeeNotSet(uint256 fee);
Expand Down Expand Up @@ -90,7 +90,7 @@ contract DeploySettlementGateway is BridgeBase {

allocator.addToWhitelist(address(settlementGateway));

(success, ) = payable(relayerAddr).call{value: RELAYER_INITIAL_FUNDING}("");
(success, ) = payable(relayerAddr).call{value: RELAYER_INITIAL_FUNDING_MEV_COMMIT_CHAIN}("");
require(success, FailedToSendETHToRelayer(relayerAddr));

vm.stopBroadcast();
Expand Down Expand Up @@ -127,7 +127,7 @@ contract DeployL1Gateway is BridgeBase {
(bool success, ) = payable(address(l1Gateway)).call{value: MEV_COMMIT_CHAIN_SETUP_COST}("");
require(success, FailedToFundL1Gateway(address(l1Gateway)));

(success, ) = payable(relayerAddr).call{value: RELAYER_INITIAL_FUNDING}("");
(success, ) = payable(relayerAddr).call{value: RELAYER_INITIAL_FUNDING_L1}("");
require(success, FailedToSendETHToRelayer(relayerAddr));

vm.stopBroadcast();
Expand Down
4 changes: 4 additions & 0 deletions infrastructure/nomad/playbooks/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,11 @@
echo "${ALLOC}" | jq --arg address "0x${ADDRESS}" '
. + {
($address): {
{% if profile == 'mainnet' %}
"balance": "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE4F2FBDFD0B813FFFF"
{% else %}
"balance": "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD4A51000FDA0FFFF"
{% endif %}
}
}
'
Expand Down
Loading