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

fix: update CLI & terraforms with new contract addresses #5553

Merged
merged 4 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions l1-contracts/scripts/ci_deploy_contracts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"

Expand Down
19 changes: 19 additions & 0 deletions l1-contracts/terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
8 changes: 8 additions & 0 deletions yarn-project/aztec-node/terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
2 changes: 2 additions & 0 deletions yarn-project/cli/src/cmds/deploy_l1_contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
14 changes: 6 additions & 8 deletions yarn-project/cli/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -55,10 +47,16 @@ export async function deployAztecContracts(
debugLogger: DebugLogger,
) {
const {
AvailabilityOracleAbi,
AvailabilityOracleBytecode,
GasPortalAbi,
GasPortalBytecode,
InboxAbi,
InboxBytecode,
OutboxAbi,
OutboxBytecode,
PortalERC20Abi,
PortalERC20Bytecode,
RegistryAbi,
RegistryBytecode,
RollupAbi,
Expand Down
5 changes: 5 additions & 0 deletions yarn-project/ethereum/src/l1_contract_addresses.ts
Original file line number Diff line number Diff line change
@@ -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',
Expand Down
Loading