From eb73d20e825f3e18acfb68a2b0b7d3501f39e52d Mon Sep 17 00:00:00 2001 From: spypsy Date: Wed, 3 Apr 2024 17:04:59 +0100 Subject: [PATCH] fix: update CLI & terraforms with new contract addresses (#5553) --- l1-contracts/scripts/ci_deploy_contracts.sh | 10 ++++++++++ l1-contracts/terraform/main.tf | 19 +++++++++++++++++++ yarn-project/aztec-node/terraform/main.tf | 8 ++++++++ .../cli/src/cmds/deploy_l1_contracts.ts | 2 ++ yarn-project/cli/src/utils.ts | 14 ++++++-------- .../ethereum/src/l1_contract_addresses.ts | 5 +++++ 6 files changed, 50 insertions(+), 8 deletions(-) diff --git a/l1-contracts/scripts/ci_deploy_contracts.sh b/l1-contracts/scripts/ci_deploy_contracts.sh index 8bf5d65b3b1..a3ccd71600b 100755 --- a/l1-contracts/scripts/ci_deploy_contracts.sh +++ b/l1-contracts/scripts/ci_deploy_contracts.sh @@ -40,6 +40,8 @@ docker run \ # L2 -> L1 Outbox address: 0xf6b1b3c2c393fe55fe577a1f528bd72a76589ab0 # Contract Deployment Emitter Address: 0xf3ecc6e9428482a74687ee5f7b96f4dff8781454 # Availability Oracle Address: 0x610178da211fef7d417bc0e6fed39f05609ad788 +# Gas Token Address: 0x9e4b815648c4a98a9bce6a899cecbaf3758cf23c +# Gas Portal Address: 0xda5dea39534f67f33deb38ec3b1e438fa893bf2c # Read the file line by line while IFS= read -r line; do @@ -62,6 +64,14 @@ while IFS= read -r line; do elif [[ $line == *"Oracle"* ]]; then export TF_VAR_AVAILABILITY_ORACLE_CONTRACT_ADDRESS=$address echo "TF_VAR_AVAILABILITY_ORACLE_CONTRACT_ADDRESS=$TF_VAR_AVAILABILITY_ORACLE_CONTRACT_ADDRESS" + elif [[ $line == *"Gas Token"* ]]; then + export TF_VAR_GAS_TOKEN_CONTRACT_ADDRESS=$address + echo "TF_VAR_GAS_TOKEN_CONTRACT_ADDRESS=$TF_VAR_GAS_TOKEN_CONTRACT_ADDRESS" + elif [[ $line == *"Gas Portal"* ]]; then + export TF_VAR_GAS_PORTAL_CONTRACT_ADDRESS=$address + echo "TF_VAR_GAS_PORTAL_CONTRACT_ADDRESS=$TF_VAR_GAS_PORTAL_CONTRACT_ADDRESS" + else + echo "Unknown contract address: $line" fi done <"$FILE_PATH" diff --git a/l1-contracts/terraform/main.tf b/l1-contracts/terraform/main.tf index 9a337e1580a..b5d237b047e 100644 --- a/l1-contracts/terraform/main.tf +++ b/l1-contracts/terraform/main.tf @@ -55,3 +55,22 @@ variable "OUTBOX_CONTRACT_ADDRESS" { output "outbox_contract_address" { value = var.OUTBOX_CONTRACT_ADDRESS } + + +variable "GAS_TOKEN_CONTRACT_ADDRESS" { + type = string + default = "" +} + +output "gas_token_contract_address" { + value = var.GAS_TOKEN_CONTRACT_ADDRESS +} + +variable "GAS_PORTAL_CONTRACT_ADDRESS" { + type = string + default = "" +} + +output "gas_portal_contract_address" { + value = var.GAS_PORTAL_CONTRACT_ADDRESS +} diff --git a/yarn-project/aztec-node/terraform/main.tf b/yarn-project/aztec-node/terraform/main.tf index fffdb2991aa..6123b877c30 100644 --- a/yarn-project/aztec-node/terraform/main.tf +++ b/yarn-project/aztec-node/terraform/main.tf @@ -236,6 +236,14 @@ resource "aws_ecs_task_definition" "aztec-node" { "name": "AVAILABILITY_ORACLE_CONTRACT_ADDRESS", "value": "${data.terraform_remote_state.l1_contracts.outputs.availability_oracle_contract_address}" }, + { + "name": "GAS_TOKEN_CONTRACT_ADDRESS", + "value": "${data.terraform_remote_state.l1_contracts.outputs.gas_token_contract_address}" + }, + { + "name": "GAS_PORTAL_CONTRACT_ADDRESS", + "value": "${data.terraform_remote_state.l1_contracts.outputs.gas_portal_contract_address}" + }, { "name": "API_KEY", "value": "${var.API_KEY}" diff --git a/yarn-project/cli/src/cmds/deploy_l1_contracts.ts b/yarn-project/cli/src/cmds/deploy_l1_contracts.ts index a96b3e277a2..49c6f5decb6 100644 --- a/yarn-project/cli/src/cmds/deploy_l1_contracts.ts +++ b/yarn-project/cli/src/cmds/deploy_l1_contracts.ts @@ -18,5 +18,7 @@ export async function deployL1Contracts( log(`L1 -> L2 Inbox Address: ${l1ContractAddresses.inboxAddress.toString()}`); log(`L2 -> L1 Outbox address: ${l1ContractAddresses.outboxAddress.toString()}`); log(`Availability Oracle Address: ${l1ContractAddresses.availabilityOracleAddress.toString()}`); + log(`Gas Token Address: ${l1ContractAddresses.gasTokenAddress.toString()}`); + log(`Gas Portal Address: ${l1ContractAddresses.gasPortalAddress.toString()}`); log('\n'); } diff --git a/yarn-project/cli/src/utils.ts b/yarn-project/cli/src/utils.ts index 1c387db67bc..56598653e2a 100644 --- a/yarn-project/cli/src/utils.ts +++ b/yarn-project/cli/src/utils.ts @@ -4,14 +4,6 @@ import { type L1ContractArtifactsForDeployment } from '@aztec/aztec.js/ethereum' import { type PXE } from '@aztec/aztec.js/interfaces/pxe'; import { type DebugLogger, type LogFn } from '@aztec/foundation/log'; import { type NoirPackageConfig } from '@aztec/foundation/noir'; -import { - AvailabilityOracleAbi, - AvailabilityOracleBytecode, - GasPortalAbi, - GasPortalBytecode, - PortalERC20Abi, - PortalERC20Bytecode, -} from '@aztec/l1-artifacts'; import TOML from '@iarna/toml'; import { CommanderError, InvalidArgumentError } from 'commander'; @@ -55,10 +47,16 @@ export async function deployAztecContracts( debugLogger: DebugLogger, ) { const { + AvailabilityOracleAbi, + AvailabilityOracleBytecode, + GasPortalAbi, + GasPortalBytecode, InboxAbi, InboxBytecode, OutboxAbi, OutboxBytecode, + PortalERC20Abi, + PortalERC20Bytecode, RegistryAbi, RegistryBytecode, RollupAbi, diff --git a/yarn-project/ethereum/src/l1_contract_addresses.ts b/yarn-project/ethereum/src/l1_contract_addresses.ts index bcbcddbc260..c870de6d665 100644 --- a/yarn-project/ethereum/src/l1_contract_addresses.ts +++ b/yarn-project/ethereum/src/l1_contract_addresses.ts @@ -1,5 +1,10 @@ import { type EthAddress } from '@aztec/foundation/eth-address'; +/** + * The names of the current L1 contract addresses. + * NOTE: When changing this list, make sure to update CLI & CI scripts accordingly. + * For reference: https://github.com/AztecProtocol/aztec-packages/pull/5553 + */ export const l1ContractsNames = [ 'availabilityOracleAddress', 'rollupAddress',