Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
d971360
only use PREFUND_ADDRESSES on local nets
mverzilli Mar 4, 2026
8796986
remove unused import
mverzilli Mar 4, 2026
1662a7c
add comment on local-network only
mverzilli Mar 4, 2026
20cfb3d
another comment
mverzilli Mar 4, 2026
4a89845
chore: remove prefund env var in non local networks (#21095)
mverzilli Mar 4, 2026
ecb5c48
Merge branch 'next' into merge-train/fairies
Mar 4, 2026
7ac5830
Merge branch 'next' into merge-train/fairies
Mar 4, 2026
e6e90a7
Merge branch 'next' into merge-train/fairies
Mar 4, 2026
1282ec1
feat: aztec new supporting multiple contract crates (#21007)
benesjan Mar 4, 2026
3ab7b10
feat!: Expose offchain effects when simulating/sending txs (#20563)
mverzilli Mar 4, 2026
f1c59a6
chore: exclude auto-generated dirs from VS Code search (#20881)
benesjan Mar 4, 2026
9c6abce
Merge branch 'next' into merge-train/fairies
Mar 4, 2026
558ba4a
Merge branch 'next' into merge-train/fairies
Mar 4, 2026
75ce5f9
feat: improve oracle name prefixes (#21101)
nventuro Mar 4, 2026
a4ef926
fix(pxe): correct contract class log DA gas metering from +2 to +1 (#…
spalladino Mar 4, 2026
b451dc5
chore: remove stale aes comments (#21133)
nventuro Mar 4, 2026
d7d0149
chore: add warning on invalid recipients (#21134)
nventuro Mar 4, 2026
ef45e7b
Merge branch 'next' into merge-train/fairies
Mar 4, 2026
80ecd98
feat: mask ciphertext fields with Poseidon2-derived values (#21009)
nchamo Mar 4, 2026
aed4420
Merge branch 'next' into merge-train/fairies
Mar 4, 2026
c022797
Merge branch 'next' into merge-train/fairies
Mar 4, 2026
95f961c
Merge branch 'next' into merge-train/fairies
ludamad Mar 5, 2026
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
44 changes: 43 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,53 @@
},
"solidity.formatter": "forge",
"search.exclude": {
// Package managers / dependencies
"**/.yarn": true,
"**/.yalc": true,
"**/node_modules": true,
"**/.pnp.*": true,
"**/msgpack-c/**": true
"**/l1-contracts/lib/**": true,
"**/barretenberg/sol/lib/**": true,
"**/msgpack-c/**": true,

// Build outputs
"**/dest/**": true,
"**/dist/**": true,
"**/target/**": true,
"**/build/**": true,
"**/out/**": true,
"**/artifacts/**": true,
"**/generated/**": true,

// Caches
"**/.cache/**": true,
"**/.cache-loader/**": true,
"**/.docusaurus/**": true,
"**/.tsbuildinfo": true,
"**/tsconfig.tsbuildinfo": true,
"**/.eslintcache": true,

// Docs: versioned/generated content
"**/docs/developer_versioned_docs/**": true,
"**/docs/network_versioned_docs/**": true,
"**/docs/network_versioned_sidebars/**": true,
"**/docs/processed-docs/**": true,
"**/docs/processed-docs-cache/**": true,
"**/docs/static/**": true,
"**/docs/build/**": true,
"**/barretenberg/docs/versioned_docs/**": true,
"**/barretenberg/docs/versioned_sidebars/**": true,
"**/barretenberg/docs/static/**": true,
"**/barretenberg/docs/build/**": true,
"**/noir/noir-repo/docs/versioned_docs/**": true,
"**/noir/noir-repo/docs/versioned_sidebars/**": true,

// C++/Rust build
"**/barretenberg/cpp/build*/**": true,
"**/barretenberg/cpp/src/wasi-sdk*/**": true,
"**/cmake-build-*/**": true,
"**/bench-out/**": true,
"**/coverage/**": true
},
"[terraform]": {
"editor.defaultFormatter": "hashicorp.terraform"
Expand Down
86 changes: 43 additions & 43 deletions avm-transpiler/src/transpile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -538,38 +538,38 @@ fn handle_foreign_call(
inputs: &[ValueOrArray],
) {
match function {
"avmOpcodeCall" => handle_external_call(avm_instrs, destinations, inputs, AvmOpcode::CALL),
"avmOpcodeStaticCall" => {
"aztec_avm_call" => handle_external_call(avm_instrs, destinations, inputs, AvmOpcode::CALL),
"aztec_avm_staticCall" => {
handle_external_call(avm_instrs, destinations, inputs, AvmOpcode::STATICCALL);
}
"avmOpcodeEmitPublicLog" => {
"aztec_avm_emitPublicLog" => {
handle_emit_public_log(avm_instrs, destinations, inputs);
}
"avmOpcodeNoteHashExists" => handle_note_hash_exists(avm_instrs, destinations, inputs),
"avmOpcodeEmitNoteHash" | "avmOpcodeEmitNullifier" => handle_emit_note_hash_or_nullifier(
function == "avmOpcodeEmitNullifier",
"aztec_avm_noteHashExists" => handle_note_hash_exists(avm_instrs, destinations, inputs),
"aztec_avm_emitNoteHash" | "aztec_avm_emitNullifier" => handle_emit_note_hash_or_nullifier(
function == "aztec_avm_emitNullifier",
avm_instrs,
destinations,
inputs,
),
"avmOpcodeNullifierExists" => handle_nullifier_exists(avm_instrs, destinations, inputs),
"avmOpcodeL1ToL2MsgExists" => handle_l1_to_l2_msg_exists(avm_instrs, destinations, inputs),
"avmOpcodeSendL2ToL1Msg" => handle_send_l2_to_l1_msg(avm_instrs, destinations, inputs),
"avmOpcodeCalldataCopy" => handle_calldata_copy(avm_instrs, destinations, inputs),
"avmOpcodeSuccessCopy" => handle_success_copy(avm_instrs, destinations, inputs),
"avmOpcodeReturndataSize" => handle_returndata_size(avm_instrs, destinations, inputs),
"avmOpcodeReturndataCopy" => handle_returndata_copy(avm_instrs, destinations, inputs),
"avmOpcodeReturn" => handle_return(avm_instrs, destinations, inputs),
"avmOpcodeRevert" => handle_revert(avm_instrs, destinations, inputs),
"avmOpcodeStorageRead" => handle_storage_read(avm_instrs, destinations, inputs),
"avmOpcodeStorageWrite" => handle_storage_write(avm_instrs, destinations, inputs),
"utilityLog" => handle_debug_log(avm_instrs, destinations, inputs),
"aztec_avm_nullifierExists" => handle_nullifier_exists(avm_instrs, destinations, inputs),
"aztec_avm_l1ToL2MsgExists" => handle_l1_to_l2_msg_exists(avm_instrs, destinations, inputs),
"aztec_avm_sendL2ToL1Msg" => handle_send_l2_to_l1_msg(avm_instrs, destinations, inputs),
"aztec_avm_calldataCopy" => handle_calldata_copy(avm_instrs, destinations, inputs),
"aztec_avm_successCopy" => handle_success_copy(avm_instrs, destinations, inputs),
"aztec_avm_returndataSize" => handle_returndata_size(avm_instrs, destinations, inputs),
"aztec_avm_returndataCopy" => handle_returndata_copy(avm_instrs, destinations, inputs),
"aztec_avm_return" => handle_return(avm_instrs, destinations, inputs),
"aztec_avm_revert" => handle_revert(avm_instrs, destinations, inputs),
"aztec_avm_storageRead" => handle_storage_read(avm_instrs, destinations, inputs),
"aztec_avm_storageWrite" => handle_storage_write(avm_instrs, destinations, inputs),
"aztec_utl_log" => handle_debug_log(avm_instrs, destinations, inputs),
// Getters.
_ if inputs.is_empty() && destinations.len() == 1 => {
handle_getter_instruction(avm_instrs, function, destinations, inputs);
}
// Get contract instance variations.
_ if function.starts_with("avmOpcodeGetContractInstance") => {
_ if function.starts_with("aztec_avm_getContractInstance") => {
handle_get_contract_instance(avm_instrs, function, destinations, inputs);
}
// Anything else.
Expand All @@ -580,7 +580,7 @@ fn handle_foreign_call(
/// Handle an AVM CALL
/// (an external 'call' brillig foreign call was encountered)
/// Adds the new instruction to the avm instructions list.
// #[oracle(avmOpcodeCall)]
// #[oracle(aztec_avm_call)]
// unconstrained fn call_opcode<let N: u32>(
// l2_gas_allocation: u32,
// da_gas_allocation: u32,
Expand Down Expand Up @@ -947,18 +947,18 @@ fn handle_getter_instruction(
};

let var_idx = match function {
"avmOpcodeAddress" => EnvironmentVariable::ADDRESS,
"avmOpcodeSender" => EnvironmentVariable::SENDER,
"avmOpcodeMinFeePerL2Gas" => EnvironmentVariable::MINFEEPERL2GAS,
"avmOpcodeMinFeePerDaGas" => EnvironmentVariable::MINFEEPERDAGAS,
"avmOpcodeTransactionFee" => EnvironmentVariable::TRANSACTIONFEE,
"avmOpcodeChainId" => EnvironmentVariable::CHAINID,
"avmOpcodeVersion" => EnvironmentVariable::VERSION,
"avmOpcodeBlockNumber" => EnvironmentVariable::BLOCKNUMBER,
"avmOpcodeTimestamp" => EnvironmentVariable::TIMESTAMP,
"avmOpcodeL2GasLeft" => EnvironmentVariable::L2GASLEFT,
"avmOpcodeDaGasLeft" => EnvironmentVariable::DAGASLEFT,
"avmOpcodeIsStaticCall" => EnvironmentVariable::ISSTATICCALL,
"aztec_avm_address" => EnvironmentVariable::ADDRESS,
"aztec_avm_sender" => EnvironmentVariable::SENDER,
"aztec_avm_minFeePerL2Gas" => EnvironmentVariable::MINFEEPERL2GAS,
"aztec_avm_minFeePerDaGas" => EnvironmentVariable::MINFEEPERDAGAS,
"aztec_avm_transactionFee" => EnvironmentVariable::TRANSACTIONFEE,
"aztec_avm_chainId" => EnvironmentVariable::CHAINID,
"aztec_avm_version" => EnvironmentVariable::VERSION,
"aztec_avm_blockNumber" => EnvironmentVariable::BLOCKNUMBER,
"aztec_avm_timestamp" => EnvironmentVariable::TIMESTAMP,
"aztec_avm_l2GasLeft" => EnvironmentVariable::L2GASLEFT,
"aztec_avm_daGasLeft" => EnvironmentVariable::DAGASLEFT,
"aztec_avm_isStaticCall" => EnvironmentVariable::ISSTATICCALL,
_ => panic!("Transpiler doesn't know how to process getter {:?}", function),
};

Expand Down Expand Up @@ -1348,7 +1348,7 @@ fn handle_debug_log(
) {
// We need to handle two flavors here:
//
// #[oracle(utilityLog)]
// #[oracle(aztec_utl_log)]
// unconstrained fn log_oracle<let M: u32, let N: u32>(
// log_level: u8,
// msg: str<M>,
Expand All @@ -1358,7 +1358,7 @@ fn handle_debug_log(
//
// and
//
//#[oracle(utilityLog)]
//#[oracle(aztec_utl_log)]
// unconstrained fn log_slice_oracle<let M: u32>(log_level: u8, msg: str<M>, args: [Field]) {}
//
// Luckily, these two flavors have both 4 arguments, since noir inserts a length field for slices before the slice.
Expand Down Expand Up @@ -1420,7 +1420,7 @@ fn handle_debug_log(
});
}

// #[oracle(avmOpcodeCalldataCopy)]
// #[oracle(aztec_avm_calldataCopy)]
// unconstrained fn calldata_copy_opcode<let N: u32>(cdoffset: Field) -> [Field; N] {}
fn handle_calldata_copy(
avm_instrs: &mut Vec<AvmInstruction>,
Expand Down Expand Up @@ -1463,7 +1463,7 @@ fn handle_calldata_copy(
});
}

// #[oracle(avmOpcodeReturndataSize)]
// #[oracle(aztec_avm_returndataSize)]
// unconstrained fn returndata_size_opcode() -> u32 {}
fn handle_returndata_size(
avm_instrs: &mut Vec<AvmInstruction>,
Expand All @@ -1488,7 +1488,7 @@ fn handle_returndata_size(
});
}

// #[oracle(avmOpcodeReturndataCopy)]
// #[oracle(aztec_avm_returndataCopy)]
// unconstrained fn returndata_copy_opcode(rdoffset: u32, copy_size: u32) -> [Field] {}
fn handle_returndata_copy(
avm_instrs: &mut Vec<AvmInstruction>,
Expand Down Expand Up @@ -1546,7 +1546,7 @@ fn handle_returndata_copy(
]);
}

// #[oracle(avmOpcodeReturn)]
// #[oracle(aztec_avm_return)]
// unconstrained fn return_opcode<let N: u32>(returndata: [Field; N]) {}
fn handle_return(
avm_instrs: &mut Vec<AvmInstruction>,
Expand All @@ -1565,7 +1565,7 @@ fn handle_return(
generate_return_instruction(avm_instrs, &return_data_offset, &return_data_size);
}

// #[oracle(avmOpcodeRevert)]
// #[oracle(aztec_avm_revert)]
// unconstrained fn revert_opcode(revertdata: [Field]) {}
fn handle_revert(
avm_instrs: &mut Vec<AvmInstruction>,
Expand Down Expand Up @@ -1640,9 +1640,9 @@ fn handle_get_contract_instance(
assert_eq!(destinations.len(), 1);

let member_idx = match function {
"avmOpcodeGetContractInstanceDeployer" => ContractInstanceMember::DEPLOYER,
"avmOpcodeGetContractInstanceClassId" => ContractInstanceMember::CLASS_ID,
"avmOpcodeGetContractInstanceInitializationHash" => ContractInstanceMember::INIT_HASH,
"aztec_avm_getContractInstanceDeployer" => ContractInstanceMember::DEPLOYER,
"aztec_avm_getContractInstanceClassId" => ContractInstanceMember::CLASS_ID,
"aztec_avm_getContractInstanceInitializationHash" => ContractInstanceMember::INIT_HASH,
_ => panic!("Transpiler doesn't know how to process function {:?}", function),
};

Expand Down Expand Up @@ -1767,7 +1767,7 @@ fn tag_from_bit_size(bit_size: BitSize) -> AvmTypeTag {
}
}

/// #[oracle(avmOpcodeSuccessCopy)]
/// #[oracle(aztec_avm_successCopy)]
/// unconstrained fn success_copy_opcode() -> bool {}
fn handle_success_copy(
avm_instrs: &mut Vec<AvmInstruction>,
Expand Down
24 changes: 12 additions & 12 deletions aztec-up/test/counter_contract.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,38 @@ set -euo pipefail
export LOG_LEVEL=silent

# Execute commands as per: https://docs.aztec.network/tutorials/codealong/contract_tutorials/counter_contract
aztec new counter_contract
aztec new counter

# Verify workspace structure
if [ ! -f counter_contract/Nargo.toml ]; then
if [ ! -f counter/Nargo.toml ]; then
echo "Failed to create workspace Nargo.toml."
exit 1
fi
if [ ! -f counter_contract/contract/Nargo.toml ] || [ ! -f counter_contract/contract/src/main.nr ]; then
if [ ! -f counter/counter_contract/Nargo.toml ] || [ ! -f counter/counter_contract/src/main.nr ]; then
echo "Failed to create contract crate."
exit 1
fi
if [ ! -f counter_contract/test/Nargo.toml ] || [ ! -f counter_contract/test/src/lib.nr ]; then
if [ ! -f counter/counter_test/Nargo.toml ] || [ ! -f counter/counter_test/src/lib.nr ]; then
echo "Failed to create test crate."
exit 1
fi

# Check counter_contract dir is owned by ubuntu.
if [ "$(stat -c %U counter_contract)" != "ubuntu" ]; then
echo "counter_contract dir is not owned by ubuntu."
# Check counter dir is owned by ubuntu.
if [ "$(stat -c %U counter)" != "ubuntu" ]; then
echo "counter dir is not owned by ubuntu."
exit 1
fi

# "Write" our contract over the scaffold.
cp -Rf ./aztec-packages/noir-projects/noir-contracts/contracts/test/counter_contract/* counter_contract/
cd counter_contract
sed -i 's|\.\./\.\./\.\./\.\./\.\./|/home/ubuntu/aztec-packages/noir-projects/|g' contract/Nargo.toml test/Nargo.toml
cp -Rf ./aztec-packages/noir-projects/noir-contracts/contracts/test/counter/* counter/
cd counter
sed -i 's|\.\./\.\./\.\./\.\./\.\./|/home/ubuntu/aztec-packages/noir-projects/|g' counter_contract/Nargo.toml counter_test/Nargo.toml

# Compile the contract.
aztec compile
# Codegen
aztec codegen -o contract/src/artifacts target
if [ ! -d contract/src/artifacts ]; then
aztec codegen -o counter_contract/src/artifacts target
if [ ! -d counter_contract/src/artifacts ]; then
echo "Failed to codegen TypeScript."
exit 1
fi
Expand Down
48 changes: 39 additions & 9 deletions aztec-up/test/default_scaffold.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,65 @@
set -euo pipefail

# Tests that the default scaffold generated by `aztec new` compiles and passes its tests without any modifications.
# This catches regressions in the template files produced by setup_workspace.sh (e.g. syntax errors, stale imports,
# or API changes in aztec-nr) that would otherwise go unnoticed until a user runs `aztec new` themselves.
# Also tests that a second contract can be added to the workspace with `aztec new`.

export LOG_LEVEL=silent

aztec new my_contract
aztec new my_workspace

# Verify workspace structure.
if [ ! -f my_contract/Nargo.toml ]; then
# Verify workspace structure with named crate directories.
if [ ! -f my_workspace/Nargo.toml ]; then
echo "Failed to create workspace Nargo.toml."
exit 1
fi
if [ ! -f my_contract/contract/Nargo.toml ] || [ ! -f my_contract/contract/src/main.nr ]; then
if [ ! -f my_workspace/my_workspace_contract/Nargo.toml ] || [ ! -f my_workspace/my_workspace_contract/src/main.nr ]; then
echo "Failed to create contract crate."
exit 1
fi
if [ ! -f my_contract/test/Nargo.toml ] || [ ! -f my_contract/test/src/lib.nr ]; then
if [ ! -f my_workspace/my_workspace_test/Nargo.toml ] || [ ! -f my_workspace/my_workspace_test/src/lib.nr ]; then
echo "Failed to create test crate."
exit 1
fi

cd my_contract
cd my_workspace

# This is unfortunate as it makes the test worse but in CI setting the aztec version is 0.0.1 which doesn't exist as
# a remote git tag, so we need to rewrite dependencies to use local aztec-nr.
sed -i 's|aztec = .*git.*AztecProtocol/aztec-nr.*|aztec = { path="/home/ubuntu/aztec-packages/noir-projects/aztec-nr/aztec" }|' contract/Nargo.toml test/Nargo.toml
sed -i 's|aztec = .*git.*AztecProtocol/aztec-nr.*|aztec = { path="/home/ubuntu/aztec-packages/noir-projects/aztec-nr/aztec" }|' \
my_workspace_contract/Nargo.toml my_workspace_test/Nargo.toml

# Compile the default scaffold contract.
aztec compile

# Run the default scaffold tests.
aztec test

# --- Test adding a second contract to the workspace ---
aztec new token

# Verify token crates were created.
if [ ! -f token_contract/Nargo.toml ] || [ ! -f token_contract/src/main.nr ]; then
echo "Failed to create token contract crate."
exit 1
fi
if [ ! -f token_test/Nargo.toml ] || [ ! -f token_test/src/lib.nr ]; then
echo "Failed to create token test crate."
exit 1
fi

# Verify workspace Nargo.toml contains all four members.
if ! grep -q '"my_workspace_contract"' Nargo.toml || \
! grep -q '"my_workspace_test"' Nargo.toml || \
! grep -q '"token_contract"' Nargo.toml || \
! grep -q '"token_test"' Nargo.toml; then
echo "Workspace Nargo.toml does not contain all expected members."
exit 1
fi

# Rewrite aztec deps for token crates too.
sed -i 's|aztec = .*git.*AztecProtocol/aztec-nr.*|aztec = { path="/home/ubuntu/aztec-packages/noir-projects/aztec-nr/aztec" }|' \
token_contract/Nargo.toml token_test/Nargo.toml

# Compile and test the full workspace (both contracts).
aztec compile
aztec test
4 changes: 2 additions & 2 deletions boxes/boxes/react/src/hooks/useContract.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ export function useContract() {
contractAddressSalt: salt,
});

const contract = await toast.promise(deploymentPromise, {
const { contract } = await toast.promise(deploymentPromise, {
pending: 'Deploying contract...',
success: {
render: ({ data }) => `Address: ${data.address}`,
render: ({ data }) => `Address: ${data.contract.address}`,
},
error: 'Error deploying contract',
});
Expand Down
4 changes: 2 additions & 2 deletions boxes/boxes/react/src/hooks/useNumber.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ export function useNumber({ contract }: { contract: Contract }) {

setWait(true);
const defaultAccountAddress = deployerEnv.getDefaultAccountAddress();
const viewTxReceipt = await contract!.methods
const { result } = await contract!.methods
.getNumber(defaultAccountAddress)
.simulate({ from: defaultAccountAddress });
toast(`Number is: ${viewTxReceipt.value}`);
toast(`Number is: ${result}`);
setWait(false);
};

Expand Down
2 changes: 1 addition & 1 deletion boxes/boxes/vanilla/app/embedded-wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ export class EmbeddedWallet extends EmbeddedWalletBase {
wait: { timeout: 120 },
};

const receipt = await deployMethod.send(deployOpts);
const { receipt } = await deployMethod.send(deployOpts);

logger.info('Account deployed', receipt);

Expand Down
Loading
Loading