Skip to content

Commit

Permalink
fix: skip check funds if use test gas token
Browse files Browse the repository at this point in the history
  • Loading branch information
yiweichi committed Aug 18, 2024
1 parent 2f3e91e commit 923ead9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docker/config-example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ L1_PLONK_VERIFIER_ADDR = "0x0000000000000000000000000000000000000001"
[contracts.overrides]

# L1_WETH = "0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14"
# L1_GAS_TOKEN = "0x0000000000000000000000000000000000000000"
# L1_GAS_TOKEN = "0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9"

L2_MESSAGE_QUEUE = "0x5300000000000000000000000000000000000000"
L1_GAS_PRICE_ORACLE = "0x5300000000000000000000000000000000000002"
Expand Down
6 changes: 4 additions & 2 deletions scripts/deterministic/DeployScroll.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ contract DeployScroll is DeterminsticDeployment {
}
}

function checkDeployerBalance() private view {
function checkDeployerBalance() private {
// ignore balance during simulation
if (broadcastLayer == Layer.None) {
return;
Expand Down Expand Up @@ -289,7 +289,9 @@ contract DeployScroll is DeterminsticDeployment {
}

// check funds for initial deposit (L1, alternative gas token)
if (broadcastLayer == Layer.L1 && ALTERNATIVE_GAS_TOKEN_ENABLED) {
// skip it if L1_GAS_TOKEN is not configured in the config file
address gasTokenAddr = tryGetOverride("L1_GAS_TOKEN");
if (broadcastLayer == Layer.L1 && ALTERNATIVE_GAS_TOKEN_ENABLED && gasTokenAddr != address(0)) {
uint256 l1GasTokenGatewayBalance = IERC20Metadata(L1_GAS_TOKEN_ADDR).balanceOf(
L1_GAS_TOKEN_GATEWAY_PROXY_ADDR
);
Expand Down
1 change: 1 addition & 0 deletions scripts/deterministic/GenerateConfigs.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ contract GenerateChainMonitorConfig is DeployScroll {
vm.writeJson(vm.toString(L1_MESSAGE_QUEUE_PROXY_ADDR), CHAIN_MONITOR_CONFIG_PATH, ".l1_config.l1_contracts.message_queue");
vm.writeJson(vm.toString(L1_SCROLL_CHAIN_PROXY_ADDR), CHAIN_MONITOR_CONFIG_PATH, ".l1_config.l1_contracts.scroll_chain");
vm.writeJson(vm.toString(L1_GAS_TOKEN_ADDR), CHAIN_MONITOR_CONFIG_PATH, ".l1_config.l1_contracts.gas_token");
vm.writeJson(vm.toString(L2_DEPLOYER_INITIAL_BALANCE), CHAIN_MONITOR_CONFIG_PATH, ".l1_config.start_messenger_balance");

// L2
vm.writeJson(L2_RPC_ENDPOINT, CHAIN_MONITOR_CONFIG_PATH, ".l2_config.l2_url");
Expand Down

0 comments on commit 923ead9

Please sign in to comment.