From ad877d96e3f023ee64d9207c0911551c26d162a2 Mon Sep 17 00:00:00 2001 From: spypsy Date: Wed, 3 Apr 2024 15:11:11 +0000 Subject: [PATCH 1/4] fix: update CLI & terraforms with new contract addresses --- yarn-project/cli/src/cmds/deploy_l1_contracts.ts | 2 ++ yarn-project/cli/src/utils.ts | 16 ++++++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) 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..478451e30a5 100644 --- a/yarn-project/cli/src/utils.ts +++ b/yarn-project/cli/src/utils.ts @@ -4,15 +4,9 @@ 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 { +// } from '@aztec/l1-artifacts'; import TOML from '@iarna/toml'; import { CommanderError, InvalidArgumentError } from 'commander'; import { readFile, rename, writeFile } from 'fs/promises'; @@ -55,10 +49,16 @@ export async function deployAztecContracts( debugLogger: DebugLogger, ) { const { + AvailabilityOracleAbi, + AvailabilityOracleBytecode, + GasPortalAbi, + GasPortalBytecode, InboxAbi, InboxBytecode, OutboxAbi, OutboxBytecode, + PortalERC20Abi, + PortalERC20Bytecode, RegistryAbi, RegistryBytecode, RollupAbi, From beca0bd13b73966d83ffee681301a25e10d09ff7 Mon Sep 17 00:00:00 2001 From: spypsy Date: Wed, 3 Apr 2024 15:12:25 +0000 Subject: [PATCH 2/4] update l1-contracts dir --- l1-contracts/scripts/ci_deploy_contracts.sh | 10 ++++++++++ l1-contracts/terraform/main.tf | 19 +++++++++++++++++++ yarn-project/aztec-node/terraform/main.tf | 8 ++++++++ 3 files changed, 37 insertions(+) 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}" From 0f80b7d4c1706292179948132acba5f420e4ff55 Mon Sep 17 00:00:00 2001 From: spypsy Date: Wed, 3 Apr 2024 15:13:39 +0000 Subject: [PATCH 3/4] remove comment --- yarn-project/cli/src/utils.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/yarn-project/cli/src/utils.ts b/yarn-project/cli/src/utils.ts index 478451e30a5..56598653e2a 100644 --- a/yarn-project/cli/src/utils.ts +++ b/yarn-project/cli/src/utils.ts @@ -5,8 +5,6 @@ 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 { -// } from '@aztec/l1-artifacts'; import TOML from '@iarna/toml'; import { CommanderError, InvalidArgumentError } from 'commander'; import { readFile, rename, writeFile } from 'fs/promises'; From ceb5878f1a0adb0eae2ceee6199d0a1a1ceef052 Mon Sep 17 00:00:00 2001 From: spypsy Date: Wed, 3 Apr 2024 15:33:46 +0000 Subject: [PATCH 4/4] add clarifying comment for updating l1 contracts --- yarn-project/ethereum/src/l1_contract_addresses.ts | 5 +++++ 1 file changed, 5 insertions(+) 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',