diff --git a/k8s/local/aztec-sandbox-node/deployment.yaml b/k8s/local/aztec-sandbox-node/deployment.yaml index 604dfba9..317f53e5 100644 --- a/k8s/local/aztec-sandbox-node/deployment.yaml +++ b/k8s/local/aztec-sandbox-node/deployment.yaml @@ -17,7 +17,7 @@ spec: app: aztec-sandbox-node spec: containers: - - image: aztecprotocol/aztec:0.65.2 + - image: aztecprotocol/aztec:0.66.0 name: aztec-sandbox-node resources: limits: diff --git a/packages/backend-utils/package.json b/packages/backend-utils/package.json index e53e5ea9..59f44929 100644 --- a/packages/backend-utils/package.json +++ b/packages/backend-utils/package.json @@ -14,7 +14,7 @@ "lint-base": "yarn run g:lint" }, "dependencies": { - "@aztec/aztec.js": "0.65.2", + "@aztec/aztec.js": "0.66.0", "@chicmoz-pkg/types": "workspace:^" }, "devDependencies": { diff --git a/packages/backend-utils/src/parse-block.ts b/packages/backend-utils/src/parse-block.ts index 197c8237..f0b48189 100644 --- a/packages/backend-utils/src/parse-block.ts +++ b/packages/backend-utils/src/parse-block.ts @@ -5,6 +5,8 @@ const getTxEffectWithHashes = (txEffects: L2Block["body"]["txEffects"]) => { return txEffects.map((txEffect) => { return { ...txEffect, + unencryptedLogslength: txEffect.unencryptedLogsLength.toNumber(), + privateLogs: txEffect.privateLogs.map((log) => log.toFields()), hash: "0x" + txEffect.hash().toString("hex"), txHash: txEffect.txHash.toString(), }; diff --git a/packages/message-registry/package.json b/packages/message-registry/package.json index 5dac89fd..f71d6926 100644 --- a/packages/message-registry/package.json +++ b/packages/message-registry/package.json @@ -14,7 +14,7 @@ "lint-base": "yarn run g:lint" }, "dependencies": { - "@aztec/aztec.js": "0.65.2", + "@aztec/aztec.js": "0.66.0", "@chicmoz-pkg/types": "workspace:^" }, "devDependencies": { diff --git a/packages/types/src/aztec/l2Contract.ts b/packages/types/src/aztec/l2Contract.ts index 55942eca..d973e732 100644 --- a/packages/types/src/aztec/l2Contract.ts +++ b/packages/types/src/aztec/l2Contract.ts @@ -33,7 +33,7 @@ export const chicmozL2ContractClassRegisteredEventSchema = z.object({ version: z.number(), artifactHash: frSchema, privateFunctionsRoot: frSchema, - packedPublicBytecode: bufferSchema, + packedBytecode: bufferSchema, }); export type ChicmozL2ContractClassRegisteredEvent = z.infer< @@ -41,8 +41,7 @@ export type ChicmozL2ContractClassRegisteredEvent = z.infer< >; const functionSelectorSchema = z.object({ - type: z.enum(["FunctionSelector"]), - value: z.string(), + value: z.number(), }); export const chicmozL2PrivateFunctionBroadcastedEventSchema = z.object({ diff --git a/packages/types/src/aztec/l2TxEffect.ts b/packages/types/src/aztec/l2TxEffect.ts index 1f7d956e..be29bd43 100644 --- a/packages/types/src/aztec/l2TxEffect.ts +++ b/packages/types/src/aztec/l2TxEffect.ts @@ -2,21 +2,12 @@ import { z } from "zod"; import { hexStringSchema } from "../general.js"; import { aztecAddressSchema, bufferSchema, frNumberSchema, frSchema } from "./utils.js"; -export const noteEncryptedLogEntrySchema = z.object({ - data: bufferSchema, -}); - -export const encryptedLogEntrySchema = z.object({ - data: bufferSchema, - maskedContractAddress: frSchema, -}); - export const unencryptedLogEntrySchema = z.object({ data: bufferSchema, contractAddress: aztecAddressSchema, }); -const logsSchema = (logEntrySchema: typeof noteEncryptedLogEntrySchema | typeof encryptedLogEntrySchema | typeof unencryptedLogEntrySchema) => +const logsSchema = (logEntrySchema: typeof unencryptedLogEntrySchema) => z.object({ functionLogs: z.array( z.object({ @@ -72,16 +63,11 @@ export const chicmozL2TxEffectSchema = z.object({ publicDataWrites: z.array( z.object({ leafSlot: frSchema, value: frSchema }), ), - noteEncryptedLogsLength: frNumberSchema, - encryptedLogsLength: frNumberSchema, unencryptedLogsLength: frNumberSchema, - noteEncryptedLogs: logsSchema(noteEncryptedLogEntrySchema), - encryptedLogs: logsSchema(encryptedLogEntrySchema), + privateLogs: z.array(z.array(frSchema)), unencryptedLogs: logsSchema(unencryptedLogEntrySchema), }); -export type NoteEncryptedLogEntry = z.infer; -export type EncryptedLogEntry = z.infer; export type UnencryptedLogEntry = z.infer; export type ChicmozL2PendingTx = z.infer; diff --git a/packages/types/src/aztec/special.ts b/packages/types/src/aztec/special.ts index 8100607a..5a3296cd 100644 --- a/packages/types/src/aztec/special.ts +++ b/packages/types/src/aztec/special.ts @@ -6,11 +6,24 @@ import { } from "./l2Contract.js"; import { chicmozL2TxEffectSchema } from "./l2TxEffect.js"; +export const chicmozL2VerifiedContractAddressDataSchema = z.object({ + contractInstanceAddress: z.string(), + name: z.string(), + details: z.string(), + contact: z.string(), + uiUrl: z.string(), + repoUrl: z.string(), +}); + +export type ChicmozL2VerifiedContractAddressData = z.infer< + typeof chicmozL2VerifiedContractAddressDataSchema +>; + export const chicmozL2ContractInstanceDeluxeSchema = z.object({ ...chicmozL2ContractInstanceDeployedEventSchema.shape, ...chicmozL2ContractClassRegisteredEventSchema.shape, blockHeight: chicmozL2BlockSchema.shape.height.optional(), - aztecScoutVerified: z.boolean().optional(), + verifiedInfo: chicmozL2VerifiedContractAddressDataSchema.optional(), }); export type ChicmozL2ContractInstanceDeluxe = z.infer< diff --git a/services/aztec-listener/package.json b/services/aztec-listener/package.json index c70e1f3a..349f6577 100644 --- a/services/aztec-listener/package.json +++ b/services/aztec-listener/package.json @@ -4,8 +4,8 @@ "main": "index.js", "license": "Apache-2.0", "dependencies": { - "@aztec/aztec.js": "0.65.2", - "@aztec/circuits.js": "0.65.2", + "@aztec/aztec.js": "0.66.0", + "@aztec/circuits.js": "0.66.0", "@chicmoz-pkg/logger-server": "workspace:^", "@chicmoz-pkg/message-bus": "workspace:^", "@chicmoz-pkg/message-registry": "workspace:^", diff --git a/services/aztec-listener/src/aztec/txs_poller.ts b/services/aztec-listener/src/aztec/txs_poller.ts index 99bd6f9e..ade58186 100644 --- a/services/aztec-listener/src/aztec/txs_poller.ts +++ b/services/aztec-listener/src/aztec/txs_poller.ts @@ -2,6 +2,7 @@ import { Tx } from "@aztec/aztec.js"; import { TX_POLL_INTERVAL_MS } from "../constants.js"; import { getPendingTxs } from "./network-client.js"; import { onPendingTxs } from "../event-handler/index.js"; +import { logger } from "../logger.js"; let pollInterval: NodeJS.Timeout; @@ -18,13 +19,19 @@ export const stopPolling = () => { }; const internalOnPendingTxs = async (pendingTxs: Tx[]) => { - const newPendingTxs = pendingTxs.filter((tx) => !handledTxs.includes(tx.getTxHash().toString())); + const newPendingTxs = pendingTxs.filter( + (tx) => !handledTxs.includes(tx.getTxHash().toString()) + ); if (newPendingTxs.length === 0) return; await onPendingTxs(pendingTxs); handledTxs = pendingTxs.map((tx) => tx.getTxHash().toString()); }; const fetchAndPublishPendingTxs = async () => { - const txs = await getPendingTxs(); - await internalOnPendingTxs(txs); + try { + const txs = await getPendingTxs(); + await internalOnPendingTxs(txs); + } catch (error) { + logger.warn("Error fetching pending txs", error); + } }; diff --git a/services/ethereum-listener/package.json b/services/ethereum-listener/package.json index e1c2f964..4a4c04c3 100644 --- a/services/ethereum-listener/package.json +++ b/services/ethereum-listener/package.json @@ -9,8 +9,8 @@ ], "license": "Apache-2.0", "dependencies": { - "@aztec/aztec.js": "0.65.2", - "@aztec/l1-artifacts": "0.65.2", + "@aztec/aztec.js": "0.66.0", + "@aztec/l1-artifacts": "0.66.0", "@chicmoz-pkg/logger-server": "workspace:^", "@chicmoz-pkg/message-bus": "workspace:^", "@chicmoz-pkg/message-registry": "workspace:^", diff --git a/services/event-cannon/README.md b/services/event-cannon/README.md index c95a0fdb..935dbef0 100644 --- a/services/event-cannon/README.md +++ b/services/event-cannon/README.md @@ -1,6 +1,6 @@ # Compile contracts (if changed, or updated version) -aztec-up 0.65.2 +aztec-up 0.66.0 cd contract-projects/YOUR_PROJECT aztec-nargo compile diff --git a/services/event-cannon/package.json b/services/event-cannon/package.json index c34aca54..ed53d27c 100644 --- a/services/event-cannon/package.json +++ b/services/event-cannon/package.json @@ -9,10 +9,10 @@ ], "license": "Apache-2.0", "dependencies": { - "@aztec/accounts": "0.65.2", - "@aztec/aztec.js": "0.65.2", - "@aztec/l1-artifacts": "0.65.2", - "@aztec/noir-contracts.js": "0.65.2", + "@aztec/accounts": "0.66.0", + "@aztec/aztec.js": "0.66.0", + "@aztec/l1-artifacts": "0.66.0", + "@aztec/noir-contracts.js": "0.66.0", "@chicmoz-pkg/logger-server": "workspace:^" }, "devDependencies": { diff --git a/services/event-cannon/src/artifacts/SimpleLogging.ts b/services/event-cannon/src/artifacts/SimpleLogging.ts index 4cf0a3da..732286e4 100644 --- a/services/event-cannon/src/artifacts/SimpleLogging.ts +++ b/services/event-cannon/src/artifacts/SimpleLogging.ts @@ -131,8 +131,8 @@ export class SimpleLoggingContract extends ContractBase { /** get_counter_value(counter_id: field) */ get_counter_value: ((counter_id: FieldLike) => ContractFunctionInteraction) & Pick; - /** increace_counter_private(counter_id: field) */ - increace_counter_private: ((counter_id: FieldLike) => ContractFunctionInteraction) & Pick; + /** increase_counter_private(counter_id: field) */ + increase_counter_private: ((counter_id: FieldLike) => ContractFunctionInteraction) & Pick; /** increase_counter_public(counter_id: field) */ increase_counter_public: ((counter_id: FieldLike) => ContractFunctionInteraction) & Pick; diff --git a/services/event-cannon/src/cannon/index.ts b/services/event-cannon/src/cannon/index.ts index 3bde38ac..a273553a 100644 --- a/services/event-cannon/src/cannon/index.ts +++ b/services/event-cannon/src/cannon/index.ts @@ -1,12 +1,6 @@ import { logger } from "../logger.js"; import { setup } from "./pxe.js"; -import { run as deployAndInteractFunctionsVote } from "./scenarios/deploy-and-interact-vote-contract.js"; -import { run as deploySimpleContract } from "./scenarios/simple-deploy-contract.js"; -import { run as deploySimpleDefaultAccount } from "./scenarios/deploy-simple-default-account.js"; -import { run as deployAndInteractTokenContract } from "./scenarios/deploy-and-interact-token-contract.js"; -import { run as deploySimpleLog } from "./scenarios/deploy-and-run-simple-log.js"; -import { run as l1L2PublicMessaging } from "./scenarios/l1-l2-public-messaging.js"; -import { run as l1L2PrivateMessaging } from "./scenarios/l1-l2-private-messaging.js"; +import * as scenarios from "./scenarios/index.js"; export async function init() { logger.info("Initializing Cannon..."); @@ -22,14 +16,14 @@ export async function init() { export const start = async () => { logger.info("Starting Cannon..."); - const scenarios = [ - deploySimpleDefaultAccount, - deployAndInteractTokenContract, - deployAndInteractFunctionsVote, - deploySimpleContract, - deploySimpleLog, - l1L2PublicMessaging, - l1L2PrivateMessaging, + const scenariosToRun = [ + scenarios.deploySimpleDefaultAccount, + scenarios.deployAndInteractTokenContract, + scenarios.deployAndInteractFunctionsVote, + scenarios.deploySimpleContract, + scenarios.deploySimpleLog, + scenarios.l1L2PublicMessaging, + scenarios.l1L2PrivateMessaging, ] as (() => Promise)[]; - for (const fn of scenarios) await fn(); + for (const fn of scenariosToRun) await fn(); }; diff --git a/services/event-cannon/src/cannon/scenarios/deploy-and-interact-token-contract.ts b/services/event-cannon/src/cannon/scenarios/deploy-and-interact-token-contract.ts index b2e2ee2f..93120ed2 100644 --- a/services/event-cannon/src/cannon/scenarios/deploy-and-interact-token-contract.ts +++ b/services/event-cannon/src/cannon/scenarios/deploy-and-interact-token-contract.ts @@ -1,6 +1,10 @@ -import { Contract, DeploySentTx, waitForPXE } from "@aztec/aztec.js"; +import { + Contract, + DeploySentTx, + waitForPXE, +} from "@aztec/aztec.js"; import { logger } from "../../logger.js"; -import { getPxe, getWallets } from "../pxe.js"; +import { getAztecNodeClient, getPxe, getWallets } from "../pxe.js"; import { deployContract, logAndWaitForTx } from "./utils/index.js"; import { TokenContract } from "@aztec/noir-contracts.js"; @@ -24,6 +28,7 @@ export async function run() { 9 ).send(); }, + node: getAztecNodeClient(), }); await Promise.all([ diff --git a/services/event-cannon/src/cannon/scenarios/deploy-and-interact-vote-contract.ts b/services/event-cannon/src/cannon/scenarios/deploy-and-interact-vote-contract.ts index 76026c53..699d9d39 100644 --- a/services/event-cannon/src/cannon/scenarios/deploy-and-interact-vote-contract.ts +++ b/services/event-cannon/src/cannon/scenarios/deploy-and-interact-vote-contract.ts @@ -1,6 +1,11 @@ -import { Contract, DeploySentTx, Fr, waitForPXE } from "@aztec/aztec.js"; +import { + Contract, + DeploySentTx, + Fr, + waitForPXE, +} from "@aztec/aztec.js"; import { logger } from "../../logger.js"; -import { getPxe, getWallets } from "../pxe.js"; +import { getAztecNodeClient, getPxe, getWallets } from "../pxe.js"; import { deployContract, logAndWaitForTx } from "./utils/index.js"; import { EasyPrivateVotingContract, @@ -21,6 +26,7 @@ export async function run() { deployFn: (): DeploySentTx => EasyPrivateVotingContract.deploy(deployerWallet, votingAdmin).send(), broadcastWithWallet: deployerWallet, // NOTE: comment this out to not broadcast + node: getAztecNodeClient(), }); const votingContractAlice = await Contract.at( diff --git a/services/event-cannon/src/cannon/scenarios/deploy-and-run-simple-log.ts b/services/event-cannon/src/cannon/scenarios/deploy-and-run-simple-log.ts index f99f01f2..49ec0b67 100644 --- a/services/event-cannon/src/cannon/scenarios/deploy-and-run-simple-log.ts +++ b/services/event-cannon/src/cannon/scenarios/deploy-and-run-simple-log.ts @@ -1,7 +1,7 @@ import { DeploySentTx, waitForPXE } from "@aztec/aztec.js"; import { SimpleLoggingContract } from "../../artifacts/SimpleLogging.js"; import { logger } from "../../logger.js"; -import { getPxe, getWallets } from "../pxe.js"; +import { getAztecNodeClient, getPxe, getWallets } from "../pxe.js"; import { deployContract, logAndWaitForTx } from "./utils/index.js"; export async function run() { @@ -15,7 +15,8 @@ export async function run() { const simpleLoggingContractDeployer = await deployContract({ contractLoggingName: "Voting Contract", deployFn: (): DeploySentTx => - SimpleLoggingContract.deploy(deployerWallet).send() + SimpleLoggingContract.deploy(deployerWallet).send(), + node: getAztecNodeClient(), }); await logAndWaitForTx( simpleLoggingContractDeployer.methods.increase_counter_public(1).send(), diff --git a/services/event-cannon/src/cannon/scenarios/index.ts b/services/event-cannon/src/cannon/scenarios/index.ts new file mode 100644 index 00000000..e0c51325 --- /dev/null +++ b/services/event-cannon/src/cannon/scenarios/index.ts @@ -0,0 +1,7 @@ +export { run as deployAndInteractFunctionsVote } from "./deploy-and-interact-vote-contract.js"; +export { run as deploySimpleContract } from "./simple-deploy-contract.js"; +export { run as deploySimpleDefaultAccount } from "./deploy-simple-default-account.js"; +export { run as deployAndInteractTokenContract } from "./deploy-and-interact-token-contract.js"; +export { run as deploySimpleLog } from "./deploy-and-run-simple-log.js"; +export { run as l1L2PublicMessaging } from "./l1-l2-public-messaging.js"; +export { run as l1L2PrivateMessaging } from "./l1-l2-private-messaging.js"; diff --git a/services/event-cannon/src/cannon/scenarios/l1-l2-private-messaging.ts b/services/event-cannon/src/cannon/scenarios/l1-l2-private-messaging.ts index 718ee04c..7b229373 100644 --- a/services/event-cannon/src/cannon/scenarios/l1-l2-private-messaging.ts +++ b/services/event-cannon/src/cannon/scenarios/l1-l2-private-messaging.ts @@ -24,7 +24,9 @@ import { } from "viem"; import { mnemonicToAccount } from "viem/accounts"; import { foundry } from "viem/chains"; -import { ETHEREUM_RPC_URL } from "../../environment.js"; +import { + ETHEREUM_RPC_URL, +} from "../../environment.js"; import { RollupAbi, TestERC20Abi, @@ -100,6 +102,7 @@ export const run = async () => { 18 ).send(); }, + node: getAztecNodeClient(), }); const bridge = await deployContract({ @@ -111,6 +114,7 @@ export const run = async () => { tokenPortalAddress ).send(); }, + node: getAztecNodeClient(), }); if ((await token.methods.get_admin().simulate()) !== owner.toBigInt()) diff --git a/services/event-cannon/src/cannon/scenarios/l1-l2-public-messaging.ts b/services/event-cannon/src/cannon/scenarios/l1-l2-public-messaging.ts index f8b616ef..c604e523 100644 --- a/services/event-cannon/src/cannon/scenarios/l1-l2-public-messaging.ts +++ b/services/event-cannon/src/cannon/scenarios/l1-l2-public-messaging.ts @@ -24,7 +24,9 @@ import { } from "viem"; import { mnemonicToAccount } from "viem/accounts"; import { foundry } from "viem/chains"; -import { ETHEREUM_RPC_URL } from "../../environment.js"; +import { + ETHEREUM_RPC_URL, +} from "../../environment.js"; import { RollupAbi, TestERC20Abi, @@ -103,6 +105,7 @@ export const run = async () => { 18 ).send(); }, + node: getAztecNodeClient(), }); const bridge = await deployContract({ @@ -114,6 +117,7 @@ export const run = async () => { tokenPortalAddress ).send(); }, + node: getAztecNodeClient(), }); if ((await token.methods.get_admin().simulate()) !== owner.toBigInt()) diff --git a/services/event-cannon/src/cannon/scenarios/simple-deploy-contract.ts b/services/event-cannon/src/cannon/scenarios/simple-deploy-contract.ts index 0b795f74..4e57dd0e 100644 --- a/services/event-cannon/src/cannon/scenarios/simple-deploy-contract.ts +++ b/services/event-cannon/src/cannon/scenarios/simple-deploy-contract.ts @@ -1,13 +1,8 @@ import { DeploySentTx, waitForPXE } from "@aztec/aztec.js"; +import { EasyPrivateVotingContract } from "@aztec/noir-contracts.js"; import { logger } from "../../logger.js"; import { getAztecNodeClient, getPxe, getWallets } from "../pxe.js"; import { deployContract } from "./utils/index.js"; -import { EasyPrivateVotingContract } from "@aztec/noir-contracts.js"; -import { - ContractClassRegisteredEvent, - ContractInstanceDeployedEvent, -} from "@aztec/circuits.js"; -import { ProtocolContractAddress } from "@aztec/protocol-contracts"; export async function run() { logger.info("===== SIMPLE DEPLOY CONTRACT ====="); @@ -26,33 +21,6 @@ export async function run() { await deployContract({ contractLoggingName: "Voting Contract", deployFn: (): DeploySentTx => sentTx, + node: getAztecNodeClient(), }); - - const blockNumber = (await sentTx.getReceipt()).blockNumber; - const node = getAztecNodeClient(); - if (blockNumber && blockNumber > 0) { - const b = await node.getBlock(blockNumber); - if (b) { - const encryptedBlockLogs = b.body.txEffects.flatMap((txEffect) => - txEffect.encryptedLogs.unrollLogs() - ); - const contractInstances = - ContractInstanceDeployedEvent.fromLogs(encryptedBlockLogs); - - const contractClassLogs = b.body.txEffects.flatMap((txEffect) => - txEffect.contractClassLogs.unrollLogs() - ); - const contractClasses = ContractClassRegisteredEvent.fromLogs( - contractClassLogs, - ProtocolContractAddress.ContractClassRegisterer - ); - - logger.info( - JSON.stringify({ - contractClasses, - contractInstances, - }) - ); - } - } } diff --git a/services/event-cannon/src/cannon/scenarios/utils/index.ts b/services/event-cannon/src/cannon/scenarios/utils/index.ts index ba33c5c6..f75b5c3a 100644 --- a/services/event-cannon/src/cannon/scenarios/utils/index.ts +++ b/services/event-cannon/src/cannon/scenarios/utils/index.ts @@ -1,4 +1,9 @@ import { + SchnorrAccountContractArtifact, + getSchnorrAccount, +} from "@aztec/accounts/schnorr"; +import { + AztecNode, BatchCall, Contract, DeploySentTx, @@ -8,19 +13,16 @@ import { SentTx, Wallet, } from "@aztec/aztec.js"; -import { FunctionType } from "@aztec/foundation/abi"; -import { deriveSigningKey } from "@aztec/circuits.js"; -import { logger } from "../../../logger.js"; import { broadcastPrivateFunction, broadcastUnconstrainedFunction, deployInstance, registerContractClass, } from "@aztec/aztec.js/deployment"; -import { - SchnorrAccountContractArtifact, - getSchnorrAccount, -} from "@aztec/accounts/schnorr"; +import { deriveSigningKey } from "@aztec/circuits.js"; +import { FunctionType } from "@aztec/foundation/abi"; +import { ContractClassRegisteredEvent } from "@aztec/protocol-contracts"; +import { logger } from "../../../logger.js"; export const truncateHashString = (value: string) => { const startHash = value.substring(0, 6); @@ -82,25 +84,49 @@ export const getNewAccount = async (pxe: PXE) => { }); }; +const getNewContractClassId = async (node: AztecNode, blockNumber?: number) => { + if (!blockNumber) return undefined; + const block = await node.getBlock(blockNumber); + if (!block) throw new Error(`Block ${blockNumber} not found`); + const contractClassLogs = block.body.txEffects + .flatMap((txEffect) => (txEffect ? [txEffect.contractClassLogs] : [])) + .flatMap((txLog) => txLog.unrollLogs()); + + const contractClasses = contractClassLogs + .filter((log) => + ContractClassRegisteredEvent.isContractClassRegisteredEvent(log.data) + ) + .map((log) => ContractClassRegisteredEvent.fromLog(log.data)) + .map((e) => e.toContractClassPublic()); + + return contractClasses[0]?.id.toString(); +}; + export const deployContract = async ({ contractLoggingName, deployFn, broadcastWithWallet, + node, }: { contractLoggingName: string; deployFn: () => DeploySentTx; broadcastWithWallet?: Wallet; + node: AztecNode; }): Promise => { logger.info(`DEPLOYING ${contractLoggingName}`); const contractTx = deployFn(); const hash = (await contractTx.getTxHash()).toString(); - logger.info( - `📫 ${contractLoggingName} ${truncateHashString(hash)} (Deploying contract)` - ); + logger.info(`📫 ${contractLoggingName} txHash: ${hash} (Deploying contract)`); const deployedContract = await contractTx.deployed(); const receipt = await contractTx.wait(); const addressString = deployedContract.address.toString(); - logger.info(`⛏ ${contractLoggingName} deployed at: ${addressString} block: ${receipt.blockNumber}`); + const newClassId = await getNewContractClassId(node, receipt.blockNumber); + const classIdString = newClassId + ? `(🍏 also, a new contract class was added: ${newClassId})` + : `(🍎 attached classId: ${deployedContract.instance.contractClassId.toString()})`; + logger.info( + `⛏ ${contractLoggingName} instance deployed at: ${addressString} block: ${receipt.blockNumber} ${classIdString}` + ); if (broadcastWithWallet) { await broadcastFunctions({ wallet: broadcastWithWallet, diff --git a/services/event-cannon/src/contract-projects/SimpleLogging/Nargo.toml b/services/event-cannon/src/contract-projects/SimpleLogging/Nargo.toml index bfb8e2f4..cd8018f4 100644 --- a/services/event-cannon/src/contract-projects/SimpleLogging/Nargo.toml +++ b/services/event-cannon/src/contract-projects/SimpleLogging/Nargo.toml @@ -5,4 +5,4 @@ authors = [ "" ] compiler_version = ">=0.25.0" [dependencies] -aztec = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "aztec-packages-v0.65.0", directory = "noir-projects/aztec-nr/aztec" } +aztec = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "aztec-packages-v0.66.0", directory = "noir-projects/aztec-nr/aztec" } diff --git a/services/event-cannon/src/contract-projects/SimpleLogging/src/main.nr b/services/event-cannon/src/contract-projects/SimpleLogging/src/main.nr index 2955fcb4..1b458a19 100644 --- a/services/event-cannon/src/contract-projects/SimpleLogging/src/main.nr +++ b/services/event-cannon/src/contract-projects/SimpleLogging/src/main.nr @@ -18,7 +18,7 @@ contract SimpleLogging { } #[private] - fn increace_counter_private(counter_id: Field) { + fn increase_counter_private(counter_id: Field) { //let msg_sender_npk_m_hash = get_public_keys(context.msg_sender()).npk_m.hash(); //let secret = context.request_nsk_app(msg_sender_npk_m_hash); // get secret key of caller of function //let nullifier = std::hash::pedersen_hash([context.msg_sender().to_field(), secret]); // derive nullifier from sender and secret diff --git a/services/event-cannon/src/contract-projects/SimpleLogging/target/simple_logging-SimpleLogging.json b/services/event-cannon/src/contract-projects/SimpleLogging/target/simple_logging-SimpleLogging.json index 9a25d51f..fcb18b65 100644 --- a/services/event-cannon/src/contract-projects/SimpleLogging/target/simple_logging-SimpleLogging.json +++ b/services/event-cannon/src/contract-projects/SimpleLogging/target/simple_logging-SimpleLogging.json @@ -1,14 +1,115 @@ { "transpiled": true, - "noir_version": "0.38.0+c807678263164209f62fa5c9bf19f468cace1f98-x8664", + "noir_version": "1.0.0-beta.0+a46035ba69b0a659897fe25271c346e005925a6c-x8664", "name": "SimpleLogging", "functions": [ { - "name": "increace_counter_private", - "is_unconstrained": false, - "custom_attributes": ["private"], + "name": "constructor", + "is_unconstrained": true, + "custom_attributes": ["public", "initializer"], + "abi": { + "error_types": { + "16761564377371454734": { + "error_kind": "string", + "string": "Array index out of bounds" + }, + "17618083556256589634": { + "error_kind": "string", + "string": "Initialization hash does not match" + }, + "17843811134343075018": { + "error_kind": "string", + "string": "Stack too deep" + }, + "2233873454491509486": { + "error_kind": "string", + "string": "Initializer address is not the contract deployer" + }, + "5019202896831570965": { + "error_kind": "string", + "string": "attempt to add with overflow" + } + }, + "parameters": [], + "return_type": null + }, + "bytecode": "JgACBAEnAAABBIBDJgAABAMmAgEEACYCAgQAHxgAAgABgEMkAAAAOicCAAEEgEMmAgIEADoNAAEAAiQAAANKHgIAAwA1OAADAAQABQAmAgYBASYCBwAAJgIIAQAjAgAFAAAAdiIAAABpLAwIASwMBwIiAAAAgywMBgEsDAQCIgAAAIMjAgABAAAAlCYCCQQAOwkBCTU4AAMAAQAJAiMCAAkAAAC3IgAAAKosDAgELAwHBSIAAADELAwGBCwMAQUiAAAAxCMCAAQAAADVJgIBBAA7CQEBJgIBBAAmAgMEASwIAQQmAgkEAgAQAQkBJgMEBAEAKAQCCR88AAEAAwAJLA0ECQAoCQIJLA4JBAAoB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P22nqNaOfBN05JuwI9+Em/JNlC7q0GQnWn3t3wGU1NpRu4YSp6amw5ejMXzDfjCBH26C3MebKODEyYdkgtjjZb1y59Lg9fUJ2EPLBfXnmo3So38zymqGkAMYSzvAtzdezfRSk+6jCka/vU1roE8F6Ked2JE+N2y0cqn2VbCT+iyxi4m8vxBy7/tQ0PThJkq8JcKYKHAJSuw+Y9cO3Dgoei1bKHABCqSjmVFzt7I5o0elzlhkyEf/PD6aLMCEfObN1XDp2OFqXBrzu70yO2s51LzX1i5VlIb3GX3KvB3JgCSWMqOVAZEAlNlfp326wU0TTEBBAMqs/5wah2P8dUIvs5BiQCQAZUJ7BjQ/3sCmKgfw70GZYJMBSSwFEIBISUC4HqRV5sBADhUkqMyQ4lAkQRmRLSPSZUV1aEW2nKiVMwM/c3tpQoEIRRJUZuwzqMw4tpcVibVhivISVGYhw6FAhCIJKrNxg0NJaiMOFRFKZEtrEQpEKEnN68wUbsElFPopKkhQ1klQTotQKEFlXufkUF6CQpGtzObKxUgjxlZKhHIiVBCgzPwX6D6lczyoCWb+SzxKF74RmimG1mPmv1RiMH49JjPXKZPuqVUepiiUoDKvznIokKC8yJYX2QoiW0Fki0S2SNJeVikRCkQokqAyr/twKC9BGS1C4WofY+dfiqCUuiA7xczvaVjGzM88DAbXY1CgZ/7SzkVflrl2YRnjBXbmD8hnMOt9syWBHVpvx82niQjHPkqephhcj9ECO/MR5jJmfjXLYAR2rMDO/Dr2qn1mMIJYwLmwHgMCO6gFGFyP8UaAWe8PMqdOLmPm52QGsz6OBKUEGCfArO87oI0As74fgBHUmxXUmyDOh7Xj9Ff89O/t8+H27vjwEhGnf/54vH89PD2eP77+9338z93z4Xg8fLv5/vx0//Dlx/PDzfHp/vS/nTr/+ByDjb11/sTl9FF7u48ro9PH0yCNIcLegopWo+X/AQ==", + "brillig_names": ["constructor"] + }, + { + "name": "public_dispatch", + "is_unconstrained": true, + "custom_attributes": ["public"], + "abi": { + "error_types": { + "10176877060487216746": { + "error_kind": "string", + "string": "Function add_to_counter_public can only be called internally" + }, + "13699457482007836410": { + "error_kind": "string", + "string": "Not initialized" + }, + "16541607464495309456": { + "error_kind": "fmtstring", + "item_types": [], + "length": 16 + }, + "16761564377371454734": { + "error_kind": "string", + "string": "Array index out of bounds" + }, + "17618083556256589634": { + "error_kind": "string", + "string": "Initialization hash does not match" + }, + "17843811134343075018": { + "error_kind": "string", + "string": "Stack too deep" + }, + "206160798890201757": { + "error_kind": "string", + "string": "Storage slot 0 not allowed. Storage slots must start from 1." + }, + "2233873454491509486": { + "error_kind": "string", + "string": "Initializer address is not the contract deployer" + }, + "5019202896831570965": { + "error_kind": "string", + "string": "attempt to add with overflow" + } + }, + "parameters": [ + { + "name": "selector", + "type": { + "kind": "field" + }, + "visibility": "private" + } + ], + "return_type": null + }, + "bytecode": "JgACBAEnAAABBIBEJgAABAMmAgIEASYCAwQAHxgAAwACgEMtCIBDAAEkAAAAQCcCAAEEgEQmAgIEADoNAAEAAiQAAAfWKAIAAgAX8SiICjgBAgMmAgQEACYCBgQDADgEBgUsCAECABABBQEmAwIEAQAoAgIFLA4EBQAoBQIFLA4EBSYCBQQDADgCBQQsDQIEACgEAgQsDgQCLA0CBAAoBAIELA4EAiYCBAQAIwIAAwAAALgiAAAA+iYCAwQFLAgABQAQAAMAJAAAB/8sBAAALA0CAwAoAwIDLA4DAgAoAgIGLA0GBSYCBwQCADgGBwM6DQADAAUiAAAA+igCAAMAkjkk1go4AQMFJgIDAQAmAgYABiYCBwQBJgIIAAAjAgAFAAABKSIAAALTLAgBBSYCCQQCABABCQEmAwUEAQAoBQIJHzwABwAHAAksDQUJACgJAgksDgkFLA0FCQAoCQIJLA4JBSwNBQkAKAkCCSwOCQUsCAEJAAABAgEsDgUJLAgBBQAAAQIBLA4EBSYCCwQMLAgADCwMCQ0sDAUOLAwGDwAQAAsAJAAACoAsBAAALAwNCiwIAQUAAAECASwOAwUsCAEJAAABAgEsDggJLAgBCwAAAQIBJgIMACYsDgwLJgIMBA0sCAANLAwFDiwMCQ8sDAsQABAADAAkAAAK2ywEAAAeAgAMAR4CAA0ACjgMDQ4jAgAOAAACHCQAAAsFJgIMAAEmAg0AGSYCEgQTLAgAEywMBRQsDAkVLAwLFiwMDBcsDA0YLAwKGQAQABIAJAAACxcsBAAALAwUDiwMFQ8sDBYQLAwXES4MABEAEgA4EgwRJgIWBBcsCAAXLAwFGCwMCRksDAsaLAwMGywMDRwsDAodABAAFgAkAAALFywEAAAsDBgSLAwZEywMGhQsDBsVLwwAEQAVACgCAgosDQoJJgILBAIAOAoLBToNAAUACSIAAALTKAIABQCv3CA7CjgBBQkmAgECcyYCBQJlJgIKAmwmAgsCYyYCDAJyJgINAm4mAg4CICYCDwJ0JgIQAm8jAgAJAAADGyIAAAYdLAgBESYCEgQCABABEgEmAxEEAQAoEQISHzwABwAHABIsDRESACgSAhIsDhIRLA0REgAoEgISLA4SESwNERIAKBICEiwOEhEsCAESAAABAgEsDhESLAgBEQAAAQIBLA4EESYCFAQVLAgAFSwMEhYsDBEXLAwGGAAQABQAJAAACoAsBAAALAwWEywIAQYAAAECASwOAwYsCAERAAABAgEsDggRLAgBEgAAAQIBJgIUAAssDhQSJgIUBBUsCAAVLAwGFiwMERcsDBIYABAAFAAkAAAK2ywEAAAmAgYCYiYCEQJpJgISAnUmAhQCZCYCFQJDJgIWAnAmAhcCYSwIARgmAhkEGQAQARkBJgMYBAEAKBgCGSwMGRosDhUaACgaAhosDhAaACgaAhosDhIaACgaAhosDg0aACgaAhosDg8aACgaAhosDgUaACgaAhosDgwaACgaAhosDg4aACgaAhosDhEaACgaAhosDg0aACgaAhosDgsaACgaAhosDgwaACgaAhosDgUaACgaAhosDhcaACgaAhosDgEaACgaAhosDgUaACgaAhosDhQaACgaAhosDg4aACgaAhosDhYaACgaAhosDhIaACgaAhosDgYaACgaAhosDgoaACgaAhosDhEaACgaAhosDgsaLA0YBgAoBgIGLA4GGCwIAQYmAhEEGQAQAREBJgMGBAEAKAYCESYCEgQYADgS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MuoBZUik2o+pwz8ukqHcEVamsz7DJqY9MqhzmATX9dMyRuQW0cJtJQ2ISqT35w2cKLU3e8Qm2cGdFQTbo2kvwvo7YuENJQpQW1caODgtp4Y1pDUQtqo31pqCZducmu3ORDbNKFTaW8EQGmkdqCElmjuAW1EQE0FLagNtpyWm5hiymVNUpaUBv36msobkDJxpkZDYVNqBZvSMxNqCZdkJpQTZ5PTZ7f6M2naeeColWrlI1oo6GoBbWxrKShSgtq4wVkDSUtKG7StZFifnm8IRv52hqKWlAbmcQXUXnjCJpyZfwE27iyn5dOhcpa2dZDBQqqSdfWpfaXUVvX1CuoeoFxScv8JsAKtXFJi4bCJpS0oDZCgIbiFhQ1eYOaPM9NurjJ89zk+dLk+dLkeWnyhjR5Q1q8sZVprqHqIVtOHbOkNWpj+UBDNemCFl1QX7ziJWIzhhWmvkAkeVYktNZTf5hBwYgdU59qKJiNlIolvz1OzXWF2rpwVEFRC2oreVJBNemSJl3SoiuF2IRq0hWhCdWkC5rs2koEUVDSgtq6pk9BtbSUVF+4vhhjUn2aIcuTF5LWmPrAX8EUO6be8hVMgz31pxgvxrJU7HE2SYMeKWbMNLRtwDToiQ166ml1QnMdFZYVpn6KR8E06KlP7y9j6pN7BdOgBxv01J84PiufGsY+FsiUGzANepjtmPpkXsE0tAWxxwMMoQFDdkyMDZgGPdBgD+QGjL18MNnrwcYT8wqmwW8N43y0ttPv06//vPvy8O7948evE+LpP//69OHbw+dPLz+//ffP+X/ef3l4fHz44+2fXz5/+PjbX18+vn38/OHp/+7Cyx//Ion3HGHi8tQJEPM9FZ5+/ZOokGO5n6Y8Tz+fTCuZ70uWicPE438=", + "brillig_names": ["public_dispatch"] + }, + { + "name": "increase_counter_public", + "is_unconstrained": true, + "custom_attributes": ["public"], "abi": { "error_types": { + "13699457482007836410": { + "error_kind": "string", + "string": "Not initialized" + }, + "16761564377371454734": { + "error_kind": "string", + "string": "Array index out of bounds" + }, "17843811134343075018": { "error_kind": "string", "string": "Stack too deep" @@ -20,194 +121,419 @@ }, "parameters": [ { - "name": "inputs", + "name": "counter_id", + "type": { + "kind": "field" + }, + "visibility": "private" + } + ], + "return_type": null + }, + "bytecode": "JgACBAEnAAABBIBEJgAABAMmAgIEASYCAwQAHxgAAwACgEMtCIBDAAEkAAAAQCcCAAEEgEQmAgIEADoNAAEAAiQAAANzLAgBAwAAAQIBJgIEAQAsDgQDLAgBAwAAAQIBJgIEAAAsDgQDLAgBAwAAAQIBJgIFAAIsDgUDHgIAAwAeAgAFADI4AAMABQAGJgIDAQEjAgAGAAAAnyQAAAOcJgIDAmwmAgUCZCYCBgJjJgIHAnImAggCbiYCCQJDJgIKAmImAgsCcyYCDAJpJgINAmUmAg4CdSYCDwJwJgIQAmEmAhECICYCEgJ0JgITAm8sCAEUJgIVBBkAEAEVASYDFAQBACgUAhUsDBUWLA4JFgAoFgIWLA4TFgAoFgIWLA4OFgAoFgIWLA4IFgAoFgIWLA4SFgAoFgIWLA4NFgAoFgIWLA4HFgAoFgIWLA4RFgAoFgIWLA4MFgAoFgIWLA4IFgAoFgIWLA4GFgAoFgIWLA4HFgAoFgIWLA4NFgAoFgIWLA4QFgAoFgIWLA4LFgAoFgIWLA4NFgAoFgIWLA4FFgAoFgIWLA4RFgAoFgIWLA4PFgAoFgIWLA4OFgAoFgIWLA4KFgAoFgIWLA4DFgAoFgIWLA4MFgAoFgIWLA4GFiwNFAMAKAMCAywOAxQsCAEDJgIFBBkAEAEFASYDAwQBACgDAgUmAgYEGAA4BgUGLAwFBww4BwYIFgwICCMCAAgAAAIwLA4EBwAoBwIHIgAAAhEsCAEEAAABAgEsDgMEJgIDBAAmAgUEASYCBgQYLAwDAiIAAAJVDDgCBgEjAgABAAAC5CIAAAJnLA0EASYCBAQYBigEAgImAgcEAwA4BAcFLAgBAwAQAQUBJgMDBAEAKAMCBSwOBAUAKAUCBSwOBAUmAgcEAwA4AwcFACgBAgctBAAHgAMtBAAFgAQtBAAEgAUkAAADrgAoAwIFLA0FBCYCBwQCAD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QRI7MRI7MRJyS4CUkjRYKrSBplJLgZSSNkm8PINqceLABQQdKoAMGVQAgICK7EiICA4AoFBCQICEgjYUZAQBqJIMEVJI0SEtyEpJEiwVUkjZBDlyCHLjlSvKtzfA9iO3FWtdwfVa3o9vsCAJP25QIme6tfEO3PtWLkS052JedINbOZHI69cf1KQznJk5wUgi85vrwTfXkn+vIO+fIOOfNOcSXnyJnqx+SYKzlHCtw/JSf5GlnJ18hSX95RXyNLfc075cK7QT68WqtlpPJZjl58CVU5yMk8lDNmsMr7d17/Xw4qSWuC1j3g1j3g1j04UmQckcAaE6TWPUite6DUmiA3JsixNYE2JrDWPbDWPSits6g0Hgc5SGuCEWbTFA4EdmKBLbV63BvXAuVAThRfcsyVHGJfcnx558jOQ0R7OaL6vZxR/6iWJXjaS2e59MEn60GOyVBOcSUn+fKOki852ZWc7Ms72Zd3LP6cnMJDOZcu1n17hs8Xf8F0Qo4r71gQX3KKKzm+ylFG5EtOdiWH2ZcccyVHfHlHfOVO8jWyki/vqK9pMAc/cra1+We6nk9vFrPX24v3z8vbd5cZN38fZ5/uNT6uV7ezu+f1bHfD8e1y465bFHhCJLWbu/EarUxiKb93V+T2zTCJlnbNuG9qbVrVUHX8Aw==", + "brillig_names": ["increase_counter_public"] + }, + { + "name": "compute_note_hash_and_optionally_a_nullifier", + "is_unconstrained": true, + "custom_attributes": [], + "abi": { + "error_types": { + "16541607464495309456": { + "error_kind": "fmtstring", + "item_types": [], + "length": 16 + }, + "17843811134343075018": { + "error_kind": "string", + "string": "Stack too deep" + } + }, + "parameters": [ + { + "name": "contract_address", "type": { "fields": [ { - "name": "call_context", + "name": "inner", "type": { - "fields": [ - { - "name": "msg_sender", - "type": { - "fields": [ - { - "name": "inner", - "type": { - "kind": "field" - } - } - ], - "kind": "struct", - "path": "aztec::protocol_types::address::aztec_address::AztecAddress" - } - }, - { - "name": "contract_address", - "type": { - "fields": [ - { - "name": "inner", - "type": { - "kind": "field" - } - } - ], - "kind": "struct", - "path": "aztec::protocol_types::address::aztec_address::AztecAddress" - } - }, - { - "name": "function_selector", - "type": { - "fields": [ - { - "name": "inner", - "type": { - "kind": "integer", - "sign": "unsigned", - "width": 32 - } - } - ], - "kind": "struct", - "path": "aztec::protocol_types::abis::function_selector::FunctionSelector" - } - }, - { - "name": "is_static_call", - "type": { - "kind": "boolean" - } - } - ], - "kind": "struct", - "path": "aztec::protocol_types::abis::call_context::CallContext" + "kind": "field" } - }, - { - "name": "historical_header", - "type": { - "fields": [ - { - "name": "last_archive", - "type": { - "fields": [ - { - "name": "root", - "type": { - "kind": "field" - } - }, - { - "name": "next_available_leaf_index", - "type": { - "kind": "integer", - "sign": "unsigned", - "width": 32 - } - } - ], - "kind": "struct", - "path": "aztec::protocol_types::abis::append_only_tree_snapshot::AppendOnlyTreeSnapshot" - } - }, - { - "name": "content_commitment", - "type": { - "fields": [ - { - "name": "num_txs", - "type": { - "kind": "field" - } - }, - { - "name": "txs_effects_hash", - "type": { - "kind": "field" - } - }, - { - "name": "in_hash", - "type": { - "kind": "field" - } - }, - { - "name": "out_hash", - "type": { - "kind": "field" - } - } - ], - "kind": "struct", - "path": "aztec::protocol_types::content_commitment::ContentCommitment" - } - }, - { - "name": "state", - "type": { - "fields": [ + } + ], + "kind": "struct", + "path": "aztec::protocol_types::address::aztec_address::AztecAddress" + }, + "visibility": "private" + }, + { + "name": "nonce", + "type": { + "kind": "field" + }, + "visibility": "private" + }, + { + "name": "storage_slot", + "type": { + "kind": "field" + }, + "visibility": "private" + }, + { + "name": "note_type_id", + "type": { + "kind": "field" + }, + "visibility": "private" + }, + { + "name": "compute_nullifier", + "type": { + "kind": "boolean" + }, + "visibility": "private" + }, + { + "name": "serialized_note", + "type": { + "kind": "array", + "length": 0, + "type": { + "kind": "field" + } + }, + "visibility": "private" + } + ], + "return_type": { + "abi_type": { + "kind": "array", + "length": 4, + "type": { + "kind": "field" + } + }, + "visibility": "public" + } + }, + "bytecode": "H4sIAAAAAAAA/9VZ227aQBBdsI2xi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8zl8N8EJ06fIf7I2dngu+16CWmcFtZ+7CxOvVvDlEq1H5x1OcQYrpfH10ycD6tu/cvs0lkuq8sra5XkzKeBtVqUr8cQPWtrefCXRvPbaMxfY0XHJ2dWo+AKBdco2KDgBgVbEExCwGSCyRImK5isYXIFk2uYbGByA5NhGSRYBgmWQYJlkGAZJFgGCZZBei+DVt0by7a+0AZHNzjawmgpcDThaImjFY7WOLrC0bg0SlwaJS6NEpTGo1RfLgfXRX+fmcYt9Q8j1Po9+6dpas5T74ct+3Ou+h+pzkOsNNf6douXgsr/kTJlkbLQDw==", + "brillig_names": ["compute_note_hash_and_optionally_a_nullifier"] + }, + { + "name": "sync_notes", + "is_unconstrained": true, + "custom_attributes": [], + "abi": { + "error_types": { + "17843811134343075018": { + "error_kind": "string", + "string": "Stack too deep" + } + }, + "parameters": [], + "return_type": null + }, + "bytecode": "H4sIAAAAAAAA/9VUyw6CMBBseURBOaiJ3kz8gyIYOJJ49x8akKMe8OKNT5eabbqpVRKlJkzSbEs3szNlW0oUKESPvAH9tGnIFdhBDCA6aN/tRgFr9hviQKs7JH/O0iQw+BtQ/5OfWtIvIPktnT+bAM+xVfzYi6w77UaIesKWZ/nPbHpe9fhc/MFnh32k1caghm+uIYci3RuYR4Y8iRlRd9prh/eV5YzJei7w++RVO67va/lrWIeafvmOFV/qrDMe1wmv+YFXVVrypcYv4KBzGnMvbGHe1wvY45yo3mjul/J0vZ0b0gNB8gCVxsvQjgYAAA==", + "debug_symbols": "nZLNCoQgFIXf5a5bpGY/vkoMYWUhiIbZwBC9+1g0QzO00c2FI+c7G78VetEuYyP1YGZg9QrKdNxJo31atwRaK5WSY3N9hnQ/CB39eeJ6j7Pj1gEjOAGhe2BZ6ulBKgEsx9sjAYQD+ySwnwX2aVgf3+5XGU1PosqK4ssgSg6IxkB5DFTEQGUERG4/vqKk+kCUlr/Q5uOTW8lbJU6xhkV3F8/caxJ/yk3WdKJfrNjlu3jnb42KBGM/66ff", + "brillig_names": ["sync_notes"] + }, + { + "name": "add_to_counter_public", + "is_unconstrained": true, + "custom_attributes": ["public", "internal"], + "abi": { + "error_types": { + "10176877060487216746": { + "error_kind": "string", + "string": "Function add_to_counter_public can only be called internally" + }, + "13699457482007836410": { + "error_kind": "string", + "string": "Not initialized" + }, + "16761564377371454734": { + "error_kind": "string", + "string": "Array index out of bounds" + }, + "17843811134343075018": { + "error_kind": "string", + "string": "Stack too deep" + }, + "206160798890201757": { + "error_kind": "string", + "string": "Storage slot 0 not allowed. Storage slots must start from 1." + }, + "5019202896831570965": { + "error_kind": "string", + "string": "attempt to add with overflow" + } + }, + "parameters": [ + { + "name": "counter_id", + "type": { + "kind": "field" + }, + "visibility": "private" + } + ], + "return_type": null + }, + "bytecode": "JgACBAEnAAABBIBEJgAABAMmAgIEASYCAwQAHxgAAwACgEMtCIBDAAEkAAAAQCcCAAEEgEQmAgIEADoNAAEAAiQAAAFVLAgBAgAAAQIBJgIDAQAsDgMCLAgBAwAAAQIBJgIEAAAsDgQDLAgBBAAAAQIBJgIFAAIsDgUEHgIABQAeAgAGADI4AAUABgAHJgIFAQEjAgAHAAAAnyQAAAF+HgIABQEeAgAGAAo4BQYHIwIABwAAALskAAABkCYCBQAdJgIGAAEmAgsEDCwIAAwsDAINLAwDDiwMBA8sDAYQLAwFESwMARIAEAALACQAAAGiLAQAACwMDQcsDA4ILAwPCSwMEAouDAAKAAsAOAsGCiYCDwQQLAgAECwMAhEsDAMSLAwEEywMBhQsDAUVLAwBFgAQAA8AJAAAAaIsBAAALAwRCywMEgwsDBMNLAwUDi8MAAoADiUnAIAEBHgADQAAAIAEgAMjAIADAAABfSkBAAEF96Hzr6Wt1Mo7AQECJSkBAAEFvh4//z6k9vo7AQECJSkBAAEFjTuHxGEpfmo7AQECJSQAAAFVLAgBCCYCCQQDABABCQEmAwgEAQAoCAIJLAwJCiwOBAoAKAoCCiwOBgomAgQAACwIAQYmAgkEBAAQAQkBJgMGBAEAKAYCCSwMCQosDgQKACgKAgosDgQKACgK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Sz47welIbOO9oExZ1eZxCiQOtlBlpc3igz/BqNlAsvUxEORWZMyUMJMmNKAYrMipaWNTUgcisooBo6LLomlT5WElRAZgIqUWnn/IyKVBo6PaUiFaFLTSUq7ZxwUZEKylxCKFGRWe8XqAhdbipR6XElQUXoglOJSh8rCSquV3EJKkJXJ8ktO7oohJgKdioJKkLrlTwVoQuUeSogdC3OnHaKGuNjKjLX4gpUGnp9W00qMnNQiYrMHFSgomXmoBKVHm0TVNp5LqwqlT5WElSEbhIsUemZOUWlZ+YEFRKamQkXKtbFVISOlTwVK3OFskDFCc1BBSpC65U8lYZekliTSh8rCSoNvSqx2sbSgQp2KgkqfWd2TGVwo1OJqbRzwNllKr8dFZBWJkcbektgwVEB238nR9NngTicDThSkSZdLwScDQUb20ln04LGb9aYdCQuaC7cvrmnhofVDmCpiKPSiqVi2TIsW4ZlC1m2kGWLWNeLWLYsy69L5/4XVJ6junAGUEnFulPSc9FsjDHpo7kDzKcOBRNpMH30bkHjtmvSd35Bw/An/QxKNpahRoaGYSe9uz+vQc3QMOwQww4lR3aw8xgNLtrZgxYYGoYdhwxN2K7xDDueYSd9mPrZ9UlpttcCpAxDw7CTLv/zmnQlXdBsvxfIIEOzPR5QOifnNaQYGo4dhj+WMXYs4/o4xjjwDG6ewY1R59PW+/TX8Onvu5f93f3h8XVQjH/88fTwtn9+On58++f7/Jf7l/3hsP92+/3l+eHxy4+Xx9vD88P4t506/vhshnnUULSNfRk/OrhxdvwwYvbqxuvB4mD1Xw==", + "brillig_names": ["add_to_counter_public"] + }, + { + "name": "get_counter_value", + "is_unconstrained": true, + "custom_attributes": [], + "abi": { + "error_types": { + "16761564377371454734": { + "error_kind": "string", + "string": "Array index out of bounds" + }, + "17843811134343075018": { + "error_kind": "string", + "string": "Stack too deep" + }, + "206160798890201757": { + "error_kind": "string", + "string": "Storage slot 0 not allowed. Storage slots must start from 1." + }, + "5019202896831570965": { + "error_kind": "string", + "string": "attempt to add with overflow" + } + }, + "parameters": [ + { + "name": "counter_id", + "type": { + "kind": "field" + }, + "visibility": "private" + } + ], + "return_type": { + "abi_type": { + "kind": "field" + }, + "visibility": "public" + } + }, + "bytecode": "H4sIAAAAAAAA/9VaP28jRRSfjf+unbV9ueROCAmJAtFQ7Dp2nFAZjoYGCYSQKJd4c5yARCShtxAFLRIlPQ0fgwLRQIXEl6CgpCJzzLN//u3btZPsWNxI1uzOe/P+vzczOw7Mfy1wP9vqMMZNxqauj+/XkgppxQHLGWyoTKCMvekeQve+A/BahQYIFVmqon8cj8ahyetcofyHoaPp0z5C0wP9uOXoPJkv6bMutkVmNUlwTvvmtwt4tr0D9GSOT1vd+Hrk2VbJQ1NsH2uDX92ztUXPPT/Nrt/+/OL0s/e++uKT7JIzDSXVxrFZqntLqk8uzq8v09Prt2azy+zqiimU5T1T7QDVT9Nn5+/OmFrjbtQ+yi6vnl2cM7XmhtTEny0Ym7o+vl9LJJ7bJBvyxdpUZc3Q6i5HAvLvkKxVx3VA/EQeto/Evdiuo8g6UGAteEYY8ukofDRa7CO04bQae8SRyduD+aJMFfpitGlsCP+O8RqrSZnP0D4cG11F1oECC+i5q/DpKny2RatvimP9rvGM8wUvVOZNXR/frg15gH0ivJHvLoxXGD/jTeNZ+HdM3hc+4nmX5CmKDbFdpMg6UGAcg5HCJ1L4vEi0JEa3lRuRMi8o6IUPj5WtKSHpgzJwTdDWyLCET1fhU7a+3FUfTeayvL8tH891ItbstUt6RBXq0SOcacV6YL70iHffjw0XZ9GBH/pDof/AD/3FnhzPVxID9szwPozbn5xKGmaZizh3AHDE/xpofuie+8r8qIAfnq0Qv1fA72PXi/2afuwX7wFdQ7w8f6c4E99JbGMTGMYl13aMKa6TqBfXtocAQ39x4xM12sKecX4HuownTYsRXgsbih4Cayp6aOtRWW1vEAzrZZmvbZu6Pr5fS7Qah7xQFttqJLtR8NsKPtpL6oDmAz7DY13QZMNnea8r87WcFvwvXW95vxysyo08MO4iZUxwQ4V3lbV7k3US+XdI1qprPddUtB/aR3xn/S+x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+75twWHrrkxBVH6LrQ0x9iK0PcfUhvjrElPZ+JqR+75v6vZ//q6HLIao+RNeH1H/2Tf1n39R/9k39Z9/Wf/Zt/d639Xvf1u99W7/3bf3et/W70tbvSlu/K13lrvwcHv11v1/fP2xWr0PE+OT79vFtvdseH779/RKeedivN5v1893Lfve4enrfr+42u8fxuQU7/vNTOL+UnP0a12scHzKxFMyOD/nhWbkUTg+vOrzyPw==", + "brillig_names": ["get_counter_value"] + }, + { + "name": "increase_counter_private", + "is_unconstrained": false, + "custom_attributes": ["private"], + "abi": { + "error_types": { + "17843811134343075018": { + "error_kind": "string", + "string": "Stack too deep" + }, + "5019202896831570965": { + "error_kind": "string", + "string": "attempt to add with overflow" + } + }, + "parameters": [ + { + "name": "inputs", + "type": { + "fields": [ + { + "name": "call_context", + "type": { + "fields": [ + { + "name": "msg_sender", + "type": { + "fields": [ { - "name": "l1_to_l2_message_tree", + "name": "inner", "type": { - "fields": [ - { - "name": "root", - "type": { - "kind": "field" - } - }, - { - "name": "next_available_leaf_index", - "type": { - "kind": "integer", - "sign": "unsigned", - "width": 32 - } - } - ], - "kind": "struct", - "path": "aztec::protocol_types::abis::append_only_tree_snapshot::AppendOnlyTreeSnapshot" + "kind": "field" } - }, + } + ], + "kind": "struct", + "path": "aztec::protocol_types::address::aztec_address::AztecAddress" + } + }, + { + "name": "contract_address", + "type": { + "fields": [ { - "name": "partial", + "name": "inner", "type": { - "fields": [ - { - "name": "note_hash_tree", - "type": { - "fields": [ - { - "name": "root", - "type": { - "kind": "field" - } - }, - { - "name": "next_available_leaf_index", - "type": { - "kind": "integer", - "sign": "unsigned", - "width": 32 - } - } - ], - "kind": "struct", - "path": "aztec::protocol_types::abis::append_only_tree_snapshot::AppendOnlyTreeSnapshot" - } - }, - { - "name": "nullifier_tree", - "type": { - "fields": [ - { - "name": "root", - "type": { - "kind": "field" - } + "kind": "field" + } + } + ], + "kind": "struct", + "path": "aztec::protocol_types::address::aztec_address::AztecAddress" + } + }, + { + "name": "function_selector", + "type": { + "fields": [ + { + "name": "inner", + "type": { + "kind": "integer", + "sign": "unsigned", + "width": 32 + } + } + ], + "kind": "struct", + "path": "aztec::protocol_types::abis::function_selector::FunctionSelector" + } + }, + { + "name": "is_static_call", + "type": { + "kind": "boolean" + } + } + ], + "kind": "struct", + "path": "aztec::protocol_types::abis::call_context::CallContext" + } + }, + { + "name": "historical_header", + "type": { + "fields": [ + { + "name": "last_archive", + "type": { + "fields": [ + { + "name": "root", + "type": { + "kind": "field" + } + }, + { + "name": "next_available_leaf_index", + "type": { + "kind": "integer", + "sign": "unsigned", + "width": 32 + } + } + ], + "kind": "struct", + "path": "aztec::protocol_types::abis::append_only_tree_snapshot::AppendOnlyTreeSnapshot" + } + }, + { + "name": "content_commitment", + "type": { + "fields": [ + { + "name": "num_txs", + "type": { + "kind": "field" + } + }, + { + "name": "txs_effects_hash", + "type": { + "kind": "field" + } + }, + { + "name": "in_hash", + "type": { + "kind": "field" + } + }, + { + "name": "out_hash", + "type": { + "kind": "field" + } + } + ], + "kind": "struct", + "path": "aztec::protocol_types::content_commitment::ContentCommitment" + } + }, + { + "name": "state", + "type": { + "fields": [ + { + "name": "l1_to_l2_message_tree", + "type": { + "fields": [ + { + "name": "root", + "type": { + "kind": "field" + } + }, + { + "name": "next_available_leaf_index", + "type": { + "kind": "integer", + "sign": "unsigned", + "width": 32 + } + } + ], + "kind": "struct", + "path": "aztec::protocol_types::abis::append_only_tree_snapshot::AppendOnlyTreeSnapshot" + } + }, + { + "name": "partial", + "type": { + "fields": [ + { + "name": "note_hash_tree", + "type": { + "fields": [ + { + "name": "root", + "type": { + "kind": "field" + } + }, + { + "name": "next_available_leaf_index", + "type": { + "kind": "integer", + "sign": "unsigned", + "width": 32 + } + } + ], + "kind": "struct", + "path": "aztec::protocol_types::abis::append_only_tree_snapshot::AppendOnlyTreeSnapshot" + } + }, + { + "name": "nullifier_tree", + "type": { + "fields": [ + { + "name": "root", + "type": { + "kind": "field" + } }, { "name": "next_available_leaf_index", @@ -352,6 +678,12 @@ "type": { "kind": "field" } + }, + { + "name": "total_mana_used", + "type": { + "kind": "field" + } } ], "kind": "struct", @@ -783,7 +1115,7 @@ "name": "private_call_requests", "type": { "kind": "array", - "length": 4, + "length": 5, "type": { "fields": [ { @@ -967,7 +1299,7 @@ } ], "kind": "struct", - "path": "aztec::protocol_types::abis::side_effect::Counted" + "path": "aztec::protocol_types::abis::side_effect::counted::Counted" } } }, @@ -1082,46 +1414,29 @@ } }, { - "name": "start_side_effect_counter", - "type": { - "kind": "integer", - "sign": "unsigned", - "width": 32 - } - }, - { - "name": "end_side_effect_counter", - "type": { - "kind": "integer", - "sign": "unsigned", - "width": 32 - } - }, - { - "name": "note_encrypted_logs_hashes", + "name": "private_logs", "type": { "kind": "array", "length": 16, "type": { "fields": [ { - "name": "value", - "type": { - "kind": "field" - } - }, - { - "name": "counter", - "type": { - "kind": "integer", - "sign": "unsigned", - "width": 32 - } - }, - { - "name": "length", + "name": "log", "type": { - "kind": "field" + "fields": [ + { + "name": "fields", + "type": { + "kind": "array", + "length": 18, + "type": { + "kind": "field" + } + } + } + ], + "kind": "struct", + "path": "aztec::protocol_types::abis::log::Log" } }, { @@ -1131,25 +1446,6 @@ "sign": "unsigned", "width": 32 } - } - ], - "kind": "struct", - "path": "aztec::protocol_types::abis::log_hash::NoteLogHash" - } - } - }, - { - "name": "encrypted_logs_hashes", - "type": { - "kind": "array", - "length": 4, - "type": { - "fields": [ - { - "name": "value", - "type": { - "kind": "field" - } }, { "name": "counter", @@ -1158,22 +1454,10 @@ "sign": "unsigned", "width": 32 } - }, - { - "name": "length", - "type": { - "kind": "field" - } - }, - { - "name": "randomness", - "type": { - "kind": "field" - } } ], "kind": "struct", - "path": "aztec::protocol_types::abis::log_hash::EncryptedLogHash" + "path": "aztec::protocol_types::abis::private_log::PrivateLogData" } } }, @@ -1210,6 +1494,22 @@ } } }, + { + "name": "start_side_effect_counter", + "type": { + "kind": "integer", + "sign": "unsigned", + "width": 32 + } + }, + { + "name": "end_side_effect_counter", + "type": { + "kind": "integer", + "sign": "unsigned", + "width": 32 + } + }, { "name": "historical_header", "type": { @@ -1401,529 +1701,209 @@ "type": { "kind": "field" } - }, - { - "name": "slot_number", - "type": { - "kind": "field" - } - }, - { - "name": "timestamp", - "type": { - "kind": "integer", - "sign": "unsigned", - "width": 64 - } - }, - { - "name": "coinbase", - "type": { - "fields": [ - { - "name": "inner", - "type": { - "kind": "field" - } - } - ], - "kind": "struct", - "path": "aztec::protocol_types::address::eth_address::EthAddress" - } - }, - { - "name": "fee_recipient", - "type": { - "fields": [ - { - "name": "inner", - "type": { - "kind": "field" - } - } - ], - "kind": "struct", - "path": "aztec::protocol_types::address::aztec_address::AztecAddress" - } - }, - { - "name": "gas_fees", - "type": { - "fields": [ - { - "name": "fee_per_da_gas", - "type": { - "kind": "field" - } - }, - { - "name": "fee_per_l2_gas", - "type": { - "kind": "field" - } - } - ], - "kind": "struct", - "path": "aztec::protocol_types::abis::gas_fees::GasFees" - } - } - ], - "kind": "struct", - "path": "aztec::protocol_types::abis::global_variables::GlobalVariables" - } - }, - { - "name": "total_fees", - "type": { - "kind": "field" - } - } - ], - "kind": "struct", - "path": "aztec::protocol_types::header::Header" - } - }, - { - "name": "tx_context", - "type": { - "fields": [ - { - "name": "chain_id", - "type": { - "kind": "field" - } - }, - { - "name": "version", - "type": { - "kind": "field" - } - }, - { - "name": "gas_settings", - "type": { - "fields": [ - { - "name": "gas_limits", - "type": { - "fields": [ - { - "name": "da_gas", - "type": { - "kind": "integer", - "sign": "unsigned", - "width": 32 - } - }, - { - "name": "l2_gas", - "type": { - "kind": "integer", - "sign": "unsigned", - "width": 32 - } - } - ], - "kind": "struct", - "path": "aztec::protocol_types::abis::gas::Gas" - } - }, - { - "name": "teardown_gas_limits", - "type": { - "fields": [ - { - "name": "da_gas", - "type": { - "kind": "integer", - "sign": "unsigned", - "width": 32 - } - }, - { - "name": "l2_gas", - "type": { - "kind": "integer", - "sign": "unsigned", - "width": 32 - } - } - ], - "kind": "struct", - "path": "aztec::protocol_types::abis::gas::Gas" - } - }, - { - "name": "max_fees_per_gas", - "type": { - "fields": [ - { - "name": "fee_per_da_gas", - "type": { - "kind": "field" - } - }, - { - "name": "fee_per_l2_gas", - "type": { - "kind": "field" - } - } - ], - "kind": "struct", - "path": "aztec::protocol_types::abis::gas_fees::GasFees" - } - } - ], - "kind": "struct", - "path": "aztec::protocol_types::abis::gas_settings::GasSettings" - } - } - ], - "kind": "struct", - "path": "aztec::protocol_types::transaction::tx_context::TxContext" - } - } - ], - "kind": "struct", - "path": "aztec::protocol_types::abis::private_circuit_public_inputs::PrivateCircuitPublicInputs" - }, - "visibility": "databus" - } - }, - "bytecode": "H4sIAAAAAAAA/+WdBZQTVxuGJ9ldYKEUWbwthRYoFEs22d0Ed3d3WMlSiltdtu7uTpW6u1Jvqbs7Neru9H+/knRnh8A5f3dC/+f895znJJmZzDzfzWQymbn3uwFnY2kRdJzs4MbnAZGVfLRJrTzTUo/u5zlplquTZlrdNNPqpZnWIM20JqKPZ1rLNMvtmGZaqzTTWqeZ1iY5zV0Cycc+ycdIqDAaTRTlJ8KRcHEoP14SKwhFC0oKY+FYuCBWUJYfi0QSsWisKF4SLwrFw9FIIlxeEI+UhzaW+sHKdYWqVfJLM+nZwDfPUCiTng3/uWe+d4K55Ylsl6t9XhuSz9s6lc8buKY3TD5PvS9PrxuJxqJJsHJ6qgQ9dRCqXgm38bE+m/r3uYfd3y1bb6sM14Pbvbr10CxD9dAsWQ/ZnjpIV/zcfsCz7oDP22jrZOZ4kbGdpZmPO0vzDO0szV07S+qH1snwBxlwMvtBVnfd8fxIPD9aVpjJOsjbSj9+oeqVcDOIZ5Z/6wq5D2QtvEdP70Giul9sPyuhnZOZD8vvmH08AIR3gcQc9DHm9pCYffxShjtspZhD1SvhXX2sP8qPREeH4dkJ4tkZ4tkF4tkV4hmCeIYhnvkQzwjEMwrxLIB4FkI8iyCeMYhnHOLZDeLZHeLZA+LZE+LZC+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tPnfNZWVJcOr/vsrkrFyYWrVjuPth63+ykCTo1L+CavrkfX+97slzLu0sdp/KELbui6vJ9ktND1ShFsVAotc3UlyDHqVp5jmf7OZ7lC5Kva7viccfb5x96lhcVh8sjxeXFBcVlZdHS4oae9TtOZT1aPe2QfA4/wY1vrRPcDH0B//4xqJmZ9ac9wXXHkpqf2ocHVFTW5YCKqk6pZQa5lhm0mWUGu5YZ7FrGypZOlL0/0m6PdCd9Az3zsp1N3VLz3AfklJMduPNcXlaGVFT6/v3D4GT0BD6W4T9S4Txnyyc/qT/EdoBvnnyeWLR0ZWJlYszKkgXzSgetXFS6Yt7iRf2LFyzwHuzdO5S75HiW874v3YHd/Trb8zonzXo3937vtM3tfG5/wg/I9snX//YPyH8Av+688PxzAQA=", - "debug_symbols": "7ZbbisIwEIbfJde9yMzkMPFVFpGqVQqlStWFRXz3TUrTgxuQreyC4E3pJH86X/4Zhl7Ftlhf9quy3h1OYvFxFdVhk5/LQ+2jqwBq107HvA7h6Zw3Z7EA42QminrrX62Ut0zsyqoQC+Nu2Q8xMnEnRjaDGMgk1KTBdWrSDh+oHTJ0aodO92rEFAkwm4jt5KAmSokBIwiA5bF4mQlQb1+Svui3L0lfzNuXpC/2aV8UoO7ECgwMN0XTZuA/z+CezgAkVRQTuSGDtalqsYo8jg1OeBJ9g6xtbBz0pbvnR/ni/JDid4iRSI56NIlvqc9gicdAKXzN0RgDw4dByxYGn4dxUWwV2Qcw4Az2dXJmop/nJr36BdT/XgAlEkUgqUBNgXy0bsqqKveryZ+VDA+V7BYACf3IRL5vMUVzDqk5h/ScQ+bXh3wEQZueRHqohh6NFj+IlzcffuZNma+rIrgadi/1Jprsw/PXMe7EMhybw6bYXpoiFGSoRXCVZKZkGOkBRHGmqWdrl5AyZJ/VZ/4G", - "brillig_names": [ - "pack_arguments_oracle_wrapper", - "enqueue_public_function_call_internal" - ], - "verification_key": "AAAAAAAAIAAAAAAAAAAADQAAAAAAAAAAAAAAAAAAAAUAjfaum2pGC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PlkprougN4PPF2Vs+ZorzhEdV+FaH4i7jlyNZbe89jxqEOK25+fpM8t7v\nqvhw+NvMiTDJHD3RB9KfRPGlDrwEHcg2BBrM/gVLfGXwxDGAIrOGTv0eGIOwzBXGvrL1t88kWQ2K\nOKQCDCZuOZvEf0aB31fEkpmTtoOVGcDxcwfdIC7pmHPZZvPB9BKR4uLVkmf7Lm1F7rGNAiwOjPeP\naO21AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\nAAAAAAAAAAAAAgs2dscYS+zKASVRePp0wGbh0kJSit88X4cKSBAVboUyAfO8XDbSLnNEmySECroI\npr+xTKY294DwyIVplJAKCKkPy7+dPPQCuqPu2l8Knkm1werJWyZMMC3IVObyLXMw3yg+39qJyUgF\nl/CzRC6XUt751Y/Ckgg2GUJh97Fj/vuvATgwXZNKpmayZy8htuiA1AuYunSoxl7i+D2PbC6ohGQY\nj8a+zx02yPQI5Rd6FkK2tUtzEwRFJMUf6M6rFylnBQ==" - }, - { - "name": "add_to_counter_public", - "is_unconstrained": true, - "custom_attributes": ["public", "internal"], - "abi": { - "error_types": { - "10176877060487216746": { - "error_kind": "string", - "string": "Function add_to_counter_public can only be called internally" - }, - "13699457482007836410": { - "error_kind": "string", - "string": "Not initialized" - }, - "16761564377371454734": { - "error_kind": "string", - "string": "Array index out of bounds" - }, - "17843811134343075018": { - "error_kind": "string", - "string": "Stack too deep" - }, - "206160798890201757": { - "error_kind": "string", - "string": "Storage slot 0 not allowed. Storage slots must start from 1." - }, - "5019202896831570965": { - "error_kind": "string", - "string": "attempt to add with overflow" - } - }, - "parameters": [ - { - "name": "counter_id", - "type": { - "kind": "field" - }, - "visibility": "private" - } - ], - "return_type": null - }, - "bytecode": "JgAEAQInAASARAABJgAEAwAmAgQBAiYCBAADHxgAAwACgEMtCIBDAAEkAAAAQCcCBIBEAAEmAgQAAjoNAAEAAiQAAAK/LAgBAwAAAQIBJgIB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wgk0pBEGopGDkF0L4cgyNhQFXovUjpcCC3kKCNBgaiuwhZtBlU4vIVDOQmqcPgHujRQx5ArX3ghM4Mq9A0DacOvgZxhYe2BQzkJqjArzqGMCDWuhtWpvaxVGapwECGHEtUVnAAFhdOyOZSXoApHYjGoQnTgUFaCKtxfHEpUF4nsIhKhJD2qdPgFhxL1Qyvqh4UTTa1P8cspzFAFv8GhRHWVPACDChJUYV6JQzkBCpVEQyzEZUoPCcX+DTnKiFBBgipEcw7lJKiCt+FQIjVIpDzJ6hIpb0TKG5HyhaNayLiEcipHWQmqMIvFoYIEVfA2DCooEcoIUKUN5xyKRCgvQRVmsTiUk6AQRChJP9RaCfJePT6LzaK8BFXYRDmB+hmv/rl52t7c7u6fI2b/5feHu5ft48Pr5cu/34Zvbp+2u9326/W3p8e7+8/fn+6vd493++826vXPRwzuKjblp/3B0PES4mgMyO8v9w2lg7nSwcVaY83/AQ==", - "brillig_names": ["add_to_counter_public"] - }, - { - "name": "public_dispatch", - "is_unconstrained": true, - "custom_attributes": ["public"], - "abi": { - "error_types": { - "10176877060487216746": { - "error_kind": "string", - "string": "Function add_to_counter_public can only be called internally" - }, - "13699457482007836410": { - "error_kind": "string", - "string": "Not initialized" - }, - "16761564377371454734": { - "error_kind": "string", - "string": "Array index out of bounds" - }, - "16957488177269924912": { - "error_kind": "fmtstring", - "item_types": [], - "length": 16 - }, - "17618083556256589634": { - "error_kind": "string", - "string": "Initialization hash does not match" - }, - "17843811134343075018": { - "error_kind": "string", - "string": "Stack too deep" - }, - "206160798890201757": { - "error_kind": "string", - "string": "Storage slot 0 not allowed. Storage slots must start from 1." - }, - "2233873454491509486": { - "error_kind": "string", - "string": "Initializer address is not the contract deployer" - }, - "5019202896831570965": { - "error_kind": "string", - "string": "attempt to add with overflow" - } - }, - "parameters": [ - { - "name": "selector", - "type": { - "kind": "field" - }, - "visibility": "private" - } - ], - "return_type": null - }, - "bytecode": "JgAEAQInAASARAABJgAEAwAmAgQBAiYCBAADHxgA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SepJ1kqK4SA2yhyvgolNahCCNBQ6wXGPM9HeHGLmQAqdDg0FNWgCh0ODYVVKKlBxSpvxCrPY5UurPJ8qvJ8qvJ8qvI8VXmDqrzBVd7gVINaPw48TQ3m+TkXVlBYgWLnqlB1uqQGtb6fVEVxDWp9p6OKSjWo9cimoCSuXw4f873hGBaY0gYbzJ3l60uuZ1Rpt4qCohoU+SrUeqzx+UiZ97SY4JTCCr+GilUoqUFJlS6p0IXOxSpUlS5fpQtcFapOF9egCpOpGirVoGKVNyLWoApPlN2INRNm3e9T2eeWHJao0j4qBZVqUKUdPgqqyq7S3pPbqNJGjlvRcEJVRN5pjFWjy3tXhcIaFFTpgjpdUoMqHFJ2Kbcux7BEcQ0qVukqvbyhoFINKlXpSlW6SK8ba6iqusFV9ZCrdEmoQnEFCgo9AAXlfRUq1aAAqlA18RBCla5QZVd0Vaiq8opVdQOrfJiqfJiqdG1vy9+m3/7z5vPjm7cf3n+ZME9//Pvju6+Pnz7++PXrf/+a//L28+OHD49/vv7r86d373//+/P71x8+vXv624P78c+/GNyradZxYvPUaNmlV+zT9Nv3HDnNbr6apr6efn1qMOxp+qtMHCYe/wM=", - "brillig_names": ["public_dispatch"] - }, - { - "name": "get_counter_value", - "is_unconstrained": true, - "custom_attributes": [], - "abi": { - "error_types": { - "16761564377371454734": { - "error_kind": "string", - "string": "Array index out of bounds" - }, - "17843811134343075018": { - "error_kind": "string", - "string": "Stack too deep" - }, - "206160798890201757": { - "error_kind": "string", - "string": "Storage slot 0 not allowed. Storage slots must start from 1." - }, - "5019202896831570965": { - "error_kind": "string", - "string": "attempt to add with overflow" - } - }, - "parameters": [ - { - "name": "counter_id", - "type": { - "kind": "field" - }, - "visibility": "private" - } - ], - "return_type": { - "abi_type": { - "kind": "field" - }, - "visibility": "public" - } - }, - "bytecode": "H4sIAAAAAAAA/+1bv28jRRSejb2Of8RnJwcnGqiQaL2Jc0kkisDRXAECJJAoTewcp4NEJEFCNLhC0FEhJAoaWqRr4E+gRz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qwIdhoRa0SaYwRrjhGsOUaw5hjBmmOE1xwjvGZFeM2K8JoV4TUrwmtWhNeY6zXmeo25QWNu1oSclSJEPJ9Uv3u7WoiCRhQ1oqQR5eeLeKUIFUTLz6fdhs4sykmISCNa2Q2Zv5Nq96OcXtSIkkaUFaKVplEQLSMPbvYpBCNEpBE5jYg1Iq8RBY0oakRJI8oK0UoVKog0K4I0K4I0K4I0K4I0K4I0K4I0K2KlCoX5sgc2GhKirBCtVKGCyGpEpBE5jYg1Iq8RLZu7W/2TiFkcYVdaTUGUFaKVVlMQWY2INCKnEbFG5DWioBFpVgRrVsRKq2EfZ1EUB5aVVlMQWY2INCKnEbFG5DWioBFFjShpRJoVETQrImhWRNCsiLUzNE9m2LUzGE+LvEb07Nrwc/fbP5d328sP11ffdpr9H7/ffLzf3t48/nr/79fpLx/uttfX2y/vv97dfrz69P3u6v317cf93zbm8Z+/XKQLl2k3mYe4T8lcUPL7X/ceueAuXPC7e93d838=", - "brillig_names": ["get_counter_value"] - }, - { - "name": "sync_notes", - "is_unconstrained": true, - "custom_attributes": [], - "abi": { - "error_types": { - "17843811134343075018": { - "error_kind": "string", - "string": "Stack too deep" - } - }, - "parameters": [], - "return_type": null - }, - "bytecode": "H4sIAAAAAAAA/9VUyw6CMBBseURBOaiJ3kz8gyIYOJJ49x8akKMe8OKNT5eabbqpVRKlJkzSbEs3szNlW0oUKESPvAH9tGnIFdhBDCA6aN/tRgFr9hviQKs7JH/O0iQw+BtQ/5OfWtIvIPktnT+bAM+xVfzYi6w77UaIesKWZ/nPbHpe9fhc/MFnh32k1caghm+uIYci3RuYR4Y8iRlRd9prh/eV5YzJei7w++RVO67va/lrWIeafvmOFV/qrDMe1wmv+YFXVVrypcYv4KBzGnMvbGHe1wvY45yo3mjul/J0vZ0b0gNB8gCVxsvQjgYAAA==", - "debug_symbols": "nZLBCoMwEET/Zc8eTDRR8ytSJGqUQEgkxkIR/71RbLHFS3JZmGXe7GFnhV60y9hIPZgZWL2CMh130miv1i2B1kql5Nhc15DuA6HDP09c73J23DpgGU5A6B5Ynnp6kEoAo9X2SADhQH8W6M8D/STMj2/zK4LLk6gIIV8G0fSASAxEY6AiBiojoOz28RVFxQeiGf2FNi+f3EreKnEWa1h0d+mZe03ir3KTNZ3oFyv28l1652ftb2HsY330Gw==", - "brillig_names": ["sync_notes"] - }, - { - "name": "constructor", - "is_unconstrained": true, - "custom_attributes": ["public", "initializer"], - "abi": { - "error_types": { - "16761564377371454734": { - "error_kind": "string", - "string": "Array index out of bounds" - }, - "17618083556256589634": { - "error_kind": "string", - "string": "Initialization hash does not match" - }, - "17843811134343075018": { - "error_kind": "string", - "string": "Stack too deep" - }, - "2233873454491509486": { - "error_kind": "string", - "string": "Initializer address is not the contract deployer" - }, - "5019202896831570965": { - "error_kind": "string", - "string": "attempt to add with overflow" - } - }, - "parameters": [], - "return_type": null - }, - "bytecode": "JgAEAQInAASAQwABJgAEAwAmAgQAASYCBAACHxgAAgABgEMkAAAAOicCBIBDAAEmAgQAAjoNAAEAAiQAAAQALAgBAwAAAQIBJgIBAAQsDgQDLAgBAwAAAQIBJgIAAAUsDgUDLAgBAwAAAQIBJgIAAgYsDgYDHgIAAAM1OAAAAwAGAAcmAgEBCCMCAAAAogAHIgAAAJUsDAQBLAwFAiIAAACvLAwIASwMBgIiAAAAryMCAAAAwAABJgIEAAk7CQEJNTgCAAMAAQAJIwIAAADjAAkiAAAA1iwMBAYsDAUHIgAAAPAsDAgGLAwBByIAAADwIwIAAAEBAAYmAgQAAzsJAQMmAgQAAyYCBAEGLAgBCSYCBAIKABABCgEmAwQBCQAoCQIKHzwAAwAGAAoAKAkCCwA4CwMMLA0MChwMBAoLHAwACwksCAEKAAABAgEmAwQBCgAoCgILHzwABgADAAssCAELJgIEBAwAEAEMASYDBAELACgLAgwsDAwNLA4FDQAoDQINLA4FDQAoDQINLA4FDSwNCwwAKAwCDCwODAssDQsMACgMAgwsDgwLLA0LDAAoDAIMLA4MCywNCwwAKAwCDCwODAssC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Y6jJmnyjSUyVbmZSsFlZn61lAmW2KyJXrdOIcy1Y1kqofJYoudpe+Vu/BJQ4kFhZYeG2d2r2koi4/iACaUyRaZdFEwoUzlFU11g015yKY8NI0c+PK2/Kv79O/t8+72bv/w0mH6L3883r/unh6PH1//+z58c/e82+93326+Pz/dP3z58fxws3+677/buOOfz15gGxz0bPqP3fz4FoH6j70gz7jtpgE6q53l/wE=", - "brillig_names": ["constructor"] - }, - { - "name": "increase_counter_public", - "is_unconstrained": true, - "custom_attributes": ["public"], - "abi": { - "error_types": { - "13699457482007836410": { - "error_kind": "string", - "string": "Not initialized" - }, - "16761564377371454734": { - "error_kind": "string", - "string": "Array index out of bounds" - }, - "17843811134343075018": { - "error_kind": "string", - "string": "Stack too deep" - }, - "5019202896831570965": { - "error_kind": "string", - "string": "attempt to add with overflow" - } - }, - "parameters": [ - { - "name": "counter_id", - "type": { - "kind": "field" - }, - "visibility": "private" - } - ], - "return_type": null - }, - "bytecode": "JgAEAQInAASARAABJgAEAwAmAgQBAiYCBAADHxgAAwACgEMtCIBDAAEkAAAAQCcCBIBEAAEmAgQAAjoNAAEAAiQAAANzLAgBAwAAAQIBJgIBAAQsDgQDLAgBAwAAAQIBJgIAAAQsDgQDLAgBAwAAAQIBJgIAAgUsDgUDHgIAAAMeAgAABTI4AAMABQAGJgIBAQMjAgAAAJ8ABiQAAAOcLAgBAyYCBBkFABABBQEmAwQBAwAoAwIFJgIEGAYAOAYFBiwMBQcMOAcGCBYMCAgjAgAAAOQACCwOBAcAKAcCByIAAADFLA0DBQAoBQIFLA4FAywIAQUAAAECASwOAwUmAgJsAyYCAmQEJgICYwYmAgJyByYCAm4IJgICQwkmAgQACiYCAmILJgICcwwmAgJpDSYCAmUOJgICdQ8mAgQBECwIAREmAgQZEgAQARIBJgMEAREAKBECEiwMEhMsDgkTACgTAhMmAgJvFCwOFBMAKBMCEywODxMAKBMCEywOCBMAKBMCEyYCAnQVLA4VEwAoEwITLA4OEwAoEwITLA4HEwAoEw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GuhtvPj+l8slgXb392xWwxGmymi3lq7fZlMVxNZ7Pp58f534Wrf6Ie7NfLwbxurjeD1aZ4g6iuLKr5OF2yc+kOk+msKt6i7t/LgrGDjzzuIx3iCD/uo9DBJz7uAw66OIUuTh26FYC6OHWJ5B/t2fLS2LnQGDsfWmNgvmJNKHK0JlQ+WSNdsRbA5t4CAb5ZH/ClB3zxjXHifyo+9qE+Qat+vKc+BGzwISjdwVeCeLRWCnqBT9Arfiqwb/iHEDF7iED5Q1wvTQztyEO5E0K4iSAa7/QbIjTG6fI0pL3/woloC0dM4bAtddiWOmJLHbGljtpSR9kSjnfeFk40hXNj0vcyHFOV5b2pyvLeljpoq7LQ1nPnxjz1ZTjBFE5wlnDC099Z7YoIkfQnToRnd1akFofxEqfPlYSeL1W+1nTRU+4AuTPA3Blg7gwIcweQzAFC7gxC7gyizx2AMwdgyB0gZg4guTOQ3Blo7lGkmeuAHeUO0MPTNLg2gNx5wWp6ozfG8XJLlvtYhfWJI6Zw+liF9YljS50bMw+iZhc9bWfH33F6/b7A5CzNpZmevcPBscURusRRUzjBljrR28JhUzhsSx22pY7A63AUL3GevdH76xqeFWzhmFJHHNnCUVM4trajxHtbOGwKB9EWjpjCIVvqkK2xE2xVVrClTrT1GGRnB2efmn8Hq+lgOKuOh04n2/no7Azq5t+y+nEcdblajKrxdlXVB1NPZ1LrtLzDMn19TWnW9QqiJai+1ycbD01XgoS6CQdbV6av/IkhcfwH", - "brillig_names": ["increase_counter_public"] - }, - { - "name": "compute_note_hash_and_optionally_a_nullifier", - "is_unconstrained": true, - "custom_attributes": [], - "abi": { - "error_types": { - "16957488177269924912": { - "error_kind": "fmtstring", - "item_types": [], - "length": 16 - }, - "17843811134343075018": { - "error_kind": "string", - "string": "Stack too deep" - } - }, - "parameters": [ - { - "name": "contract_address", - "type": { - "fields": [ - { - "name": "inner", - "type": { - "kind": "field" - } + }, + { + "name": "slot_number", + "type": { + "kind": "field" + } + }, + { + "name": "timestamp", + "type": { + "kind": "integer", + "sign": "unsigned", + "width": 64 + } + }, + { + "name": "coinbase", + "type": { + "fields": [ + { + "name": "inner", + "type": { + "kind": "field" + } + } + ], + "kind": "struct", + "path": "aztec::protocol_types::address::eth_address::EthAddress" + } + }, + { + "name": "fee_recipient", + "type": { + "fields": [ + { + "name": "inner", + "type": { + "kind": "field" + } + } + ], + "kind": "struct", + "path": "aztec::protocol_types::address::aztec_address::AztecAddress" + } + }, + { + "name": "gas_fees", + "type": { + "fields": [ + { + "name": "fee_per_da_gas", + "type": { + "kind": "field" + } + }, + { + "name": "fee_per_l2_gas", + "type": { + "kind": "field" + } + } + ], + "kind": "struct", + "path": "aztec::protocol_types::abis::gas_fees::GasFees" + } + } + ], + "kind": "struct", + "path": "aztec::protocol_types::abis::global_variables::GlobalVariables" + } + }, + { + "name": "total_fees", + "type": { + "kind": "field" + } + }, + { + "name": "total_mana_used", + "type": { + "kind": "field" + } + } + ], + "kind": "struct", + "path": "aztec::protocol_types::header::Header" + } + }, + { + "name": "tx_context", + "type": { + "fields": [ + { + "name": "chain_id", + "type": { + "kind": "field" + } + }, + { + "name": "version", + "type": { + "kind": "field" + } + }, + { + "name": "gas_settings", + "type": { + "fields": [ + { + "name": "gas_limits", + "type": { + "fields": [ + { + "name": "da_gas", + "type": { + "kind": "integer", + "sign": "unsigned", + "width": 32 + } + }, + { + "name": "l2_gas", + "type": { + "kind": "integer", + "sign": "unsigned", + "width": 32 + } + } + ], + "kind": "struct", + "path": "aztec::protocol_types::abis::gas::Gas" + } + }, + { + "name": "teardown_gas_limits", + "type": { + "fields": [ + { + "name": "da_gas", + "type": { + "kind": "integer", + "sign": "unsigned", + "width": 32 + } + }, + { + "name": "l2_gas", + "type": { + "kind": "integer", + "sign": "unsigned", + "width": 32 + } + } + ], + "kind": "struct", + "path": "aztec::protocol_types::abis::gas::Gas" + } + }, + { + "name": "max_fees_per_gas", + "type": { + "fields": [ + { + "name": "fee_per_da_gas", + "type": { + "kind": "field" + } + }, + { + "name": "fee_per_l2_gas", + "type": { + "kind": "field" + } + } + ], + "kind": "struct", + "path": "aztec::protocol_types::abis::gas_fees::GasFees" + } + } + ], + "kind": "struct", + "path": "aztec::protocol_types::abis::gas_settings::GasSettings" + } + } + ], + "kind": "struct", + "path": "aztec::protocol_types::transaction::tx_context::TxContext" } - ], - "kind": "struct", - "path": "aztec::protocol_types::address::aztec_address::AztecAddress" - }, - "visibility": "private" - }, - { - "name": "nonce", - "type": { - "kind": "field" - }, - "visibility": "private" - }, - { - "name": "storage_slot", - "type": { - "kind": "field" - }, - "visibility": "private" - }, - { - "name": "note_type_id", - "type": { - "kind": "field" - }, - "visibility": "private" - }, - { - "name": "compute_nullifier", - "type": { - "kind": "boolean" - }, - "visibility": "private" - }, - { - "name": "serialized_note", - "type": { - "kind": "array", - "length": 0, - "type": { - "kind": "field" } - }, - "visibility": "private" - } - ], - "return_type": { - "abi_type": { - "kind": "array", - "length": 4, - "type": { - "kind": "field" - } + ], + "kind": "struct", + "path": "aztec::protocol_types::abis::private_circuit_public_inputs::PrivateCircuitPublicInputs" }, - "visibility": "public" + "visibility": "databus" } }, - "bytecode": "H4sIAAAAAAAA/9VZ23LaMBAV2AbshIRA0kIfM9O3dsYO5pI3ZnrJd7hJ+IJ+gB/60n51o0FrHy+bDMGrB3aGke2Vzh6dlSzJdMzOBi+/jrsOXdkz+0Z1Nq5M21mmiJX65Nk5EZ7dE+EZnAjPUJFnR+BpS5pvkdnNub7Zzcc9Jza2iQ7Ab94CYkH/uTJ2ZRf8ionJYqGzWvjrNH+MTdOU+c9jh9n3g78g/IEf/JR4fytrfOwLxQ1c+VDWWj5AG2tDd42DmHDJ1wXfd+YLwPeD+XAM/2Q+HPfEiXTrQV8Ux9Xad16ob33oW+eV0phaO3xGWifG6xjNKOcx48P5E58h1SlrPj3mC8EXM18EPtLflrdQj+e+D/W+wnM+JgOzP4bJTzlHrX2MqdAD/ovlku48J2HZjI0+1D0EPW+ZPj7WCtTHh/5Wn8kr/OnaWr80lQVMT9S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P9Qw9rNqPV5GdPQP9zAp65v9sL8jWhYM26umnq1fTqzwriR2e7BcMIThciudsW0/yIk37ESR5xMr92ChZGbH4SyVANuRgtooNjMD/Kri5nTRVVjaf7dp5EDubuc5NOUhk23XpeLfZdFQsy1CKqylBoiCM9EtGuEO65nbbC3CIXoobIXw==", + "brillig_names": [ + "pack_arguments_oracle_wrapper", + "enqueue_public_function_call_internal" + ], + "verification_key": "AAAAAAAAIAAAAAAAAAAADQAAAAAAAAAAAAAAAAAAAAUA1nYzEmPwSvVTAN4u+zKA6xCBXSoG0LbJ\n9Q49WAsJWs2pnq5lUu9XFhuUIfCbhmUlHpZchSPByhgx1oJyZ57HIwAAAAAAAAAAABmthydR3ycq\n4WFKAMKcOecO8hAgcAPaLXr/3POd+yxeAnvg8Psa/HTbsbxfSyKVlA7/StKc/E70dLqA76jWGTEA\npkTdl6mkMLl8zU49Z+y0/ntNent4E5oCQRZTHjkeiiVRR75OZqm7h4sRqJQaHMnnLZSAHDl2nHGK\nGw8+suDFLxG7BUGmHy5mG3FxkTA9MFL1HvFqnarOVARJW/D4i20k1XVyD27VLtAUi7M5O1lor6e0\nBLxp07tgsLCaOqPHgCb8Zn9azxZYWL7M4Nx+HLAq9hq/hMoinABCyjGwZLrbLVIKK0xpZiL23n7c\n7HlEUXhWM27JO1niaWoFP6pN+EwSM6+1mSQCd1QEKj8XHmY0ca2BGc9xPWVnIZcYDFGnNRgAWjqW\nLxydLXANrFo4er6E3caWj7sW4GT/ZhLt4F0KLEeo/zNYw7Uy+Y5WDTG1/FZKJbfpUzZrqPO0RyO9\nf0EKc4YBQQHdnFnuEtftkq8cmCksADsuBQGiHJhTALNtyREwbQYjHrVRG2pK9iKsGbyxqnoaJGcV\nIykX3t1/cAPjD2yfeNrQX1jnaMgHeENWtTzB8+anVLgiRdWDS0u993Ei+/BxokM4W2q1EJ3epmt6\nSOESuuTuLA+lKjHGKjpitgelBMYrGotg14HmHr3vSFWX29LZqUJepKfyg6PJx5fCFH4Kl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3tIEUrwQw/dl\n47wmQ8ZBrww7sBc4abnf3wokm2EoMp4G0BUBCoScNo6qcmfyt54wbohVMi0S+6hdhETJX1ISnNEl\nIWW8Eo9V1I2IR6qBdrN0T8Z2qGU9DLxQs9Dk1LcguZMQavXflCxhvEyiJ3LOcIdHPYUyLXCBgHos\n7sn1zyXZPCMRmtGn+fy/ULQ1oiscNqnPe18/xglNgnyQ/WnFQuRmA645tKuK6yTjpYo0CT2n2jvI\n+5Wl8iwIU7qw7gx9DjsPlkprougN4PPF2Vs+ZorzhEdV+FaH4i7jlyNZbe89jxqEOK25+fpM8t7v\nqvhw+NvMiTDJHD3RB9KfRPGlDrwEHcg2BBrM/gVLfGXwxDGAIrOGTv0eGIOwzBXGvrL1t88kWQ2K\nOKQCDCZuOZvEf0aB31fEkpmTtoOVGcDxcwfdIC7pmHPZZvPB9BKR4uLVkmf7Lm1F7rGNAiwOjPeP\naO21AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\nAAAAAAAAAAAAAiqw6G/2YxfOLJh2BpCTqsTbIDI/Kk81SmQN4hV48Hg/H4/iSDMq0QlxLGdx/eHU\nWeSsUgXI0IeSVj+8xPepD90Py7+dPPQCuqPu2l8Knkm1werJWyZMMC3IVObyLXMw3yg+39qJyUgF\nl/CzRC6XUt751Y/Ckgg2GUJh97Fj/vuvATgwXZNKpmayZy8htuiA1AuYunSoxl7i+D2PbC6ohGQY\nj8a+zx02yPQI5Rd6FkK2tUtzEwRFJMUf6M6rFylnBQ==" } ], "outputs": { @@ -1997,12 +1977,12 @@ } ], "kind": "struct", - "path": "SimpleLogging::increace_counter_private_parameters" + "path": "SimpleLogging::increase_counter_private_parameters" } } ], "kind": "struct", - "path": "SimpleLogging::increace_counter_private_abi" + "path": "SimpleLogging::increase_counter_private_abi" }, { "fields": [ @@ -2050,105 +2030,105 @@ } }, "file_map": { - "109": { - "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.65.0/noir-projects/aztec-nr/aztec/src/state_vars/map.nr", + "102": { + "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.66.0/noir-projects/aztec-nr/aztec/src/state_vars/map.nr", "source": "use crate::state_vars::storage::Storage;\nuse dep::protocol_types::{\n storage::map::derive_storage_slot_in_map,\n traits::{Deserialize, Serialize, ToField},\n};\n\n// docs:start:map\npub struct Map {\n context: Context,\n storage_slot: Field,\n state_var_constructor: fn(Context, Field) -> V,\n}\n// docs:end:map\n\nimpl Storage for Map\nwhere\n T: Serialize + Deserialize,\n{}\n\nimpl Map {\n // docs:start:new\n pub fn new(\n context: Context,\n storage_slot: Field,\n state_var_constructor: fn(Context, Field) -> V,\n ) -> Self {\n assert(storage_slot != 0, \"Storage slot 0 not allowed. Storage slots must start from 1.\");\n Map { context, storage_slot, state_var_constructor }\n }\n // docs:end:new\n\n // docs:start:at\n pub fn at(self, key: K) -> V\n where\n K: ToField,\n {\n // TODO(#1204): use a generator index for the storage slot\n let derived_storage_slot = derive_storage_slot_in_map(self.storage_slot, key);\n\n let state_var_constructor = self.state_var_constructor;\n state_var_constructor(self.context, derived_storage_slot)\n }\n // docs:end:at\n}\n" }, - "122": { - "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.65.0/noir-projects/aztec-nr/aztec/src/state_vars/public_mutable.nr", + "115": { + "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.66.0/noir-projects/aztec-nr/aztec/src/state_vars/public_mutable.nr", "source": "use crate::context::{PublicContext, UnconstrainedContext};\nuse crate::state_vars::storage::Storage;\nuse dep::protocol_types::traits::{Deserialize, Serialize};\n\n// docs:start:public_mutable_struct\npub struct PublicMutable {\n context: Context,\n storage_slot: Field,\n}\n// docs:end:public_mutable_struct\n\nimpl Storage for PublicMutable\nwhere\n T: Serialize + Deserialize,\n{}\n\nimpl PublicMutable {\n // docs:start:public_mutable_struct_new\n pub fn new(\n // Note: Passing the contexts to new(...) just to have an interface compatible with a Map.\n context: Context,\n storage_slot: Field,\n ) -> Self {\n assert(storage_slot != 0, \"Storage slot 0 not allowed. Storage slots must start from 1.\");\n PublicMutable { context, storage_slot }\n }\n // docs:end:public_mutable_struct_new\n}\n\nimpl PublicMutable\nwhere\n T: Serialize + Deserialize,\n{\n // docs:start:public_mutable_struct_read\n pub fn read(self) -> T {\n self.context.storage_read(self.storage_slot)\n }\n // docs:end:public_mutable_struct_read\n\n // docs:start:public_mutable_struct_write\n pub fn write(self, value: T) {\n self.context.storage_write(self.storage_slot, value);\n }\n // docs:end:public_mutable_struct_write\n}\n\nimpl PublicMutable\nwhere\n T: Deserialize,\n{\n pub unconstrained fn read(self) -> T {\n self.context.storage_read(self.storage_slot)\n }\n}\n" }, - "126": { - "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.65.0/noir-projects/aztec-nr/aztec/src/context/private_context.nr", - "source": "use crate::{\n context::{inputs::PrivateContextInputs, packed_returns::PackedReturns},\n hash::{ArgsHasher, hash_args_array},\n keys::constants::{NULLIFIER_INDEX, NUM_KEY_TYPES, OUTGOING_INDEX, sk_generators},\n messaging::process_l1_to_l2_message,\n oracle::{\n arguments,\n call_private_function::call_private_function_internal,\n enqueue_public_function_call::{\n enqueue_public_function_call_internal, notify_set_min_revertible_side_effect_counter,\n set_public_teardown_function_call_internal,\n },\n header::get_header_at,\n key_validation_request::get_key_validation_request,\n logs::{emit_encrypted_event_log, emit_encrypted_note_log},\n returns::pack_returns,\n },\n};\nuse dep::protocol_types::{\n abis::{\n call_context::CallContext,\n function_selector::FunctionSelector,\n log_hash::{EncryptedLogHash, LogHash, NoteLogHash},\n max_block_number::MaxBlockNumber,\n note_hash::NoteHash,\n nullifier::Nullifier,\n private_call_request::PrivateCallRequest,\n private_circuit_public_inputs::PrivateCircuitPublicInputs,\n public_call_request::PublicCallRequest,\n read_request::ReadRequest,\n side_effect::Counted,\n validation_requests::{KeyValidationRequest, KeyValidationRequestAndGenerator},\n },\n address::{AztecAddress, EthAddress},\n constants::{\n MAX_CONTRACT_CLASS_LOGS_PER_CALL, MAX_ENCRYPTED_LOGS_PER_CALL, MAX_ENQUEUED_CALLS_PER_CALL,\n MAX_KEY_VALIDATION_REQUESTS_PER_CALL, MAX_L2_TO_L1_MSGS_PER_CALL,\n MAX_NOTE_ENCRYPTED_LOGS_PER_CALL, MAX_NOTE_HASH_READ_REQUESTS_PER_CALL,\n MAX_NOTE_HASHES_PER_CALL, MAX_NULLIFIER_READ_REQUESTS_PER_CALL, MAX_NULLIFIERS_PER_CALL,\n MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL, PUBLIC_DISPATCH_SELECTOR,\n },\n header::Header,\n messaging::l2_to_l1_message::L2ToL1Message,\n traits::Empty,\n};\n\n// When finished, one can call .finish() to convert back to the abi\npub struct PrivateContext {\n // docs:start:private-context\n pub inputs: PrivateContextInputs,\n pub side_effect_counter: u32,\n\n pub min_revertible_side_effect_counter: u32,\n pub is_fee_payer: bool,\n\n pub args_hash: Field,\n pub return_hash: Field,\n\n pub max_block_number: MaxBlockNumber,\n\n pub note_hash_read_requests: BoundedVec,\n pub nullifier_read_requests: BoundedVec,\n key_validation_requests_and_generators: BoundedVec,\n\n pub note_hashes: BoundedVec,\n pub nullifiers: BoundedVec,\n\n pub private_call_requests: BoundedVec,\n pub public_call_requests: BoundedVec, MAX_ENQUEUED_CALLS_PER_CALL>,\n pub public_teardown_call_request: PublicCallRequest,\n pub l2_to_l1_msgs: BoundedVec,\n // docs:end:private-context\n\n // Header of a block whose state is used during private execution (not the block the transaction is included in).\n pub historical_header: Header,\n\n pub note_encrypted_logs_hashes: BoundedVec,\n pub encrypted_logs_hashes: BoundedVec,\n pub contract_class_logs_hashes: BoundedVec,\n\n // Contains the last key validation request for each key type. This is used to cache the last request and avoid\n // fetching the same request multiple times.\n // The index of the array corresponds to the key type (0 nullifier, 1 incoming, 2 outgoing, 3 tagging).\n pub last_key_validation_requests: [Option; NUM_KEY_TYPES],\n}\n\nimpl PrivateContext {\n pub fn new(inputs: PrivateContextInputs, args_hash: Field) -> PrivateContext {\n PrivateContext {\n inputs,\n side_effect_counter: inputs.start_side_effect_counter + 1,\n min_revertible_side_effect_counter: 0,\n is_fee_payer: false,\n args_hash,\n return_hash: 0,\n max_block_number: MaxBlockNumber::empty(),\n note_hash_read_requests: BoundedVec::new(),\n nullifier_read_requests: BoundedVec::new(),\n key_validation_requests_and_generators: BoundedVec::new(),\n note_hashes: BoundedVec::new(),\n nullifiers: BoundedVec::new(),\n historical_header: inputs.historical_header,\n private_call_requests: BoundedVec::new(),\n public_call_requests: BoundedVec::new(),\n public_teardown_call_request: PublicCallRequest::empty(),\n l2_to_l1_msgs: BoundedVec::new(),\n note_encrypted_logs_hashes: BoundedVec::new(),\n encrypted_logs_hashes: BoundedVec::new(),\n contract_class_logs_hashes: BoundedVec::new(),\n last_key_validation_requests: [Option::none(); NUM_KEY_TYPES],\n }\n }\n\n pub fn msg_sender(self) -> AztecAddress {\n self.inputs.call_context.msg_sender\n }\n\n pub fn this_address(self) -> AztecAddress {\n self.inputs.call_context.contract_address\n }\n\n pub fn chain_id(self) -> Field {\n self.inputs.tx_context.chain_id\n }\n\n pub fn version(self) -> Field {\n self.inputs.tx_context.version\n }\n\n pub fn selector(self) -> FunctionSelector {\n self.inputs.call_context.function_selector\n }\n\n pub fn get_args_hash(self) -> Field {\n self.args_hash\n }\n\n pub fn push_note_hash(&mut self, note_hash: Field) {\n self.note_hashes.push(NoteHash { value: note_hash, counter: self.next_counter() });\n }\n\n pub fn push_nullifier(&mut self, nullifier: Field) {\n self.nullifiers.push(\n Nullifier { value: nullifier, note_hash: 0, counter: self.next_counter() },\n );\n }\n\n pub fn push_nullifier_for_note_hash(&mut self, nullifier: Field, nullified_note_hash: Field) {\n self.nullifiers.push(\n Nullifier {\n value: nullifier,\n note_hash: nullified_note_hash,\n counter: self.next_counter(),\n },\n );\n }\n\n // Returns the header of a block whose state is used during private execution (not the block the transaction is\n // included in).\n pub fn get_header(self) -> Header {\n self.historical_header\n }\n\n // Returns the header of an arbitrary block whose block number is less than or equal to the block number\n // of historical header.\n pub fn get_header_at(self, block_number: u32) -> Header {\n get_header_at(block_number, self)\n }\n\n pub fn set_return_hash(&mut self, returns_hasher: ArgsHasher) {\n pack_returns(returns_hasher.fields);\n self.return_hash = returns_hasher.hash();\n }\n\n pub fn finish(self) -> PrivateCircuitPublicInputs {\n PrivateCircuitPublicInputs {\n call_context: self.inputs.call_context,\n args_hash: self.args_hash,\n returns_hash: self.return_hash,\n min_revertible_side_effect_counter: self.min_revertible_side_effect_counter,\n is_fee_payer: self.is_fee_payer,\n max_block_number: self.max_block_number,\n note_hash_read_requests: self.note_hash_read_requests.storage(),\n nullifier_read_requests: self.nullifier_read_requests.storage(),\n key_validation_requests_and_generators: self\n .key_validation_requests_and_generators\n .storage(),\n note_hashes: self.note_hashes.storage(),\n nullifiers: self.nullifiers.storage(),\n private_call_requests: self.private_call_requests.storage(),\n public_call_requests: self.public_call_requests.storage(),\n public_teardown_call_request: self.public_teardown_call_request,\n l2_to_l1_msgs: self.l2_to_l1_msgs.storage(),\n start_side_effect_counter: self.inputs.start_side_effect_counter,\n end_side_effect_counter: self.side_effect_counter,\n note_encrypted_logs_hashes: self.note_encrypted_logs_hashes.storage(),\n encrypted_logs_hashes: self.encrypted_logs_hashes.storage(),\n contract_class_logs_hashes: self.contract_class_logs_hashes.storage(),\n historical_header: self.historical_header,\n tx_context: self.inputs.tx_context,\n }\n }\n\n pub fn set_as_fee_payer(&mut self) {\n dep::protocol_types::debug_log::debug_log_format(\n \"Setting {0} as fee payer\",\n [self.this_address().to_field()],\n );\n self.is_fee_payer = true;\n }\n\n pub fn end_setup(&mut self) {\n // dep::protocol_types::debug_log::debug_log_format(\n // \"Ending setup at counter {0}\",\n // [self.side_effect_counter as Field]\n // );\n self.min_revertible_side_effect_counter = self.side_effect_counter;\n notify_set_min_revertible_side_effect_counter(self.min_revertible_side_effect_counter);\n }\n\n // docs:start:max-block-number\n pub fn set_tx_max_block_number(&mut self, max_block_number: u32) {\n // docs:end:max-block-number\n self.max_block_number =\n MaxBlockNumber::min_with_u32(self.max_block_number, max_block_number);\n }\n\n pub fn push_note_hash_read_request(&mut self, note_hash: Field) {\n let side_effect = ReadRequest { value: note_hash, counter: self.next_counter() };\n self.note_hash_read_requests.push(side_effect);\n }\n\n pub fn push_nullifier_read_request(&mut self, nullifier: Field) {\n let request = ReadRequest { value: nullifier, counter: self.next_counter() };\n self.nullifier_read_requests.push(request);\n }\n\n pub fn request_nsk_app(&mut self, npk_m_hash: Field) -> Field {\n self.request_sk_app(npk_m_hash, NULLIFIER_INDEX)\n }\n\n pub fn request_ovsk_app(&mut self, ovpk_m_hash: Field) -> Field {\n self.request_sk_app(ovpk_m_hash, OUTGOING_INDEX)\n }\n\n fn request_sk_app(&mut self, pk_m_hash: Field, key_index: Field) -> Field {\n let cached_request =\n self.last_key_validation_requests[key_index].unwrap_or(KeyValidationRequest::empty());\n\n if cached_request.pk_m.hash() == pk_m_hash {\n // We get a match so the cached request is the latest one\n cached_request.sk_app\n } else {\n // We didn't get a match meaning the cached result is stale\n // Typically we'd validate keys by showing that they are the preimage of `pk_m_hash`, but that'd require\n // the oracle returning the master secret keys, which could cause malicious contracts to leak it or learn\n // about secrets from other contracts. We therefore silo secret keys, and rely on the private kernel to\n // validate that we siloed secret key corresponds to correct siloing of the master secret key that hashes\n // to `pk_m_hash`.\n let request = unsafe { get_key_validation_request(pk_m_hash, key_index) };\n assert(request.pk_m.hash() == pk_m_hash);\n\n self.key_validation_requests_and_generators.push(\n KeyValidationRequestAndGenerator {\n request,\n sk_app_generator: sk_generators[key_index],\n },\n );\n self.last_key_validation_requests[key_index] = Option::some(request);\n request.sk_app\n }\n }\n\n // docs:start:context_message_portal\n pub fn message_portal(&mut self, recipient: EthAddress, content: Field) {\n // docs:end:context_message_portal\n let message = L2ToL1Message { recipient, content, counter: self.next_counter() };\n self.l2_to_l1_msgs.push(message);\n }\n\n // docs:start:context_consume_l1_to_l2_message\n // docs:start:consume_l1_to_l2_message\n pub fn consume_l1_to_l2_message(\n &mut self,\n content: Field,\n secret: Field,\n sender: EthAddress,\n leaf_index: Field,\n ) {\n // docs:end:context_consume_l1_to_l2_message\n let nullifier = process_l1_to_l2_message(\n self.historical_header.state.l1_to_l2_message_tree.root,\n self.this_address(),\n sender,\n self.chain_id(),\n self.version(),\n content,\n secret,\n leaf_index,\n );\n\n // Push nullifier (and the \"commitment\" corresponding to this can be \"empty\")\n self.push_nullifier(nullifier)\n }\n // docs:end:consume_l1_to_l2_message\n\n // NB: A randomness value of 0 signals that the kernels should not mask the contract address\n // used in siloing later on e.g. 'handshaking' contract w/ known address.\n pub fn emit_raw_event_log_with_masked_address(\n &mut self,\n randomness: Field,\n log: [u8; M],\n log_hash: Field,\n ) {\n let counter = self.next_counter();\n let contract_address = self.this_address();\n let len = log.len() as Field + 4;\n let side_effect = EncryptedLogHash { value: log_hash, counter, length: len, randomness };\n self.encrypted_logs_hashes.push(side_effect);\n\n emit_encrypted_event_log(contract_address, randomness, log, counter);\n }\n\n pub fn emit_raw_note_log(\n &mut self,\n note_hash_counter: u32,\n log: [u8; M],\n log_hash: Field,\n ) {\n let counter = self.next_counter();\n let len = log.len() as Field + 4;\n let side_effect = NoteLogHash { value: log_hash, counter, length: len, note_hash_counter };\n self.note_encrypted_logs_hashes.push(side_effect);\n\n emit_encrypted_note_log(note_hash_counter, log, counter);\n }\n\n pub fn call_private_function(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args: [Field; ARGS_COUNT],\n ) -> PackedReturns {\n let args_hash = hash_args_array(args);\n arguments::pack_arguments_array(args);\n self.call_private_function_with_packed_args(\n contract_address,\n function_selector,\n args_hash,\n false,\n )\n }\n\n pub fn static_call_private_function(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args: [Field; ARGS_COUNT],\n ) -> PackedReturns {\n let args_hash = hash_args_array(args);\n arguments::pack_arguments_array(args);\n self.call_private_function_with_packed_args(\n contract_address,\n function_selector,\n args_hash,\n true,\n )\n }\n\n pub fn call_private_function_no_args(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n ) -> PackedReturns {\n self.call_private_function_with_packed_args(contract_address, function_selector, 0, false)\n }\n\n pub fn static_call_private_function_no_args(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n ) -> PackedReturns {\n self.call_private_function_with_packed_args(contract_address, function_selector, 0, true)\n }\n\n pub fn call_private_function_with_packed_args(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args_hash: Field,\n is_static_call: bool,\n ) -> PackedReturns {\n let mut is_static_call = is_static_call | self.inputs.call_context.is_static_call;\n let start_side_effect_counter = self.side_effect_counter;\n\n // The oracle simulates the private call and returns the value of the side effects counter after execution of\n // the call (which means that end_side_effect_counter - start_side_effect_counter is the number of side effects\n // that took place), along with the hash of the return values. We validate these by requesting a private kernel\n // iteration in which the return values are constrained to hash to `returns_hash` and the side effects counter\n // to increment from start to end.\n let (end_side_effect_counter, returns_hash) = unsafe {\n call_private_function_internal(\n contract_address,\n function_selector,\n args_hash,\n start_side_effect_counter,\n is_static_call,\n )\n };\n\n self.private_call_requests.push(\n PrivateCallRequest {\n call_context: CallContext {\n msg_sender: self.this_address(),\n contract_address,\n function_selector,\n is_static_call,\n },\n args_hash,\n returns_hash,\n start_side_effect_counter,\n end_side_effect_counter,\n },\n );\n\n // TODO (fees) figure out why this crashes the prover and enable it\n // we need this in order to pay fees inside child call contexts\n // assert(\n // (item.public_inputs.min_revertible_side_effect_counter == 0 as u32)\n // | (item.public_inputs.min_revertible_side_effect_counter\n // > self.min_revertible_side_effect_counter)\n // );\n // if item.public_inputs.min_revertible_side_effect_counter\n // > self.min_revertible_side_effect_counter {\n // self.min_revertible_side_effect_counter = item.public_inputs.min_revertible_side_effect_counter;\n // }\n self.side_effect_counter = end_side_effect_counter + 1;\n PackedReturns::new(returns_hash)\n }\n\n pub fn call_public_function(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args: [Field; ARGS_COUNT],\n ) {\n let args_hash = hash_args_array(args);\n arguments::pack_arguments_array(args);\n self.call_public_function_with_packed_args(\n contract_address,\n function_selector,\n args_hash,\n false,\n )\n }\n\n pub fn static_call_public_function(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args: [Field; ARGS_COUNT],\n ) {\n let args_hash = hash_args_array(args);\n arguments::pack_arguments_array(args);\n self.call_public_function_with_packed_args(\n contract_address,\n function_selector,\n args_hash,\n true,\n )\n }\n\n pub fn call_public_function_no_args(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n ) {\n self.call_public_function_with_packed_args(contract_address, function_selector, 0, false)\n }\n\n pub fn static_call_public_function_no_args(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n ) {\n self.call_public_function_with_packed_args(contract_address, function_selector, 0, true)\n }\n\n pub fn call_public_function_with_packed_args(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args_hash: Field,\n is_static_call: bool,\n ) {\n let counter = self.next_counter();\n\n let mut is_static_call = is_static_call | self.inputs.call_context.is_static_call;\n // TODO(https://github.com/AztecProtocol/aztec-packages/issues/8985): Fix this.\n // WARNING: This is insecure and should be temporary!\n // The oracle repacks the arguments and returns a new args_hash.\n // new_args = [selector, ...old_args], so as to make it suitable to call the public dispatch function.\n // We don't validate or compute it in the circuit because a) it's harder to do with slices, and\n // b) this is only temporary.\n let args_hash = enqueue_public_function_call_internal(\n contract_address,\n function_selector,\n args_hash,\n counter,\n is_static_call,\n );\n\n // Public calls are rerouted through the dispatch function.\n let function_selector = comptime { FunctionSelector::from_field(PUBLIC_DISPATCH_SELECTOR) };\n\n let call_request = PublicCallRequest {\n msg_sender: self.this_address(),\n contract_address,\n function_selector,\n is_static_call,\n args_hash,\n };\n\n self.public_call_requests.push(Counted::new(call_request, counter));\n }\n\n pub fn set_public_teardown_function(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args: [Field; ARGS_COUNT],\n ) {\n let args_hash = hash_args_array(args);\n arguments::pack_arguments_array(args);\n self.set_public_teardown_function_with_packed_args(\n contract_address,\n function_selector,\n args_hash,\n false,\n )\n }\n\n pub fn set_public_teardown_function_with_packed_args(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args_hash: Field,\n is_static_call: bool,\n ) {\n let counter = self.next_counter();\n\n let mut is_static_call = is_static_call | self.inputs.call_context.is_static_call;\n // TODO(https://github.com/AztecProtocol/aztec-packages/issues/8985): Fix this.\n // WARNING: This is insecure and should be temporary!\n // The oracle repacks the arguments and returns a new args_hash.\n // new_args = [selector, ...old_args], so as to make it suitable to call the public dispatch function.\n // We don't validate or compute it in the circuit because a) it's harder to do with slices, and\n // b) this is only temporary.\n let args_hash = set_public_teardown_function_call_internal(\n contract_address,\n function_selector,\n args_hash,\n counter,\n is_static_call,\n );\n\n let function_selector = comptime { FunctionSelector::from_field(PUBLIC_DISPATCH_SELECTOR) };\n\n self.public_teardown_call_request = PublicCallRequest {\n msg_sender: self.this_address(),\n contract_address,\n function_selector,\n is_static_call,\n args_hash,\n };\n }\n\n fn next_counter(&mut self) -> u32 {\n let counter = self.side_effect_counter;\n self.side_effect_counter += 1;\n counter\n }\n}\n\nimpl Empty for PrivateContext {\n fn empty() -> Self {\n PrivateContext {\n inputs: PrivateContextInputs::empty(),\n side_effect_counter: 0 as u32,\n min_revertible_side_effect_counter: 0 as u32,\n is_fee_payer: false,\n args_hash: 0,\n return_hash: 0,\n max_block_number: MaxBlockNumber::empty(),\n note_hash_read_requests: BoundedVec::new(),\n nullifier_read_requests: BoundedVec::new(),\n key_validation_requests_and_generators: BoundedVec::new(),\n note_hashes: BoundedVec::new(),\n nullifiers: BoundedVec::new(),\n private_call_requests: BoundedVec::new(),\n public_call_requests: BoundedVec::new(),\n public_teardown_call_request: PublicCallRequest::empty(),\n l2_to_l1_msgs: BoundedVec::new(),\n historical_header: Header::empty(),\n note_encrypted_logs_hashes: BoundedVec::new(),\n encrypted_logs_hashes: BoundedVec::new(),\n contract_class_logs_hashes: BoundedVec::new(),\n last_key_validation_requests: [Option::none(); NUM_KEY_TYPES],\n }\n }\n}\n" + "119": { + "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.66.0/noir-projects/aztec-nr/aztec/src/context/private_context.nr", + "source": "use crate::{\n context::{inputs::PrivateContextInputs, packed_returns::PackedReturns},\n hash::{ArgsHasher, hash_args_array},\n keys::constants::{NULLIFIER_INDEX, NUM_KEY_TYPES, OUTGOING_INDEX, sk_generators},\n messaging::process_l1_to_l2_message,\n oracle::{\n arguments,\n call_private_function::call_private_function_internal,\n enqueue_public_function_call::{\n enqueue_public_function_call_internal, notify_set_min_revertible_side_effect_counter,\n set_public_teardown_function_call_internal,\n },\n header::get_header_at,\n key_validation_request::get_key_validation_request,\n returns::pack_returns,\n },\n};\nuse dep::protocol_types::{\n abis::{\n call_context::CallContext,\n function_selector::FunctionSelector,\n log::Log,\n log_hash::LogHash,\n max_block_number::MaxBlockNumber,\n note_hash::NoteHash,\n nullifier::Nullifier,\n private_call_request::PrivateCallRequest,\n private_circuit_public_inputs::PrivateCircuitPublicInputs,\n private_log::PrivateLogData,\n public_call_request::PublicCallRequest,\n read_request::ReadRequest,\n side_effect::Counted,\n validation_requests::{KeyValidationRequest, KeyValidationRequestAndGenerator},\n },\n address::{AztecAddress, EthAddress},\n constants::{\n MAX_CONTRACT_CLASS_LOGS_PER_CALL, MAX_ENQUEUED_CALLS_PER_CALL,\n MAX_KEY_VALIDATION_REQUESTS_PER_CALL, MAX_L2_TO_L1_MSGS_PER_CALL,\n MAX_NOTE_HASH_READ_REQUESTS_PER_CALL, MAX_NOTE_HASHES_PER_CALL,\n MAX_NULLIFIER_READ_REQUESTS_PER_CALL, MAX_NULLIFIERS_PER_CALL,\n MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL, MAX_PRIVATE_LOGS_PER_CALL,\n PRIVATE_LOG_SIZE_IN_FIELDS, PUBLIC_DISPATCH_SELECTOR,\n },\n header::Header,\n messaging::l2_to_l1_message::L2ToL1Message,\n traits::Empty,\n};\n\n// When finished, one can call .finish() to convert back to the abi\npub struct PrivateContext {\n // docs:start:private-context\n pub inputs: PrivateContextInputs,\n pub side_effect_counter: u32,\n\n pub min_revertible_side_effect_counter: u32,\n pub is_fee_payer: bool,\n\n pub args_hash: Field,\n pub return_hash: Field,\n\n pub max_block_number: MaxBlockNumber,\n\n pub note_hash_read_requests: BoundedVec,\n pub nullifier_read_requests: BoundedVec,\n key_validation_requests_and_generators: BoundedVec,\n\n pub note_hashes: BoundedVec,\n pub nullifiers: BoundedVec,\n\n pub private_call_requests: BoundedVec,\n pub public_call_requests: BoundedVec, MAX_ENQUEUED_CALLS_PER_CALL>,\n pub public_teardown_call_request: PublicCallRequest,\n pub l2_to_l1_msgs: BoundedVec,\n // docs:end:private-context\n\n // Header of a block whose state is used during private execution (not the block the transaction is included in).\n pub historical_header: Header,\n\n pub private_logs: BoundedVec,\n pub contract_class_logs_hashes: BoundedVec,\n\n // Contains the last key validation request for each key type. This is used to cache the last request and avoid\n // fetching the same request multiple times.\n // The index of the array corresponds to the key type (0 nullifier, 1 incoming, 2 outgoing, 3 tagging).\n pub last_key_validation_requests: [Option; NUM_KEY_TYPES],\n}\n\nimpl PrivateContext {\n pub fn new(inputs: PrivateContextInputs, args_hash: Field) -> PrivateContext {\n PrivateContext {\n inputs,\n side_effect_counter: inputs.start_side_effect_counter + 1,\n min_revertible_side_effect_counter: 0,\n is_fee_payer: false,\n args_hash,\n return_hash: 0,\n max_block_number: MaxBlockNumber::empty(),\n note_hash_read_requests: BoundedVec::new(),\n nullifier_read_requests: BoundedVec::new(),\n key_validation_requests_and_generators: BoundedVec::new(),\n note_hashes: BoundedVec::new(),\n nullifiers: BoundedVec::new(),\n historical_header: inputs.historical_header,\n private_call_requests: BoundedVec::new(),\n public_call_requests: BoundedVec::new(),\n public_teardown_call_request: PublicCallRequest::empty(),\n l2_to_l1_msgs: BoundedVec::new(),\n private_logs: BoundedVec::new(),\n contract_class_logs_hashes: BoundedVec::new(),\n last_key_validation_requests: [Option::none(); NUM_KEY_TYPES],\n }\n }\n\n pub fn msg_sender(self) -> AztecAddress {\n self.inputs.call_context.msg_sender\n }\n\n pub fn this_address(self) -> AztecAddress {\n self.inputs.call_context.contract_address\n }\n\n pub fn chain_id(self) -> Field {\n self.inputs.tx_context.chain_id\n }\n\n pub fn version(self) -> Field {\n self.inputs.tx_context.version\n }\n\n pub fn selector(self) -> FunctionSelector {\n self.inputs.call_context.function_selector\n }\n\n pub fn get_args_hash(self) -> Field {\n self.args_hash\n }\n\n pub fn push_note_hash(&mut self, note_hash: Field) {\n self.note_hashes.push(NoteHash { value: note_hash, counter: self.next_counter() });\n }\n\n pub fn push_nullifier(&mut self, nullifier: Field) {\n self.nullifiers.push(\n Nullifier { value: nullifier, note_hash: 0, counter: self.next_counter() },\n );\n }\n\n pub fn push_nullifier_for_note_hash(&mut self, nullifier: Field, nullified_note_hash: Field) {\n self.nullifiers.push(\n Nullifier {\n value: nullifier,\n note_hash: nullified_note_hash,\n counter: self.next_counter(),\n },\n );\n }\n\n // Returns the header of a block whose state is used during private execution (not the block the transaction is\n // included in).\n pub fn get_header(self) -> Header {\n self.historical_header\n }\n\n // Returns the header of an arbitrary block whose block number is less than or equal to the block number\n // of historical header.\n pub fn get_header_at(self, block_number: u32) -> Header {\n get_header_at(block_number, self)\n }\n\n pub fn set_return_hash(&mut self, returns_hasher: ArgsHasher) {\n pack_returns(returns_hasher.fields);\n self.return_hash = returns_hasher.hash();\n }\n\n pub fn finish(self) -> PrivateCircuitPublicInputs {\n PrivateCircuitPublicInputs {\n call_context: self.inputs.call_context,\n args_hash: self.args_hash,\n returns_hash: self.return_hash,\n min_revertible_side_effect_counter: self.min_revertible_side_effect_counter,\n is_fee_payer: self.is_fee_payer,\n max_block_number: self.max_block_number,\n note_hash_read_requests: self.note_hash_read_requests.storage(),\n nullifier_read_requests: self.nullifier_read_requests.storage(),\n key_validation_requests_and_generators: self\n .key_validation_requests_and_generators\n .storage(),\n note_hashes: self.note_hashes.storage(),\n nullifiers: self.nullifiers.storage(),\n private_call_requests: self.private_call_requests.storage(),\n public_call_requests: self.public_call_requests.storage(),\n public_teardown_call_request: self.public_teardown_call_request,\n l2_to_l1_msgs: self.l2_to_l1_msgs.storage(),\n start_side_effect_counter: self.inputs.start_side_effect_counter,\n end_side_effect_counter: self.side_effect_counter,\n private_logs: self.private_logs.storage(),\n contract_class_logs_hashes: self.contract_class_logs_hashes.storage(),\n historical_header: self.historical_header,\n tx_context: self.inputs.tx_context,\n }\n }\n\n pub fn set_as_fee_payer(&mut self) {\n dep::protocol_types::debug_log::debug_log_format(\n \"Setting {0} as fee payer\",\n [self.this_address().to_field()],\n );\n self.is_fee_payer = true;\n }\n\n pub fn end_setup(&mut self) {\n // dep::protocol_types::debug_log::debug_log_format(\n // \"Ending setup at counter {0}\",\n // [self.side_effect_counter as Field]\n // );\n self.min_revertible_side_effect_counter = self.side_effect_counter;\n notify_set_min_revertible_side_effect_counter(self.min_revertible_side_effect_counter);\n }\n\n // docs:start:max-block-number\n pub fn set_tx_max_block_number(&mut self, max_block_number: u32) {\n // docs:end:max-block-number\n self.max_block_number =\n MaxBlockNumber::min_with_u32(self.max_block_number, max_block_number);\n }\n\n pub fn push_note_hash_read_request(&mut self, note_hash: Field) {\n let side_effect = ReadRequest { value: note_hash, counter: self.next_counter() };\n self.note_hash_read_requests.push(side_effect);\n }\n\n pub fn push_nullifier_read_request(&mut self, nullifier: Field) {\n let request = ReadRequest { value: nullifier, counter: self.next_counter() };\n self.nullifier_read_requests.push(request);\n }\n\n pub fn request_nsk_app(&mut self, npk_m_hash: Field) -> Field {\n self.request_sk_app(npk_m_hash, NULLIFIER_INDEX)\n }\n\n pub fn request_ovsk_app(&mut self, ovpk_m_hash: Field) -> Field {\n self.request_sk_app(ovpk_m_hash, OUTGOING_INDEX)\n }\n\n fn request_sk_app(&mut self, pk_m_hash: Field, key_index: Field) -> Field {\n let cached_request =\n self.last_key_validation_requests[key_index].unwrap_or(KeyValidationRequest::empty());\n\n if cached_request.pk_m.hash() == pk_m_hash {\n // We get a match so the cached request is the latest one\n cached_request.sk_app\n } else {\n // We didn't get a match meaning the cached result is stale\n // Typically we'd validate keys by showing that they are the preimage of `pk_m_hash`, but that'd require\n // the oracle returning the master secret keys, which could cause malicious contracts to leak it or learn\n // about secrets from other contracts. We therefore silo secret keys, and rely on the private kernel to\n // validate that we siloed secret key corresponds to correct siloing of the master secret key that hashes\n // to `pk_m_hash`.\n let request = unsafe { get_key_validation_request(pk_m_hash, key_index) };\n assert(request.pk_m.hash() == pk_m_hash);\n\n self.key_validation_requests_and_generators.push(\n KeyValidationRequestAndGenerator {\n request,\n sk_app_generator: sk_generators[key_index],\n },\n );\n self.last_key_validation_requests[key_index] = Option::some(request);\n request.sk_app\n }\n }\n\n // docs:start:context_message_portal\n pub fn message_portal(&mut self, recipient: EthAddress, content: Field) {\n // docs:end:context_message_portal\n let message = L2ToL1Message { recipient, content, counter: self.next_counter() };\n self.l2_to_l1_msgs.push(message);\n }\n\n // docs:start:context_consume_l1_to_l2_message\n // docs:start:consume_l1_to_l2_message\n pub fn consume_l1_to_l2_message(\n &mut self,\n content: Field,\n secret: Field,\n sender: EthAddress,\n leaf_index: Field,\n ) {\n // docs:end:context_consume_l1_to_l2_message\n let nullifier = process_l1_to_l2_message(\n self.historical_header.state.l1_to_l2_message_tree.root,\n self.this_address(),\n sender,\n self.chain_id(),\n self.version(),\n content,\n secret,\n leaf_index,\n );\n\n // Push nullifier (and the \"commitment\" corresponding to this can be \"empty\")\n self.push_nullifier(nullifier)\n }\n // docs:end:consume_l1_to_l2_message\n\n pub fn emit_private_log(&mut self, log: [Field; PRIVATE_LOG_SIZE_IN_FIELDS]) {\n let counter = self.next_counter();\n let private_log = PrivateLogData { log: Log::new(log), note_hash_counter: 0, counter };\n self.private_logs.push(private_log);\n }\n\n pub fn emit_raw_note_log(\n &mut self,\n log: [Field; PRIVATE_LOG_SIZE_IN_FIELDS],\n note_hash_counter: u32,\n ) {\n let counter = self.next_counter();\n let private_log = PrivateLogData { log: Log::new(log), note_hash_counter, counter };\n self.private_logs.push(private_log);\n }\n\n pub fn call_private_function(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args: [Field; ARGS_COUNT],\n ) -> PackedReturns {\n let args_hash = hash_args_array(args);\n arguments::pack_arguments_array(args);\n self.call_private_function_with_packed_args(\n contract_address,\n function_selector,\n args_hash,\n false,\n )\n }\n\n pub fn static_call_private_function(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args: [Field; ARGS_COUNT],\n ) -> PackedReturns {\n let args_hash = hash_args_array(args);\n arguments::pack_arguments_array(args);\n self.call_private_function_with_packed_args(\n contract_address,\n function_selector,\n args_hash,\n true,\n )\n }\n\n pub fn call_private_function_no_args(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n ) -> PackedReturns {\n self.call_private_function_with_packed_args(contract_address, function_selector, 0, false)\n }\n\n pub fn static_call_private_function_no_args(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n ) -> PackedReturns {\n self.call_private_function_with_packed_args(contract_address, function_selector, 0, true)\n }\n\n pub fn call_private_function_with_packed_args(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args_hash: Field,\n is_static_call: bool,\n ) -> PackedReturns {\n let mut is_static_call = is_static_call | self.inputs.call_context.is_static_call;\n let start_side_effect_counter = self.side_effect_counter;\n\n // The oracle simulates the private call and returns the value of the side effects counter after execution of\n // the call (which means that end_side_effect_counter - start_side_effect_counter is the number of side effects\n // that took place), along with the hash of the return values. We validate these by requesting a private kernel\n // iteration in which the return values are constrained to hash to `returns_hash` and the side effects counter\n // to increment from start to end.\n let (end_side_effect_counter, returns_hash) = unsafe {\n call_private_function_internal(\n contract_address,\n function_selector,\n args_hash,\n start_side_effect_counter,\n is_static_call,\n )\n };\n\n self.private_call_requests.push(\n PrivateCallRequest {\n call_context: CallContext {\n msg_sender: self.this_address(),\n contract_address,\n function_selector,\n is_static_call,\n },\n args_hash,\n returns_hash,\n start_side_effect_counter,\n end_side_effect_counter,\n },\n );\n\n // TODO (fees) figure out why this crashes the prover and enable it\n // we need this in order to pay fees inside child call contexts\n // assert(\n // (item.public_inputs.min_revertible_side_effect_counter == 0 as u32)\n // | (item.public_inputs.min_revertible_side_effect_counter\n // > self.min_revertible_side_effect_counter)\n // );\n // if item.public_inputs.min_revertible_side_effect_counter\n // > self.min_revertible_side_effect_counter {\n // self.min_revertible_side_effect_counter = item.public_inputs.min_revertible_side_effect_counter;\n // }\n self.side_effect_counter = end_side_effect_counter + 1;\n PackedReturns::new(returns_hash)\n }\n\n pub fn call_public_function(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args: [Field; ARGS_COUNT],\n ) {\n let args_hash = hash_args_array(args);\n arguments::pack_arguments_array(args);\n self.call_public_function_with_packed_args(\n contract_address,\n function_selector,\n args_hash,\n false,\n )\n }\n\n pub fn static_call_public_function(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args: [Field; ARGS_COUNT],\n ) {\n let args_hash = hash_args_array(args);\n arguments::pack_arguments_array(args);\n self.call_public_function_with_packed_args(\n contract_address,\n function_selector,\n args_hash,\n true,\n )\n }\n\n pub fn call_public_function_no_args(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n ) {\n self.call_public_function_with_packed_args(contract_address, function_selector, 0, false)\n }\n\n pub fn static_call_public_function_no_args(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n ) {\n self.call_public_function_with_packed_args(contract_address, function_selector, 0, true)\n }\n\n pub fn call_public_function_with_packed_args(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args_hash: Field,\n is_static_call: bool,\n ) {\n let counter = self.next_counter();\n\n let mut is_static_call = is_static_call | self.inputs.call_context.is_static_call;\n // TODO(https://github.com/AztecProtocol/aztec-packages/issues/8985): Fix this.\n // WARNING: This is insecure and should be temporary!\n // The oracle repacks the arguments and returns a new args_hash.\n // new_args = [selector, ...old_args], so as to make it suitable to call the public dispatch function.\n // We don't validate or compute it in the circuit because a) it's harder to do with slices, and\n // b) this is only temporary.\n let args_hash = enqueue_public_function_call_internal(\n contract_address,\n function_selector,\n args_hash,\n counter,\n is_static_call,\n );\n\n // Public calls are rerouted through the dispatch function.\n let function_selector = comptime { FunctionSelector::from_field(PUBLIC_DISPATCH_SELECTOR) };\n\n let call_request = PublicCallRequest {\n msg_sender: self.this_address(),\n contract_address,\n function_selector,\n is_static_call,\n args_hash,\n };\n\n self.public_call_requests.push(Counted::new(call_request, counter));\n }\n\n pub fn set_public_teardown_function(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args: [Field; ARGS_COUNT],\n ) {\n let args_hash = hash_args_array(args);\n arguments::pack_arguments_array(args);\n self.set_public_teardown_function_with_packed_args(\n contract_address,\n function_selector,\n args_hash,\n false,\n )\n }\n\n pub fn set_public_teardown_function_with_packed_args(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args_hash: Field,\n is_static_call: bool,\n ) {\n let counter = self.next_counter();\n\n let mut is_static_call = is_static_call | self.inputs.call_context.is_static_call;\n // TODO(https://github.com/AztecProtocol/aztec-packages/issues/8985): Fix this.\n // WARNING: This is insecure and should be temporary!\n // The oracle repacks the arguments and returns a new args_hash.\n // new_args = [selector, ...old_args], so as to make it suitable to call the public dispatch function.\n // We don't validate or compute it in the circuit because a) it's harder to do with slices, and\n // b) this is only temporary.\n let args_hash = set_public_teardown_function_call_internal(\n contract_address,\n function_selector,\n args_hash,\n counter,\n is_static_call,\n );\n\n let function_selector = comptime { FunctionSelector::from_field(PUBLIC_DISPATCH_SELECTOR) };\n\n self.public_teardown_call_request = PublicCallRequest {\n msg_sender: self.this_address(),\n contract_address,\n function_selector,\n is_static_call,\n args_hash,\n };\n }\n\n fn next_counter(&mut self) -> u32 {\n let counter = self.side_effect_counter;\n self.side_effect_counter += 1;\n counter\n }\n}\n\nimpl Empty for PrivateContext {\n fn empty() -> Self {\n PrivateContext {\n inputs: PrivateContextInputs::empty(),\n side_effect_counter: 0 as u32,\n min_revertible_side_effect_counter: 0 as u32,\n is_fee_payer: false,\n args_hash: 0,\n return_hash: 0,\n max_block_number: MaxBlockNumber::empty(),\n note_hash_read_requests: BoundedVec::new(),\n nullifier_read_requests: BoundedVec::new(),\n key_validation_requests_and_generators: BoundedVec::new(),\n note_hashes: BoundedVec::new(),\n nullifiers: BoundedVec::new(),\n private_call_requests: BoundedVec::new(),\n public_call_requests: BoundedVec::new(),\n public_teardown_call_request: PublicCallRequest::empty(),\n l2_to_l1_msgs: BoundedVec::new(),\n historical_header: Header::empty(),\n private_logs: BoundedVec::new(),\n contract_class_logs_hashes: BoundedVec::new(),\n last_key_validation_requests: [Option::none(); NUM_KEY_TYPES],\n }\n }\n}\n" }, - "127": { - "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.65.0/noir-projects/aztec-nr/aztec/src/context/call_interfaces.nr", + "120": { + "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.66.0/noir-projects/aztec-nr/aztec/src/context/call_interfaces.nr", "source": "use dep::protocol_types::{\n abis::function_selector::FunctionSelector, address::AztecAddress, traits::Deserialize,\n};\n\nuse crate::context::{gas::GasOpts, private_context::PrivateContext, public_context::PublicContext};\n\nuse crate::hash::hash_args;\nuse crate::oracle::arguments::pack_arguments;\n\npub trait CallInterface {\n fn get_args(self) -> [Field] {\n self.args\n }\n\n fn get_selector(self) -> FunctionSelector {\n self.selector\n }\n\n fn get_name(self) -> str {\n self.name\n }\n\n fn get_contract_address(self) -> AztecAddress {\n self.target_contract\n }\n\n fn get_is_static(self) -> bool {\n self.is_static\n }\n}\n\npub struct PrivateCallInterface {\n pub target_contract: AztecAddress,\n pub selector: FunctionSelector,\n pub name: str,\n pub args_hash: Field,\n pub args: [Field],\n pub return_type: T,\n pub is_static: bool,\n}\n\nimpl PrivateCallInterface {\n pub fn call(self, context: &mut PrivateContext) -> T\n where\n T: Deserialize,\n {\n pack_arguments(self.args);\n let returns = context.call_private_function_with_packed_args(\n self.target_contract,\n self.selector,\n self.args_hash,\n false,\n );\n let unpacked: T = returns.unpack_into();\n unpacked\n }\n\n pub fn view(self, context: &mut PrivateContext) -> T\n where\n T: Deserialize,\n {\n pack_arguments(self.args);\n let returns = context.call_private_function_with_packed_args(\n self.target_contract,\n self.selector,\n self.args_hash,\n true,\n );\n returns.unpack_into()\n }\n}\n\nimpl CallInterface for PrivateVoidCallInterface {}\n\npub struct PrivateVoidCallInterface {\n pub target_contract: AztecAddress,\n pub selector: FunctionSelector,\n pub name: str,\n pub args_hash: Field,\n pub args: [Field],\n pub return_type: (),\n pub is_static: bool,\n}\n\nimpl PrivateVoidCallInterface {\n pub fn call(self, context: &mut PrivateContext) {\n pack_arguments(self.args);\n context\n .call_private_function_with_packed_args(\n self.target_contract,\n self.selector,\n self.args_hash,\n false,\n )\n .assert_empty();\n }\n\n pub fn view(self, context: &mut PrivateContext) {\n pack_arguments(self.args);\n context\n .call_private_function_with_packed_args(\n self.target_contract,\n self.selector,\n self.args_hash,\n true,\n )\n .assert_empty();\n }\n}\n\nimpl CallInterface for PrivateStaticCallInterface {}\n\npub struct PrivateStaticCallInterface {\n pub target_contract: AztecAddress,\n pub selector: FunctionSelector,\n pub name: str,\n pub args_hash: Field,\n pub args: [Field],\n pub return_type: T,\n pub is_static: bool,\n}\n\nimpl PrivateStaticCallInterface {\n pub fn view(self, context: &mut PrivateContext) -> T\n where\n T: Deserialize,\n {\n pack_arguments(self.args);\n let returns = context.call_private_function_with_packed_args(\n self.target_contract,\n self.selector,\n self.args_hash,\n true,\n );\n returns.unpack_into()\n }\n}\n\nimpl CallInterface for PrivateStaticVoidCallInterface {}\n\npub struct PrivateStaticVoidCallInterface {\n pub target_contract: AztecAddress,\n pub selector: FunctionSelector,\n pub name: str,\n pub args_hash: Field,\n pub args: [Field],\n pub return_type: (),\n pub is_static: bool,\n}\n\nimpl PrivateStaticVoidCallInterface {\n pub fn view(self, context: &mut PrivateContext) {\n pack_arguments(self.args);\n context\n .call_private_function_with_packed_args(\n self.target_contract,\n self.selector,\n self.args_hash,\n true,\n )\n .assert_empty();\n }\n}\n\nimpl CallInterface for PublicCallInterface {}\n\npub struct PublicCallInterface {\n pub target_contract: AztecAddress,\n pub selector: FunctionSelector,\n pub name: str,\n pub args: [Field],\n pub gas_opts: GasOpts,\n pub return_type: T,\n pub is_static: bool,\n}\n\nimpl PublicCallInterface {\n pub fn with_gas(self: &mut Self, gas_opts: GasOpts) -> &mut Self {\n self.gas_opts = gas_opts;\n self\n }\n\n pub unconstrained fn call(self, context: &mut PublicContext) -> T\n where\n T: Deserialize,\n {\n let returns = context.call_public_function(\n self.target_contract,\n self.selector,\n self.args,\n self.gas_opts,\n );\n Deserialize::deserialize(returns.as_array::())\n }\n\n pub unconstrained fn view(self, context: &mut PublicContext) -> T\n where\n T: Deserialize,\n {\n let returns = context.static_call_public_function(\n self.target_contract,\n self.selector,\n self.args,\n self.gas_opts,\n );\n Deserialize::deserialize(returns.as_array::())\n }\n\n pub fn enqueue(self, context: &mut PrivateContext) {\n let args_hash = hash_args(self.args);\n pack_arguments(self.args);\n context.call_public_function_with_packed_args(\n self.target_contract,\n self.selector,\n args_hash,\n /*static=*/\n false,\n )\n }\n\n pub fn enqueue_view(self, context: &mut PrivateContext) {\n let args_hash = hash_args(self.args);\n pack_arguments(self.args);\n context.call_public_function_with_packed_args(\n self.target_contract,\n self.selector,\n args_hash,\n /*static=*/\n true,\n )\n }\n}\n\nimpl CallInterface for PublicVoidCallInterface {}\n\npub struct PublicVoidCallInterface {\n pub target_contract: AztecAddress,\n pub selector: FunctionSelector,\n pub name: str,\n pub args: [Field],\n pub return_type: (),\n pub is_static: bool,\n pub gas_opts: GasOpts,\n}\n\nimpl PublicVoidCallInterface {\n pub fn with_gas(self: &mut Self, gas_opts: GasOpts) -> &mut Self {\n self.gas_opts = gas_opts;\n self\n }\n\n pub unconstrained fn call(self, context: &mut PublicContext) {\n let returns = context.call_public_function(\n self.target_contract,\n self.selector,\n self.args,\n self.gas_opts,\n );\n assert(returns.len() == 0);\n }\n\n pub unconstrained fn view(self, context: &mut PublicContext) {\n let returns = context.static_call_public_function(\n self.target_contract,\n self.selector,\n self.args,\n self.gas_opts,\n );\n assert(returns.len() == 0);\n }\n\n pub fn enqueue(self, context: &mut PrivateContext) {\n let args_hash = hash_args(self.args);\n pack_arguments(self.args);\n context.call_public_function_with_packed_args(\n self.target_contract,\n self.selector,\n args_hash,\n /*static=*/\n false,\n )\n }\n\n pub fn enqueue_view(self, context: &mut PrivateContext) {\n let args_hash = hash_args(self.args);\n pack_arguments(self.args);\n context.call_public_function_with_packed_args(\n self.target_contract,\n self.selector,\n args_hash,\n /*static=*/\n true,\n )\n }\n}\n\nimpl CallInterface for PublicStaticCallInterface {}\n\npub struct PublicStaticCallInterface {\n pub target_contract: AztecAddress,\n pub selector: FunctionSelector,\n pub name: str,\n pub args: [Field],\n pub return_type: T,\n pub is_static: bool,\n pub gas_opts: GasOpts,\n}\n\nimpl PublicStaticCallInterface {\n pub fn with_gas(self: &mut Self, gas_opts: GasOpts) -> &mut Self {\n self.gas_opts = gas_opts;\n self\n }\n\n pub unconstrained fn view(self, context: &mut PublicContext) -> T\n where\n T: Deserialize,\n {\n let returns = context.static_call_public_function(\n self.target_contract,\n self.selector,\n self.args,\n self.gas_opts,\n );\n Deserialize::deserialize(returns.as_array::())\n }\n\n pub fn enqueue_view(self, context: &mut PrivateContext) {\n let args_hash = hash_args(self.args);\n pack_arguments(self.args);\n context.call_public_function_with_packed_args(\n self.target_contract,\n self.selector,\n args_hash,\n /*static=*/\n true,\n )\n }\n}\n\nimpl CallInterface for PublicStaticVoidCallInterface {}\n\npub struct PublicStaticVoidCallInterface {\n target_contract: AztecAddress,\n selector: FunctionSelector,\n name: str,\n args: [Field],\n return_type: (),\n is_static: bool,\n gas_opts: GasOpts,\n}\n\nimpl PublicStaticVoidCallInterface {\n pub fn with_gas(self: &mut Self, gas_opts: GasOpts) -> &mut Self {\n self.gas_opts = gas_opts;\n self\n }\n\n pub unconstrained fn view(self, context: &mut PublicContext) {\n let returns = context.static_call_public_function(\n self.target_contract,\n self.selector,\n self.args,\n self.gas_opts,\n );\n assert(returns.len() == 0);\n }\n\n pub fn enqueue_view(self, context: &mut PrivateContext) {\n let args_hash = hash_args(self.args);\n pack_arguments(self.args);\n context.call_public_function_with_packed_args(\n self.target_contract,\n self.selector,\n args_hash,\n /*static=*/\n true,\n )\n }\n}\n" }, - "128": { - "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.65.0/noir-projects/aztec-nr/aztec/src/context/unconstrained_context.nr", + "121": { + "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.66.0/noir-projects/aztec-nr/aztec/src/context/unconstrained_context.nr", "source": "use crate::oracle::{\n execution::{get_block_number, get_chain_id, get_contract_address, get_version},\n storage::storage_read,\n};\nuse dep::protocol_types::{address::AztecAddress, traits::Deserialize};\n\npub struct UnconstrainedContext {\n block_number: u32,\n contract_address: AztecAddress,\n version: Field,\n chain_id: Field,\n}\n\nimpl UnconstrainedContext {\n pub unconstrained fn new() -> Self {\n // We could call these oracles on the getters instead of at creation, which makes sense given that they might\n // not even be accessed. However any performance gains are minimal, and we'd rather fail early if a user\n // incorrectly attempts to create an UnconstrainedContext in an environment in which these oracles are not\n // available.\n let block_number = get_block_number();\n let contract_address = get_contract_address();\n let chain_id = get_chain_id();\n let version = get_version();\n Self { block_number, contract_address, version, chain_id }\n }\n\n pub unconstrained fn at(contract_address: AztecAddress) -> Self {\n let block_number = get_block_number();\n let chain_id = get_chain_id();\n let version = get_version();\n Self { block_number, contract_address, version, chain_id }\n }\n\n pub unconstrained fn at_historical(contract_address: AztecAddress, block_number: u32) -> Self {\n let chain_id = get_chain_id();\n let version = get_version();\n Self { block_number, contract_address, version, chain_id }\n }\n\n pub fn block_number(self) -> u32 {\n self.block_number\n }\n\n pub fn this_address(self) -> AztecAddress {\n self.contract_address\n }\n\n pub fn version(self) -> Field {\n self.version\n }\n\n pub fn chain_id(self) -> Field {\n self.chain_id\n }\n\n pub unconstrained fn raw_storage_read(\n self: Self,\n storage_slot: Field,\n ) -> [Field; N] {\n storage_read(self.this_address(), storage_slot, self.block_number())\n }\n\n pub unconstrained fn storage_read(self, storage_slot: Field) -> T\n where\n T: Deserialize,\n {\n T::deserialize(self.raw_storage_read(storage_slot))\n }\n}\n" }, - "134": { - "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.65.0/noir-projects/aztec-nr/aztec/src/context/public_context.nr", - "source": "use crate::context::gas::GasOpts;\nuse crate::hash::{\n compute_l1_to_l2_message_hash, compute_l1_to_l2_message_nullifier, compute_secret_hash,\n};\nuse dep::protocol_types::abis::function_selector::FunctionSelector;\nuse dep::protocol_types::address::{AztecAddress, EthAddress};\nuse dep::protocol_types::constants::MAX_FIELD_VALUE;\nuse dep::protocol_types::traits::{Deserialize, Empty, Serialize};\n\npub struct PublicContext {\n pub args_hash: Option,\n pub compute_args_hash: fn() -> Field,\n}\n\nimpl PublicContext {\n pub fn new(compute_args_hash: fn() -> Field) -> Self {\n PublicContext { args_hash: Option::none(), compute_args_hash }\n }\n\n pub fn emit_unencrypted_log(_self: &mut Self, log: T)\n where\n T: Serialize,\n {\n // AVM opcodes are constrained by the AVM itself\n unsafe { emit_unencrypted_log(Serialize::serialize(log).as_slice()) };\n }\n\n pub fn note_hash_exists(_self: Self, note_hash: Field, leaf_index: Field) -> bool {\n // AVM opcodes are constrained by the AVM itself\n unsafe { note_hash_exists(note_hash, leaf_index) } == 1\n }\n\n pub fn l1_to_l2_msg_exists(_self: Self, msg_hash: Field, msg_leaf_index: Field) -> bool {\n // AVM opcodes are constrained by the AVM itself\n unsafe { l1_to_l2_msg_exists(msg_hash, msg_leaf_index) } == 1\n }\n\n pub fn nullifier_exists(_self: Self, unsiloed_nullifier: Field, address: AztecAddress) -> bool {\n // AVM opcodes are constrained by the AVM itself\n unsafe { nullifier_exists(unsiloed_nullifier, address.to_field()) } == 1\n }\n\n pub fn consume_l1_to_l2_message(\n &mut self,\n content: Field,\n secret: Field,\n sender: EthAddress,\n leaf_index: Field,\n ) {\n let secret_hash = compute_secret_hash(secret);\n let message_hash = compute_l1_to_l2_message_hash(\n sender,\n self.chain_id(),\n /*recipient=*/\n self.this_address(),\n self.version(),\n content,\n secret_hash,\n leaf_index,\n );\n let nullifier = compute_l1_to_l2_message_nullifier(message_hash, secret);\n\n assert(\n !self.nullifier_exists(nullifier, self.this_address()),\n \"L1-to-L2 message is already nullified\",\n );\n assert(\n self.l1_to_l2_msg_exists(message_hash, leaf_index),\n \"Tried to consume nonexistent L1-to-L2 message\",\n );\n\n self.push_nullifier(nullifier);\n }\n\n pub fn message_portal(_self: &mut Self, recipient: EthAddress, content: Field) {\n // AVM opcodes are constrained by the AVM itself\n unsafe { send_l2_to_l1_msg(recipient, content) };\n }\n\n pub unconstrained fn call_public_function(\n _self: &mut Self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args: [Field],\n gas_opts: GasOpts,\n ) -> [Field] {\n let args = args.push_front(function_selector.to_field());\n let success = call(gas_for_call(gas_opts), contract_address, args);\n\n let result_data = returndata_copy(0, returndata_size());\n if !success {\n // Rethrow the revert data.\n avm_revert(result_data);\n }\n result_data\n }\n\n pub unconstrained fn static_call_public_function(\n _self: &mut Self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args: [Field],\n gas_opts: GasOpts,\n ) -> [Field] {\n let args = args.push_front(function_selector.to_field());\n let success = call_static(gas_for_call(gas_opts), contract_address, args);\n\n let result_data = returndata_copy(0, returndata_size());\n if !success {\n // Rethrow the revert data.\n avm_revert(result_data);\n }\n result_data\n }\n\n pub fn push_note_hash(_self: &mut Self, note_hash: Field) {\n // AVM opcodes are constrained by the AVM itself\n unsafe { emit_note_hash(note_hash) };\n }\n pub fn push_nullifier(_self: &mut Self, nullifier: Field) {\n // AVM opcodes are constrained by the AVM itself\n unsafe { emit_nullifier(nullifier) };\n }\n\n pub fn this_address(_self: Self) -> AztecAddress {\n // AVM opcodes are constrained by the AVM itself\n unsafe {\n address()\n }\n }\n pub fn msg_sender(_self: Self) -> AztecAddress {\n // AVM opcodes are constrained by the AVM itself\n unsafe {\n sender()\n }\n }\n pub fn selector(_self: Self) -> FunctionSelector {\n // The selector is the first element of the calldata when calling a public function through dispatch.\n // AVM opcodes are constrained by the AVM itself.\n let raw_selector: [Field; 1] = unsafe { calldata_copy(0, 1) };\n FunctionSelector::from_field(raw_selector[0])\n }\n pub fn get_args_hash(mut self) -> Field {\n if !self.args_hash.is_some() {\n self.args_hash = Option::some((self.compute_args_hash)());\n }\n\n self.args_hash.unwrap_unchecked()\n }\n pub fn transaction_fee(_self: Self) -> Field {\n // AVM opcodes are constrained by the AVM itself\n unsafe {\n transaction_fee()\n }\n }\n\n pub fn chain_id(_self: Self) -> Field {\n // AVM opcodes are constrained by the AVM itself\n unsafe {\n chain_id()\n }\n }\n pub fn version(_self: Self) -> Field {\n // AVM opcodes are constrained by the AVM itself\n unsafe {\n version()\n }\n }\n pub fn block_number(_self: Self) -> Field {\n // AVM opcodes are constrained by the AVM itself\n unsafe {\n block_number()\n }\n }\n pub fn timestamp(_self: Self) -> u64 {\n // AVM opcodes are constrained by the AVM itself\n unsafe {\n timestamp()\n }\n }\n pub fn fee_per_l2_gas(_self: Self) -> Field {\n // AVM opcodes are constrained by the AVM itself\n unsafe {\n fee_per_l2_gas()\n }\n }\n pub fn fee_per_da_gas(_self: Self) -> Field {\n // AVM opcodes are constrained by the AVM itself\n unsafe {\n fee_per_da_gas()\n }\n }\n\n pub fn l2_gas_left(_self: Self) -> Field {\n // AVM opcodes are constrained by the AVM itself\n unsafe {\n l2_gas_left()\n }\n }\n pub fn da_gas_left(_self: Self) -> Field {\n // AVM opcodes are constrained by the AVM itself\n unsafe {\n da_gas_left()\n }\n }\n pub fn is_static_call(_self: Self) -> bool {\n // AVM opcodes are constrained by the AVM itself\n unsafe { is_static_call() } == 1\n }\n\n pub fn raw_storage_read(_self: Self, storage_slot: Field) -> [Field; N] {\n let mut out = [0; N];\n for i in 0..N {\n // AVM opcodes are constrained by the AVM itself\n out[i] = unsafe { storage_read(storage_slot + i as Field) };\n }\n out\n }\n\n pub fn storage_read(self, storage_slot: Field) -> T\n where\n T: Deserialize,\n {\n T::deserialize(self.raw_storage_read(storage_slot))\n }\n\n pub fn raw_storage_write(_self: Self, storage_slot: Field, values: [Field; N]) {\n for i in 0..N {\n // AVM opcodes are constrained by the AVM itself\n unsafe { storage_write(storage_slot + i as Field, values[i]) };\n }\n }\n\n pub fn storage_write(self, storage_slot: Field, value: T)\n where\n T: Serialize,\n {\n self.raw_storage_write(storage_slot, value.serialize());\n }\n}\n\n// Helper functions\nfn gas_for_call(user_gas: GasOpts) -> [Field; 2] {\n // It's ok to use the max possible gas here, because the gas will be\n // capped by the gas left in the (STATIC)CALL instruction.\n [user_gas.l2_gas.unwrap_or(MAX_FIELD_VALUE), user_gas.da_gas.unwrap_or(MAX_FIELD_VALUE)]\n}\n\n// Unconstrained opcode wrappers (do not use directly).\nunconstrained fn address() -> AztecAddress {\n address_opcode()\n}\nunconstrained fn sender() -> AztecAddress {\n sender_opcode()\n}\n// TODO(9396): Remove.\nunconstrained fn portal() -> EthAddress {\n portal_opcode()\n}\n// TODO(9396): Remove.\n//unconstrained fn function_selector() -> u32 {\n// function_selector_opcode()\n//}\nunconstrained fn transaction_fee() -> Field {\n transaction_fee_opcode()\n}\nunconstrained fn chain_id() -> Field {\n chain_id_opcode()\n}\nunconstrained fn version() -> Field {\n version_opcode()\n}\nunconstrained fn block_number() -> Field {\n block_number_opcode()\n}\nunconstrained fn timestamp() -> u64 {\n timestamp_opcode()\n}\nunconstrained fn fee_per_l2_gas() -> Field {\n fee_per_l2_gas_opcode()\n}\nunconstrained fn fee_per_da_gas() -> Field {\n fee_per_da_gas_opcode()\n}\nunconstrained fn l2_gas_left() -> Field {\n l2_gas_left_opcode()\n}\nunconstrained fn da_gas_left() -> Field {\n da_gas_left_opcode()\n}\nunconstrained fn is_static_call() -> Field {\n is_static_call_opcode()\n}\nunconstrained fn note_hash_exists(note_hash: Field, leaf_index: Field) -> u1 {\n note_hash_exists_opcode(note_hash, leaf_index)\n}\nunconstrained fn emit_note_hash(note_hash: Field) {\n emit_note_hash_opcode(note_hash)\n}\nunconstrained fn nullifier_exists(nullifier: Field, address: Field) -> u1 {\n nullifier_exists_opcode(nullifier, address)\n}\nunconstrained fn emit_nullifier(nullifier: Field) {\n emit_nullifier_opcode(nullifier)\n}\nunconstrained fn emit_unencrypted_log(message: [Field]) {\n emit_unencrypted_log_opcode(message)\n}\nunconstrained fn l1_to_l2_msg_exists(msg_hash: Field, msg_leaf_index: Field) -> u1 {\n l1_to_l2_msg_exists_opcode(msg_hash, msg_leaf_index)\n}\nunconstrained fn send_l2_to_l1_msg(recipient: EthAddress, content: Field) {\n send_l2_to_l1_msg_opcode(recipient, content)\n}\nunconstrained fn call(gas: [Field; 2], address: AztecAddress, args: [Field]) -> bool {\n call_opcode(gas, address, args)\n}\nunconstrained fn call_static(gas: [Field; 2], address: AztecAddress, args: [Field]) -> bool {\n call_static_opcode(gas, address, args)\n}\n\npub unconstrained fn calldata_copy(cdoffset: u32, copy_size: u32) -> [Field; N] {\n calldata_copy_opcode(cdoffset, copy_size)\n}\n\nunconstrained fn returndata_size() -> u32 {\n returndata_size_opcode()\n}\n\nunconstrained fn returndata_copy(rdoffset: u32, copy_size: u32) -> [Field] {\n returndata_copy_opcode(rdoffset, copy_size)\n}\n\npub unconstrained fn avm_return(returndata: [Field]) {\n return_opcode(returndata)\n}\n\n// This opcode reverts using the exact data given. In general it should only be used\n// to do rethrows, where the revert data is the same as the original revert data.\n// For normal reverts, use Noir's `assert` which, on top of reverting, will also add\n// an error selector to the revert data.\nunconstrained fn avm_revert(revertdata: [Field]) {\n revert_opcode(revertdata)\n}\n\nunconstrained fn storage_read(storage_slot: Field) -> Field {\n storage_read_opcode(storage_slot)\n}\n\nunconstrained fn storage_write(storage_slot: Field, value: Field) {\n storage_write_opcode(storage_slot, value);\n}\n\nimpl Empty for PublicContext {\n fn empty() -> Self {\n PublicContext::new(|| 0)\n }\n}\n\n// AVM oracles (opcodes) follow, do not use directly.\n#[oracle(avmOpcodeAddress)]\nunconstrained fn address_opcode() -> AztecAddress {}\n\n#[oracle(avmOpcodeSender)]\nunconstrained fn sender_opcode() -> AztecAddress {}\n\n#[oracle(avmOpcodePortal)]\nunconstrained fn portal_opcode() -> EthAddress {}\n\n// TODO(9396): Remove.\n//#[oracle(avmOpcodeFunctionSelector)]\n//unconstrained fn function_selector_opcode() -> u32 {}\n\n#[oracle(avmOpcodeTransactionFee)]\nunconstrained fn transaction_fee_opcode() -> Field {}\n\n#[oracle(avmOpcodeChainId)]\nunconstrained fn chain_id_opcode() -> Field {}\n\n#[oracle(avmOpcodeVersion)]\nunconstrained fn version_opcode() -> Field {}\n\n#[oracle(avmOpcodeBlockNumber)]\nunconstrained fn block_number_opcode() -> Field {}\n\n#[oracle(avmOpcodeTimestamp)]\nunconstrained fn timestamp_opcode() -> u64 {}\n\n#[oracle(avmOpcodeFeePerL2Gas)]\nunconstrained fn fee_per_l2_gas_opcode() -> Field {}\n\n#[oracle(avmOpcodeFeePerDaGas)]\nunconstrained fn fee_per_da_gas_opcode() -> Field {}\n\n#[oracle(avmOpcodeL2GasLeft)]\nunconstrained fn l2_gas_left_opcode() -> Field {}\n\n#[oracle(avmOpcodeDaGasLeft)]\nunconstrained fn da_gas_left_opcode() -> Field {}\n\n#[oracle(avmOpcodeIsStaticCall)]\nunconstrained fn is_static_call_opcode() -> Field {}\n\n#[oracle(avmOpcodeNoteHashExists)]\nunconstrained fn note_hash_exists_opcode(note_hash: Field, leaf_index: Field) -> u1 {}\n\n#[oracle(avmOpcodeEmitNoteHash)]\nunconstrained fn emit_note_hash_opcode(note_hash: Field) {}\n\n#[oracle(avmOpcodeNullifierExists)]\nunconstrained fn nullifier_exists_opcode(nullifier: Field, address: Field) -> u1 {}\n\n#[oracle(avmOpcodeEmitNullifier)]\nunconstrained fn emit_nullifier_opcode(nullifier: Field) {}\n\n#[oracle(avmOpcodeEmitUnencryptedLog)]\nunconstrained fn emit_unencrypted_log_opcode(message: [Field]) {}\n\n#[oracle(avmOpcodeL1ToL2MsgExists)]\nunconstrained fn l1_to_l2_msg_exists_opcode(msg_hash: Field, msg_leaf_index: Field) -> u1 {}\n\n#[oracle(avmOpcodeSendL2ToL1Msg)]\nunconstrained fn send_l2_to_l1_msg_opcode(recipient: EthAddress, content: Field) {}\n\n#[oracle(avmOpcodeCalldataCopy)]\nunconstrained fn calldata_copy_opcode(cdoffset: u32, copy_size: u32) -> [Field; N] {}\n\n#[oracle(avmOpcodeReturndataSize)]\nunconstrained fn returndata_size_opcode() -> u32 {}\n\n#[oracle(avmOpcodeReturndataCopy)]\nunconstrained fn returndata_copy_opcode(rdoffset: u32, copy_size: u32) -> [Field] {}\n\n#[oracle(avmOpcodeReturn)]\nunconstrained fn return_opcode(returndata: [Field]) {}\n\n// This opcode reverts using the exact data given. In general it should only be used\n// to do rethrows, where the revert data is the same as the original revert data.\n// For normal reverts, use Noir's `assert` which, on top of reverting, will also add\n// an error selector to the revert data.\n#[oracle(avmOpcodeRevert)]\nunconstrained fn revert_opcode(revertdata: [Field]) {}\n\n#[oracle(avmOpcodeCall)]\nunconstrained fn call_opcode(\n gas: [Field; 2], // gas allocation: [l2_gas, da_gas]\n address: AztecAddress,\n args: [Field],\n) -> bool {}\n\n#[oracle(avmOpcodeStaticCall)]\nunconstrained fn call_static_opcode(\n gas: [Field; 2], // gas allocation: [l2_gas, da_gas]\n address: AztecAddress,\n args: [Field],\n) -> bool {}\n\n#[oracle(avmOpcodeStorageRead)]\nunconstrained fn storage_read_opcode(storage_slot: Field) -> Field {}\n\n#[oracle(avmOpcodeStorageWrite)]\nunconstrained fn storage_write_opcode(storage_slot: Field, value: Field) {}\n" + "127": { + "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.66.0/noir-projects/aztec-nr/aztec/src/context/public_context.nr", + "source": "use crate::context::gas::GasOpts;\nuse crate::hash::{\n compute_l1_to_l2_message_hash, compute_l1_to_l2_message_nullifier, compute_secret_hash,\n};\nuse dep::protocol_types::abis::function_selector::FunctionSelector;\nuse dep::protocol_types::address::{AztecAddress, EthAddress};\nuse dep::protocol_types::constants::MAX_FIELD_VALUE;\nuse dep::protocol_types::traits::{Deserialize, Empty, Serialize};\n\npub struct PublicContext {\n pub args_hash: Option,\n pub compute_args_hash: fn() -> Field,\n}\n\nimpl PublicContext {\n pub fn new(compute_args_hash: fn() -> Field) -> Self {\n PublicContext { args_hash: Option::none(), compute_args_hash }\n }\n\n pub fn emit_unencrypted_log(_self: &mut Self, log: T)\n where\n T: Serialize,\n {\n // AVM opcodes are constrained by the AVM itself\n unsafe { emit_unencrypted_log(Serialize::serialize(log).as_slice()) };\n }\n\n pub fn note_hash_exists(_self: Self, note_hash: Field, leaf_index: Field) -> bool {\n // AVM opcodes are constrained by the AVM itself\n unsafe { note_hash_exists(note_hash, leaf_index) } == 1\n }\n\n pub fn l1_to_l2_msg_exists(_self: Self, msg_hash: Field, msg_leaf_index: Field) -> bool {\n // AVM opcodes are constrained by the AVM itself\n unsafe { l1_to_l2_msg_exists(msg_hash, msg_leaf_index) } == 1\n }\n\n pub fn nullifier_exists(_self: Self, unsiloed_nullifier: Field, address: AztecAddress) -> bool {\n // AVM opcodes are constrained by the AVM itself\n unsafe { nullifier_exists(unsiloed_nullifier, address.to_field()) } == 1\n }\n\n pub fn consume_l1_to_l2_message(\n &mut self,\n content: Field,\n secret: Field,\n sender: EthAddress,\n leaf_index: Field,\n ) {\n let secret_hash = compute_secret_hash(secret);\n let message_hash = compute_l1_to_l2_message_hash(\n sender,\n self.chain_id(),\n /*recipient=*/\n self.this_address(),\n self.version(),\n content,\n secret_hash,\n leaf_index,\n );\n let nullifier = compute_l1_to_l2_message_nullifier(message_hash, secret);\n\n assert(\n !self.nullifier_exists(nullifier, self.this_address()),\n \"L1-to-L2 message is already nullified\",\n );\n assert(\n self.l1_to_l2_msg_exists(message_hash, leaf_index),\n \"Tried to consume nonexistent L1-to-L2 message\",\n );\n\n self.push_nullifier(nullifier);\n }\n\n pub fn message_portal(_self: &mut Self, recipient: EthAddress, content: Field) {\n // AVM opcodes are constrained by the AVM itself\n unsafe { send_l2_to_l1_msg(recipient, content) };\n }\n\n pub unconstrained fn call_public_function(\n _self: &mut Self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args: [Field],\n gas_opts: GasOpts,\n ) -> [Field] {\n let args = args.push_front(function_selector.to_field());\n let success = call(gas_for_call(gas_opts), contract_address, args);\n\n let result_data = returndata_copy(0, returndata_size());\n if !success {\n // Rethrow the revert data.\n avm_revert(result_data);\n }\n result_data\n }\n\n pub unconstrained fn static_call_public_function(\n _self: &mut Self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args: [Field],\n gas_opts: GasOpts,\n ) -> [Field] {\n let args = args.push_front(function_selector.to_field());\n let success = call_static(gas_for_call(gas_opts), contract_address, args);\n\n let result_data = returndata_copy(0, returndata_size());\n if !success {\n // Rethrow the revert data.\n avm_revert(result_data);\n }\n result_data\n }\n\n pub fn push_note_hash(_self: &mut Self, note_hash: Field) {\n // AVM opcodes are constrained by the AVM itself\n unsafe { emit_note_hash(note_hash) };\n }\n pub fn push_nullifier(_self: &mut Self, nullifier: Field) {\n // AVM opcodes are constrained by the AVM itself\n unsafe { emit_nullifier(nullifier) };\n }\n\n pub fn this_address(_self: Self) -> AztecAddress {\n // AVM opcodes are constrained by the AVM itself\n unsafe {\n address()\n }\n }\n pub fn msg_sender(_self: Self) -> AztecAddress {\n // AVM opcodes are constrained by the AVM itself\n unsafe {\n sender()\n }\n }\n pub fn selector(_self: Self) -> FunctionSelector {\n // The selector is the first element of the calldata when calling a public function through dispatch.\n // AVM opcodes are constrained by the AVM itself.\n let raw_selector: [Field; 1] = unsafe { calldata_copy(0, 1) };\n FunctionSelector::from_field(raw_selector[0])\n }\n pub fn get_args_hash(mut self) -> Field {\n if !self.args_hash.is_some() {\n self.args_hash = Option::some((self.compute_args_hash)());\n }\n\n self.args_hash.unwrap_unchecked()\n }\n pub fn transaction_fee(_self: Self) -> Field {\n // AVM opcodes are constrained by the AVM itself\n unsafe {\n transaction_fee()\n }\n }\n\n pub fn chain_id(_self: Self) -> Field {\n // AVM opcodes are constrained by the AVM itself\n unsafe {\n chain_id()\n }\n }\n pub fn version(_self: Self) -> Field {\n // AVM opcodes are constrained by the AVM itself\n unsafe {\n version()\n }\n }\n pub fn block_number(_self: Self) -> Field {\n // AVM opcodes are constrained by the AVM itself\n unsafe {\n block_number()\n }\n }\n pub fn timestamp(_self: Self) -> u64 {\n // AVM opcodes are constrained by the AVM itself\n unsafe {\n timestamp()\n }\n }\n pub fn fee_per_l2_gas(_self: Self) -> Field {\n // AVM opcodes are constrained by the AVM itself\n unsafe {\n fee_per_l2_gas()\n }\n }\n pub fn fee_per_da_gas(_self: Self) -> Field {\n // AVM opcodes are constrained by the AVM itself\n unsafe {\n fee_per_da_gas()\n }\n }\n\n pub fn l2_gas_left(_self: Self) -> Field {\n // AVM opcodes are constrained by the AVM itself\n unsafe {\n l2_gas_left()\n }\n }\n pub fn da_gas_left(_self: Self) -> Field {\n // AVM opcodes are constrained by the AVM itself\n unsafe {\n da_gas_left()\n }\n }\n pub fn is_static_call(_self: Self) -> bool {\n // AVM opcodes are constrained by the AVM itself\n unsafe { is_static_call() } == 1\n }\n\n pub fn raw_storage_read(_self: Self, storage_slot: Field) -> [Field; N] {\n let mut out = [0; N];\n for i in 0..N {\n // AVM opcodes are constrained by the AVM itself\n out[i] = unsafe { storage_read(storage_slot + i as Field) };\n }\n out\n }\n\n pub fn storage_read(self, storage_slot: Field) -> T\n where\n T: Deserialize,\n {\n T::deserialize(self.raw_storage_read(storage_slot))\n }\n\n pub fn raw_storage_write(_self: Self, storage_slot: Field, values: [Field; N]) {\n for i in 0..N {\n // AVM opcodes are constrained by the AVM itself\n unsafe { storage_write(storage_slot + i as Field, values[i]) };\n }\n }\n\n pub fn storage_write(self, storage_slot: Field, value: T)\n where\n T: Serialize,\n {\n self.raw_storage_write(storage_slot, value.serialize());\n }\n}\n\n// Helper functions\nfn gas_for_call(user_gas: GasOpts) -> [Field; 2] {\n // It's ok to use the max possible gas here, because the gas will be\n // capped by the gas left in the (STATIC)CALL instruction.\n [user_gas.l2_gas.unwrap_or(MAX_FIELD_VALUE), user_gas.da_gas.unwrap_or(MAX_FIELD_VALUE)]\n}\n\n// Unconstrained opcode wrappers (do not use directly).\nunconstrained fn address() -> AztecAddress {\n address_opcode()\n}\nunconstrained fn sender() -> AztecAddress {\n sender_opcode()\n}\nunconstrained fn transaction_fee() -> Field {\n transaction_fee_opcode()\n}\nunconstrained fn chain_id() -> Field {\n chain_id_opcode()\n}\nunconstrained fn version() -> Field {\n version_opcode()\n}\nunconstrained fn block_number() -> Field {\n block_number_opcode()\n}\nunconstrained fn timestamp() -> u64 {\n timestamp_opcode()\n}\nunconstrained fn fee_per_l2_gas() -> Field {\n fee_per_l2_gas_opcode()\n}\nunconstrained fn fee_per_da_gas() -> Field {\n fee_per_da_gas_opcode()\n}\nunconstrained fn l2_gas_left() -> Field {\n l2_gas_left_opcode()\n}\nunconstrained fn da_gas_left() -> Field {\n da_gas_left_opcode()\n}\nunconstrained fn is_static_call() -> Field {\n is_static_call_opcode()\n}\nunconstrained fn note_hash_exists(note_hash: Field, leaf_index: Field) -> u1 {\n note_hash_exists_opcode(note_hash, leaf_index)\n}\nunconstrained fn emit_note_hash(note_hash: Field) {\n emit_note_hash_opcode(note_hash)\n}\nunconstrained fn nullifier_exists(nullifier: Field, address: Field) -> u1 {\n nullifier_exists_opcode(nullifier, address)\n}\nunconstrained fn emit_nullifier(nullifier: Field) {\n emit_nullifier_opcode(nullifier)\n}\nunconstrained fn emit_unencrypted_log(message: [Field]) {\n emit_unencrypted_log_opcode(message)\n}\nunconstrained fn l1_to_l2_msg_exists(msg_hash: Field, msg_leaf_index: Field) -> u1 {\n l1_to_l2_msg_exists_opcode(msg_hash, msg_leaf_index)\n}\nunconstrained fn send_l2_to_l1_msg(recipient: EthAddress, content: Field) {\n send_l2_to_l1_msg_opcode(recipient, content)\n}\nunconstrained fn call(gas: [Field; 2], address: AztecAddress, args: [Field]) -> bool {\n call_opcode(gas, address, args)\n}\nunconstrained fn call_static(gas: [Field; 2], address: AztecAddress, args: [Field]) -> bool {\n call_static_opcode(gas, address, args)\n}\n\npub unconstrained fn calldata_copy(cdoffset: u32, copy_size: u32) -> [Field; N] {\n calldata_copy_opcode(cdoffset, copy_size)\n}\n\nunconstrained fn returndata_size() -> u32 {\n returndata_size_opcode()\n}\n\nunconstrained fn returndata_copy(rdoffset: u32, copy_size: u32) -> [Field] {\n returndata_copy_opcode(rdoffset, copy_size)\n}\n\npub unconstrained fn avm_return(returndata: [Field]) {\n return_opcode(returndata)\n}\n\n// This opcode reverts using the exact data given. In general it should only be used\n// to do rethrows, where the revert data is the same as the original revert data.\n// For normal reverts, use Noir's `assert` which, on top of reverting, will also add\n// an error selector to the revert data.\nunconstrained fn avm_revert(revertdata: [Field]) {\n revert_opcode(revertdata)\n}\n\nunconstrained fn storage_read(storage_slot: Field) -> Field {\n storage_read_opcode(storage_slot)\n}\n\nunconstrained fn storage_write(storage_slot: Field, value: Field) {\n storage_write_opcode(storage_slot, value);\n}\n\nimpl Empty for PublicContext {\n fn empty() -> Self {\n PublicContext::new(|| 0)\n }\n}\n\n// AVM oracles (opcodes) follow, do not use directly.\n#[oracle(avmOpcodeAddress)]\nunconstrained fn address_opcode() -> AztecAddress {}\n\n#[oracle(avmOpcodeSender)]\nunconstrained fn sender_opcode() -> AztecAddress {}\n\n#[oracle(avmOpcodeTransactionFee)]\nunconstrained fn transaction_fee_opcode() -> Field {}\n\n#[oracle(avmOpcodeChainId)]\nunconstrained fn chain_id_opcode() -> Field {}\n\n#[oracle(avmOpcodeVersion)]\nunconstrained fn version_opcode() -> Field {}\n\n#[oracle(avmOpcodeBlockNumber)]\nunconstrained fn block_number_opcode() -> Field {}\n\n#[oracle(avmOpcodeTimestamp)]\nunconstrained fn timestamp_opcode() -> u64 {}\n\n#[oracle(avmOpcodeFeePerL2Gas)]\nunconstrained fn fee_per_l2_gas_opcode() -> Field {}\n\n#[oracle(avmOpcodeFeePerDaGas)]\nunconstrained fn fee_per_da_gas_opcode() -> Field {}\n\n#[oracle(avmOpcodeL2GasLeft)]\nunconstrained fn l2_gas_left_opcode() -> Field {}\n\n#[oracle(avmOpcodeDaGasLeft)]\nunconstrained fn da_gas_left_opcode() -> Field {}\n\n#[oracle(avmOpcodeIsStaticCall)]\nunconstrained fn is_static_call_opcode() -> Field {}\n\n#[oracle(avmOpcodeNoteHashExists)]\nunconstrained fn note_hash_exists_opcode(note_hash: Field, leaf_index: Field) -> u1 {}\n\n#[oracle(avmOpcodeEmitNoteHash)]\nunconstrained fn emit_note_hash_opcode(note_hash: Field) {}\n\n#[oracle(avmOpcodeNullifierExists)]\nunconstrained fn nullifier_exists_opcode(nullifier: Field, address: Field) -> u1 {}\n\n#[oracle(avmOpcodeEmitNullifier)]\nunconstrained fn emit_nullifier_opcode(nullifier: Field) {}\n\n#[oracle(avmOpcodeEmitUnencryptedLog)]\nunconstrained fn emit_unencrypted_log_opcode(message: [Field]) {}\n\n#[oracle(avmOpcodeL1ToL2MsgExists)]\nunconstrained fn l1_to_l2_msg_exists_opcode(msg_hash: Field, msg_leaf_index: Field) -> u1 {}\n\n#[oracle(avmOpcodeSendL2ToL1Msg)]\nunconstrained fn send_l2_to_l1_msg_opcode(recipient: EthAddress, content: Field) {}\n\n#[oracle(avmOpcodeCalldataCopy)]\nunconstrained fn calldata_copy_opcode(cdoffset: u32, copy_size: u32) -> [Field; N] {}\n\n#[oracle(avmOpcodeReturndataSize)]\nunconstrained fn returndata_size_opcode() -> u32 {}\n\n#[oracle(avmOpcodeReturndataCopy)]\nunconstrained fn returndata_copy_opcode(rdoffset: u32, copy_size: u32) -> [Field] {}\n\n#[oracle(avmOpcodeReturn)]\nunconstrained fn return_opcode(returndata: [Field]) {}\n\n// This opcode reverts using the exact data given. In general it should only be used\n// to do rethrows, where the revert data is the same as the original revert data.\n// For normal reverts, use Noir's `assert` which, on top of reverting, will also add\n// an error selector to the revert data.\n#[oracle(avmOpcodeRevert)]\nunconstrained fn revert_opcode(revertdata: [Field]) {}\n\n#[oracle(avmOpcodeCall)]\nunconstrained fn call_opcode(\n gas: [Field; 2], // gas allocation: [l2_gas, da_gas]\n address: AztecAddress,\n args: [Field],\n) -> bool {}\n\n#[oracle(avmOpcodeStaticCall)]\nunconstrained fn call_static_opcode(\n gas: [Field; 2], // gas allocation: [l2_gas, da_gas]\n address: AztecAddress,\n args: [Field],\n) -> bool {}\n\n#[oracle(avmOpcodeStorageRead)]\nunconstrained fn storage_read_opcode(storage_slot: Field) -> Field {}\n\n#[oracle(avmOpcodeStorageWrite)]\nunconstrained fn storage_write_opcode(storage_slot: Field, value: Field) {}\n" }, - "136": { - "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.65.0/noir-projects/aztec-nr/aztec/src/hash.nr", + "129": { + "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.66.0/noir-projects/aztec-nr/aztec/src/hash.nr", "source": "use crate::utils::to_bytes::{arr_to_be_bytes_arr, str_to_be_bytes_arr};\nuse dep::protocol_types::{\n address::{AztecAddress, EthAddress},\n constants::{\n GENERATOR_INDEX__FUNCTION_ARGS, GENERATOR_INDEX__MESSAGE_NULLIFIER,\n GENERATOR_INDEX__SECRET_HASH,\n },\n hash::{poseidon2_hash_with_separator, poseidon2_hash_with_separator_slice, sha256_to_field},\n point::Point,\n traits::Hash,\n};\n\npub use dep::protocol_types::hash::{compute_siloed_nullifier, pedersen_hash};\n\npub fn pedersen_commitment(inputs: [Field; N], hash_index: u32) -> Point {\n std::hash::pedersen_commitment_with_separator(inputs, hash_index)\n}\n\npub fn compute_secret_hash(secret: Field) -> Field {\n poseidon2_hash_with_separator([secret], GENERATOR_INDEX__SECRET_HASH)\n}\n\npub fn compute_unencrypted_log_hash(\n contract_address: AztecAddress,\n log: [u8; N],\n) -> Field {\n let mut hash_bytes = [0; N + 36];\n // Address is converted to 32 bytes in ts\n let address_bytes: [u8; 32] = contract_address.to_field().to_be_bytes();\n for i in 0..32 {\n hash_bytes[i] = address_bytes[i];\n }\n let len_bytes: [u8; 4] = (N as Field).to_be_bytes();\n for i in 0..4 {\n hash_bytes[32 + i] = len_bytes[i];\n }\n for i in 0..N {\n hash_bytes[36 + i] = log[i];\n }\n\n sha256_to_field(hash_bytes)\n}\n\npub fn compute_l1_to_l2_message_hash(\n sender: EthAddress,\n chain_id: Field,\n recipient: AztecAddress,\n version: Field,\n content: Field,\n secret_hash: Field,\n leaf_index: Field,\n) -> Field {\n let mut hash_bytes = [0 as u8; 224];\n let sender_bytes: [u8; 32] = sender.to_field().to_be_bytes();\n let chain_id_bytes: [u8; 32] = chain_id.to_be_bytes();\n let recipient_bytes: [u8; 32] = recipient.to_field().to_be_bytes();\n let version_bytes: [u8; 32] = version.to_be_bytes();\n let content_bytes: [u8; 32] = content.to_be_bytes();\n let secret_hash_bytes: [u8; 32] = secret_hash.to_be_bytes();\n let leaf_index_bytes: [u8; 32] = leaf_index.to_be_bytes();\n\n for i in 0..32 {\n hash_bytes[i] = sender_bytes[i];\n hash_bytes[i + 32] = chain_id_bytes[i];\n hash_bytes[i + 64] = recipient_bytes[i];\n hash_bytes[i + 96] = version_bytes[i];\n hash_bytes[i + 128] = content_bytes[i];\n hash_bytes[i + 160] = secret_hash_bytes[i];\n hash_bytes[i + 192] = leaf_index_bytes[i];\n }\n\n sha256_to_field(hash_bytes)\n}\n\n// The nullifier of a l1 to l2 message is the hash of the message salted with the secret\npub fn compute_l1_to_l2_message_nullifier(message_hash: Field, secret: Field) -> Field {\n poseidon2_hash_with_separator([message_hash, secret], GENERATOR_INDEX__MESSAGE_NULLIFIER)\n}\n\npub struct ArgsHasher {\n pub fields: [Field],\n}\n\nimpl Hash for ArgsHasher {\n fn hash(self) -> Field {\n hash_args(self.fields)\n }\n}\n\nimpl ArgsHasher {\n pub fn new() -> Self {\n Self { fields: [] }\n }\n\n pub fn add(&mut self, field: Field) {\n self.fields = self.fields.push_back(field);\n }\n\n pub fn add_multiple(&mut self, fields: [Field; N]) {\n for i in 0..N {\n self.fields = self.fields.push_back(fields[i]);\n }\n }\n}\n\npub fn hash_args_array(args: [Field; N]) -> Field {\n if args.len() == 0 {\n 0\n } else {\n poseidon2_hash_with_separator(args, GENERATOR_INDEX__FUNCTION_ARGS)\n }\n}\n\npub fn hash_args(args: [Field]) -> Field {\n if args.len() == 0 {\n 0\n } else {\n poseidon2_hash_with_separator_slice(args, GENERATOR_INDEX__FUNCTION_ARGS)\n }\n}\n\n#[test]\nunconstrained fn compute_var_args_hash() {\n let mut input = ArgsHasher::new();\n for i in 0..100 {\n input.add(i as Field);\n }\n let hash = input.hash();\n dep::std::println(hash);\n assert(hash == 0x19b0d74feb06ebde19edd85a28986c97063e84b3b351a8b666c7cac963ce655f);\n}\n\n#[test]\nunconstrained fn compute_unenc_log_hash_array() {\n let contract_address = AztecAddress::from_field(\n 0x233a3e0df23b2b15b324194cb4a151f26c0b7333250781d34cc269d85dc334c6,\n );\n let log = [\n 0x20660de09f35f876e3e69d227b2a35166ad05f09d82d06366ec9b6f65a51fec2,\n 0x1b52bfe3b8689761916f76dc3d38aa8810860db325cd39ca611eed980091f01c,\n 0x2e559c4045c378a56ad13b9edb1e8de4e7ad3b3aa35cc7ba9ec77f7a68fa43a4,\n 0x25d0f689c4a4178a29d59306f2675824d19be6d25e44fa03b03f49c263053dd2,\n 0x2d513a722d6f352dc0961f156afdc5e31495b9f0e35cb069261a8e55e2df67fd,\n ];\n let serialized_log = arr_to_be_bytes_arr(log);\n let hash = compute_unencrypted_log_hash(contract_address, serialized_log);\n assert(hash == 0x0095b2d17ab72f4b27a341f7ac63e49ec73935ae8c9181a0ac02023eb12f3284);\n}\n\n#[test]\nunconstrained fn compute_unenc_log_hash_addr() {\n let contract_address = AztecAddress::from_field(\n 0x233a3e0df23b2b15b324194cb4a151f26c0b7333250781d34cc269d85dc334c6,\n );\n let log = AztecAddress::from_field(\n 0x26aa302d4715fd8a687453cb26d616b0768027bd54bcae56b09d908ecd9f8303,\n );\n let serialized_log: [u8; 32] = log.to_field().to_be_bytes();\n let hash = compute_unencrypted_log_hash(contract_address, serialized_log);\n assert(hash == 0x0083ab647dfb26e7ddee90a0f4209d049d4660cab42000c544b986aaa84c55a3);\n}\n\n#[test]\nunconstrained fn compute_unenc_log_hash_str() {\n let contract_address = AztecAddress::from_field(\n 0x1b401e1146c5c507962287065c81f0ef7590adae3802c533d7549d6bf0a41bd8,\n );\n let log = \"dummy\";\n let serialized_log = str_to_be_bytes_arr(log);\n let hash = compute_unencrypted_log_hash(contract_address, serialized_log);\n assert(hash == 0x00629e88ebd6374f44aa6cfe07e251ecf07213ebc7267e8f6b578ae57ffd6c20);\n}\n\n#[test]\nunconstrained fn compute_unenc_log_hash_longer_str() {\n let contract_address = AztecAddress::from_field(\n 0x1b401e1146c5c507962287065c81f0ef7590adae3802c533d7549d6bf0a41bd8,\n );\n let log = \"Hello this is a string\";\n let serialized_log = str_to_be_bytes_arr(log);\n let hash = compute_unencrypted_log_hash(contract_address, serialized_log);\n assert(hash == 0x0098637962f7d34fa202b7ffad8a07a238c5d1fd897b82a108f7f467fa73b841);\n}\n" }, - "150": { - "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.65.0/noir-projects/aztec-nr/aztec/src/oracle/arguments.nr", + "143": { + "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.66.0/noir-projects/aztec-nr/aztec/src/oracle/arguments.nr", "source": "/// Notifies the simulator that `args` will later be used at some point during execution, referenced by their hash. This\n/// allows the simulator to know how to respond to this future request.\n///\n/// This is only used during private execution, since in public it is the VM itself that keeps track of arguments.\npub fn pack_arguments(args: [Field]) {\n // This oracle call returns nothing: we only call it for its side effects. It is therefore always safe to call. When\n // unpacking however the caller must check that the returned value is indeed the preimage.\n unsafe { pack_arguments_oracle_wrapper(args) };\n}\n\n/// Same as `pack_arguments`, but using arrays instead of slices.\npub fn pack_arguments_array(args: [Field; N]) {\n // This oracle call returns nothing: we only call it for its side effects. It is therefore always safe to call. When\n // unpacking however the caller must check that the returned value is indeed the preimage.\n unsafe { pack_arguments_array_oracle_wrapper(args) };\n}\n\nunconstrained fn pack_arguments_oracle_wrapper(args: [Field]) {\n let _ = pack_arguments_oracle(args);\n}\n\nunconstrained fn pack_arguments_array_oracle_wrapper(args: [Field; N]) {\n let _ = pack_arguments_array_oracle(args);\n}\n\n#[oracle(packArguments)]\nunconstrained fn pack_arguments_oracle(_args: [Field]) -> Field {}\n\n#[oracle(packArgumentsArray)]\nunconstrained fn pack_arguments_array_oracle(_args: [Field; N]) -> Field {}\n" }, - "151": { - "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.65.0/noir-projects/aztec-nr/aztec/src/oracle/get_contract_instance.nr", + "144": { + "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.66.0/noir-projects/aztec-nr/aztec/src/oracle/get_contract_instance.nr", "source": "use dep::protocol_types::{\n address::AztecAddress, constants::CONTRACT_INSTANCE_LENGTH, contract_class_id::ContractClassId,\n contract_instance::ContractInstance,\n};\n\n// NOTE: this is for use in private only\n#[oracle(getContractInstance)]\nunconstrained fn get_contract_instance_oracle(\n _address: AztecAddress,\n) -> [Field; CONTRACT_INSTANCE_LENGTH] {}\n\n// NOTE: this is for use in private only\nunconstrained fn get_contract_instance_internal(\n address: AztecAddress,\n) -> [Field; CONTRACT_INSTANCE_LENGTH] {\n get_contract_instance_oracle(address)\n}\n\n// NOTE: this is for use in private only\npub fn get_contract_instance(address: AztecAddress) -> ContractInstance {\n let instance =\n unsafe { ContractInstance::deserialize(get_contract_instance_internal(address)) };\n // The to_address function combines all values in the instance object to produce an address, so by checking that we\n // get the expected address we validate the entire struct.\n assert_eq(instance.to_address(), address);\n\n instance\n}\n\n// These oracles each return a ContractInstance member\n// plus a boolean indicating whether the instance was found.\n#[oracle(avmOpcodeGetContractInstanceDeployer)]\nunconstrained fn get_contract_instance_deployer_oracle_avm(\n _address: AztecAddress,\n) -> (Field, bool) {}\n#[oracle(avmOpcodeGetContractInstanceClassId)]\nunconstrained fn get_contract_instance_class_id_oracle_avm(\n _address: AztecAddress,\n) -> (Field, bool) {}\n#[oracle(avmOpcodeGetContractInstanceInitializationHash)]\nunconstrained fn get_contract_instance_initialization_hash_oracle_avm(\n _address: AztecAddress,\n) -> (Field, bool) {}\n\npub unconstrained fn get_contract_instance_deployer_internal_avm(\n address: AztecAddress,\n) -> (Field, bool) {\n get_contract_instance_deployer_oracle_avm(address)\n}\npub unconstrained fn get_contract_instance_class_id_internal_avm(\n address: AztecAddress,\n) -> (Field, bool) {\n get_contract_instance_class_id_oracle_avm(address)\n}\npub unconstrained fn get_contract_instance_initialization_hash_internal_avm(\n address: AztecAddress,\n) -> (Field, bool) {\n get_contract_instance_initialization_hash_oracle_avm(address)\n}\n\npub fn get_contract_instance_deployer_avm(address: AztecAddress) -> Option {\n let (member, exists) = get_contract_instance_deployer_internal_avm(address);\n if exists {\n Option::some(AztecAddress::from_field(member))\n } else {\n Option::none()\n }\n}\npub fn get_contract_instance_class_id_avm(address: AztecAddress) -> Option {\n let (member, exists) = get_contract_instance_class_id_internal_avm(address);\n if exists {\n Option::some(ContractClassId::from_field(member))\n } else {\n Option::none()\n }\n}\npub fn get_contract_instance_initialization_hash_avm(address: AztecAddress) -> Option {\n let (member, exists) = get_contract_instance_initialization_hash_internal_avm(address);\n if exists {\n Option::some(member)\n } else {\n Option::none()\n }\n}\n" }, - "158": { - "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.65.0/noir-projects/aztec-nr/aztec/src/oracle/execution.nr", + "151": { + "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.66.0/noir-projects/aztec-nr/aztec/src/oracle/execution.nr", "source": "use dep::protocol_types::address::AztecAddress;\n\n#[oracle(getContractAddress)]\nunconstrained fn get_contract_address_oracle() -> AztecAddress {}\n\n#[oracle(getBlockNumber)]\nunconstrained fn get_block_number_oracle() -> u32 {}\n\n#[oracle(getChainId)]\nunconstrained fn get_chain_id_oracle() -> Field {}\n\n#[oracle(getVersion)]\nunconstrained fn get_version_oracle() -> Field {}\n\npub unconstrained fn get_contract_address() -> AztecAddress {\n get_contract_address_oracle()\n}\n\npub unconstrained fn get_block_number() -> u32 {\n get_block_number_oracle()\n}\n\npub unconstrained fn get_chain_id() -> Field {\n get_chain_id_oracle()\n}\n\npub unconstrained fn get_version() -> Field {\n get_version_oracle()\n}\n" }, - "160": { - "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.65.0/noir-projects/aztec-nr/aztec/src/oracle/notes.nr", - "source": "use crate::note::{note_header::NoteHeader, note_interface::NoteInterface};\n\nuse dep::protocol_types::{\n address::AztecAddress,\n indexed_tagging_secret::{INDEXED_TAGGING_SECRET_LENGTH, IndexedTaggingSecret},\n utils::arr_copy_slice,\n};\n\n/// Notifies the simulator that a note has been created, so that it can be returned in future read requests in the same\n/// transaction. This note should only be added to the non-volatile database if found in an actual block.\npub fn notify_created_note(\n storage_slot: Field,\n note_type_id: Field,\n serialized_note: [Field; N],\n note_hash: Field,\n counter: u32,\n) {\n // This oracle call returns nothing: we only call it for its side effects. It is therefore always safe to call.\n unsafe {\n notify_created_note_oracle_wrapper(\n storage_slot,\n note_type_id,\n serialized_note,\n note_hash,\n counter,\n )\n };\n}\n\n/// Notifies the simulator that a note has been nullified, so that it is no longer returned in future read requests in\n/// the same transaction. This note should only be removed to the non-volatile database if its nullifier is found in an\n/// actual block.\npub fn notify_nullified_note(nullifier: Field, note_hash: Field, counter: u32) {\n // This oracle call returns nothing: we only call it for its side effects. It is therefore always safe to call.\n unsafe { notify_nullified_note_oracle_wrapper(nullifier, note_hash, counter) };\n}\n\nunconstrained fn notify_created_note_oracle_wrapper(\n storage_slot: Field,\n note_type_id: Field,\n serialized_note: [Field; N],\n note_hash: Field,\n counter: u32,\n) {\n let _ = notify_created_note_oracle(\n storage_slot,\n note_type_id,\n serialized_note,\n note_hash,\n counter,\n );\n}\n\n#[oracle(notifyCreatedNote)]\nunconstrained fn notify_created_note_oracle(\n _storage_slot: Field,\n _note_type_id: Field,\n _serialized_note: [Field; N],\n _note_hash: Field,\n _counter: u32,\n) -> Field {}\n\nunconstrained fn notify_nullified_note_oracle_wrapper(\n nullifier: Field,\n note_hash: Field,\n counter: u32,\n) {\n let _ = notify_nullified_note_oracle(nullifier, note_hash, counter);\n}\n\n#[oracle(notifyNullifiedNote)]\nunconstrained fn notify_nullified_note_oracle(\n _nullifier: Field,\n _note_hash: Field,\n _counter: u32,\n) -> Field {}\n\n#[oracle(getNotes)]\nunconstrained fn get_notes_oracle(\n _storage_slot: Field,\n _num_selects: u8,\n _select_by_indexes: [u8; N],\n _select_by_offsets: [u8; N],\n _select_by_lengths: [u8; N],\n _select_values: [Field; N],\n _select_comparators: [u8; N],\n _sort_by_indexes: [u8; N],\n _sort_by_offsets: [u8; N],\n _sort_by_lengths: [u8; N],\n _sort_order: [u8; N],\n _limit: u32,\n _offset: u32,\n _status: u8,\n _return_size: u32,\n _placeholder_fields: [Field; S],\n) -> [Field; S] {}\n\nunconstrained fn get_notes_oracle_wrapper(\n storage_slot: Field,\n num_selects: u8,\n select_by_indexes: [u8; N],\n select_by_offsets: [u8; N],\n select_by_lengths: [u8; N],\n select_values: [Field; N],\n select_comparators: [u8; N],\n sort_by_indexes: [u8; N],\n sort_by_offsets: [u8; N],\n sort_by_lengths: [u8; N],\n sort_order: [u8; N],\n limit: u32,\n offset: u32,\n status: u8,\n mut placeholder_fields: [Field; S],\n) -> [Field; S] {\n let return_size = placeholder_fields.len() as u32;\n get_notes_oracle(\n storage_slot,\n num_selects,\n select_by_indexes,\n select_by_offsets,\n select_by_lengths,\n select_values,\n select_comparators,\n sort_by_indexes,\n sort_by_offsets,\n sort_by_lengths,\n sort_order,\n limit,\n offset,\n status,\n return_size,\n placeholder_fields,\n )\n}\n\npub unconstrained fn get_notes(\n storage_slot: Field,\n num_selects: u8,\n select_by_indexes: [u8; M],\n select_by_offsets: [u8; M],\n select_by_lengths: [u8; M],\n select_values: [Field; M],\n select_comparators: [u8; M],\n sort_by_indexes: [u8; M],\n sort_by_offsets: [u8; M],\n sort_by_lengths: [u8; M],\n sort_order: [u8; M],\n limit: u32,\n offset: u32,\n status: u8,\n mut placeholder_opt_notes: [Option; S], // TODO: Remove it and use `limit` to initialize the note array.\n placeholder_fields: [Field; NS], // TODO: Remove it and use `limit` to initialize the note array.\n _placeholder_note_length: [Field; N], // Turbofish hack? Compiler breaks calculating read_offset unless we add this parameter\n) -> [Option; S]\nwhere\n Note: NoteInterface,\n{\n sync_notes_oracle_wrapper();\n let fields = get_notes_oracle_wrapper(\n storage_slot,\n num_selects,\n select_by_indexes,\n select_by_offsets,\n select_by_lengths,\n select_values,\n select_comparators,\n sort_by_indexes,\n sort_by_offsets,\n sort_by_lengths,\n sort_order,\n limit,\n offset,\n status,\n placeholder_fields,\n );\n let num_notes = fields[0] as u32;\n let contract_address = AztecAddress::from_field(fields[1]);\n for i in 0..placeholder_opt_notes.len() {\n if i < num_notes {\n // lengths named as per typescript.\n let return_header_length: u32 = 2; // num_notes & contract_address.\n let extra_preimage_length: u32 = 2; // nonce & note_hash_counter.\n let read_offset: u32 = return_header_length + i * (N + extra_preimage_length);\n let nonce = fields[read_offset];\n let note_hash_counter = fields[read_offset + 1] as u32;\n let header = NoteHeader { contract_address, nonce, storage_slot, note_hash_counter };\n let serialized_note = arr_copy_slice(fields, [0; N], read_offset + 2);\n let mut note = Note::deserialize_content(serialized_note);\n note.set_header(header);\n placeholder_opt_notes[i] = Option::some(note);\n };\n }\n placeholder_opt_notes\n}\n\n/// Returns true if the nullifier exists. Note that a `true` value can be constrained by proving existence of the\n/// nullifier, but a `false` value should not be relied upon since other transactions may emit this nullifier before the\n/// current transaction is included in a block. While this might seem of little use at first, certain design patterns\n/// benefit from this abstraction (see e.g. `PrivateMutable`).\npub unconstrained fn check_nullifier_exists(inner_nullifier: Field) -> bool {\n check_nullifier_exists_oracle(inner_nullifier) == 1\n}\n\n#[oracle(checkNullifierExists)]\nunconstrained fn check_nullifier_exists_oracle(_inner_nullifier: Field) -> Field {}\n\n/// Same as `get_app_tagging_secret_as_sender`, except it returns the derived tag as an array of bytes, ready to be included in a\n/// log.\npub unconstrained fn get_app_tag_bytes_as_sender(\n sender: AztecAddress,\n recipient: AztecAddress,\n) -> [u8; 32] {\n let tag = get_app_tagging_secret_as_sender(sender, recipient).compute_tag(recipient);\n tag.to_be_bytes()\n}\n\n/// Returns the tagging secret for a given sender and recipient pair, siloed for the current contract address.\n/// Includes the last known index used to send a note tagged with this secret.\n/// For this to work, PXE must know the ivpsk_m of the sender.\n/// For the recipient's side, only the address is needed.\npub unconstrained fn get_app_tagging_secret_as_sender(\n sender: AztecAddress,\n recipient: AztecAddress,\n) -> IndexedTaggingSecret {\n let result = get_app_tagging_secret_as_sender_oracle(sender, recipient);\n IndexedTaggingSecret::deserialize(result)\n}\n\n#[oracle(getAppTaggingSecretAsSender)]\nunconstrained fn get_app_tagging_secret_as_sender_oracle(\n _sender: AztecAddress,\n _recipient: AztecAddress,\n) -> [Field; INDEXED_TAGGING_SECRET_LENGTH] {}\n\n/// Notifies the simulator that a tag has been used in a note, and to therefore increment the associated index so that\n/// future notes get a different tag and can be discovered by the recipient.\n/// This change should only be persisted in a non-volatile database if the tagged log is found in an actual block -\n/// otherwise e.g. a reverting transaction can cause the sender to accidentally skip indices and later produce notes\n/// that are not found by the recipient.\npub fn increment_app_tagging_secret_index_as_sender(sender: AztecAddress, recipient: AztecAddress) {\n // This oracle call returns nothing: we only call it for its side effects. It is therefore always safe to call.\n unsafe {\n increment_app_tagging_secret_index_as_sender_wrapper(sender, recipient);\n }\n}\n\nunconstrained fn increment_app_tagging_secret_index_as_sender_wrapper(\n sender: AztecAddress,\n recipient: AztecAddress,\n) {\n increment_app_tagging_secret_index_as_sender_oracle(sender, recipient);\n}\n\n#[oracle(incrementAppTaggingSecretIndexAsSender)]\nunconstrained fn increment_app_tagging_secret_index_as_sender_oracle(\n _sender: AztecAddress,\n _recipient: AztecAddress,\n) {}\n\n/// Finds new notes that may have been sent to all registered accounts in PXE in the current contract and makes them available\n/// for later querying via the `get_notes` oracle.\npub fn sync_notes() {\n // This oracle call returns nothing: we only call it for its side effects. It is therefore always safe to call.\n unsafe {\n sync_notes_oracle_wrapper();\n }\n}\n\nunconstrained fn sync_notes_oracle_wrapper() {\n sync_notes_oracle();\n}\n\n#[oracle(syncNotes)]\nunconstrained fn sync_notes_oracle() {}\n" + "153": { + "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.66.0/noir-projects/aztec-nr/aztec/src/oracle/notes.nr", + "source": "use crate::note::{note_header::NoteHeader, note_interface::NoteInterface};\n\nuse dep::protocol_types::{\n address::AztecAddress,\n indexed_tagging_secret::{INDEXED_TAGGING_SECRET_LENGTH, IndexedTaggingSecret},\n utils::arr_copy_slice,\n};\n\n/// Notifies the simulator that a note has been created, so that it can be returned in future read requests in the same\n/// transaction. This note should only be added to the non-volatile database if found in an actual block.\npub fn notify_created_note(\n storage_slot: Field,\n note_type_id: Field,\n serialized_note: [Field; N],\n note_hash: Field,\n counter: u32,\n) {\n // This oracle call returns nothing: we only call it for its side effects. It is therefore always safe to call.\n unsafe {\n notify_created_note_oracle_wrapper(\n storage_slot,\n note_type_id,\n serialized_note,\n note_hash,\n counter,\n )\n };\n}\n\n/// Notifies the simulator that a note has been nullified, so that it is no longer returned in future read requests in\n/// the same transaction. This note should only be removed to the non-volatile database if its nullifier is found in an\n/// actual block.\npub fn notify_nullified_note(nullifier: Field, note_hash: Field, counter: u32) {\n // This oracle call returns nothing: we only call it for its side effects. It is therefore always safe to call.\n unsafe { notify_nullified_note_oracle_wrapper(nullifier, note_hash, counter) };\n}\n\nunconstrained fn notify_created_note_oracle_wrapper(\n storage_slot: Field,\n note_type_id: Field,\n serialized_note: [Field; N],\n note_hash: Field,\n counter: u32,\n) {\n let _ = notify_created_note_oracle(\n storage_slot,\n note_type_id,\n serialized_note,\n note_hash,\n counter,\n );\n}\n\n#[oracle(notifyCreatedNote)]\nunconstrained fn notify_created_note_oracle(\n _storage_slot: Field,\n _note_type_id: Field,\n _serialized_note: [Field; N],\n _note_hash: Field,\n _counter: u32,\n) -> Field {}\n\nunconstrained fn notify_nullified_note_oracle_wrapper(\n nullifier: Field,\n note_hash: Field,\n counter: u32,\n) {\n let _ = notify_nullified_note_oracle(nullifier, note_hash, counter);\n}\n\n#[oracle(notifyNullifiedNote)]\nunconstrained fn notify_nullified_note_oracle(\n _nullifier: Field,\n _note_hash: Field,\n _counter: u32,\n) -> Field {}\n\n#[oracle(getNotes)]\nunconstrained fn get_notes_oracle(\n _storage_slot: Field,\n _num_selects: u8,\n _select_by_indexes: [u8; N],\n _select_by_offsets: [u8; N],\n _select_by_lengths: [u8; N],\n _select_values: [Field; N],\n _select_comparators: [u8; N],\n _sort_by_indexes: [u8; N],\n _sort_by_offsets: [u8; N],\n _sort_by_lengths: [u8; N],\n _sort_order: [u8; N],\n _limit: u32,\n _offset: u32,\n _status: u8,\n _return_size: u32,\n _placeholder_fields: [Field; S],\n) -> [Field; S] {}\n\nunconstrained fn get_notes_oracle_wrapper(\n storage_slot: Field,\n num_selects: u8,\n select_by_indexes: [u8; N],\n select_by_offsets: [u8; N],\n select_by_lengths: [u8; N],\n select_values: [Field; N],\n select_comparators: [u8; N],\n sort_by_indexes: [u8; N],\n sort_by_offsets: [u8; N],\n sort_by_lengths: [u8; N],\n sort_order: [u8; N],\n limit: u32,\n offset: u32,\n status: u8,\n mut placeholder_fields: [Field; S],\n) -> [Field; S] {\n let return_size = placeholder_fields.len() as u32;\n get_notes_oracle(\n storage_slot,\n num_selects,\n select_by_indexes,\n select_by_offsets,\n select_by_lengths,\n select_values,\n select_comparators,\n sort_by_indexes,\n sort_by_offsets,\n sort_by_lengths,\n sort_order,\n limit,\n offset,\n status,\n return_size,\n placeholder_fields,\n )\n}\n\npub unconstrained fn get_notes(\n storage_slot: Field,\n num_selects: u8,\n select_by_indexes: [u8; M],\n select_by_offsets: [u8; M],\n select_by_lengths: [u8; M],\n select_values: [Field; M],\n select_comparators: [u8; M],\n sort_by_indexes: [u8; M],\n sort_by_offsets: [u8; M],\n sort_by_lengths: [u8; M],\n sort_order: [u8; M],\n limit: u32,\n offset: u32,\n status: u8,\n mut placeholder_opt_notes: [Option; S], // TODO: Remove it and use `limit` to initialize the note array.\n placeholder_fields: [Field; NS], // TODO: Remove it and use `limit` to initialize the note array.\n _placeholder_note_length: [Field; N], // Turbofish hack? Compiler breaks calculating read_offset unless we add this parameter\n) -> [Option; S]\nwhere\n Note: NoteInterface,\n{\n sync_notes_oracle_wrapper();\n let fields = get_notes_oracle_wrapper(\n storage_slot,\n num_selects,\n select_by_indexes,\n select_by_offsets,\n select_by_lengths,\n select_values,\n select_comparators,\n sort_by_indexes,\n sort_by_offsets,\n sort_by_lengths,\n sort_order,\n limit,\n offset,\n status,\n placeholder_fields,\n );\n let num_notes = fields[0] as u32;\n let contract_address = AztecAddress::from_field(fields[1]);\n for i in 0..placeholder_opt_notes.len() {\n if i < num_notes {\n // lengths named as per typescript.\n let return_header_length: u32 = 2; // num_notes & contract_address.\n let extra_preimage_length: u32 = 2; // nonce & note_hash_counter.\n let read_offset: u32 = return_header_length + i * (N + extra_preimage_length);\n let nonce = fields[read_offset];\n let note_hash_counter = fields[read_offset + 1] as u32;\n let header = NoteHeader { contract_address, nonce, storage_slot, note_hash_counter };\n let serialized_note = arr_copy_slice(fields, [0; N], read_offset + 2);\n let mut note = Note::deserialize_content(serialized_note);\n note.set_header(header);\n placeholder_opt_notes[i] = Option::some(note);\n };\n }\n placeholder_opt_notes\n}\n\n/// Returns true if the nullifier exists. Note that a `true` value can be constrained by proving existence of the\n/// nullifier, but a `false` value should not be relied upon since other transactions may emit this nullifier before the\n/// current transaction is included in a block. While this might seem of little use at first, certain design patterns\n/// benefit from this abstraction (see e.g. `PrivateMutable`).\npub unconstrained fn check_nullifier_exists(inner_nullifier: Field) -> bool {\n check_nullifier_exists_oracle(inner_nullifier) == 1\n}\n\n#[oracle(checkNullifierExists)]\nunconstrained fn check_nullifier_exists_oracle(_inner_nullifier: Field) -> Field {}\n\n/// Same as `get_app_tagging_secret_as_sender`, except it returns the derived tag, ready to be included in a log.\npub unconstrained fn get_app_tag_as_sender(sender: AztecAddress, recipient: AztecAddress) -> Field {\n get_app_tagging_secret_as_sender(sender, recipient).compute_tag(recipient)\n}\n\n/// Returns the tagging secret for a given sender and recipient pair, siloed for the current contract address.\n/// Includes the last known index used to send a note tagged with this secret.\n/// For this to work, PXE must know the ivpsk_m of the sender.\n/// For the recipient's side, only the address is needed.\npub unconstrained fn get_app_tagging_secret_as_sender(\n sender: AztecAddress,\n recipient: AztecAddress,\n) -> IndexedTaggingSecret {\n let result = get_app_tagging_secret_as_sender_oracle(sender, recipient);\n IndexedTaggingSecret::deserialize(result)\n}\n\n#[oracle(getAppTaggingSecretAsSender)]\nunconstrained fn get_app_tagging_secret_as_sender_oracle(\n _sender: AztecAddress,\n _recipient: AztecAddress,\n) -> [Field; INDEXED_TAGGING_SECRET_LENGTH] {}\n\n/// Notifies the simulator that a tag has been used in a note, and to therefore increment the associated index so that\n/// future notes get a different tag and can be discovered by the recipient.\n/// This change should only be persisted in a non-volatile database if the tagged log is found in an actual block -\n/// otherwise e.g. a reverting transaction can cause the sender to accidentally skip indices and later produce notes\n/// that are not found by the recipient.\npub fn increment_app_tagging_secret_index_as_sender(sender: AztecAddress, recipient: AztecAddress) {\n // This oracle call returns nothing: we only call it for its side effects. It is therefore always safe to call.\n unsafe {\n increment_app_tagging_secret_index_as_sender_wrapper(sender, recipient);\n }\n}\n\nunconstrained fn increment_app_tagging_secret_index_as_sender_wrapper(\n sender: AztecAddress,\n recipient: AztecAddress,\n) {\n increment_app_tagging_secret_index_as_sender_oracle(sender, recipient);\n}\n\n#[oracle(incrementAppTaggingSecretIndexAsSender)]\nunconstrained fn increment_app_tagging_secret_index_as_sender_oracle(\n _sender: AztecAddress,\n _recipient: AztecAddress,\n) {}\n\n/// Finds new notes that may have been sent to all registered accounts in PXE in the current contract and makes them available\n/// for later querying via the `get_notes` oracle.\npub fn sync_notes() {\n // This oracle call returns nothing: we only call it for its side effects. It is therefore always safe to call.\n unsafe {\n sync_notes_oracle_wrapper();\n }\n}\n\nunconstrained fn sync_notes_oracle_wrapper() {\n sync_notes_oracle();\n}\n\n#[oracle(syncNotes)]\nunconstrained fn sync_notes_oracle() {}\n" }, - "161": { - "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.65.0/noir-projects/aztec-nr/aztec/src/oracle/enqueue_public_function_call.nr", + "154": { + "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.66.0/noir-projects/aztec-nr/aztec/src/oracle/enqueue_public_function_call.nr", "source": "use dep::protocol_types::{abis::function_selector::FunctionSelector, address::AztecAddress};\n\n#[oracle(enqueuePublicFunctionCall)]\nunconstrained fn enqueue_public_function_call_oracle(\n _contract_address: AztecAddress,\n _function_selector: FunctionSelector,\n _args_hash: Field,\n _side_effect_counter: u32,\n _is_static_call: bool,\n) -> Field {}\n\npub unconstrained fn enqueue_public_function_call_internal(\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args_hash: Field,\n side_effect_counter: u32,\n is_static_call: bool,\n) -> Field {\n enqueue_public_function_call_oracle(\n contract_address,\n function_selector,\n args_hash,\n side_effect_counter,\n is_static_call,\n )\n}\n\n#[oracle(setPublicTeardownFunctionCall)]\nunconstrained fn set_public_teardown_function_call_oracle(\n _contract_address: AztecAddress,\n _function_selector: FunctionSelector,\n _args_hash: Field,\n _side_effect_counter: u32,\n _is_static_call: bool,\n) -> Field {}\n\npub unconstrained fn set_public_teardown_function_call_internal(\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args_hash: Field,\n side_effect_counter: u32,\n is_static_call: bool,\n) -> Field {\n set_public_teardown_function_call_oracle(\n contract_address,\n function_selector,\n args_hash,\n side_effect_counter,\n is_static_call,\n )\n}\n\npub fn notify_set_min_revertible_side_effect_counter(counter: u32) {\n unsafe { notify_set_min_revertible_side_effect_counter_oracle_wrapper(counter) };\n}\n\npub unconstrained fn notify_set_min_revertible_side_effect_counter_oracle_wrapper(counter: u32) {\n notify_set_min_revertible_side_effect_counter_oracle(counter);\n}\n\n#[oracle(notifySetMinRevertibleSideEffectCounter)]\nunconstrained fn notify_set_min_revertible_side_effect_counter_oracle(_counter: u32) {}\n" }, - "162": { - "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.65.0/noir-projects/aztec-nr/aztec/src/oracle/storage.nr", - "source": "use dep::protocol_types::{address::AztecAddress, traits::Deserialize};\n\n#[oracle(storageRead)]\nunconstrained fn storage_read_oracle(\n address: Field,\n storage_slot: Field,\n block_number: Field,\n length: Field,\n) -> [Field; N] {}\n\npub unconstrained fn raw_storage_read(\n address: AztecAddress,\n storage_slot: Field,\n block_number: u32,\n) -> [Field; N] {\n storage_read_oracle(\n address.to_field(),\n storage_slot,\n block_number as Field,\n N as Field,\n )\n}\n\npub unconstrained fn storage_read(\n address: AztecAddress,\n storage_slot: Field,\n block_number: u32,\n) -> T\nwhere\n T: Deserialize,\n{\n T::deserialize(raw_storage_read(address, storage_slot, block_number))\n}\n\nmod tests {\n use crate::oracle::storage::{raw_storage_read, storage_read};\n use dep::protocol_types::address::AztecAddress;\n\n use crate::test::mocks::mock_struct::MockStruct;\n use std::test::OracleMock;\n\n global address = AztecAddress::from_field(29);\n global slot = 7;\n global block_number = 17;\n\n #[test]\n unconstrained fn test_raw_storage_read() {\n let written = MockStruct { a: 13, b: 42 };\n\n let _ = OracleMock::mock(\"storageRead\").returns(written.serialize());\n\n let read: [Field; 2] = raw_storage_read(address, slot, block_number);\n assert_eq(read[0], 13);\n assert_eq(read[1], 42);\n }\n\n #[test]\n unconstrained fn test_storage_read() {\n let written = MockStruct { a: 13, b: 42 };\n\n let _ = OracleMock::mock(\"storageRead\").returns(written.serialize());\n\n let read: MockStruct = storage_read(address, slot, block_number);\n assert_eq(read.a, 13);\n assert_eq(read.b, 42);\n }\n}\n" + "155": { + "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.66.0/noir-projects/aztec-nr/aztec/src/oracle/storage.nr", + "source": "use dep::protocol_types::{address::AztecAddress, traits::Deserialize};\n\n#[oracle(storageRead)]\nunconstrained fn storage_read_oracle(\n address: Field,\n storage_slot: Field,\n block_number: Field,\n length: Field,\n) -> [Field; N] {}\n\npub unconstrained fn raw_storage_read(\n address: AztecAddress,\n storage_slot: Field,\n block_number: u32,\n) -> [Field; N] {\n storage_read_oracle(\n address.to_field(),\n storage_slot,\n block_number as Field,\n N as Field,\n )\n}\n\npub unconstrained fn storage_read(\n address: AztecAddress,\n storage_slot: Field,\n block_number: u32,\n) -> T\nwhere\n T: Deserialize,\n{\n T::deserialize(raw_storage_read(address, storage_slot, block_number))\n}\n\nmod tests {\n use crate::oracle::storage::{raw_storage_read, storage_read};\n use dep::protocol_types::address::AztecAddress;\n\n use crate::test::mocks::mock_struct::MockStruct;\n use std::test::OracleMock;\n\n global address: AztecAddress = AztecAddress::from_field(29);\n global slot: Field = 7;\n global block_number: u32 = 17;\n\n #[test]\n unconstrained fn test_raw_storage_read() {\n let written = MockStruct { a: 13, b: 42 };\n\n let _ = OracleMock::mock(\"storageRead\").returns(written.serialize());\n\n let read: [Field; 2] = raw_storage_read(address, slot, block_number);\n assert_eq(read[0], 13);\n assert_eq(read[1], 42);\n }\n\n #[test]\n unconstrained fn test_storage_read() {\n let written = MockStruct { a: 13, b: 42 };\n\n let _ = OracleMock::mock(\"storageRead\").returns(written.serialize());\n\n let read: MockStruct = storage_read(address, slot, block_number);\n assert_eq(read.a, 13);\n assert_eq(read.b, 42);\n }\n}\n" }, - "177": { - "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.65.0/noir-projects/aztec-nr/aztec/src/initializer.nr", + "170": { + "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.66.0/noir-projects/aztec-nr/aztec/src/initializer.nr", "source": "use dep::protocol_types::{\n abis::function_selector::FunctionSelector, address::AztecAddress,\n constants::GENERATOR_INDEX__CONSTRUCTOR, hash::poseidon2_hash_with_separator,\n};\n\nuse crate::{\n context::{PrivateContext, PublicContext},\n oracle::get_contract_instance::{\n get_contract_instance, get_contract_instance_deployer_avm,\n get_contract_instance_initialization_hash_avm,\n },\n};\n\npub fn mark_as_initialized_public(context: &mut PublicContext) {\n let init_nullifier =\n compute_unsiloed_contract_initialization_nullifier((*context).this_address());\n context.push_nullifier(init_nullifier);\n}\n\npub fn mark_as_initialized_private(context: &mut PrivateContext) {\n let init_nullifier =\n compute_unsiloed_contract_initialization_nullifier((*context).this_address());\n context.push_nullifier(init_nullifier);\n}\n\npub fn assert_is_initialized_public(context: &mut PublicContext) {\n let init_nullifier = compute_unsiloed_contract_initialization_nullifier(context.this_address());\n assert(context.nullifier_exists(init_nullifier, context.this_address()), \"Not initialized\");\n}\n\npub fn assert_is_initialized_private(context: &mut PrivateContext) {\n let init_nullifier = compute_unsiloed_contract_initialization_nullifier(context.this_address());\n context.push_nullifier_read_request(init_nullifier);\n}\n\nfn compute_unsiloed_contract_initialization_nullifier(address: AztecAddress) -> Field {\n address.to_field()\n}\n\npub fn assert_initialization_matches_address_preimage_public(context: PublicContext) {\n let address = context.this_address();\n let deployer = get_contract_instance_deployer_avm(address).unwrap();\n let initialization_hash = get_contract_instance_initialization_hash_avm(address).unwrap();\n let expected_init = compute_initialization_hash(context.selector(), context.get_args_hash());\n assert(initialization_hash == expected_init, \"Initialization hash does not match\");\n assert(\n (deployer.is_zero()) | (deployer == context.msg_sender()),\n \"Initializer address is not the contract deployer\",\n );\n}\n\npub fn assert_initialization_matches_address_preimage_private(context: PrivateContext) {\n let address = context.this_address();\n let instance = get_contract_instance(address);\n let expected_init = compute_initialization_hash(context.selector(), context.get_args_hash());\n assert(instance.initialization_hash == expected_init, \"Initialization hash does not match\");\n assert(\n (instance.deployer.is_zero()) | (instance.deployer == context.msg_sender()),\n \"Initializer address is not the contract deployer\",\n );\n}\n\npub fn compute_initialization_hash(\n init_selector: FunctionSelector,\n init_args_hash: Field,\n) -> Field {\n poseidon2_hash_with_separator(\n [init_selector.to_field(), init_args_hash],\n GENERATOR_INDEX__CONSTRUCTOR,\n )\n}\n" }, - "183": { - "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.65.0/noir-projects/noir-protocol-circuits/crates/types/src/address/aztec_address.nr", - "source": "use crate::{\n abis::function_selector::FunctionSelector,\n address::{\n partial_address::PartialAddress, salted_initialization_hash::SaltedInitializationHash,\n },\n constants::{\n AZTEC_ADDRESS_LENGTH, FUNCTION_TREE_HEIGHT, GENERATOR_INDEX__CONTRACT_ADDRESS_V1,\n MAX_FIELD_VALUE,\n },\n contract_class_id::ContractClassId,\n hash::{poseidon2_hash_with_separator, private_functions_root_from_siblings},\n merkle_tree::membership::MembershipWitness,\n public_keys::{IvpkM, NpkM, OvpkM, PublicKeys, TpkM},\n traits::{Deserialize, Empty, FromField, Serialize, ToField},\n utils,\n};\n\n// We do below because `use crate::point::Point;` does not work\nuse dep::std::embedded_curve_ops::EmbeddedCurvePoint as Point;\n\nuse crate::public_keys::AddressPoint;\nuse std::{\n ec::{pow, sqrt},\n embedded_curve_ops::{EmbeddedCurveScalar, fixed_base_scalar_mul as derive_public_key},\n};\n\n// Aztec address\npub struct AztecAddress {\n pub inner: Field,\n}\n\nimpl Eq for AztecAddress {\n fn eq(self, other: Self) -> bool {\n self.to_field() == other.to_field()\n }\n}\n\nimpl Empty for AztecAddress {\n fn empty() -> Self {\n Self { inner: 0 }\n }\n}\n\nimpl ToField for AztecAddress {\n fn to_field(self) -> Field {\n self.inner\n }\n}\n\nimpl FromField for AztecAddress {\n fn from_field(value: Field) -> AztecAddress {\n AztecAddress { inner: value }\n }\n}\n\nimpl Serialize for AztecAddress {\n fn serialize(self: Self) -> [Field; AZTEC_ADDRESS_LENGTH] {\n [self.to_field()]\n }\n}\n\nimpl Deserialize for AztecAddress {\n fn deserialize(fields: [Field; AZTEC_ADDRESS_LENGTH]) -> Self {\n FromField::from_field(fields[0])\n }\n}\n\nimpl AztecAddress {\n pub fn zero() -> Self {\n Self { inner: 0 }\n }\n\n pub fn to_address_point(self) -> AddressPoint {\n // We compute the address point by taking our address, setting it to x, and then solving for y in the\n // equation which defines our bn curve:\n // y^2 = x^3 - 17; x = address\n let x = self.inner;\n let y_squared = pow(x, 3) - 17;\n\n // TODO (#8970): Handle cases where we cannot recover a point from an address\n let mut y = sqrt(y_squared);\n\n // If we get a negative y coordinate (any y where y > MAX_FIELD_VALUE / 2), we pin it to the\n // positive one (any value where y <= MAX_FIELD_VALUE / 2) by subtracting it from the Field modulus\n // note: The field modulus is MAX_FIELD_VALUE + 1\n if (!(y.lt(MAX_FIELD_VALUE / 2) | y.eq(MAX_FIELD_VALUE / 2))) {\n y = (MAX_FIELD_VALUE + 1) - y;\n }\n\n AddressPoint { inner: Point { x: self.inner, y, is_infinite: false } }\n }\n\n pub fn compute(public_keys: PublicKeys, partial_address: PartialAddress) -> AztecAddress {\n let public_keys_hash = public_keys.hash();\n\n let pre_address = poseidon2_hash_with_separator(\n [public_keys_hash.to_field(), partial_address.to_field()],\n GENERATOR_INDEX__CONTRACT_ADDRESS_V1,\n );\n\n let address_point = derive_public_key(EmbeddedCurveScalar::from_field(pre_address)).add(\n public_keys.ivpk_m.to_point(),\n );\n\n // Note that our address is only the x-coordinate of the full address_point. This is okay because when people want to encrypt something and send it to us\n // they can recover our full point using the x-coordinate (our address itself). To do this, they recompute the y-coordinate according to the equation y^2 = x^3 - 17.\n // When they do this, they may get a positive y-coordinate (a value that is less than or equal to MAX_FIELD_VALUE / 2) or\n // a negative y-coordinate (a value that is more than MAX_FIELD_VALUE), and we cannot dictate which one they get and hence the recovered point may sometimes be different than the one\n // our secrect can decrypt. Regardless though, they should and will always encrypt using point with the positive y-coordinate by convention.\n // This ensures that everyone encrypts to the same point given an arbitrary x-coordinate (address). This is allowed because even though our original point may not have a positive y-coordinate,\n // with our original secret, we will be able to derive the secret to the point with the flipped (and now positive) y-coordinate that everyone encrypts to.\n AztecAddress::from_field(address_point.x)\n }\n\n pub fn compute_from_private_function(\n function_selector: FunctionSelector,\n function_vk_hash: Field,\n function_leaf_membership_witness: MembershipWitness,\n contract_class_artifact_hash: Field,\n contract_class_public_bytecode_commitment: Field,\n salted_initialization_hash: SaltedInitializationHash,\n public_keys: PublicKeys,\n ) -> Self {\n let private_functions_root = private_functions_root_from_siblings(\n function_selector,\n function_vk_hash,\n function_leaf_membership_witness.leaf_index,\n function_leaf_membership_witness.sibling_path,\n );\n\n let contract_class_id = ContractClassId::compute(\n contract_class_artifact_hash,\n private_functions_root,\n contract_class_public_bytecode_commitment,\n );\n\n // Compute contract address using the preimage which includes the class_id.\n let partial_address = PartialAddress::compute_from_salted_initialization_hash(\n contract_class_id,\n salted_initialization_hash,\n );\n\n AztecAddress::compute(public_keys, partial_address)\n }\n\n pub fn is_zero(self) -> bool {\n self.inner == 0\n }\n\n pub fn assert_is_zero(self) {\n assert(self.to_field() == 0);\n }\n\n pub fn conditional_assign(predicate: bool, lhs: Self, rhs: Self) -> Self {\n let result = utils::conditional_assign(predicate, rhs.to_field(), lhs.to_field());\n Self { inner: result }\n }\n}\n\n#[test]\nfn compute_address_from_partial_and_pub_keys() {\n let public_keys = PublicKeys {\n npk_m: NpkM {\n inner: Point {\n x: 0x22f7fcddfa3ce3e8f0cc8e82d7b94cdd740afa3e77f8e4a63ea78a239432dcab,\n y: 0x0471657de2b6216ade6c506d28fbc22ba8b8ed95c871ad9f3e3984e90d9723a7,\n is_infinite: false,\n },\n },\n ivpk_m: IvpkM {\n inner: Point {\n x: 0x111223493147f6785514b1c195bb37a2589f22a6596d30bb2bb145fdc9ca8f1e,\n y: 0x273bbffd678edce8fe30e0deafc4f66d58357c06fd4a820285294b9746c3be95,\n is_infinite: false,\n },\n },\n ovpk_m: OvpkM {\n inner: Point {\n x: 0x09115c96e962322ffed6522f57194627136b8d03ac7469109707f5e44190c484,\n y: 0x0c49773308a13d740a7f0d4f0e6163b02c5a408b6f965856b6a491002d073d5b,\n is_infinite: false,\n },\n },\n tpk_m: TpkM {\n inner: Point {\n x: 0x00d3d81beb009873eb7116327cf47c612d5758ef083d4fda78e9b63980b2a762,\n y: 0x2f567d22d2b02fe1f4ad42db9d58a36afd1983e7e2909d1cab61cafedad6193a,\n is_infinite: false,\n },\n },\n };\n\n let partial_address = PartialAddress::from_field(\n 0x0a7c585381b10f4666044266a02405bf6e01fa564c8517d4ad5823493abd31de,\n );\n\n let address = AztecAddress::compute(public_keys, partial_address);\n\n // The following value was generated by `derivation.test.ts`.\n // --> Run the test with AZTEC_GENERATE_TEST_DATA=1 flag to update test data.\n let expected_computed_address_from_partial_and_pubkeys =\n 0x24e4646f58b9fbe7d38e317db8d5636c423fbbdfbe119fc190fe9c64747e0c62;\n assert(address.to_field() == expected_computed_address_from_partial_and_pubkeys);\n}\n\n#[test]\nfn from_field_to_field() {\n let address = AztecAddress { inner: 37 };\n assert_eq(FromField::from_field(address.to_field()), address);\n}\n\n#[test]\nfn serde() {\n let address = AztecAddress { inner: 37 };\n assert_eq(Deserialize::deserialize(address.serialize()), address);\n}\n" + "176": { + "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.66.0/noir-projects/noir-protocol-circuits/crates/types/src/address/aztec_address.nr", + "source": "use crate::{\n abis::function_selector::FunctionSelector,\n address::{\n partial_address::PartialAddress, salted_initialization_hash::SaltedInitializationHash,\n },\n constants::{\n AZTEC_ADDRESS_LENGTH, FUNCTION_TREE_HEIGHT, GENERATOR_INDEX__CONTRACT_ADDRESS_V1,\n MAX_FIELD_VALUE,\n },\n contract_class_id::ContractClassId,\n hash::{poseidon2_hash_with_separator, private_functions_root_from_siblings},\n merkle_tree::membership::MembershipWitness,\n public_keys::{IvpkM, NpkM, OvpkM, PublicKeys, TpkM},\n traits::{Deserialize, Empty, FromField, Serialize, ToField},\n utils,\n};\n\n// We do below because `use crate::point::Point;` does not work\nuse dep::std::embedded_curve_ops::EmbeddedCurvePoint as Point;\n\nuse crate::public_keys::AddressPoint;\nuse ec::{pow, sqrt};\nuse std::embedded_curve_ops::{EmbeddedCurveScalar, fixed_base_scalar_mul as derive_public_key};\n\n// Aztec address\npub struct AztecAddress {\n pub inner: Field,\n}\n\nimpl Eq for AztecAddress {\n fn eq(self, other: Self) -> bool {\n self.to_field() == other.to_field()\n }\n}\n\nimpl Empty for AztecAddress {\n fn empty() -> Self {\n Self { inner: 0 }\n }\n}\n\nimpl ToField for AztecAddress {\n fn to_field(self) -> Field {\n self.inner\n }\n}\n\nimpl FromField for AztecAddress {\n fn from_field(value: Field) -> AztecAddress {\n AztecAddress { inner: value }\n }\n}\n\nimpl Serialize for AztecAddress {\n fn serialize(self: Self) -> [Field; AZTEC_ADDRESS_LENGTH] {\n [self.to_field()]\n }\n}\n\nimpl Deserialize for AztecAddress {\n fn deserialize(fields: [Field; AZTEC_ADDRESS_LENGTH]) -> Self {\n FromField::from_field(fields[0])\n }\n}\n\nimpl AztecAddress {\n pub fn zero() -> Self {\n Self { inner: 0 }\n }\n\n pub fn to_address_point(self) -> AddressPoint {\n // We compute the address point by taking our address, setting it to x, and then solving for y in the\n // equation which defines our bn curve:\n // y^2 = x^3 - 17; x = address\n let x = self.inner;\n let y_squared = pow(x, 3) - 17;\n\n // TODO (#8970): Handle cases where we cannot recover a point from an address\n let mut y = sqrt(y_squared);\n\n // If we get a negative y coordinate (any y where y > MAX_FIELD_VALUE / 2), we pin it to the\n // positive one (any value where y <= MAX_FIELD_VALUE / 2) by subtracting it from the Field modulus\n // note: The field modulus is MAX_FIELD_VALUE + 1\n if (!(y.lt(MAX_FIELD_VALUE / 2) | y.eq(MAX_FIELD_VALUE / 2))) {\n y = (MAX_FIELD_VALUE + 1) - y;\n }\n\n AddressPoint { inner: Point { x: self.inner, y, is_infinite: false } }\n }\n\n pub fn compute(public_keys: PublicKeys, partial_address: PartialAddress) -> AztecAddress {\n let public_keys_hash = public_keys.hash();\n\n let pre_address = poseidon2_hash_with_separator(\n [public_keys_hash.to_field(), partial_address.to_field()],\n GENERATOR_INDEX__CONTRACT_ADDRESS_V1,\n );\n\n let address_point = derive_public_key(EmbeddedCurveScalar::from_field(pre_address)).add(\n public_keys.ivpk_m.to_point(),\n );\n\n // Note that our address is only the x-coordinate of the full address_point. This is okay because when people want to encrypt something and send it to us\n // they can recover our full point using the x-coordinate (our address itself). To do this, they recompute the y-coordinate according to the equation y^2 = x^3 - 17.\n // When they do this, they may get a positive y-coordinate (a value that is less than or equal to MAX_FIELD_VALUE / 2) or\n // a negative y-coordinate (a value that is more than MAX_FIELD_VALUE), and we cannot dictate which one they get and hence the recovered point may sometimes be different than the one\n // our secrect can decrypt. Regardless though, they should and will always encrypt using point with the positive y-coordinate by convention.\n // This ensures that everyone encrypts to the same point given an arbitrary x-coordinate (address). This is allowed because even though our original point may not have a positive y-coordinate,\n // with our original secret, we will be able to derive the secret to the point with the flipped (and now positive) y-coordinate that everyone encrypts to.\n AztecAddress::from_field(address_point.x)\n }\n\n pub fn compute_from_private_function(\n function_selector: FunctionSelector,\n function_vk_hash: Field,\n function_leaf_membership_witness: MembershipWitness,\n contract_class_artifact_hash: Field,\n contract_class_public_bytecode_commitment: Field,\n salted_initialization_hash: SaltedInitializationHash,\n public_keys: PublicKeys,\n ) -> Self {\n let private_functions_root = private_functions_root_from_siblings(\n function_selector,\n function_vk_hash,\n function_leaf_membership_witness.leaf_index,\n function_leaf_membership_witness.sibling_path,\n );\n\n let contract_class_id = ContractClassId::compute(\n contract_class_artifact_hash,\n private_functions_root,\n contract_class_public_bytecode_commitment,\n );\n\n // Compute contract address using the preimage which includes the class_id.\n let partial_address = PartialAddress::compute_from_salted_initialization_hash(\n contract_class_id,\n salted_initialization_hash,\n );\n\n AztecAddress::compute(public_keys, partial_address)\n }\n\n pub fn is_zero(self) -> bool {\n self.inner == 0\n }\n\n pub fn assert_is_zero(self) {\n assert(self.to_field() == 0);\n }\n\n pub fn conditional_assign(predicate: bool, lhs: Self, rhs: Self) -> Self {\n let result = utils::conditional_assign(predicate, rhs.to_field(), lhs.to_field());\n Self { inner: result }\n }\n}\n\n#[test]\nfn compute_address_from_partial_and_pub_keys() {\n let public_keys = PublicKeys {\n npk_m: NpkM {\n inner: Point {\n x: 0x22f7fcddfa3ce3e8f0cc8e82d7b94cdd740afa3e77f8e4a63ea78a239432dcab,\n y: 0x0471657de2b6216ade6c506d28fbc22ba8b8ed95c871ad9f3e3984e90d9723a7,\n is_infinite: false,\n },\n },\n ivpk_m: IvpkM {\n inner: Point {\n x: 0x111223493147f6785514b1c195bb37a2589f22a6596d30bb2bb145fdc9ca8f1e,\n y: 0x273bbffd678edce8fe30e0deafc4f66d58357c06fd4a820285294b9746c3be95,\n is_infinite: false,\n },\n },\n ovpk_m: OvpkM {\n inner: Point {\n x: 0x09115c96e962322ffed6522f57194627136b8d03ac7469109707f5e44190c484,\n y: 0x0c49773308a13d740a7f0d4f0e6163b02c5a408b6f965856b6a491002d073d5b,\n is_infinite: false,\n },\n },\n tpk_m: TpkM {\n inner: Point {\n x: 0x00d3d81beb009873eb7116327cf47c612d5758ef083d4fda78e9b63980b2a762,\n y: 0x2f567d22d2b02fe1f4ad42db9d58a36afd1983e7e2909d1cab61cafedad6193a,\n is_infinite: false,\n },\n },\n };\n\n let partial_address = PartialAddress::from_field(\n 0x0a7c585381b10f4666044266a02405bf6e01fa564c8517d4ad5823493abd31de,\n );\n\n let address = AztecAddress::compute(public_keys, partial_address);\n\n // The following value was generated by `derivation.test.ts`.\n // --> Run the test with AZTEC_GENERATE_TEST_DATA=1 flag to update test data.\n let expected_computed_address_from_partial_and_pubkeys =\n 0x24e4646f58b9fbe7d38e317db8d5636c423fbbdfbe119fc190fe9c64747e0c62;\n assert(address.to_field() == expected_computed_address_from_partial_and_pubkeys);\n}\n\n#[test]\nfn compute_preaddress_from_partial_and_pub_keys() {\n let pre_address = poseidon2_hash_with_separator([1, 2], GENERATOR_INDEX__CONTRACT_ADDRESS_V1);\n let expected_computed_preaddress_from_partial_and_pubkey =\n 0x23ce9be3fa3c846b0f9245cc796902e731d04f086e8a42473bb29e405fc98075;\n assert(pre_address == expected_computed_preaddress_from_partial_and_pubkey);\n}\n\n#[test]\nfn from_field_to_field() {\n let address = AztecAddress { inner: 37 };\n assert_eq(FromField::from_field(address.to_field()), address);\n}\n\n#[test]\nfn serde() {\n let address = AztecAddress { inner: 37 };\n assert_eq(Deserialize::deserialize(address.serialize()), address);\n}\n" }, - "194": { - "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.65.0/noir-projects/noir-protocol-circuits/crates/types/src/type_serialization.nr", + "187": { + "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.66.0/noir-projects/noir-protocol-circuits/crates/types/src/type_serialization.nr", "source": "use crate::traits::{Deserialize, Serialize};\n\nglobal BOOL_SERIALIZED_LEN: u32 = 1;\nglobal U8_SERIALIZED_LEN: u32 = 1;\nglobal U16_SERIALIZED_LEN: u32 = 1;\nglobal U32_SERIALIZED_LEN: u32 = 1;\nglobal U64_SERIALIZED_LEN: u32 = 1;\nglobal U128_SERIALIZED_LEN: u32 = 1;\nglobal FIELD_SERIALIZED_LEN: u32 = 1;\nglobal I8_SERIALIZED_LEN: u32 = 1;\nglobal I16_SERIALIZED_LEN: u32 = 1;\nglobal I32_SERIALIZED_LEN: u32 = 1;\nglobal I64_SERIALIZED_LEN: u32 = 1;\n\nimpl Serialize for bool {\n fn serialize(self) -> [Field; BOOL_SERIALIZED_LEN] {\n [self as Field]\n }\n}\n\nimpl Deserialize for bool {\n fn deserialize(fields: [Field; BOOL_SERIALIZED_LEN]) -> bool {\n fields[0] as bool\n }\n}\n\nimpl Serialize for u8 {\n fn serialize(self) -> [Field; U8_SERIALIZED_LEN] {\n [self as Field]\n }\n}\n\nimpl Deserialize for u8 {\n fn deserialize(fields: [Field; U8_SERIALIZED_LEN]) -> Self {\n fields[0] as u8\n }\n}\n\nimpl Serialize for u16 {\n fn serialize(self) -> [Field; U16_SERIALIZED_LEN] {\n [self as Field]\n }\n}\n\nimpl Deserialize for u16 {\n fn deserialize(fields: [Field; U16_SERIALIZED_LEN]) -> Self {\n fields[0] as u16\n }\n}\n\nimpl Serialize for u32 {\n fn serialize(self) -> [Field; U32_SERIALIZED_LEN] {\n [self as Field]\n }\n}\n\nimpl Deserialize for u32 {\n fn deserialize(fields: [Field; U32_SERIALIZED_LEN]) -> Self {\n fields[0] as u32\n }\n}\n\nimpl Serialize for u64 {\n fn serialize(self) -> [Field; U64_SERIALIZED_LEN] {\n [self as Field]\n }\n}\n\nimpl Deserialize for u64 {\n fn deserialize(fields: [Field; U64_SERIALIZED_LEN]) -> Self {\n fields[0] as u64\n }\n}\n\nimpl Serialize for U128 {\n fn serialize(self) -> [Field; U128_SERIALIZED_LEN] {\n [self.to_integer()]\n }\n}\n\nimpl Deserialize for U128 {\n fn deserialize(fields: [Field; U128_SERIALIZED_LEN]) -> Self {\n U128::from_integer(fields[0])\n }\n}\n\nimpl Serialize for Field {\n fn serialize(self) -> [Field; FIELD_SERIALIZED_LEN] {\n [self]\n }\n}\n\nimpl Deserialize for Field {\n fn deserialize(fields: [Field; FIELD_SERIALIZED_LEN]) -> Self {\n fields[0]\n }\n}\n\nimpl Serialize for i8 {\n fn serialize(self) -> [Field; I8_SERIALIZED_LEN] {\n [self as Field]\n }\n}\n\nimpl Deserialize for i8 {\n fn deserialize(fields: [Field; I8_SERIALIZED_LEN]) -> Self {\n fields[0] as i8\n }\n}\n\nimpl Serialize for i16 {\n fn serialize(self) -> [Field; I16_SERIALIZED_LEN] {\n [self as Field]\n }\n}\n\nimpl Deserialize for i16 {\n fn deserialize(fields: [Field; I16_SERIALIZED_LEN]) -> Self {\n fields[0] as i16\n }\n}\n\nimpl Serialize for i32 {\n fn serialize(self) -> [Field; I32_SERIALIZED_LEN] {\n [self as Field]\n }\n}\n\nimpl Deserialize for i32 {\n fn deserialize(fields: [Field; I32_SERIALIZED_LEN]) -> Self {\n fields[0] as i32\n }\n}\n\nimpl Serialize for i64 {\n fn serialize(self) -> [Field; I64_SERIALIZED_LEN] {\n [self as Field]\n }\n}\n\nimpl Deserialize for i64 {\n fn deserialize(fields: [Field; I64_SERIALIZED_LEN]) -> Self {\n fields[0] as i64\n }\n}\n\nimpl Serialize for [T; N]\nwhere\n T: Serialize,\n{\n fn serialize(self) -> [Field; N * M] {\n let mut result: [Field; N * M] = std::mem::zeroed();\n let mut serialized: [Field; M] = std::mem::zeroed();\n for i in 0..N {\n serialized = self[i].serialize();\n for j in 0..M {\n result[i * M + j] = serialized[j];\n }\n }\n result\n }\n}\n\nimpl Deserialize for [T; N]\nwhere\n T: Deserialize,\n{\n fn deserialize(fields: [Field; N * M]) -> Self {\n let mut reader = crate::utils::reader::Reader::new(fields);\n let mut result: [T; N] = std::mem::zeroed();\n reader.read_struct_array::(Deserialize::deserialize, result)\n }\n}\n\n#[test]\nfn test_u16_serialization() {\n let a: u16 = 10;\n assert_eq(a, u16::deserialize(a.serialize()));\n}\n\n#[test]\nfn test_i8_serialization() {\n let a: i8 = -10;\n assert_eq(a, i8::deserialize(a.serialize()));\n}\n\n#[test]\nfn test_i16_serialization() {\n let a: i16 = -10;\n assert_eq(a, i16::deserialize(a.serialize()));\n}\n\n#[test]\nfn test_i32_serialization() {\n let a: i32 = -10;\n assert_eq(a, i32::deserialize(a.serialize()));\n}\n\n#[test]\nfn test_i64_serialization() {\n let a: i64 = -10;\n assert_eq(a, i64::deserialize(a.serialize()));\n}\n" }, - "212": { - "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.65.0/noir-projects/noir-protocol-circuits/crates/types/src/utils/reader.nr", + "205": { + "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.66.0/noir-projects/noir-protocol-circuits/crates/types/src/utils/reader.nr", "source": "pub struct Reader {\n data: [Field; N],\n offset: u32,\n}\n\nimpl Reader {\n pub fn new(data: [Field; N]) -> Self {\n Self { data, offset: 0 }\n }\n\n pub fn read(&mut self) -> Field {\n let result = self.data[self.offset];\n self.offset += 1;\n result\n }\n\n pub fn read_u32(&mut self) -> u32 {\n self.read() as u32\n }\n\n pub fn read_bool(&mut self) -> bool {\n self.read() as bool\n }\n\n pub fn read_array(&mut self) -> [Field; K] {\n let mut result = [0; K];\n for i in 0..K {\n result[i] = self.data[self.offset + i];\n }\n self.offset += K;\n result\n }\n\n pub fn read_struct(&mut self, deserialise: fn([Field; K]) -> T) -> T {\n let result = deserialise(self.read_array());\n result\n }\n\n pub fn read_struct_array(\n &mut self,\n deserialise: fn([Field; K]) -> T,\n mut result: [T; C],\n ) -> [T; C] {\n for i in 0..C {\n result[i] = self.read_struct(deserialise);\n }\n result\n }\n\n pub fn finish(self) {\n assert(self.offset == self.data.len(), \"Reader did not read all data\");\n }\n}\n" }, - "227": { - "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.65.0/noir-projects/noir-protocol-circuits/crates/types/src/traits.nr", + "220": { + "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.66.0/noir-projects/noir-protocol-circuits/crates/types/src/traits.nr", "source": "use crate::meta::{derive_deserialize, derive_serialize};\nuse crate::utils::field::field_from_bytes;\n\n// Trait: is_empty\n//\n// The general is_empty trait checks if a data type is is empty,\n// and it defines empty for the basic data types as 0.\n//\n// If a Field is equal to zero, then it is regarded as zero.\n// We will go with this definition for now, however it can be problematic\n// if a value can actually be zero. In a future refactor, we can\n// use the optional type for safety. Doing it now would lead to a worse devex\n// and would make it harder to sync up with the cpp code.\n// Preferred over Default trait to convey intent, as default doesn't necessarily mean empty.\npub trait Empty {\n fn empty() -> Self;\n}\n\nimpl Empty for Field {\n fn empty() -> Self {\n 0\n }\n}\n\nimpl Empty for u1 {\n fn empty() -> Self {\n 0\n }\n}\nimpl Empty for u8 {\n fn empty() -> Self {\n 0\n }\n}\nimpl Empty for u32 {\n fn empty() -> Self {\n 0\n }\n}\nimpl Empty for u64 {\n fn empty() -> Self {\n 0\n }\n}\nimpl Empty for U128 {\n fn empty() -> Self {\n U128::from_integer(0)\n }\n}\n\npub fn is_empty(item: T) -> bool\nwhere\n T: Empty + Eq,\n{\n item.eq(T::empty())\n}\n\npub fn is_empty_array(array: [T; N]) -> bool\nwhere\n T: Empty + Eq,\n{\n array.all(|elem| is_empty(elem))\n}\n\npub trait Hash {\n fn hash(self) -> Field;\n}\n\npub trait ToField {\n fn to_field(self) -> Field;\n}\n\nimpl ToField for Field {\n fn to_field(self) -> Field {\n self\n }\n}\n\nimpl ToField for bool {\n fn to_field(self) -> Field {\n self as Field\n }\n}\nimpl ToField for u1 {\n fn to_field(self) -> Field {\n self as Field\n }\n}\nimpl ToField for u8 {\n fn to_field(self) -> Field {\n self as Field\n }\n}\nimpl ToField for u32 {\n fn to_field(self) -> Field {\n self as Field\n }\n}\nimpl ToField for u64 {\n fn to_field(self) -> Field {\n self as Field\n }\n}\nimpl ToField for U128 {\n fn to_field(self) -> Field {\n self.to_integer()\n }\n}\nimpl ToField for str {\n fn to_field(self) -> Field {\n assert(N < 32, \"String doesn't fit in a field, consider using Serialize instead\");\n field_from_bytes(self.as_bytes(), true)\n }\n}\n\npub trait FromField {\n fn from_field(value: Field) -> Self;\n}\n\nimpl FromField for Field {\n fn from_field(value: Field) -> Self {\n value\n }\n}\n\nimpl FromField for bool {\n fn from_field(value: Field) -> Self {\n value as bool\n }\n}\nimpl FromField for u1 {\n fn from_field(value: Field) -> Self {\n value as u1\n }\n}\nimpl FromField for u8 {\n fn from_field(value: Field) -> Self {\n value as u8\n }\n}\nimpl FromField for u32 {\n fn from_field(value: Field) -> Self {\n value as u32\n }\n}\nimpl FromField for u64 {\n fn from_field(value: Field) -> Self {\n value as u64\n }\n}\nimpl FromField for U128 {\n fn from_field(value: Field) -> Self {\n U128::from_integer(value)\n }\n}\n\n// docs:start:serialize\n#[derive_via(derive_serialize)]\npub trait Serialize {\n fn serialize(self) -> [Field; N];\n}\n// docs:end:serialize\n\nimpl Serialize for str {\n fn serialize(self) -> [Field; N] {\n let bytes = self.as_bytes();\n let mut fields = [0; N];\n for i in 0..bytes.len() {\n fields[i] = bytes[i] as Field;\n }\n fields\n }\n}\n\n// docs:start:deserialize\n#[derive_via(derive_deserialize)]\npub trait Deserialize {\n fn deserialize(fields: [Field; N]) -> Self;\n}\n// docs:end:deserialize\n\nimpl Deserialize for str {\n fn deserialize(fields: [Field; N]) -> Self {\n str::from(fields.map(|value| value as u8))\n }\n}\n" }, - "229": { - "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.65.0/noir-projects/noir-protocol-circuits/crates/types/src/hash.nr", - "source": "use crate::{\n abis::{\n contract_class_function_leaf_preimage::ContractClassFunctionLeafPreimage,\n function_selector::FunctionSelector,\n log_hash::{LogHash, ScopedEncryptedLogHash, ScopedLogHash},\n note_hash::ScopedNoteHash,\n nullifier::ScopedNullifier,\n },\n address::{AztecAddress, EthAddress},\n constants::{\n FUNCTION_TREE_HEIGHT, GENERATOR_INDEX__NOTE_HASH_NONCE, GENERATOR_INDEX__OUTER_NULLIFIER,\n GENERATOR_INDEX__SILOED_NOTE_HASH, GENERATOR_INDEX__UNIQUE_NOTE_HASH,\n },\n merkle_tree::root::root_from_sibling_path,\n messaging::l2_to_l1_message::{L2ToL1Message, ScopedL2ToL1Message},\n traits::{is_empty, ToField},\n utils::field::field_from_bytes_32_trunc,\n};\nuse super::utils::field::field_from_bytes;\n\npub fn sha256_to_field(bytes_to_hash: [u8; N]) -> Field {\n let sha256_hashed = std::hash::sha256(bytes_to_hash);\n let hash_in_a_field = field_from_bytes_32_trunc(sha256_hashed);\n\n hash_in_a_field\n}\n\npub fn private_functions_root_from_siblings(\n selector: FunctionSelector,\n vk_hash: Field,\n function_leaf_index: Field,\n function_leaf_sibling_path: [Field; FUNCTION_TREE_HEIGHT],\n) -> Field {\n let function_leaf_preimage = ContractClassFunctionLeafPreimage { selector, vk_hash };\n let function_leaf = function_leaf_preimage.hash();\n root_from_sibling_path(\n function_leaf,\n function_leaf_index,\n function_leaf_sibling_path,\n )\n}\n\nfn compute_note_hash_nonce(tx_hash: Field, note_index_in_tx: u32) -> Field {\n // Hashing tx hash with note index in tx is guaranteed to be unique\n poseidon2_hash_with_separator(\n [tx_hash, note_index_in_tx as Field],\n GENERATOR_INDEX__NOTE_HASH_NONCE,\n )\n}\n\npub fn compute_unique_note_hash(nonce: Field, note_hash: Field) -> Field {\n let inputs = [nonce, note_hash];\n poseidon2_hash_with_separator(inputs, GENERATOR_INDEX__UNIQUE_NOTE_HASH)\n}\n\npub fn compute_siloed_note_hash(app: AztecAddress, unique_note_hash: Field) -> Field {\n poseidon2_hash_with_separator(\n [app.to_field(), unique_note_hash],\n GENERATOR_INDEX__SILOED_NOTE_HASH,\n )\n}\n\n/// Siloing in the context of Aztec refers to the process of hashing a note hash with a contract address (this way\n/// the note hash is scoped to a specific contract). This is used to prevent intermingling of notes between contracts.\npub fn silo_note_hash(note_hash: ScopedNoteHash, tx_hash: Field, note_index_in_tx: u32) -> Field {\n if note_hash.contract_address.is_zero() {\n 0\n } else {\n let nonce = compute_note_hash_nonce(tx_hash, note_index_in_tx);\n let unique_note_hash = compute_unique_note_hash(nonce, note_hash.value());\n compute_siloed_note_hash(note_hash.contract_address, unique_note_hash)\n }\n}\n\npub fn compute_siloed_nullifier(app: AztecAddress, nullifier: Field) -> Field {\n poseidon2_hash_with_separator(\n [app.to_field(), nullifier],\n GENERATOR_INDEX__OUTER_NULLIFIER,\n )\n}\n\npub fn silo_nullifier(nullifier: ScopedNullifier) -> Field {\n if nullifier.contract_address.is_zero() {\n nullifier.value() // Return value instead of 0 because the first nullifier's contract address is zero.\n } else {\n compute_siloed_nullifier(nullifier.contract_address, nullifier.value())\n }\n}\n\npub fn silo_encrypted_log_hash(log_hash: ScopedLogHash) -> Field {\n // We assume contract address has already been masked\n if log_hash.contract_address.is_zero() {\n 0\n } else {\n accumulate_sha256(\n [log_hash.contract_address.to_field(), log_hash.log_hash.value],\n )\n }\n}\n\npub fn mask_encrypted_log_hash(scoped_log: ScopedEncryptedLogHash) -> AztecAddress {\n if scoped_log.contract_address.is_zero() {\n AztecAddress::from_field(0)\n } else if (scoped_log.log_hash.randomness == 0) {\n scoped_log.contract_address\n } else {\n AztecAddress::from_field(poseidon2_hash_with_separator(\n [scoped_log.contract_address.to_field(), scoped_log.log_hash.randomness],\n 0,\n ))\n }\n}\n\nfn compute_siloed_unencrypted_log_hash(address: AztecAddress, log_hash: Field) -> Field {\n accumulate_sha256([address.to_field(), log_hash])\n}\n\npub fn silo_unencrypted_log_hash(log_hash: ScopedLogHash) -> Field {\n if log_hash.contract_address.is_zero() {\n 0\n } else {\n compute_siloed_unencrypted_log_hash(log_hash.contract_address, log_hash.value())\n }\n}\n\npub fn merkle_hash(left: Field, right: Field) -> Field {\n poseidon2_hash([left, right])\n}\n\npub fn compute_l2_to_l1_hash(\n contract_address: AztecAddress,\n recipient: EthAddress,\n content: Field,\n rollup_version_id: Field,\n chain_id: Field,\n) -> Field {\n let mut bytes: BoundedVec = BoundedVec::new();\n\n let inputs =\n [contract_address.to_field(), rollup_version_id, recipient.to_field(), chain_id, content];\n for i in 0..inputs.len() {\n // TODO are bytes be in fr.to_buffer() ?\n let item_bytes: [u8; 32] = inputs[i].to_be_bytes();\n for j in 0..32 {\n bytes.push(item_bytes[j]);\n }\n }\n\n sha256_to_field(bytes.storage())\n}\n\npub fn silo_l2_to_l1_message(\n msg: ScopedL2ToL1Message,\n rollup_version_id: Field,\n chain_id: Field,\n) -> Field {\n if msg.contract_address.is_zero() {\n 0\n } else {\n compute_l2_to_l1_hash(\n msg.contract_address,\n msg.message.recipient,\n msg.message.content,\n rollup_version_id,\n chain_id,\n )\n }\n}\n\n// Computes sha256 hash of 2 input hashes.\n//\n// NB: This method now takes in two 31 byte fields - it assumes that any input\n// is the result of a sha_to_field hash and => is truncated\n//\n// TODO(Jan and David): This is used for the encrypted_log hashes.\n// Can we check to see if we can just use hash_to_field or pedersen_compress here?\n//\npub fn accumulate_sha256(input: [Field; 2]) -> Field {\n // This is a note about the cpp code, since it takes an array of Fields\n // instead of a U128.\n // 4 Field elements when converted to bytes will usually\n // occupy 4 * 32 = 128 bytes.\n // However, this function is making the assumption that each Field\n // only occupies 128 bits.\n //\n // TODO(David): This does not seem to be getting guaranteed anywhere in the code?\n // Concatentate two fields into 32x2 = 64 bytes\n // accumulate_sha256 assumes that the inputs are pre-truncated 31 byte numbers\n let mut hash_input_flattened = [0; 64];\n for offset in 0..input.len() {\n let input_as_bytes: [u8; 32] = input[offset].to_be_bytes();\n for byte_index in 0..32 {\n hash_input_flattened[offset * 32 + byte_index] = input_as_bytes[byte_index];\n }\n }\n\n sha256_to_field(hash_input_flattened)\n}\n\n// Computes the final logs hash for a tx.\npub fn compute_tx_logs_hash(logs: [LogHash; N]) -> Field {\n // Convert each field element into a byte array and append the bytes to `hash_input_flattened`\n let mut hash_input_flattened = [0; N * 32];\n for offset in 0..N {\n // TODO: This is not checking that the decomposition is smaller than P\n let input_as_bytes: [u8; 32] = logs[offset].value.to_be_radix(256);\n for byte_index in 0..32 {\n hash_input_flattened[offset * 32 + byte_index] = input_as_bytes[byte_index];\n }\n }\n // Ideally we would push to a slice then hash, but there is no sha_slice\n // Hardcode to 256 bytes for now\n let mut hash = sha256_to_field(hash_input_flattened);\n // Not having a 0 value hash for empty logs causes issues with empty txs\n // used for padding. Returning early is currently unsupported.\n // We always provide sorted logs here, so 0 being empty means all are empty.\n if is_empty(logs[0]) {\n hash = 0;\n }\n hash\n}\n\npub fn verification_key_hash(key: [Field; N]) -> Field {\n crate::hash::poseidon2_hash(key)\n}\n\n#[inline_always]\npub fn pedersen_hash(inputs: [Field; N], hash_index: u32) -> Field {\n std::hash::pedersen_hash_with_separator(inputs, hash_index)\n}\n\npub fn poseidon2_hash(inputs: [Field; N]) -> Field {\n std::hash::poseidon2::Poseidon2::hash(inputs, N)\n}\n\n#[no_predicates]\npub fn poseidon2_hash_with_separator(inputs: [Field; N], separator: T) -> Field\nwhere\n T: ToField,\n{\n // We manually hash the inputs here, since we cannot express with the type system a constant size inputs array of N + 1\n let in_len = N + 1;\n let two_pow_64 = 18446744073709551616;\n let iv: Field = (in_len as Field) * two_pow_64;\n let mut sponge = std::hash::poseidon2::Poseidon2::new(iv);\n sponge.absorb(separator.to_field());\n\n for i in 0..inputs.len() {\n sponge.absorb(inputs[i]);\n }\n\n sponge.squeeze()\n}\n\npub fn poseidon2_hash_with_separator_slice(inputs: [Field], separator: T) -> Field\nwhere\n T: ToField,\n{\n let in_len = inputs.len() + 1;\n let two_pow_64 = 18446744073709551616;\n let iv: Field = (in_len as Field) * two_pow_64;\n let mut sponge = std::hash::poseidon2::Poseidon2::new(iv);\n sponge.absorb(separator.to_field());\n\n for i in 0..inputs.len() {\n sponge.absorb(inputs[i]);\n }\n\n sponge.squeeze()\n}\n\n#[no_predicates]\npub fn poseidon2_hash_bytes(inputs: [u8; N]) -> Field {\n // We manually hash the inputs here, since we cannot express with the type system a constant size inputs array of Math.ceil(N/31)\n let mut in_len = N / 31;\n let mut has_padding = false;\n if N % 31 != 0 {\n in_len += 1;\n has_padding = true;\n }\n\n let two_pow_64 = 18446744073709551616;\n let iv: Field = (in_len as Field) * two_pow_64;\n let mut sponge = std::hash::poseidon2::Poseidon2::new(iv);\n\n let mut current_field = [0; 31];\n for i in 0..inputs.len() {\n let index = i % 31;\n current_field[index] = inputs[i];\n if index == 30 {\n sponge.absorb(field_from_bytes(current_field, false));\n current_field = [0; 31];\n }\n }\n if has_padding {\n sponge.absorb(field_from_bytes(current_field, false));\n }\n\n sponge.squeeze()\n}\n\n#[test]\nfn smoke_sha256_to_field() {\n let full_buffer = [\n 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,\n 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,\n 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70,\n 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,\n 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,\n 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130,\n 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148,\n 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,\n ];\n let result = sha256_to_field(full_buffer);\n\n assert(result == 0x448ebbc9e1a31220a2f3830c18eef61b9bd070e5084b7fa2a359fe729184c7);\n\n // to show correctness of the current ver (truncate one byte) vs old ver (mod full bytes):\n let result_bytes = std::hash::sha256(full_buffer);\n let truncated_field = crate::utils::field::field_from_bytes_32_trunc(result_bytes);\n assert(truncated_field == result);\n let mod_res = result + (result_bytes[31] as Field);\n assert(mod_res == 0x448ebbc9e1a31220a2f3830c18eef61b9bd070e5084b7fa2a359fe729184e0);\n}\n\n#[test]\nfn compute_l2_l1_hash() {\n // All zeroes\n let hash_result =\n compute_l2_to_l1_hash(AztecAddress::from_field(0), EthAddress::zero(), 0, 0, 0);\n assert(hash_result == 0xb393978842a0fa3d3e1470196f098f473f9678e72463cb65ec4ab5581856c2);\n\n // Non-zero case\n let hash_result = compute_l2_to_l1_hash(\n AztecAddress::from_field(1),\n EthAddress::from_field(3),\n 5,\n 2,\n 4,\n );\n assert(hash_result == 0x3f88c1044a05e5340ed20466276500f6d45ca5603913b9091e957161734e16);\n}\n\n#[test]\nfn silo_l2_to_l1_message_matches_typescript() {\n let version = 4;\n let chainId = 5;\n\n let hash = silo_l2_to_l1_message(\n ScopedL2ToL1Message {\n message: L2ToL1Message { recipient: EthAddress::from_field(1), content: 2, counter: 0 },\n contract_address: AztecAddress::from_field(3),\n },\n version,\n chainId,\n );\n\n // The following value was generated by `l2_to_l1_message.test.ts`\n let hash_from_typescript = 0x00c6155d69febb9d5039b374dd4f77bf57b7c881709aa524a18acaa0bd57476a;\n\n assert_eq(hash, hash_from_typescript);\n}\n" + "222": { + "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.66.0/noir-projects/noir-protocol-circuits/crates/types/src/hash.nr", + "source": "use crate::{\n abis::{\n contract_class_function_leaf_preimage::ContractClassFunctionLeafPreimage,\n function_selector::FunctionSelector,\n log_hash::{LogHash, ScopedLogHash},\n note_hash::ScopedNoteHash,\n nullifier::ScopedNullifier,\n private_log::{PrivateLog, PrivateLogData},\n side_effect::scoped::Scoped,\n },\n address::{AztecAddress, EthAddress},\n constants::{\n FUNCTION_TREE_HEIGHT, GENERATOR_INDEX__NOTE_HASH_NONCE, GENERATOR_INDEX__OUTER_NULLIFIER,\n GENERATOR_INDEX__SILOED_NOTE_HASH, GENERATOR_INDEX__UNIQUE_NOTE_HASH,\n },\n merkle_tree::root::root_from_sibling_path,\n messaging::l2_to_l1_message::{L2ToL1Message, ScopedL2ToL1Message},\n traits::{is_empty, ToField},\n utils::field::field_from_bytes_32_trunc,\n};\nuse super::utils::field::field_from_bytes;\n\npub fn sha256_to_field(bytes_to_hash: [u8; N]) -> Field {\n let sha256_hashed = std::hash::sha256(bytes_to_hash);\n let hash_in_a_field = field_from_bytes_32_trunc(sha256_hashed);\n\n hash_in_a_field\n}\n\npub fn private_functions_root_from_siblings(\n selector: FunctionSelector,\n vk_hash: Field,\n function_leaf_index: Field,\n function_leaf_sibling_path: [Field; FUNCTION_TREE_HEIGHT],\n) -> Field {\n let function_leaf_preimage = ContractClassFunctionLeafPreimage { selector, vk_hash };\n let function_leaf = function_leaf_preimage.hash();\n root_from_sibling_path(\n function_leaf,\n function_leaf_index,\n function_leaf_sibling_path,\n )\n}\n\nfn compute_note_hash_nonce(tx_hash: Field, note_index_in_tx: u32) -> Field {\n // Hashing tx hash with note index in tx is guaranteed to be unique\n poseidon2_hash_with_separator(\n [tx_hash, note_index_in_tx as Field],\n GENERATOR_INDEX__NOTE_HASH_NONCE,\n )\n}\n\npub fn compute_unique_note_hash(nonce: Field, note_hash: Field) -> Field {\n let inputs = [nonce, note_hash];\n poseidon2_hash_with_separator(inputs, GENERATOR_INDEX__UNIQUE_NOTE_HASH)\n}\n\npub fn compute_siloed_note_hash(app: AztecAddress, unique_note_hash: Field) -> Field {\n poseidon2_hash_with_separator(\n [app.to_field(), unique_note_hash],\n GENERATOR_INDEX__SILOED_NOTE_HASH,\n )\n}\n\n/// Siloing in the context of Aztec refers to the process of hashing a note hash with a contract address (this way\n/// the note hash is scoped to a specific contract). This is used to prevent intermingling of notes between contracts.\npub fn silo_note_hash(note_hash: ScopedNoteHash, tx_hash: Field, note_index_in_tx: u32) -> Field {\n if note_hash.contract_address.is_zero() {\n 0\n } else {\n let nonce = compute_note_hash_nonce(tx_hash, note_index_in_tx);\n let unique_note_hash = compute_unique_note_hash(nonce, note_hash.value());\n compute_siloed_note_hash(note_hash.contract_address, unique_note_hash)\n }\n}\n\npub fn compute_siloed_nullifier(app: AztecAddress, nullifier: Field) -> Field {\n poseidon2_hash_with_separator(\n [app.to_field(), nullifier],\n GENERATOR_INDEX__OUTER_NULLIFIER,\n )\n}\n\npub fn silo_nullifier(nullifier: ScopedNullifier) -> Field {\n if nullifier.contract_address.is_zero() {\n nullifier.value() // Return value instead of 0 because the first nullifier's contract address is zero.\n } else {\n compute_siloed_nullifier(nullifier.contract_address, nullifier.value())\n }\n}\n\npub fn compute_siloed_private_log_field(contract_address: AztecAddress, field: Field) -> Field {\n poseidon2_hash([contract_address.to_field(), field])\n}\n\npub fn silo_private_log(private_log: Scoped) -> PrivateLog {\n if private_log.contract_address.is_zero() {\n private_log.inner.log\n } else {\n let mut fields = private_log.inner.log.fields;\n fields[0] = compute_siloed_private_log_field(private_log.contract_address, fields[0]);\n PrivateLog { fields }\n }\n}\n\nfn compute_siloed_unencrypted_log_hash(address: AztecAddress, log_hash: Field) -> Field {\n accumulate_sha256([address.to_field(), log_hash])\n}\n\npub fn silo_unencrypted_log_hash(log_hash: ScopedLogHash) -> Field {\n if log_hash.contract_address.is_zero() {\n 0\n } else {\n compute_siloed_unencrypted_log_hash(log_hash.contract_address, log_hash.value())\n }\n}\n\npub fn merkle_hash(left: Field, right: Field) -> Field {\n poseidon2_hash([left, right])\n}\n\npub fn compute_l2_to_l1_hash(\n contract_address: AztecAddress,\n recipient: EthAddress,\n content: Field,\n rollup_version_id: Field,\n chain_id: Field,\n) -> Field {\n let mut bytes: BoundedVec = BoundedVec::new();\n\n let inputs =\n [contract_address.to_field(), rollup_version_id, recipient.to_field(), chain_id, content];\n for i in 0..inputs.len() {\n // TODO are bytes be in fr.to_buffer() ?\n let item_bytes: [u8; 32] = inputs[i].to_be_bytes();\n for j in 0..32 {\n bytes.push(item_bytes[j]);\n }\n }\n\n sha256_to_field(bytes.storage())\n}\n\npub fn silo_l2_to_l1_message(\n msg: ScopedL2ToL1Message,\n rollup_version_id: Field,\n chain_id: Field,\n) -> Field {\n if msg.contract_address.is_zero() {\n 0\n } else {\n compute_l2_to_l1_hash(\n msg.contract_address,\n msg.message.recipient,\n msg.message.content,\n rollup_version_id,\n chain_id,\n )\n }\n}\n\n// Computes sha256 hash of 2 input hashes.\n//\n// NB: This method now takes in two 31 byte fields - it assumes that any input\n// is the result of a sha_to_field hash and => is truncated\n//\n// TODO(Jan and David): This is used for the encrypted_log hashes.\n// Can we check to see if we can just use hash_to_field or pedersen_compress here?\n//\npub fn accumulate_sha256(input: [Field; 2]) -> Field {\n // This is a note about the cpp code, since it takes an array of Fields\n // instead of a U128.\n // 4 Field elements when converted to bytes will usually\n // occupy 4 * 32 = 128 bytes.\n // However, this function is making the assumption that each Field\n // only occupies 128 bits.\n //\n // TODO(David): This does not seem to be getting guaranteed anywhere in the code?\n // Concatentate two fields into 32x2 = 64 bytes\n // accumulate_sha256 assumes that the inputs are pre-truncated 31 byte numbers\n let mut hash_input_flattened = [0; 64];\n for offset in 0..input.len() {\n let input_as_bytes: [u8; 32] = input[offset].to_be_bytes();\n for byte_index in 0..32 {\n hash_input_flattened[offset * 32 + byte_index] = input_as_bytes[byte_index];\n }\n }\n\n sha256_to_field(hash_input_flattened)\n}\n\n// Computes the final logs hash for a tx.\npub fn compute_tx_logs_hash(logs: [LogHash; N]) -> Field {\n // Convert each field element into a byte array and append the bytes to `hash_input_flattened`\n let mut hash_input_flattened = [0; N * 32];\n for offset in 0..N {\n // TODO: This is not checking that the decomposition is smaller than P\n let input_as_bytes: [u8; 32] = logs[offset].value.to_be_radix(256);\n for byte_index in 0..32 {\n hash_input_flattened[offset * 32 + byte_index] = input_as_bytes[byte_index];\n }\n }\n // Ideally we would push to a slice then hash, but there is no sha_slice\n // Hardcode to 256 bytes for now\n let mut hash = sha256_to_field(hash_input_flattened);\n // Not having a 0 value hash for empty logs causes issues with empty txs\n // used for padding. Returning early is currently unsupported.\n // We always provide sorted logs here, so 0 being empty means all are empty.\n if is_empty(logs[0]) {\n hash = 0;\n }\n hash\n}\n\npub fn verification_key_hash(key: [Field; N]) -> Field {\n crate::hash::poseidon2_hash(key)\n}\n\n#[inline_always]\npub fn pedersen_hash(inputs: [Field; N], hash_index: u32) -> Field {\n std::hash::pedersen_hash_with_separator(inputs, hash_index)\n}\n\npub fn poseidon2_hash(inputs: [Field; N]) -> Field {\n std::hash::poseidon2::Poseidon2::hash(inputs, N)\n}\n\n#[no_predicates]\npub fn poseidon2_hash_with_separator(inputs: [Field; N], separator: T) -> Field\nwhere\n T: ToField,\n{\n // We manually hash the inputs here, since we cannot express with the type system a constant size inputs array of N + 1\n let in_len = N + 1;\n let two_pow_64 = 18446744073709551616;\n let iv: Field = (in_len as Field) * two_pow_64;\n let mut sponge = std::hash::poseidon2::Poseidon2::new(iv);\n sponge.absorb(separator.to_field());\n\n for i in 0..inputs.len() {\n sponge.absorb(inputs[i]);\n }\n\n sponge.squeeze()\n}\n\npub fn poseidon2_hash_with_separator_slice(inputs: [Field], separator: T) -> Field\nwhere\n T: ToField,\n{\n let in_len = inputs.len() + 1;\n let two_pow_64 = 18446744073709551616;\n let iv: Field = (in_len as Field) * two_pow_64;\n let mut sponge = std::hash::poseidon2::Poseidon2::new(iv);\n sponge.absorb(separator.to_field());\n\n for i in 0..inputs.len() {\n sponge.absorb(inputs[i]);\n }\n\n sponge.squeeze()\n}\n\n#[no_predicates]\npub fn poseidon2_hash_bytes(inputs: [u8; N]) -> Field {\n // We manually hash the inputs here, since we cannot express with the type system a constant size inputs array of Math.ceil(N/31)\n let mut in_len = N / 31;\n let mut has_padding = false;\n if N % 31 != 0 {\n in_len += 1;\n has_padding = true;\n }\n\n let two_pow_64 = 18446744073709551616;\n let iv: Field = (in_len as Field) * two_pow_64;\n let mut sponge = std::hash::poseidon2::Poseidon2::new(iv);\n\n let mut current_field = [0; 31];\n for i in 0..inputs.len() {\n let index = i % 31;\n current_field[index] = inputs[i];\n if index == 30 {\n sponge.absorb(field_from_bytes(current_field, false));\n current_field = [0; 31];\n }\n }\n if has_padding {\n sponge.absorb(field_from_bytes(current_field, false));\n }\n\n sponge.squeeze()\n}\n\n#[test]\nfn smoke_sha256_to_field() {\n let full_buffer = [\n 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,\n 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,\n 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70,\n 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,\n 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,\n 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130,\n 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148,\n 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,\n ];\n let result = sha256_to_field(full_buffer);\n\n assert(result == 0x448ebbc9e1a31220a2f3830c18eef61b9bd070e5084b7fa2a359fe729184c7);\n\n // to show correctness of the current ver (truncate one byte) vs old ver (mod full bytes):\n let result_bytes = std::hash::sha256(full_buffer);\n let truncated_field = crate::utils::field::field_from_bytes_32_trunc(result_bytes);\n assert(truncated_field == result);\n let mod_res = result + (result_bytes[31] as Field);\n assert(mod_res == 0x448ebbc9e1a31220a2f3830c18eef61b9bd070e5084b7fa2a359fe729184e0);\n}\n\n#[test]\nfn compute_l2_l1_hash() {\n // All zeroes\n let hash_result =\n compute_l2_to_l1_hash(AztecAddress::from_field(0), EthAddress::zero(), 0, 0, 0);\n assert(hash_result == 0xb393978842a0fa3d3e1470196f098f473f9678e72463cb65ec4ab5581856c2);\n\n // Non-zero case\n let hash_result = compute_l2_to_l1_hash(\n AztecAddress::from_field(1),\n EthAddress::from_field(3),\n 5,\n 2,\n 4,\n );\n assert(hash_result == 0x3f88c1044a05e5340ed20466276500f6d45ca5603913b9091e957161734e16);\n}\n\n#[test]\nfn silo_l2_to_l1_message_matches_typescript() {\n let version = 4;\n let chainId = 5;\n\n let hash = silo_l2_to_l1_message(\n ScopedL2ToL1Message {\n message: L2ToL1Message { recipient: EthAddress::from_field(1), content: 2, counter: 0 },\n contract_address: AztecAddress::from_field(3),\n },\n version,\n chainId,\n );\n\n // The following value was generated by `l2_to_l1_message.test.ts`\n let hash_from_typescript = 0x00c6155d69febb9d5039b374dd4f77bf57b7c881709aa524a18acaa0bd57476a;\n\n assert_eq(hash, hash_from_typescript);\n}\n" }, - "262": { - "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.65.0/noir-projects/noir-protocol-circuits/crates/types/src/abis/function_selector.nr", + "255": { + "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.66.0/noir-projects/noir-protocol-circuits/crates/types/src/abis/function_selector.nr", "source": "use crate::traits::{Deserialize, Empty, FromField, Serialize, ToField};\n\npub struct FunctionSelector {\n // 1st 4-bytes of abi-encoding of function.\n pub inner: u32,\n}\n\nimpl Eq for FunctionSelector {\n fn eq(self, function_selector: FunctionSelector) -> bool {\n function_selector.inner == self.inner\n }\n}\n\nimpl Serialize<1> for FunctionSelector {\n fn serialize(self: Self) -> [Field; 1] {\n [self.inner as Field]\n }\n}\n\nimpl Deserialize<1> for FunctionSelector {\n fn deserialize(fields: [Field; 1]) -> Self {\n Self { inner: fields[0] as u32 }\n }\n}\n\nimpl FromField for FunctionSelector {\n fn from_field(field: Field) -> Self {\n Self { inner: field as u32 }\n }\n}\n\nimpl ToField for FunctionSelector {\n fn to_field(self) -> Field {\n self.inner as Field\n }\n}\n\nimpl Empty for FunctionSelector {\n fn empty() -> Self {\n Self { inner: 0 as u32 }\n }\n}\n\nimpl FunctionSelector {\n pub fn from_u32(value: u32) -> Self {\n Self { inner: value }\n }\n\n pub fn from_signature(signature: str) -> Self {\n let bytes = signature.as_bytes();\n let hash = crate::hash::poseidon2_hash_bytes(bytes);\n\n // `hash` is automatically truncated to fit within 32 bits.\n FunctionSelector::from_field(hash)\n }\n\n pub fn zero() -> Self {\n Self { inner: 0 }\n }\n}\n\n#[test]\nfn test_is_valid_selector() {\n let selector = FunctionSelector::from_signature(\"IS_VALID()\");\n assert_eq(selector.to_field(), 0x73cdda47);\n}\n\n#[test]\nfn test_long_selector() {\n let selector =\n FunctionSelector::from_signature(\"foo_and_bar_and_baz_and_foo_bar_baz_and_bar_foo\");\n assert_eq(selector.to_field(), 0x7590a997);\n}\n" }, - "311": { - "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.65.0/noir-projects/noir-protocol-circuits/crates/types/src/storage/map.nr", - "source": "use crate::{hash::poseidon2_hash, traits::ToField};\n\npub fn derive_storage_slot_in_map(storage_slot: Field, key: K) -> Field\nwhere\n K: ToField,\n{\n poseidon2_hash([storage_slot, key.to_field()])\n}\n\nmod test {\n use crate::{address::AztecAddress, storage::map::derive_storage_slot_in_map};\n\n #[test]\n fn test_derive_storage_slot_in_map_matches_typescript() {\n let map_slot = 0x132258fb6962c4387ba659d9556521102d227549a386d39f0b22d1890d59c2b5;\n let key = AztecAddress::from_field(\n 0x302dbc2f9b50a73283d5fb2f35bc01eae8935615817a0b4219a057b2ba8a5a3f,\n );\n\n let slot = derive_storage_slot_in_map(map_slot, key);\n\n // The following value was generated by `map_slot.test.ts`\n let slot_from_typescript =\n 0x15b9fe39449affd8b377461263e9d2b610b9ad40580553500b4e41d9cbd887ac;\n\n assert_eq(slot, slot_from_typescript);\n }\n}\n" - }, - "33": { + "26": { "path": "std/hash/poseidon2.nr", - "source": "use crate::default::Default;\nuse crate::hash::Hasher;\n\ncomptime global RATE: u32 = 3;\n\npub struct Poseidon2 {\n cache: [Field; 3],\n state: [Field; 4],\n cache_size: u32,\n squeeze_mode: bool, // 0 => absorb, 1 => squeeze\n}\n\nimpl Poseidon2 {\n #[no_predicates]\n pub fn hash(input: [Field; N], message_size: u32) -> Field {\n if message_size == N {\n Poseidon2::hash_internal(input, N, false)\n } else {\n Poseidon2::hash_internal(input, message_size, true)\n }\n }\n\n pub(crate) fn new(iv: Field) -> Poseidon2 {\n let mut result =\n Poseidon2 { cache: [0; 3], state: [0; 4], cache_size: 0, squeeze_mode: false };\n result.state[RATE] = iv;\n result\n }\n\n fn perform_duplex(&mut self) {\n // add the cache into sponge state\n for i in 0..RATE {\n // We effectively zero-pad the cache by only adding to the state\n // cache that is less than the specified `cache_size`\n if i < self.cache_size {\n self.state[i] += self.cache[i];\n }\n }\n self.state = crate::hash::poseidon2_permutation(self.state, 4);\n }\n\n fn absorb(&mut self, input: Field) {\n assert(!self.squeeze_mode);\n if self.cache_size == RATE {\n // If we're absorbing, and the cache is full, apply the sponge permutation to compress the cache\n self.perform_duplex();\n self.cache[0] = input;\n self.cache_size = 1;\n } else {\n // If we're absorbing, and the cache is not full, add the input into the cache\n self.cache[self.cache_size] = input;\n self.cache_size += 1;\n }\n }\n\n fn squeeze(&mut self) -> Field {\n assert(!self.squeeze_mode);\n // If we're in absorb mode, apply sponge permutation to compress the cache.\n self.perform_duplex();\n self.squeeze_mode = true;\n\n // Pop one item off the top of the permutation and return it.\n self.state[0]\n }\n\n fn hash_internal(\n input: [Field; N],\n in_len: u32,\n is_variable_length: bool,\n ) -> Field {\n let two_pow_64 = 18446744073709551616;\n let iv: Field = (in_len as Field) * two_pow_64;\n let mut sponge = Poseidon2::new(iv);\n for i in 0..input.len() {\n if i < in_len {\n sponge.absorb(input[i]);\n }\n }\n\n // In the case where the hash preimage is variable-length, we append `1` to the end of the input, to distinguish\n // from fixed-length hashes. (the combination of this additional field element + the hash IV ensures\n // fixed-length and variable-length hashes do not collide)\n if is_variable_length {\n sponge.absorb(1);\n }\n sponge.squeeze()\n }\n}\n\npub struct Poseidon2Hasher {\n _state: [Field],\n}\n\nimpl Hasher for Poseidon2Hasher {\n fn finish(self) -> Field {\n let iv: Field = (self._state.len() as Field) * 18446744073709551616; // iv = (self._state.len() << 64)\n let mut sponge = Poseidon2::new(iv);\n for i in 0..self._state.len() {\n sponge.absorb(self._state[i]);\n }\n sponge.squeeze()\n }\n\n fn write(&mut self, input: Field) {\n self._state = self._state.push_back(input);\n }\n}\n\nimpl Default for Poseidon2Hasher {\n fn default() -> Self {\n Poseidon2Hasher { _state: &[] }\n }\n}\n" + "source": "use crate::default::Default;\nuse crate::hash::Hasher;\n\ncomptime global RATE: u32 = 3;\n\npub struct Poseidon2 {\n cache: [Field; 3],\n state: [Field; 4],\n cache_size: u32,\n squeeze_mode: bool, // 0 => absorb, 1 => squeeze\n}\n\nimpl Poseidon2 {\n #[no_predicates]\n pub fn hash(input: [Field; N], message_size: u32) -> Field {\n Poseidon2::hash_internal(input, message_size, message_size != N)\n }\n\n pub(crate) fn new(iv: Field) -> Poseidon2 {\n let mut result =\n Poseidon2 { cache: [0; 3], state: [0; 4], cache_size: 0, squeeze_mode: false };\n result.state[RATE] = iv;\n result\n }\n\n fn perform_duplex(&mut self) {\n // add the cache into sponge state\n for i in 0..RATE {\n // We effectively zero-pad the cache by only adding to the state\n // cache that is less than the specified `cache_size`\n if i < self.cache_size {\n self.state[i] += self.cache[i];\n }\n }\n self.state = crate::hash::poseidon2_permutation(self.state, 4);\n }\n\n fn absorb(&mut self, input: Field) {\n assert(!self.squeeze_mode);\n if self.cache_size == RATE {\n // If we're absorbing, and the cache is full, apply the sponge permutation to compress the cache\n self.perform_duplex();\n self.cache[0] = input;\n self.cache_size = 1;\n } else {\n // If we're absorbing, and the cache is not full, add the input into the cache\n self.cache[self.cache_size] = input;\n self.cache_size += 1;\n }\n }\n\n fn squeeze(&mut self) -> Field {\n assert(!self.squeeze_mode);\n // If we're in absorb mode, apply sponge permutation to compress the cache.\n self.perform_duplex();\n self.squeeze_mode = true;\n\n // Pop one item off the top of the permutation and return it.\n self.state[0]\n }\n\n fn hash_internal(\n input: [Field; N],\n in_len: u32,\n is_variable_length: bool,\n ) -> Field {\n let two_pow_64 = 18446744073709551616;\n let iv: Field = (in_len as Field) * two_pow_64;\n let mut sponge = Poseidon2::new(iv);\n for i in 0..input.len() {\n if i < in_len {\n sponge.absorb(input[i]);\n }\n }\n\n // In the case where the hash preimage is variable-length, we append `1` to the end of the input, to distinguish\n // from fixed-length hashes. (the combination of this additional field element + the hash IV ensures\n // fixed-length and variable-length hashes do not collide)\n if is_variable_length {\n sponge.absorb(1);\n }\n sponge.squeeze()\n }\n}\n\npub struct Poseidon2Hasher {\n _state: [Field],\n}\n\nimpl Hasher for Poseidon2Hasher {\n fn finish(self) -> Field {\n let iv: Field = (self._state.len() as Field) * 18446744073709551616; // iv = (self._state.len() << 64)\n let mut sponge = Poseidon2::new(iv);\n for i in 0..self._state.len() {\n sponge.absorb(self._state[i]);\n }\n sponge.squeeze()\n }\n\n fn write(&mut self, input: Field) {\n self._state = self._state.push_back(input);\n }\n}\n\nimpl Default for Poseidon2Hasher {\n fn default() -> Self {\n Poseidon2Hasher { _state: &[] }\n }\n}\n" + }, + "308": { + "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.66.0/noir-projects/noir-protocol-circuits/crates/types/src/storage/map.nr", + "source": "use crate::{hash::poseidon2_hash, traits::ToField};\n\npub fn derive_storage_slot_in_map(storage_slot: Field, key: K) -> Field\nwhere\n K: ToField,\n{\n poseidon2_hash([storage_slot, key.to_field()])\n}\n\nmod test {\n use crate::{address::AztecAddress, storage::map::derive_storage_slot_in_map};\n\n #[test]\n fn test_derive_storage_slot_in_map_matches_typescript() {\n let map_slot = 0x132258fb6962c4387ba659d9556521102d227549a386d39f0b22d1890d59c2b5;\n let key = AztecAddress::from_field(\n 0x302dbc2f9b50a73283d5fb2f35bc01eae8935615817a0b4219a057b2ba8a5a3f,\n );\n\n let slot = derive_storage_slot_in_map(map_slot, key);\n\n // The following value was generated by `map_slot.test.ts`\n let slot_from_typescript =\n 0x15b9fe39449affd8b377461263e9d2b610b9ad40580553500b4e41d9cbd887ac;\n\n assert_eq(slot, slot_from_typescript);\n }\n}\n" }, - "57": { + "50": { "path": "std/option.nr", "source": "use crate::cmp::{Eq, Ord, Ordering};\nuse crate::default::Default;\nuse crate::hash::{Hash, Hasher};\n\npub struct Option {\n _is_some: bool,\n _value: T,\n}\n\nimpl Option {\n /// Constructs a None value\n pub fn none() -> Self {\n Self { _is_some: false, _value: crate::mem::zeroed() }\n }\n\n /// Constructs a Some wrapper around the given value\n pub fn some(_value: T) -> Self {\n Self { _is_some: true, _value }\n }\n\n /// True if this Option is None\n pub fn is_none(self) -> bool {\n !self._is_some\n }\n\n /// True if this Option is Some\n pub fn is_some(self) -> bool {\n self._is_some\n }\n\n /// Asserts `self.is_some()` and returns the wrapped value.\n pub fn unwrap(self) -> T {\n assert(self._is_some);\n self._value\n }\n\n /// Returns the inner value without asserting `self.is_some()`\n /// Note that if `self` is `None`, there is no guarantee what value will be returned,\n /// only that it will be of type `T`.\n pub fn unwrap_unchecked(self) -> T {\n self._value\n }\n\n /// Returns the wrapped value if `self.is_some()`. Otherwise, returns the given default value.\n pub fn unwrap_or(self, default: T) -> T {\n if self._is_some {\n self._value\n } else {\n default\n }\n }\n\n /// Returns the wrapped value if `self.is_some()`. Otherwise, calls the given function to return\n /// a default value.\n pub fn unwrap_or_else(self, default: fn[Env]() -> T) -> T {\n if self._is_some {\n self._value\n } else {\n default()\n }\n }\n\n /// Asserts `self.is_some()` with a provided custom message and returns the contained `Some` value\n pub fn expect(self, message: fmtstr) -> T {\n assert(self.is_some(), message);\n self._value\n }\n\n /// If self is `Some(x)`, this returns `Some(f(x))`. Otherwise, this returns `None`.\n pub fn map(self, f: fn[Env](T) -> U) -> Option {\n if self._is_some {\n Option::some(f(self._value))\n } else {\n Option::none()\n }\n }\n\n /// If self is `Some(x)`, this returns `f(x)`. Otherwise, this returns the given default value.\n pub fn map_or(self, default: U, f: fn[Env](T) -> U) -> U {\n if self._is_some {\n f(self._value)\n } else {\n default\n }\n }\n\n /// If self is `Some(x)`, this returns `f(x)`. Otherwise, this returns `default()`.\n pub fn map_or_else(self, default: fn[Env1]() -> U, f: fn[Env2](T) -> U) -> U {\n if self._is_some {\n f(self._value)\n } else {\n default()\n }\n }\n\n /// Returns None if self is None. Otherwise, this returns `other`.\n pub fn and(self, other: Self) -> Self {\n if self.is_none() {\n Option::none()\n } else {\n other\n }\n }\n\n /// If self is None, this returns None. Otherwise, this calls the given function\n /// with the Some value contained within self, and returns the result of that call.\n ///\n /// In some languages this function is called `flat_map` or `bind`.\n pub fn and_then(self, f: fn[Env](T) -> Option) -> Option {\n if self._is_some {\n f(self._value)\n } else {\n Option::none()\n }\n }\n\n /// If self is Some, return self. Otherwise, return `other`.\n pub fn or(self, other: Self) -> Self {\n if self._is_some {\n self\n } else {\n other\n }\n }\n\n /// If self is Some, return self. Otherwise, return `default()`.\n pub fn or_else(self, default: fn[Env]() -> Self) -> Self {\n if self._is_some {\n self\n } else {\n default()\n }\n }\n\n // If only one of the two Options is Some, return that option.\n // Otherwise, if both options are Some or both are None, None is returned.\n pub fn xor(self, other: Self) -> Self {\n if self._is_some {\n if other._is_some {\n Option::none()\n } else {\n self\n }\n } else if other._is_some {\n other\n } else {\n Option::none()\n }\n }\n\n /// Returns `Some(x)` if self is `Some(x)` and `predicate(x)` is true.\n /// Otherwise, this returns `None`\n pub fn filter(self, predicate: fn[Env](T) -> bool) -> Self {\n if self._is_some {\n if predicate(self._value) {\n self\n } else {\n Option::none()\n }\n } else {\n Option::none()\n }\n }\n\n /// Flattens an Option> into a Option.\n /// This returns None if the outer Option is None. Otherwise, this returns the inner Option.\n pub fn flatten(option: Option>) -> Option {\n if option._is_some {\n option._value\n } else {\n Option::none()\n }\n }\n}\n\nimpl Default for Option {\n fn default() -> Self {\n Option::none()\n }\n}\n\nimpl Eq for Option\nwhere\n T: Eq,\n{\n fn eq(self, other: Self) -> bool {\n if self._is_some == other._is_some {\n if self._is_some {\n self._value == other._value\n } else {\n true\n }\n } else {\n false\n }\n }\n}\n\nimpl Hash for Option\nwhere\n T: Hash,\n{\n fn hash(self, state: &mut H)\n where\n H: Hasher,\n {\n self._is_some.hash(state);\n if self._is_some {\n self._value.hash(state);\n }\n }\n}\n\n// For this impl we're declaring Option::none < Option::some\nimpl Ord for Option\nwhere\n T: Ord,\n{\n fn cmp(self, other: Self) -> Ordering {\n if self._is_some {\n if other._is_some {\n self._value.cmp(other._value)\n } else {\n Ordering::greater()\n }\n } else if other._is_some {\n Ordering::less()\n } else {\n Ordering::equal()\n }\n }\n}\n" }, - "58": { + "51": { "path": "std/panic.nr", "source": "pub fn panic(message: fmtstr) -> U {\n assert(false, message);\n crate::mem::zeroed()\n}\n" }, - "69": { + "62": { "path": "/home/filip/c/chicmoz/services/event-cannon/src/contract-projects/SimpleLogging/src/main.nr", - "source": "use dep::aztec::macros::aztec;\n\n#[aztec]\ncontract SimpleLogging {\n use dep::aztec::prelude::{Map, PublicMutable};\n use dep::aztec::{\n //keys::getters::get_public_keys,\n macros::{storage::storage, functions::{public, initializer, private, internal}},\n };\n #[storage]\n struct Storage {\n counters: Map, Context>,\n }\n\n #[public]\n #[initializer]\n fn constructor() {\n }\n\n #[private]\n fn increace_counter_private(counter_id: Field) {\n //let msg_sender_npk_m_hash = get_public_keys(context.msg_sender()).npk_m.hash();\n //let secret = context.request_nsk_app(msg_sender_npk_m_hash); // get secret key of caller of function\n //let nullifier = std::hash::pedersen_hash([context.msg_sender().to_field(), secret]); // derive nullifier from sender and secret\n //context.push_nullifier(nullifier);\n SimpleLogging::at(context.this_address()).add_to_counter_public(counter_id).enqueue(\n &mut context,\n );\n }\n\n #[public]\n #[internal]\n fn add_to_counter_public(counter_id: Field) {\n let new_counter_value = storage.counters.at(counter_id).read() + 1;\n storage.counters.at(counter_id).write(new_counter_value);\n }\n\n #[public]\n fn increase_counter_public(counter_id: Field) {\n context.emit_unencrypted_log(/*message=*/\"Counter increased public\");\n SimpleLogging::at(context.this_address()).add_to_counter_public(counter_id);\n }\n unconstrained fn get_counter_value(counter_id: Field) -> pub Field {\n storage.counters.at(counter_id).read()\n }\n}\n" + "source": "use dep::aztec::macros::aztec;\n\n#[aztec]\ncontract SimpleLogging {\n use dep::aztec::prelude::{Map, PublicMutable};\n use dep::aztec::{\n //keys::getters::get_public_keys,\n macros::{storage::storage, functions::{public, initializer, private, internal}},\n };\n #[storage]\n struct Storage {\n counters: Map, Context>,\n }\n\n #[public]\n #[initializer]\n fn constructor() {\n }\n\n #[private]\n fn increase_counter_private(counter_id: Field) {\n //let msg_sender_npk_m_hash = get_public_keys(context.msg_sender()).npk_m.hash();\n //let secret = context.request_nsk_app(msg_sender_npk_m_hash); // get secret key of caller of function\n //let nullifier = std::hash::pedersen_hash([context.msg_sender().to_field(), secret]); // derive nullifier from sender and secret\n //context.push_nullifier(nullifier);\n SimpleLogging::at(context.this_address()).add_to_counter_public(counter_id).enqueue(\n &mut context,\n );\n }\n\n #[public]\n #[internal]\n fn add_to_counter_public(counter_id: Field) {\n let new_counter_value = storage.counters.at(counter_id).read() + 1;\n storage.counters.at(counter_id).write(new_counter_value);\n }\n\n #[public]\n fn increase_counter_public(counter_id: Field) {\n context.emit_unencrypted_log(/*message=*/\"Counter increased public\");\n SimpleLogging::at(context.this_address()).add_to_counter_public(counter_id);\n }\n unconstrained fn get_counter_value(counter_id: Field) -> pub Field {\n storage.counters.at(counter_id).read()\n }\n}\n" } } } diff --git a/services/event-cannon/src/contract-projects/SimpleLogging/target/simple_logging-SimpleLogging.json.bak b/services/event-cannon/src/contract-projects/SimpleLogging/target/simple_logging-SimpleLogging.json.bak index 716181cb..04232f6f 100644 --- a/services/event-cannon/src/contract-projects/SimpleLogging/target/simple_logging-SimpleLogging.json.bak +++ b/services/event-cannon/src/contract-projects/SimpleLogging/target/simple_logging-SimpleLogging.json.bak @@ -1 +1 @@ -{"noir_version":"0.38.0+c807678263164209f62fa5c9bf19f468cace1f98-x8664","name":"SimpleLogging","functions":[{"name":"increace_counter_private","is_unconstrained":false,"custom_attributes":["private"],"abi":{"parameters":[{"name":"inputs","type":{"kind":"struct","path":"aztec::context::inputs::private_context_inputs::PrivateContextInputs","fields":[{"name":"call_context","type":{"kind":"struct","path":"aztec::protocol_types::abis::call_context::CallContext","fields":[{"name":"msg_sender","type":{"kind":"struct","path":"aztec::protocol_types::address::aztec_address::AztecAddress","fields":[{"name":"inner","type":{"kind":"field"}}]}},{"name":"contract_address","type":{"kind":"struct","path":"aztec::protocol_types::address::aztec_address::AztecAddress","fields":[{"name":"inner","type":{"kind":"field"}}]}},{"name":"function_selector","type":{"kind":"struct","path":"aztec::protocol_types::abis::function_selector::FunctionSelector","fields":[{"name":"inner","type":{"kind":"integer","sign":"unsigned","width":32}}]}},{"name":"is_static_call","type":{"kind":"boolean"}}]}},{"name":"historical_header","type":{"kind":"struct","path":"aztec::protocol_types::header::Header","fields":[{"name":"last_archive","type":{"kind":"struct","path":"aztec::protocol_types::abis::append_only_tree_snapshot::AppendOnlyTreeSnapshot","fields":[{"name":"root","type":{"kind":"field"}},{"name":"next_available_leaf_index","type":{"kind":"integer","sign":"unsigned","width":32}}]}},{"name":"content_commitment","type":{"kind":"struct","path":"aztec::protocol_types::content_commitment::ContentCommitment","fields":[{"name":"num_txs","type":{"kind":"field"}},{"name":"txs_effects_hash","type":{"kind":"field"}},{"name":"in_hash","type":{"kind":"field"}},{"name":"out_hash","type":{"kind":"field"}}]}},{"name":"state","type":{"kind":"struct","path":"aztec::protocol_types::state_reference::StateReference","fields":[{"name":"l1_to_l2_message_tree","type":{"kind":"struct","path":"aztec::protocol_types::abis::append_only_tree_snapshot::AppendOnlyTreeSnapshot","fields":[{"name":"root","type":{"kind":"field"}},{"name":"next_available_leaf_index","type":{"kind":"integer","sign":"unsigned","width":32}}]}},{"name":"partial","type":{"kind":"struct","path":"aztec::protocol_types::partial_state_reference::PartialStateReference","fields":[{"name":"note_hash_tree","type":{"kind":"struct","path":"aztec::protocol_types::abis::append_only_tree_snapshot::AppendOnlyTreeSnapshot","fields":[{"name":"root","type":{"kind":"field"}},{"name":"next_available_leaf_index","type":{"kind":"integer","sign":"unsigned","width":32}}]}},{"name":"nullifier_tree","type":{"kind":"struct","path":"aztec::protocol_types::abis::append_only_tree_snapshot::AppendOnlyTreeSnapshot","fields":[{"name":"root","type":{"kind":"field"}},{"name":"next_available_leaf_index","type":{"kind":"integer","sign":"unsigned","width":32}}]}},{"name":"public_data_tree","type":{"kind":"struct","path":"aztec::protocol_types::abis::append_only_tree_snapshot::AppendOnlyTreeSnapshot","fields":[{"name":"root","type":{"kind":"field"}},{"name":"next_available_leaf_index","type":{"kind":"integer","sign":"unsigned","width":32}}]}}]}}]}},{"name":"global_variables","type":{"kind":"struct","path":"aztec::protocol_types::abis::global_variables::GlobalVariables","fields":[{"name":"chain_id","type":{"kind":"field"}},{"name":"version","type":{"kind":"field"}},{"name":"block_number","type":{"kind":"field"}},{"name":"slot_number","type":{"kind":"field"}},{"name":"timestamp","type":{"kind":"integer","sign":"unsigned","width":64}},{"name":"coinbase","type":{"kind":"struct","path":"aztec::protocol_types::address::eth_address::EthAddress","fields":[{"name":"inner","type":{"kind":"field"}}]}},{"name":"fee_recipient","type":{"kind":"struct","path":"aztec::protocol_types::address::aztec_address::AztecAddress","fields":[{"name":"inner","type":{"kind":"field"}}]}},{"name":"gas_fees","type":{"kind":"struct","path":"aztec::protocol_types::abis::gas_fees::GasFees","fields":[{"name":"fee_per_da_gas","type":{"kind":"field"}},{"name":"fee_per_l2_gas","type":{"kind":"field"}}]}}]}},{"name":"total_fees","type":{"kind":"field"}}]}},{"name":"tx_context","type":{"kind":"struct","path":"aztec::protocol_types::transaction::tx_context::TxContext","fields":[{"name":"chain_id","type":{"kind":"field"}},{"name":"version","type":{"kind":"field"}},{"name":"gas_settings","type":{"kind":"struct","path":"aztec::protocol_types::abis::gas_settings::GasSettings","fields":[{"name":"gas_limits","type":{"kind":"struct","path":"aztec::protocol_types::abis::gas::Gas","fields":[{"name":"da_gas","type":{"kind":"integer","sign":"unsigned","width":32}},{"name":"l2_gas","type":{"kind":"integer","sign":"unsigned","width":32}}]}},{"name":"teardown_gas_limits","type":{"kind":"struct","path":"aztec::protocol_types::abis::gas::Gas","fields":[{"name":"da_gas","type":{"kind":"integer","sign":"unsigned","width":32}},{"name":"l2_gas","type":{"kind":"integer","sign":"unsigned","width":32}}]}},{"name":"max_fees_per_gas","type":{"kind":"struct","path":"aztec::protocol_types::abis::gas_fees::GasFees","fields":[{"name":"fee_per_da_gas","type":{"kind":"field"}},{"name":"fee_per_l2_gas","type":{"kind":"field"}}]}}]}}]}},{"name":"start_side_effect_counter","type":{"kind":"integer","sign":"unsigned","width":32}}]},"visibility":"private"},{"name":"counter_id","type":{"kind":"field"},"visibility":"private"}],"return_type":{"abi_type":{"kind":"struct","path":"aztec::protocol_types::abis::private_circuit_public_inputs::PrivateCircuitPublicInputs","fields":[{"name":"call_context","type":{"kind":"struct","path":"aztec::protocol_types::abis::call_context::CallContext","fields":[{"name":"msg_sender","type":{"kind":"struct","path":"aztec::protocol_types::address::aztec_address::AztecAddress","fields":[{"name":"inner","type":{"kind":"field"}}]}},{"name":"contract_address","type":{"kind":"struct","path":"aztec::protocol_types::address::aztec_address::AztecAddress","fields":[{"name":"inner","type":{"kind":"field"}}]}},{"name":"function_selector","type":{"kind":"struct","path":"aztec::protocol_types::abis::function_selector::FunctionSelector","fields":[{"name":"inner","type":{"kind":"integer","sign":"unsigned","width":32}}]}},{"name":"is_static_call","type":{"kind":"boolean"}}]}},{"name":"args_hash","type":{"kind":"field"}},{"name":"returns_hash","type":{"kind":"field"}},{"name":"min_revertible_side_effect_counter","type":{"kind":"integer","sign":"unsigned","width":32}},{"name":"is_fee_payer","type":{"kind":"boolean"}},{"name":"max_block_number","type":{"kind":"struct","path":"aztec::protocol_types::abis::max_block_number::MaxBlockNumber","fields":[{"name":"_opt","type":{"kind":"struct","path":"std::option::Option","fields":[{"name":"_is_some","type":{"kind":"boolean"}},{"name":"_value","type":{"kind":"integer","sign":"unsigned","width":32}}]}}]}},{"name":"note_hash_read_requests","type":{"kind":"array","length":16,"type":{"kind":"struct","path":"aztec::protocol_types::abis::read_request::ReadRequest","fields":[{"name":"value","type":{"kind":"field"}},{"name":"counter","type":{"kind":"integer","sign":"unsigned","width":32}}]}}},{"name":"nullifier_read_requests","type":{"kind":"array","length":16,"type":{"kind":"struct","path":"aztec::protocol_types::abis::read_request::ReadRequest","fields":[{"name":"value","type":{"kind":"field"}},{"name":"counter","type":{"kind":"integer","sign":"unsigned","width":32}}]}}},{"name":"key_validation_requests_and_generators","type":{"kind":"array","length":16,"type":{"kind":"struct","path":"aztec::protocol_types::abis::validation_requests::key_validation_request_and_generator::KeyValidationRequestAndGenerator","fields":[{"name":"request","type":{"kind":"struct","path":"aztec::protocol_types::abis::validation_requests::key_validation_request::KeyValidationRequest","fields":[{"name":"pk_m","type":{"kind":"struct","path":"std::embedded_curve_ops::EmbeddedCurvePoint","fields":[{"name":"x","type":{"kind":"field"}},{"name":"y","type":{"kind":"field"}},{"name":"is_infinite","type":{"kind":"boolean"}}]}},{"name":"sk_app","type":{"kind":"field"}}]}},{"name":"sk_app_generator","type":{"kind":"field"}}]}}},{"name":"note_hashes","type":{"kind":"array","length":16,"type":{"kind":"struct","path":"aztec::protocol_types::abis::note_hash::NoteHash","fields":[{"name":"value","type":{"kind":"field"}},{"name":"counter","type":{"kind":"integer","sign":"unsigned","width":32}}]}}},{"name":"nullifiers","type":{"kind":"array","length":16,"type":{"kind":"struct","path":"aztec::protocol_types::abis::nullifier::Nullifier","fields":[{"name":"value","type":{"kind":"field"}},{"name":"counter","type":{"kind":"integer","sign":"unsigned","width":32}},{"name":"note_hash","type":{"kind":"field"}}]}}},{"name":"private_call_requests","type":{"kind":"array","length":4,"type":{"kind":"struct","path":"aztec::protocol_types::abis::private_call_request::PrivateCallRequest","fields":[{"name":"call_context","type":{"kind":"struct","path":"aztec::protocol_types::abis::call_context::CallContext","fields":[{"name":"msg_sender","type":{"kind":"struct","path":"aztec::protocol_types::address::aztec_address::AztecAddress","fields":[{"name":"inner","type":{"kind":"field"}}]}},{"name":"contract_address","type":{"kind":"struct","path":"aztec::protocol_types::address::aztec_address::AztecAddress","fields":[{"name":"inner","type":{"kind":"field"}}]}},{"name":"function_selector","type":{"kind":"struct","path":"aztec::protocol_types::abis::function_selector::FunctionSelector","fields":[{"name":"inner","type":{"kind":"integer","sign":"unsigned","width":32}}]}},{"name":"is_static_call","type":{"kind":"boolean"}}]}},{"name":"args_hash","type":{"kind":"field"}},{"name":"returns_hash","type":{"kind":"field"}},{"name":"start_side_effect_counter","type":{"kind":"integer","sign":"unsigned","width":32}},{"name":"end_side_effect_counter","type":{"kind":"integer","sign":"unsigned","width":32}}]}}},{"name":"public_call_requests","type":{"kind":"array","length":16,"type":{"kind":"struct","path":"aztec::protocol_types::abis::side_effect::Counted","fields":[{"name":"inner","type":{"kind":"struct","path":"aztec::protocol_types::abis::public_call_request::PublicCallRequest","fields":[{"name":"msg_sender","type":{"kind":"struct","path":"aztec::protocol_types::address::aztec_address::AztecAddress","fields":[{"name":"inner","type":{"kind":"field"}}]}},{"name":"contract_address","type":{"kind":"struct","path":"aztec::protocol_types::address::aztec_address::AztecAddress","fields":[{"name":"inner","type":{"kind":"field"}}]}},{"name":"function_selector","type":{"kind":"struct","path":"aztec::protocol_types::abis::function_selector::FunctionSelector","fields":[{"name":"inner","type":{"kind":"integer","sign":"unsigned","width":32}}]}},{"name":"is_static_call","type":{"kind":"boolean"}},{"name":"args_hash","type":{"kind":"field"}}]}},{"name":"counter","type":{"kind":"integer","sign":"unsigned","width":32}}]}}},{"name":"public_teardown_call_request","type":{"kind":"struct","path":"aztec::protocol_types::abis::public_call_request::PublicCallRequest","fields":[{"name":"msg_sender","type":{"kind":"struct","path":"aztec::protocol_types::address::aztec_address::AztecAddress","fields":[{"name":"inner","type":{"kind":"field"}}]}},{"name":"contract_address","type":{"kind":"struct","path":"aztec::protocol_types::address::aztec_address::AztecAddress","fields":[{"name":"inner","type":{"kind":"field"}}]}},{"name":"function_selector","type":{"kind":"struct","path":"aztec::protocol_types::abis::function_selector::FunctionSelector","fields":[{"name":"inner","type":{"kind":"integer","sign":"unsigned","width":32}}]}},{"name":"is_static_call","type":{"kind":"boolean"}},{"name":"args_hash","type":{"kind":"field"}}]}},{"name":"l2_to_l1_msgs","type":{"kind":"array","length":2,"type":{"kind":"struct","path":"aztec::protocol_types::messaging::l2_to_l1_message::L2ToL1Message","fields":[{"name":"recipient","type":{"kind":"struct","path":"aztec::protocol_types::address::eth_address::EthAddress","fields":[{"name":"inner","type":{"kind":"field"}}]}},{"name":"content","type":{"kind":"field"}},{"name":"counter","type":{"kind":"integer","sign":"unsigned","width":32}}]}}},{"name":"start_side_effect_counter","type":{"kind":"integer","sign":"unsigned","width":32}},{"name":"end_side_effect_counter","type":{"kind":"integer","sign":"unsigned","width":32}},{"name":"note_encrypted_logs_hashes","type":{"kind":"array","length":16,"type":{"kind":"struct","path":"aztec::protocol_types::abis::log_hash::NoteLogHash","fields":[{"name":"value","type":{"kind":"field"}},{"name":"counter","type":{"kind":"integer","sign":"unsigned","width":32}},{"name":"length","type":{"kind":"field"}},{"name":"note_hash_counter","type":{"kind":"integer","sign":"unsigned","width":32}}]}}},{"name":"encrypted_logs_hashes","type":{"kind":"array","length":4,"type":{"kind":"struct","path":"aztec::protocol_types::abis::log_hash::EncryptedLogHash","fields":[{"name":"value","type":{"kind":"field"}},{"name":"counter","type":{"kind":"integer","sign":"unsigned","width":32}},{"name":"length","type":{"kind":"field"}},{"name":"randomness","type":{"kind":"field"}}]}}},{"name":"contract_class_logs_hashes","type":{"kind":"array","length":1,"type":{"kind":"struct","path":"aztec::protocol_types::abis::log_hash::LogHash","fields":[{"name":"value","type":{"kind":"field"}},{"name":"counter","type":{"kind":"integer","sign":"unsigned","width":32}},{"name":"length","type":{"kind":"field"}}]}}},{"name":"historical_header","type":{"kind":"struct","path":"aztec::protocol_types::header::Header","fields":[{"name":"last_archive","type":{"kind":"struct","path":"aztec::protocol_types::abis::append_only_tree_snapshot::AppendOnlyTreeSnapshot","fields":[{"name":"root","type":{"kind":"field"}},{"name":"next_available_leaf_index","type":{"kind":"integer","sign":"unsigned","width":32}}]}},{"name":"content_commitment","type":{"kind":"struct","path":"aztec::protocol_types::content_commitment::ContentCommitment","fields":[{"name":"num_txs","type":{"kind":"field"}},{"name":"txs_effects_hash","type":{"kind":"field"}},{"name":"in_hash","type":{"kind":"field"}},{"name":"out_hash","type":{"kind":"field"}}]}},{"name":"state","type":{"kind":"struct","path":"aztec::protocol_types::state_reference::StateReference","fields":[{"name":"l1_to_l2_message_tree","type":{"kind":"struct","path":"aztec::protocol_types::abis::append_only_tree_snapshot::AppendOnlyTreeSnapshot","fields":[{"name":"root","type":{"kind":"field"}},{"name":"next_available_leaf_index","type":{"kind":"integer","sign":"unsigned","width":32}}]}},{"name":"partial","type":{"kind":"struct","path":"aztec::protocol_types::partial_state_reference::PartialStateReference","fields":[{"name":"note_hash_tree","type":{"kind":"struct","path":"aztec::protocol_types::abis::append_only_tree_snapshot::AppendOnlyTreeSnapshot","fields":[{"name":"root","type":{"kind":"field"}},{"name":"next_available_leaf_index","type":{"kind":"integer","sign":"unsigned","width":32}}]}},{"name":"nullifier_tree","type":{"kind":"struct","path":"aztec::protocol_types::abis::append_only_tree_snapshot::AppendOnlyTreeSnapshot","fields":[{"name":"root","type":{"kind":"field"}},{"name":"next_available_leaf_index","type":{"kind":"integer","sign":"unsigned","width":32}}]}},{"name":"public_data_tree","type":{"kind":"struct","path":"aztec::protocol_types::abis::append_only_tree_snapshot::AppendOnlyTreeSnapshot","fields":[{"name":"root","type":{"kind":"field"}},{"name":"next_available_leaf_index","type":{"kind":"integer","sign":"unsigned","width":32}}]}}]}}]}},{"name":"global_variables","type":{"kind":"struct","path":"aztec::protocol_types::abis::global_variables::GlobalVariables","fields":[{"name":"chain_id","type":{"kind":"field"}},{"name":"version","type":{"kind":"field"}},{"name":"block_number","type":{"kind":"field"}},{"name":"slot_number","type":{"kind":"field"}},{"name":"timestamp","type":{"kind":"integer","sign":"unsigned","width":64}},{"name":"coinbase","type":{"kind":"struct","path":"aztec::protocol_types::address::eth_address::EthAddress","fields":[{"name":"inner","type":{"kind":"field"}}]}},{"name":"fee_recipient","type":{"kind":"struct","path":"aztec::protocol_types::address::aztec_address::AztecAddress","fields":[{"name":"inner","type":{"kind":"field"}}]}},{"name":"gas_fees","type":{"kind":"struct","path":"aztec::protocol_types::abis::gas_fees::GasFees","fields":[{"name":"fee_per_da_gas","type":{"kind":"field"}},{"name":"fee_per_l2_gas","type":{"kind":"field"}}]}}]}},{"name":"total_fees","type":{"kind":"field"}}]}},{"name":"tx_context","type":{"kind":"struct","path":"aztec::protocol_types::transaction::tx_context::TxContext","fields":[{"name":"chain_id","type":{"kind":"field"}},{"name":"version","type":{"kind":"field"}},{"name":"gas_settings","type":{"kind":"struct","path":"aztec::protocol_types::abis::gas_settings::GasSettings","fields":[{"name":"gas_limits","type":{"kind":"struct","path":"aztec::protocol_types::abis::gas::Gas","fields":[{"name":"da_gas","type":{"kind":"integer","sign":"unsigned","width":32}},{"name":"l2_gas","type":{"kind":"integer","sign":"unsigned","width":32}}]}},{"name":"teardown_gas_limits","type":{"kind":"struct","path":"aztec::protocol_types::abis::gas::Gas","fields":[{"name":"da_gas","type":{"kind":"integer","sign":"unsigned","width":32}},{"name":"l2_gas","type":{"kind":"integer","sign":"unsigned","width":32}}]}},{"name":"max_fees_per_gas","type":{"kind":"struct","path":"aztec::protocol_types::abis::gas_fees::GasFees","fields":[{"name":"fee_per_da_gas","type":{"kind":"field"}},{"name":"fee_per_l2_gas","type":{"kind":"field"}}]}}]}}]}}]},"visibility":"databus"},"error_types":{"5019202896831570965":{"error_kind":"string","string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XFS6Yt7iRf2LFyzwHuzdO5S75HiW874v3YHd/Trb8zonzXo3937vtM3tfG5/wg/I9snX//YPyH8Av+688PxzAQA=","debug_symbols":"7ZbbisIwEIbfJde9yMzkMPFVFpGqVQqlStWFRXz3TUrTgxuQreyC4E3pJH86X/4Zhl7Ftlhf9quy3h1OYvFxFdVhk5/LQ+2jqwBq107HvA7h6Zw3Z7EA42QminrrX62Ut0zsyqoQC+Nu2Q8xMnEnRjaDGMgk1KTBdWrSDh+oHTJ0aodO92rEFAkwm4jt5KAmSokBIwiA5bF4mQlQb1+Svui3L0lfzNuXpC/2aV8UoO7ECgwMN0XTZuA/z+CezgAkVRQTuSGDtalqsYo8jg1OeBJ9g6xtbBz0pbvnR/ni/JDid4iRSI56NIlvqc9gicdAKXzN0RgDw4dByxYGn4dxUWwV2Qcw4Az2dXJmop/nJr36BdT/XgAlEkUgqUBNgXy0bsqqKveryZ+VDA+V7BYACf3IRL5vMUVzDqk5h/ScQ+bXh3wEQZueRHqohh6NFj+IlzcffuZNma+rIrgadi/1Jprsw/PXMe7EMhybw6bYXpoiFGSoRXCVZKZkGOkBRHGmqWdrl5AyZJ/VZ/4G","brillig_names":["pack_arguments_oracle_wrapper","enqueue_public_function_call_internal"]},{"name":"add_to_counter_public","is_unconstrained":true,"custom_attributes":["public","internal"],"abi":{"parameters":[{"name":"counter_id","type":{"kind":"field"},"visibility":"private"}],"return_type":null,"error_types":{"206160798890201757":{"error_kind":"string","string":"Storage slot 0 not allowed. Storage slots must start from 1."},"5019202896831570965":{"error_kind":"string","string":"attempt to add with overflow"},"10176877060487216746":{"error_kind":"string","string":"Function add_to_counter_public can only be called internally"},"13699457482007836410":{"error_kind":"string","string":"Not initialized"},"16761564377371454734":{"error_kind":"string","string":"Array index out of bounds"},"17843811134343075018":{"error_kind":"string","string":"Stack too deep"}}},"bytecode":"H4sIAAAAAAAA/+1cS29kxRWu636/3D325LFJpAgpUhZR7u1ujz2KEnWUoGSVSGHBBiF63LeRJWDAM7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IEFABgFNS251vE/WqgTkEJBHQAEAzZw2lwERAmIEpBGQICCDgJCMYCQjGMkIRjJCIxmhkYzQSEbMTABZH+uTU5yABAEZBGQRkENAHgEFADQzAZQBTd9ciV/NIZGkh52Zy8mABAEZBGQRkENAHgEFADTzBaQMiBAQkhEGyYiZySYxLoJc0rHMTDZlQBYBOQTkEVAAQDOTTRkQISBGQBoBIRlhkYywSEZYJCNmJpuWPezMZNMyaGayKQO6eNjwo3v3793L/u7+8PjaYY5//Pb08LZ/fnp/+/bf1+Ev9y/7w2H/5fbry/PD46dvL4+3h+eH49926v3HRw7uRpPryPSnqVM3niLxx7dHajqYGx1cd9Xuyv8D","brillig_names":["add_to_counter_public"]},{"name":"public_dispatch","is_unconstrained":true,"custom_attributes":["public"],"abi":{"parameters":[{"name":"selector","type":{"kind":"field"},"visibility":"private"}],"return_type":null,"error_types":{"206160798890201757":{"error_kind":"string","string":"Storage slot 0 not allowed. Storage slots must start from 1."},"2233873454491509486":{"error_kind":"string","string":"Initializer address is not the contract deployer"},"5019202896831570965":{"error_kind":"string","string":"attempt to add with overflow"},"10176877060487216746":{"error_kind":"string","string":"Function add_to_counter_public can only be called internally"},"13699457482007836410":{"error_kind":"string","string":"Not initialized"},"16761564377371454734":{"error_kind":"string","string":"Array index out of bounds"},"16957488177269924912":{"error_kind":"fmtstring","length":16,"item_types":[]},"17618083556256589634":{"error_kind":"string","string":"Initialization hash does not match"},"17843811134343075018":{"error_kind":"string","string":"Stack too deep"}}},"bytecode":"H4sIAAAAAAAA/91dTYhkVxW+r+tnuqq7p2omPZOZiQGRIIoQXlVX/wliyxhNIFFIUJdS01UdGyc9Q08nJG5s3fmzkGwMuDEIuhBcKMSFRLIRBTeCG0UQBdGFGAwIgiCYF96p+uqr7716r+re7okXilf17rnn75577r3n/lTkxilKn1X67QTMXvqMF0sdj7jiCSbzhMgSqpcWaqS/lyC/4lHoBtH1iX8n7vUaQj6P/G80Upwh9WM4A+CPL6R4bp6O8bMsSVpLf6MN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p32fMgsIDQAooWEFlAyQLKFhBbQGIBWXrEqZ0PD+t6ccAFCCwgtICiBUQWULKAsgXEFtD6ySWsIKLXI2w5sZyQAgILCC2gaAGRBZQsoGwBsQUkFpClR0RLjzixOgElriBeDCwnXvVXQNECIgsoWUDZAmILSCygYgCdeKVUAVl6BFl6BFl6BFl6BKXtNWyhbAGxBWS4bCgndnIRmkEi6Wil0qf9ucqJt964TvIELstDkQWULKBsAbEFtP6bi8z3EKCEtAAVA+jECyEKCCwgtICiBUQWULKAsgXEFpClR2RLj2BLj2BLj2BLj2BLj2BLj1ifbTzdvau30EJcgrIFxBaQWEDFAFq/g6aBwAJCCyhaQLQd9LAM9mpao7r8dopLzImHO6lWvsfLRVdUsaBOLc6soMCEWo9eqO9xAbAsUdGEIhMqmVDZhGITSkyoYkGduCbXUGBCmfoGmvoGmvoGmvoGmvoGmvrG+mX2+bHm1LKFQDWS4woqmlBkQiUTKptQbEKZxutoGq/JNF6Tabw+teSPgoomFJlQyYQ60Tdyja4guESxCSUmVLGgTi11o6DAhEITSu8bayhT30imvnFqORIFxSaUadxIpnEjm8aNbBo3smncyKZxI5v6Rjb1jWzqG9nUN7Kpb7DpLLPpLLPpLPPms/xr+vbfd1/v3r2///htwjz88cenD9/vPn96/vr9f1/mv7z/end/f/fv2y9fP3/4+PePrx/f3n/+8PC3m/D8z1+C4Xa6qzipeZAiId8K5Edt01fKfEuMD18ffhQBnv5aJg2Tjv8D","brillig_names":["public_dispatch"]},{"name":"get_counter_value","is_unconstrained":true,"custom_attributes":[],"abi":{"parameters":[{"name":"counter_id","type":{"kind":"field"},"visibility":"private"}],"return_type":{"abi_type":{"kind":"field"},"visibility":"public"},"error_types":{"206160798890201757":{"error_kind":"string","string":"Storage slot 0 not allowed. Storage slots must start from 1."},"5019202896831570965":{"error_kind":"string","string":"attempt to add with overflow"},"16761564377371454734":{"error_kind":"string","string":"Array index out of bounds"},"17843811134343075018":{"error_kind":"string","string":"Stack too deep"}}},"bytecode":"H4sI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r5zqeCyGpEpBE5jYg1IsVB2VHQiKJGlDSirBCtfJ63ILIaEWlEKysi5EOuICFijchrREEjihpR0oiyQsTlFbEg0qwI1qwIdhoRa0SaYwRrjhGsOUaw5hjBmmOE1xwjvGZFeM2K8JoV4TUrwmtWhNeY6zXmeo25QWNu1oSclSJEPJ9Uv3u7WoiCRhQ1oqQR5eeLeKUIFUTLz6fdhs4sykmISCNa2Q2Zv5Nq96OcXtSIkkaUFaKVplEQLSMPbvYpBCNEpBE5jYg1Iq8RBY0oakRJI8oK0UoVKog0K4I0K4I0K4I0K4I0K4I0K4I0K2KlCoX5sgc2GhKirBCtVKGCyGpEpBE5jYg1Iq8RLZu7W/2TiFkcYVdaTUGUFaKVVlMQWY2INCKnEbFG5DWioBFpVgRrVsRKq2EfZ1EUB5aVVlMQWY2INCKnEbFG5DWioBFFjShpRJoVETQrImhWRNCsiLUzNE9m2LUzGE+LvEb07Nrwc/fbP5d328sP11ffdpr9H7/ffLzf3t48/nr/79fpLx/uttfX2y/vv97dfrz69P3u6v317cf93zbm8Z+/XKQLl2k3mYe4T8lcUPL7X/ceueAuXPC7e93d838=","brillig_names":["get_counter_value"]},{"name":"sync_notes","is_unconstrained":true,"custom_attributes":[],"abi":{"parameters":[],"return_type":null,"error_types":{"17843811134343075018":{"error_kind":"string","string":"Stack too deep"}}},"bytecode":"H4sIAAAAAAAA/9VUyw6CMBBseURBOaiJ3kz8gyIYOJJ49x8akKMe8OKNT5eabbqpVRKlJkzSbEs3szNlW0oUKESPvAH9tGnIFdhBDCA6aN/tRgFr9hviQKs7JH/O0iQw+BtQ/5OfWtIvIPktnT+bAM+xVfzYi6w77UaIesKWZ/nPbHpe9fhc/MFnh32k1caghm+uIYci3RuYR4Y8iRlRd9prh/eV5YzJei7w++RVO67va/lrWIeafvmOFV/qrDMe1wmv+YFXVVrypcYv4KBzGnMvbGHe1wvY45yo3mjul/J0vZ0b0gNB8gCVxsvQjgYAAA==","debug_symbols":"nZLBCoMwEET/Zc8eTDRR8ytSJGqUQEgkxkIR/71RbLHFS3JZmGXe7GFnhV60y9hIPZgZWL2CMh130miv1i2B1kql5Nhc15DuA6HDP09c73J23DpgGU5A6B5Ynnp6kEoAo9X2SADhQH8W6M8D/STMj2/zK4LLk6gIIV8G0fSASAxEY6AiBiojoOz28RVFxQeiGf2FNi+f3EreKnEWa1h0d+mZe03ir3KTNZ3oFyv28l1652ftb2HsY330Gw==","brillig_names":["sync_notes"]},{"name":"constructor","is_unconstrained":true,"custom_attributes":["public","initializer"],"abi":{"parameters":[],"return_type":null,"error_types":{"2233873454491509486":{"error_kind":"string","string":"Initializer address is not the contract deployer"},"5019202896831570965":{"error_kind":"string","string":"attempt to add with overflow"},"16761564377371454734":{"error_kind":"string","string":"Array index out of bounds"},"17618083556256589634":{"error_kind":"string","string":"Initialization hash does not match"},"17843811134343075018":{"error_kind":"string","string":"Stack too deep"}}},"bytecode":"H4sIAAAAAAAA/+1azW4jRRDuiT2Of9fOLrsnJCRYJARiNeM4JLkZwt9e2AMHjmgU28IimyyJAe1KSEYIiQtC8BackHgBXgFxgRsnrrwCpFdd8ZfP5fYkns4uEi1ZPZ6qqb+uqq7+icysRa4vmwUt8gEVXNt+cA81938N4KXTX9/9T1ZraY34Fkl/J+lt1hT9CpT/Mf0okPy2Cf1A9k/WHZ296Yw+6iJ8q6e/upn5RCidZcxC6nxjiZ6/uecW8DaAq/UG8PDdGtmsTDj9gnTqkKzIK4QeMcD6AXWIA+pQKV6HrqaD8Gme/jruOfvs/r0H+0eD4euDwfHw5CQivTT5tWZp3maa7wwne0eHk+Nsf3L38GSSHe4P3xw+ODh6ODxeIz4V+r9OtjIEx36ZrGLnKsH7rk9Wa2lMMj/neqvTs+5Z/AZl57jAPBMDjec9NKoeGhWFRkw0XiQb4TxYZK67DnQN8bK+c8c9+3zn7uF4Ms4Oxo+yyfjo8N3s5CP2IvYIrhoMwY3J70Ux0XzF9da6L7lnGYUK0OBRXgcYjvIdD42qh0ak0IiJRur6mqJj6F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nRRNncgwRUiMUqRGK1AhFaoQiNUKRGqFIRiiSEYpkREAyIiAZEZCdG5CdG5CdGy7eub+bV//dPG1vbnf3z42mffPnw93L9vHh9eXL/z+6d26ftrvd9vv1j6fHu/uvP5/ur3ePd+17G/f657NPdCWOvrSP8mhecjMBY9L2Zft1+8hXPkqz1WbLfwA=","brillig_names":["constructor"]},{"name":"increase_counter_public","is_unconstrained":true,"custom_attributes":["public"],"abi":{"parameters":[{"name":"counter_id","type":{"kind":"field"},"visibility":"private"}],"return_type":null,"error_types":{"5019202896831570965":{"error_kind":"string","string":"attempt to add with overflow"},"13699457482007836410":{"error_kind":"string","string":"Not initialized"},"16761564377371454734":{"error_kind":"string","string":"Array index out of bounds"},"17843811134343075018":{"error_kind":"string","string":"Stack too deep"}}},"bytecode":"H4sIAAAAAAAA/9VZS4sjVRSu6lTl2ZnEZB49Lbh05eJWUt1JdiUyO9GVP6BMqqRhXnS3oiCYv+HGpXvBjYLgTsGFuHEnCv6RmRrOSb6cOkl3p+6dx4FwX+d+53kfueV7a/KpDETbU3gSKk01iiximQ0ldxmxzaj/qWxReQDjNYtGt4Rcm/hTE8ctxT6L+o9bhOnSP4zpAN80COeD5Rpf2lJQl9qYQzyn+fzXob6W4HMRT4f+NkNFf5ZV2Pmj8EcN/OFvKT1vM35MB8Jncp0mlmzqe+UcCl6CHW+yDaF9G0aaDSzn8PmvT/X0i0cfP50/WWTvLxbn2cWFL+zS9NfoJpjhDTCPJOZHnz98eJafZecPvjy7uCxh1xVsrh94um1SL+RD0vbHghIqTTWKQmHDO1QWe8HPVN+VfzKf7O5X0ew6+Y3y257T8yTyvfL6qXll/8j1Vnfjn6kv8FGfuuIfjmVDGWOsJrVDwEL+OtiI/Fjn+dj3HpV9BTMQOjS8sj3Yx/4tdHmX6j1Pz0XE1eIWKri79rKuMm/f/bi/Q+fWFhsSaptKdDrXzmWL+LGW+xbxV3fThhP8yYjxm270zxi/5QQ/XvmnLXLLDr4xjN9x45+V/w/dxHfln64b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njjn+FVVquKn1BFQoACrLRCvPs6lAS6iRo1itNzgzCayfkSZg628TXbFKvL+1u53x5O2eLXNdsd1stzedjH0fWWZ6uq3O3K97fXjzNVv5C+x5+Oy309PJ2X1TlbkBOVZ8V+E996peIVtuWuyBZObr/zjMyIHB6RY0fkuBE5fkROGJEj38/RakQOjcgZUQd6RB3o79ZB3g1WyjbBSts2mLzviWYTwiOajfhntOGe6ECmuXYgS5+ia3o7AX3QTXDEn5XeTUDP1D57N/TsyZqGnqzwAL0wuUe0sJUOvZ+UntRn+lohJFeQ1Aqm3y+MbYvOhAGF4BuBIG7gOzOGmuD49lnNWn/QEBSNhqIxUDQMRWOhaBwUjYeiCVA0gkTDUF7MUF7MUF7MUF7MUF7MUF7MUF7MUF7MUF7MUF5Meu6mapc+xrB0ceauHMctjjddnClLR16XJR+LN9KSWGDShU+vAKUW0KkFTGoBTi1gUwu41AI+tUDqTjapO5lTdzKn7mRO3cmcupM5dSdz6k6eYqJoVSsQBn5gxVGz9Squu/VKU8wUp8QJWDgChWMVFk6/XzE32+Wx2N3XOJP+jxC39aHm0nbuqb13LU7gLo7FwnFYOB4LJ2DhCBSOU1g49HM40l00u7n3ML9ewzuDhcNYOBYLx2HhYG1HuYCFI1A4XmHhEBYOlit7LFf2WK7ssVzZY7myB3LlWxz+WVblcrUrHqdKt5f9+uWQ6fnvsfjvvOmxOqyLzaUq6pOnz0OntX9pZXKtTbzNukEoSE4i9U2r+1DlFGw9pHusyrXSkSFy/AM=","brillig_names":["increase_counter_public"]},{"name":"compute_note_hash_and_optionally_a_nullifier","is_unconstrained":true,"custom_attributes":[],"abi":{"parameters":[{"name":"contract_address","type":{"kind":"struct","path":"aztec::protocol_types::address::aztec_address::AztecAddress","fields":[{"name":"inner","type":{"kind":"field"}}]},"visibility":"private"},{"name":"nonce","type":{"kind":"field"},"visibility":"private"},{"name":"storage_slot","type":{"kind":"field"},"visibility":"private"},{"name":"note_type_id","type":{"kind":"field"},"visibility":"private"},{"name":"compute_nullifier","type":{"kind":"boolean"},"visibility":"private"},{"name":"serialized_note","type":{"kind":"array","length":0,"type":{"kind":"field"}},"visibility":"private"}],"return_type":{"abi_type":{"kind":"array","length":4,"type":{"kind":"field"}},"visibility":"public"},"error_types":{"16957488177269924912":{"error_kind":"fmtstring","length":16,"item_types":[]},"17843811134343075018":{"error_kind":"string","string":"Stack too deep"}}},"bytecode":"H4sIAAAAAAAA/9VZ23LaMBAV2AbshIRA0kIfM9O3dsYO5pI3ZnrJd7hJ+IJ+gB/60n51o0FrHy+bDMGrB3aGke2Vzh6dlSzJdMzOBi+/jrsOXdkz+0Z1Nq5M21mmiJX65Nk5EZ7dE+EZnAjPUJFnR+BpS5pvkdnNub7Zzcc9Jza2iQ7Ab94CYkH/uTJ2ZRf8ionJYqGzWvjrNH+MTdOU+c9jh9n3g78g/IEf/JR4fytrfOwLxQ1c+VDWWj5AG2tDd42DmHDJ1wXfd+YLwPeD+XAM/2Q+HPfEiXTrQV8Ux9Xad16ob33oW+eV0phaO3xGWifG6xjNKOcx48P5E58h1SlrPj3mC8EXM18EPtLflrdQj+e+D/W+wnM+JgOzP4bJTzlHrX2MqdAD/ovlku48J2HZjI0+1D0EPW+ZPj7WCtTHh/5Wn8kr/OnaWr80lQVMT9SINBtgfeaLwReWzTiJuw8hDmIRj4jV/+LuL13ZgzbUfiTE77H4Dd7CM9SIYwXCM6pv5+Rnd31mduPnD9U3++8pvU318l56Z+vhr6q9QOyH/zPhJ17w8wr/DPA11zTCP/ejz5Lwh37wq73YhRf8u0qfS8A3evpntC7S/McYFPvKS+6z7JA9C8ZPGFdfe5Yrxofrg+uj9Y0FriPBx+foWIgzFuJQHias/Ual38utxHVyJFcJ60IRK1bEOraPlI9r1n7j7tNWtsolrteK/R4qYg0UsY4dJ5SPG9Z+4+7TVrYU83Gj2G/NfJwrYvUVsTTnraZelEdprbO2cWXa0jhXPM9hTFrnI1b/N+P5Adoorsl3tKZ9NLXx/cDUU+xD9wMUfyjwId6J4GvzUfb512KR3RerLEu3y3xe5XPKuPJneCayv5lQX9pbkNafjBetU+ncPwNdrYXgmzJfBD7iKJ37Z574H6I/xh8JPjzTvCeXY9Mcazgf+XnVGL13CI136du8dM7U/OZ86Nyk+Anjqsznze+LqA/fqycC15Hg42tfIsRJhDiniMW/0aOGdo6QTmFZ+7VyuVrXf3DRuygyze/+hsWPWP2/7h77RmWbd/52VWTbebEtFsXTU/5YjBm+tS7o9B+RfvSPFR8AAA==","debug_symbols":"tdnNioMwFEDhd8nahanJvTe+yjAMtk2LIFqsHRiK7z6xzE+ZWZ+NEIknIn6re3fHvL+d3/rxNF1d+3J3w3Toln4ay+q+Vm4/98PQn9+eb7t6uwR57L9eunFbXpduXlzb7CqXx6NrQ12ePvVDdq2ktfq3Ub83qv5sjLa+Vi4oFTYqnKBwrKmwp8I7KtxQ4UCFIxWm5EVKXqTkRUqeUPKEkieUPKHkCSVPKHlCyRNKnlDyhJKnlDyl5CklTyl5SslTSp5S8pSSp5Q8peQZJc8oeUbJM0qeUfKMkmeUPKPkGSXPKHmJkpcoeYmSlyh5iZKXKHmJkpcoeYmSlyh5vq6xssfKO6zcYOWAlSNWFqysWNmwMmbQYwY9ZtBjBj1m0GMGPWNwLav3bu67/ZC/BhKn23h4mk8sH5f8Z1RxmadDPt7mvA0tfucV21dtQhXC418uC19ezzdaDikHfQI=","brillig_names":["compute_note_hash_and_optionally_a_nullifier"]}],"outputs":{"structs":{"functions":[{"kind":"struct","path":"SimpleLogging::constructor_abi","fields":[{"name":"parameters","type":{"kind":"struct","path":"SimpleLogging::constructor_parameters","fields":[]}}]},{"kind":"struct","path":"SimpleLogging::increace_counter_private_abi","fields":[{"name":"parameters","type":{"kind":"struct","path":"SimpleLogging::increace_counter_private_parameters","fields":[{"name":"counter_id","type":{"kind":"field"}}]}}]},{"kind":"struct","path":"SimpleLogging::add_to_counter_public_abi","fields":[{"name":"parameters","type":{"kind":"struct","path":"SimpleLogging::add_to_counter_public_parameters","fields":[{"name":"counter_id","type":{"kind":"field"}}]}}]},{"kind":"struct","path":"SimpleLogging::increase_counter_public_abi","fields":[{"name":"parameters","type":{"kind":"struct","path":"SimpleLogging::increase_counter_public_parameters","fields":[{"name":"counter_id","type":{"kind":"field"}}]}}]}]},"globals":{"storage":[{"kind":"struct","fields":[{"name":"contract_name","value":{"kind":"string","value":"SimpleLogging"}},{"name":"fields","value":{"kind":"struct","fields":[{"name":"counters","value":{"kind":"struct","fields":[{"name":"slot","value":{"kind":"integer","sign":false,"value":"0000000000000000000000000000000000000000000000000000000000000001"}}]}}]}}]}]}},"file_map":{"33":{"source":"use crate::default::Default;\nuse crate::hash::Hasher;\n\ncomptime global RATE: u32 = 3;\n\npub struct Poseidon2 {\n cache: [Field; 3],\n state: [Field; 4],\n cache_size: u32,\n squeeze_mode: bool, // 0 => absorb, 1 => squeeze\n}\n\nimpl Poseidon2 {\n #[no_predicates]\n pub fn hash(input: [Field; N], message_size: u32) -> Field {\n if message_size == N {\n Poseidon2::hash_internal(input, N, false)\n } else {\n Poseidon2::hash_internal(input, message_size, true)\n }\n }\n\n pub(crate) fn new(iv: Field) -> Poseidon2 {\n let mut result =\n Poseidon2 { cache: [0; 3], state: [0; 4], cache_size: 0, squeeze_mode: false };\n result.state[RATE] = iv;\n result\n }\n\n fn perform_duplex(&mut self) {\n // add the cache into sponge state\n for i in 0..RATE {\n // We effectively zero-pad the cache by only adding to the state\n // cache that is less than the specified `cache_size`\n if i < self.cache_size {\n self.state[i] += self.cache[i];\n }\n }\n self.state = crate::hash::poseidon2_permutation(self.state, 4);\n }\n\n fn absorb(&mut self, input: Field) {\n assert(!self.squeeze_mode);\n if self.cache_size == RATE {\n // If we're absorbing, and the cache is full, apply the sponge permutation to compress the cache\n self.perform_duplex();\n self.cache[0] = input;\n self.cache_size = 1;\n } else {\n // If we're absorbing, and the cache is not full, add the input into the cache\n self.cache[self.cache_size] = input;\n self.cache_size += 1;\n }\n }\n\n fn squeeze(&mut self) -> Field {\n assert(!self.squeeze_mode);\n // If we're in absorb mode, apply sponge permutation to compress the cache.\n self.perform_duplex();\n self.squeeze_mode = true;\n\n // Pop one item off the top of the permutation and return it.\n self.state[0]\n }\n\n fn hash_internal(\n input: [Field; N],\n in_len: u32,\n is_variable_length: bool,\n ) -> Field {\n let two_pow_64 = 18446744073709551616;\n let iv: Field = (in_len as Field) * two_pow_64;\n let mut sponge = Poseidon2::new(iv);\n for i in 0..input.len() {\n if i < in_len {\n sponge.absorb(input[i]);\n }\n }\n\n // In the case where the hash preimage is variable-length, we append `1` to the end of the input, to distinguish\n // from fixed-length hashes. (the combination of this additional field element + the hash IV ensures\n // fixed-length and variable-length hashes do not collide)\n if is_variable_length {\n sponge.absorb(1);\n }\n sponge.squeeze()\n }\n}\n\npub struct Poseidon2Hasher {\n _state: [Field],\n}\n\nimpl Hasher for Poseidon2Hasher {\n fn finish(self) -> Field {\n let iv: Field = (self._state.len() as Field) * 18446744073709551616; // iv = (self._state.len() << 64)\n let mut sponge = Poseidon2::new(iv);\n for i in 0..self._state.len() {\n sponge.absorb(self._state[i]);\n }\n sponge.squeeze()\n }\n\n fn write(&mut self, input: Field) {\n self._state = self._state.push_back(input);\n }\n}\n\nimpl Default for Poseidon2Hasher {\n fn default() -> Self {\n Poseidon2Hasher { _state: &[] }\n }\n}\n","path":"std/hash/poseidon2.nr"},"57":{"source":"use crate::cmp::{Eq, Ord, Ordering};\nuse crate::default::Default;\nuse crate::hash::{Hash, Hasher};\n\npub struct Option {\n _is_some: bool,\n _value: T,\n}\n\nimpl Option {\n /// Constructs a None value\n pub fn none() -> Self {\n Self { _is_some: false, _value: crate::mem::zeroed() }\n }\n\n /// Constructs a Some wrapper around the given value\n pub fn some(_value: T) -> Self {\n Self { _is_some: true, _value }\n }\n\n /// True if this Option is None\n pub fn is_none(self) -> bool {\n !self._is_some\n }\n\n /// True if this Option is Some\n pub fn is_some(self) -> bool {\n self._is_some\n }\n\n /// Asserts `self.is_some()` and returns the wrapped value.\n pub fn unwrap(self) -> T {\n assert(self._is_some);\n self._value\n }\n\n /// Returns the inner value without asserting `self.is_some()`\n /// Note that if `self` is `None`, there is no guarantee what value will be returned,\n /// only that it will be of type `T`.\n pub fn unwrap_unchecked(self) -> T {\n self._value\n }\n\n /// Returns the wrapped value if `self.is_some()`. Otherwise, returns the given default value.\n pub fn unwrap_or(self, default: T) -> T {\n if self._is_some {\n self._value\n } else {\n default\n }\n }\n\n /// Returns the wrapped value if `self.is_some()`. Otherwise, calls the given function to return\n /// a default value.\n pub fn unwrap_or_else(self, default: fn[Env]() -> T) -> T {\n if self._is_some {\n self._value\n } else {\n default()\n }\n }\n\n /// Asserts `self.is_some()` with a provided custom message and returns the contained `Some` value\n pub fn expect(self, message: fmtstr) -> T {\n assert(self.is_some(), message);\n self._value\n }\n\n /// If self is `Some(x)`, this returns `Some(f(x))`. Otherwise, this returns `None`.\n pub fn map(self, f: fn[Env](T) -> U) -> Option {\n if self._is_some {\n Option::some(f(self._value))\n } else {\n Option::none()\n }\n }\n\n /// If self is `Some(x)`, this returns `f(x)`. Otherwise, this returns the given default value.\n pub fn map_or(self, default: U, f: fn[Env](T) -> U) -> U {\n if self._is_some {\n f(self._value)\n } else {\n default\n }\n }\n\n /// If self is `Some(x)`, this returns `f(x)`. Otherwise, this returns `default()`.\n pub fn map_or_else(self, default: fn[Env1]() -> U, f: fn[Env2](T) -> U) -> U {\n if self._is_some {\n f(self._value)\n } else {\n default()\n }\n }\n\n /// Returns None if self is None. Otherwise, this returns `other`.\n pub fn and(self, other: Self) -> Self {\n if self.is_none() {\n Option::none()\n } else {\n other\n }\n }\n\n /// If self is None, this returns None. Otherwise, this calls the given function\n /// with the Some value contained within self, and returns the result of that call.\n ///\n /// In some languages this function is called `flat_map` or `bind`.\n pub fn and_then(self, f: fn[Env](T) -> Option) -> Option {\n if self._is_some {\n f(self._value)\n } else {\n Option::none()\n }\n }\n\n /// If self is Some, return self. Otherwise, return `other`.\n pub fn or(self, other: Self) -> Self {\n if self._is_some {\n self\n } else {\n other\n }\n }\n\n /// If self is Some, return self. Otherwise, return `default()`.\n pub fn or_else(self, default: fn[Env]() -> Self) -> Self {\n if self._is_some {\n self\n } else {\n default()\n }\n }\n\n // If only one of the two Options is Some, return that option.\n // Otherwise, if both options are Some or both are None, None is returned.\n pub fn xor(self, other: Self) -> Self {\n if self._is_some {\n if other._is_some {\n Option::none()\n } else {\n self\n }\n } else if other._is_some {\n other\n } else {\n Option::none()\n }\n }\n\n /// Returns `Some(x)` if self is `Some(x)` and `predicate(x)` is true.\n /// Otherwise, this returns `None`\n pub fn filter(self, predicate: fn[Env](T) -> bool) -> Self {\n if self._is_some {\n if predicate(self._value) {\n self\n } else {\n Option::none()\n }\n } else {\n Option::none()\n }\n }\n\n /// Flattens an Option> into a Option.\n /// This returns None if the outer Option is None. Otherwise, this returns the inner Option.\n pub fn flatten(option: Option>) -> Option {\n if option._is_some {\n option._value\n } else {\n Option::none()\n }\n }\n}\n\nimpl Default for Option {\n fn default() -> Self {\n Option::none()\n }\n}\n\nimpl Eq for Option\nwhere\n T: Eq,\n{\n fn eq(self, other: Self) -> bool {\n if self._is_some == other._is_some {\n if self._is_some {\n self._value == other._value\n } else {\n true\n }\n } else {\n false\n }\n }\n}\n\nimpl Hash for Option\nwhere\n T: Hash,\n{\n fn hash(self, state: &mut H)\n where\n H: Hasher,\n {\n self._is_some.hash(state);\n if self._is_some {\n self._value.hash(state);\n }\n }\n}\n\n// For this impl we're declaring Option::none < Option::some\nimpl Ord for Option\nwhere\n T: Ord,\n{\n fn cmp(self, other: Self) -> Ordering {\n if self._is_some {\n if other._is_some {\n self._value.cmp(other._value)\n } else {\n Ordering::greater()\n }\n } else if other._is_some {\n Ordering::less()\n } else {\n Ordering::equal()\n }\n }\n}\n","path":"std/option.nr"},"58":{"source":"pub fn panic(message: fmtstr) -> U {\n assert(false, message);\n crate::mem::zeroed()\n}\n","path":"std/panic.nr"},"69":{"source":"use dep::aztec::macros::aztec;\n\n#[aztec]\ncontract SimpleLogging {\n use dep::aztec::prelude::{Map, PublicMutable};\n use dep::aztec::{\n //keys::getters::get_public_keys,\n macros::{storage::storage, functions::{public, initializer, private, internal}},\n };\n #[storage]\n struct Storage {\n counters: Map, Context>,\n }\n\n #[public]\n #[initializer]\n fn constructor() {\n }\n\n #[private]\n fn increace_counter_private(counter_id: Field) {\n //let msg_sender_npk_m_hash = get_public_keys(context.msg_sender()).npk_m.hash();\n //let secret = context.request_nsk_app(msg_sender_npk_m_hash); // get secret key of caller of function\n //let nullifier = std::hash::pedersen_hash([context.msg_sender().to_field(), secret]); // derive nullifier from sender and secret\n //context.push_nullifier(nullifier);\n SimpleLogging::at(context.this_address()).add_to_counter_public(counter_id).enqueue(\n &mut context,\n );\n }\n\n #[public]\n #[internal]\n fn add_to_counter_public(counter_id: Field) {\n let new_counter_value = storage.counters.at(counter_id).read() + 1;\n storage.counters.at(counter_id).write(new_counter_value);\n }\n\n #[public]\n fn increase_counter_public(counter_id: Field) {\n context.emit_unencrypted_log(/*message=*/\"Counter increased public\");\n SimpleLogging::at(context.this_address()).add_to_counter_public(counter_id);\n }\n unconstrained fn get_counter_value(counter_id: Field) -> pub Field {\n storage.counters.at(counter_id).read()\n }\n}\n","path":"/home/filip/c/chicmoz/services/event-cannon/src/contract-projects/SimpleLogging/src/main.nr"},"109":{"source":"use crate::state_vars::storage::Storage;\nuse dep::protocol_types::{\n storage::map::derive_storage_slot_in_map,\n traits::{Deserialize, Serialize, ToField},\n};\n\n// docs:start:map\npub struct Map {\n context: Context,\n storage_slot: Field,\n state_var_constructor: fn(Context, Field) -> V,\n}\n// docs:end:map\n\nimpl Storage for Map\nwhere\n T: Serialize + Deserialize,\n{}\n\nimpl Map {\n // docs:start:new\n pub fn new(\n context: Context,\n storage_slot: Field,\n state_var_constructor: fn(Context, Field) -> V,\n ) -> Self {\n assert(storage_slot != 0, \"Storage slot 0 not allowed. Storage slots must start from 1.\");\n Map { context, storage_slot, state_var_constructor }\n }\n // docs:end:new\n\n // docs:start:at\n pub fn at(self, key: K) -> V\n where\n K: ToField,\n {\n // TODO(#1204): use a generator index for the storage slot\n let derived_storage_slot = derive_storage_slot_in_map(self.storage_slot, key);\n\n let state_var_constructor = self.state_var_constructor;\n state_var_constructor(self.context, derived_storage_slot)\n }\n // docs:end:at\n}\n","path":"/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.65.0/noir-projects/aztec-nr/aztec/src/state_vars/map.nr"},"122":{"source":"use crate::context::{PublicContext, UnconstrainedContext};\nuse crate::state_vars::storage::Storage;\nuse dep::protocol_types::traits::{Deserialize, Serialize};\n\n// docs:start:public_mutable_struct\npub struct PublicMutable {\n context: Context,\n storage_slot: Field,\n}\n// docs:end:public_mutable_struct\n\nimpl Storage for PublicMutable\nwhere\n T: Serialize + Deserialize,\n{}\n\nimpl PublicMutable {\n // docs:start:public_mutable_struct_new\n pub fn new(\n // Note: Passing the contexts to new(...) just to have an interface compatible with a Map.\n context: Context,\n storage_slot: Field,\n ) -> Self {\n assert(storage_slot != 0, \"Storage slot 0 not allowed. Storage slots must start from 1.\");\n PublicMutable { context, storage_slot }\n }\n // docs:end:public_mutable_struct_new\n}\n\nimpl PublicMutable\nwhere\n T: Serialize + Deserialize,\n{\n // docs:start:public_mutable_struct_read\n pub fn read(self) -> T {\n self.context.storage_read(self.storage_slot)\n }\n // docs:end:public_mutable_struct_read\n\n // docs:start:public_mutable_struct_write\n pub fn write(self, value: T) {\n self.context.storage_write(self.storage_slot, value);\n }\n // docs:end:public_mutable_struct_write\n}\n\nimpl PublicMutable\nwhere\n T: Deserialize,\n{\n pub unconstrained fn read(self) -> T {\n self.context.storage_read(self.storage_slot)\n }\n}\n","path":"/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.65.0/noir-projects/aztec-nr/aztec/src/state_vars/public_mutable.nr"},"126":{"source":"use crate::{\n context::{inputs::PrivateContextInputs, packed_returns::PackedReturns},\n hash::{ArgsHasher, hash_args_array},\n keys::constants::{NULLIFIER_INDEX, NUM_KEY_TYPES, OUTGOING_INDEX, sk_generators},\n messaging::process_l1_to_l2_message,\n oracle::{\n arguments,\n call_private_function::call_private_function_internal,\n enqueue_public_function_call::{\n enqueue_public_function_call_internal, notify_set_min_revertible_side_effect_counter,\n set_public_teardown_function_call_internal,\n },\n header::get_header_at,\n key_validation_request::get_key_validation_request,\n logs::{emit_encrypted_event_log, emit_encrypted_note_log},\n returns::pack_returns,\n },\n};\nuse dep::protocol_types::{\n abis::{\n call_context::CallContext,\n function_selector::FunctionSelector,\n log_hash::{EncryptedLogHash, LogHash, NoteLogHash},\n max_block_number::MaxBlockNumber,\n note_hash::NoteHash,\n nullifier::Nullifier,\n private_call_request::PrivateCallRequest,\n private_circuit_public_inputs::PrivateCircuitPublicInputs,\n public_call_request::PublicCallRequest,\n read_request::ReadRequest,\n side_effect::Counted,\n validation_requests::{KeyValidationRequest, KeyValidationRequestAndGenerator},\n },\n address::{AztecAddress, EthAddress},\n constants::{\n MAX_CONTRACT_CLASS_LOGS_PER_CALL, MAX_ENCRYPTED_LOGS_PER_CALL, MAX_ENQUEUED_CALLS_PER_CALL,\n MAX_KEY_VALIDATION_REQUESTS_PER_CALL, MAX_L2_TO_L1_MSGS_PER_CALL,\n MAX_NOTE_ENCRYPTED_LOGS_PER_CALL, MAX_NOTE_HASH_READ_REQUESTS_PER_CALL,\n MAX_NOTE_HASHES_PER_CALL, MAX_NULLIFIER_READ_REQUESTS_PER_CALL, MAX_NULLIFIERS_PER_CALL,\n MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL, PUBLIC_DISPATCH_SELECTOR,\n },\n header::Header,\n messaging::l2_to_l1_message::L2ToL1Message,\n traits::Empty,\n};\n\n// When finished, one can call .finish() to convert back to the abi\npub struct PrivateContext {\n // docs:start:private-context\n pub inputs: PrivateContextInputs,\n pub side_effect_counter: u32,\n\n pub min_revertible_side_effect_counter: u32,\n pub is_fee_payer: bool,\n\n pub args_hash: Field,\n pub return_hash: Field,\n\n pub max_block_number: MaxBlockNumber,\n\n pub note_hash_read_requests: BoundedVec,\n pub nullifier_read_requests: BoundedVec,\n key_validation_requests_and_generators: BoundedVec,\n\n pub note_hashes: BoundedVec,\n pub nullifiers: BoundedVec,\n\n pub private_call_requests: BoundedVec,\n pub public_call_requests: BoundedVec, MAX_ENQUEUED_CALLS_PER_CALL>,\n pub public_teardown_call_request: PublicCallRequest,\n pub l2_to_l1_msgs: BoundedVec,\n // docs:end:private-context\n\n // Header of a block whose state is used during private execution (not the block the transaction is included in).\n pub historical_header: Header,\n\n pub note_encrypted_logs_hashes: BoundedVec,\n pub encrypted_logs_hashes: BoundedVec,\n pub contract_class_logs_hashes: BoundedVec,\n\n // Contains the last key validation request for each key type. This is used to cache the last request and avoid\n // fetching the same request multiple times.\n // The index of the array corresponds to the key type (0 nullifier, 1 incoming, 2 outgoing, 3 tagging).\n pub last_key_validation_requests: [Option; NUM_KEY_TYPES],\n}\n\nimpl PrivateContext {\n pub fn new(inputs: PrivateContextInputs, args_hash: Field) -> PrivateContext {\n PrivateContext {\n inputs,\n side_effect_counter: inputs.start_side_effect_counter + 1,\n min_revertible_side_effect_counter: 0,\n is_fee_payer: false,\n args_hash,\n return_hash: 0,\n max_block_number: MaxBlockNumber::empty(),\n note_hash_read_requests: BoundedVec::new(),\n nullifier_read_requests: BoundedVec::new(),\n key_validation_requests_and_generators: BoundedVec::new(),\n note_hashes: BoundedVec::new(),\n nullifiers: BoundedVec::new(),\n historical_header: inputs.historical_header,\n private_call_requests: BoundedVec::new(),\n public_call_requests: BoundedVec::new(),\n public_teardown_call_request: PublicCallRequest::empty(),\n l2_to_l1_msgs: BoundedVec::new(),\n note_encrypted_logs_hashes: BoundedVec::new(),\n encrypted_logs_hashes: BoundedVec::new(),\n contract_class_logs_hashes: BoundedVec::new(),\n last_key_validation_requests: [Option::none(); NUM_KEY_TYPES],\n }\n }\n\n pub fn msg_sender(self) -> AztecAddress {\n self.inputs.call_context.msg_sender\n }\n\n pub fn this_address(self) -> AztecAddress {\n self.inputs.call_context.contract_address\n }\n\n pub fn chain_id(self) -> Field {\n self.inputs.tx_context.chain_id\n }\n\n pub fn version(self) -> Field {\n self.inputs.tx_context.version\n }\n\n pub fn selector(self) -> FunctionSelector {\n self.inputs.call_context.function_selector\n }\n\n pub fn get_args_hash(self) -> Field {\n self.args_hash\n }\n\n pub fn push_note_hash(&mut self, note_hash: Field) {\n self.note_hashes.push(NoteHash { value: note_hash, counter: self.next_counter() });\n }\n\n pub fn push_nullifier(&mut self, nullifier: Field) {\n self.nullifiers.push(\n Nullifier { value: nullifier, note_hash: 0, counter: self.next_counter() },\n );\n }\n\n pub fn push_nullifier_for_note_hash(&mut self, nullifier: Field, nullified_note_hash: Field) {\n self.nullifiers.push(\n Nullifier {\n value: nullifier,\n note_hash: nullified_note_hash,\n counter: self.next_counter(),\n },\n );\n }\n\n // Returns the header of a block whose state is used during private execution (not the block the transaction is\n // included in).\n pub fn get_header(self) -> Header {\n self.historical_header\n }\n\n // Returns the header of an arbitrary block whose block number is less than or equal to the block number\n // of historical header.\n pub fn get_header_at(self, block_number: u32) -> Header {\n get_header_at(block_number, self)\n }\n\n pub fn set_return_hash(&mut self, returns_hasher: ArgsHasher) {\n pack_returns(returns_hasher.fields);\n self.return_hash = returns_hasher.hash();\n }\n\n pub fn finish(self) -> PrivateCircuitPublicInputs {\n PrivateCircuitPublicInputs {\n call_context: self.inputs.call_context,\n args_hash: self.args_hash,\n returns_hash: self.return_hash,\n min_revertible_side_effect_counter: self.min_revertible_side_effect_counter,\n is_fee_payer: self.is_fee_payer,\n max_block_number: self.max_block_number,\n note_hash_read_requests: self.note_hash_read_requests.storage(),\n nullifier_read_requests: self.nullifier_read_requests.storage(),\n key_validation_requests_and_generators: self\n .key_validation_requests_and_generators\n .storage(),\n note_hashes: self.note_hashes.storage(),\n nullifiers: self.nullifiers.storage(),\n private_call_requests: self.private_call_requests.storage(),\n public_call_requests: self.public_call_requests.storage(),\n public_teardown_call_request: self.public_teardown_call_request,\n l2_to_l1_msgs: self.l2_to_l1_msgs.storage(),\n start_side_effect_counter: self.inputs.start_side_effect_counter,\n end_side_effect_counter: self.side_effect_counter,\n note_encrypted_logs_hashes: self.note_encrypted_logs_hashes.storage(),\n encrypted_logs_hashes: self.encrypted_logs_hashes.storage(),\n contract_class_logs_hashes: self.contract_class_logs_hashes.storage(),\n historical_header: self.historical_header,\n tx_context: self.inputs.tx_context,\n }\n }\n\n pub fn set_as_fee_payer(&mut self) {\n dep::protocol_types::debug_log::debug_log_format(\n \"Setting {0} as fee payer\",\n [self.this_address().to_field()],\n );\n self.is_fee_payer = true;\n }\n\n pub fn end_setup(&mut self) {\n // dep::protocol_types::debug_log::debug_log_format(\n // \"Ending setup at counter {0}\",\n // [self.side_effect_counter as Field]\n // );\n self.min_revertible_side_effect_counter = self.side_effect_counter;\n notify_set_min_revertible_side_effect_counter(self.min_revertible_side_effect_counter);\n }\n\n // docs:start:max-block-number\n pub fn set_tx_max_block_number(&mut self, max_block_number: u32) {\n // docs:end:max-block-number\n self.max_block_number =\n MaxBlockNumber::min_with_u32(self.max_block_number, max_block_number);\n }\n\n pub fn push_note_hash_read_request(&mut self, note_hash: Field) {\n let side_effect = ReadRequest { value: note_hash, counter: self.next_counter() };\n self.note_hash_read_requests.push(side_effect);\n }\n\n pub fn push_nullifier_read_request(&mut self, nullifier: Field) {\n let request = ReadRequest { value: nullifier, counter: self.next_counter() };\n self.nullifier_read_requests.push(request);\n }\n\n pub fn request_nsk_app(&mut self, npk_m_hash: Field) -> Field {\n self.request_sk_app(npk_m_hash, NULLIFIER_INDEX)\n }\n\n pub fn request_ovsk_app(&mut self, ovpk_m_hash: Field) -> Field {\n self.request_sk_app(ovpk_m_hash, OUTGOING_INDEX)\n }\n\n fn request_sk_app(&mut self, pk_m_hash: Field, key_index: Field) -> Field {\n let cached_request =\n self.last_key_validation_requests[key_index].unwrap_or(KeyValidationRequest::empty());\n\n if cached_request.pk_m.hash() == pk_m_hash {\n // We get a match so the cached request is the latest one\n cached_request.sk_app\n } else {\n // We didn't get a match meaning the cached result is stale\n // Typically we'd validate keys by showing that they are the preimage of `pk_m_hash`, but that'd require\n // the oracle returning the master secret keys, which could cause malicious contracts to leak it or learn\n // about secrets from other contracts. We therefore silo secret keys, and rely on the private kernel to\n // validate that we siloed secret key corresponds to correct siloing of the master secret key that hashes\n // to `pk_m_hash`.\n let request = unsafe { get_key_validation_request(pk_m_hash, key_index) };\n assert(request.pk_m.hash() == pk_m_hash);\n\n self.key_validation_requests_and_generators.push(\n KeyValidationRequestAndGenerator {\n request,\n sk_app_generator: sk_generators[key_index],\n },\n );\n self.last_key_validation_requests[key_index] = Option::some(request);\n request.sk_app\n }\n }\n\n // docs:start:context_message_portal\n pub fn message_portal(&mut self, recipient: EthAddress, content: Field) {\n // docs:end:context_message_portal\n let message = L2ToL1Message { recipient, content, counter: self.next_counter() };\n self.l2_to_l1_msgs.push(message);\n }\n\n // docs:start:context_consume_l1_to_l2_message\n // docs:start:consume_l1_to_l2_message\n pub fn consume_l1_to_l2_message(\n &mut self,\n content: Field,\n secret: Field,\n sender: EthAddress,\n leaf_index: Field,\n ) {\n // docs:end:context_consume_l1_to_l2_message\n let nullifier = process_l1_to_l2_message(\n self.historical_header.state.l1_to_l2_message_tree.root,\n self.this_address(),\n sender,\n self.chain_id(),\n self.version(),\n content,\n secret,\n leaf_index,\n );\n\n // Push nullifier (and the \"commitment\" corresponding to this can be \"empty\")\n self.push_nullifier(nullifier)\n }\n // docs:end:consume_l1_to_l2_message\n\n // NB: A randomness value of 0 signals that the kernels should not mask the contract address\n // used in siloing later on e.g. 'handshaking' contract w/ known address.\n pub fn emit_raw_event_log_with_masked_address(\n &mut self,\n randomness: Field,\n log: [u8; M],\n log_hash: Field,\n ) {\n let counter = self.next_counter();\n let contract_address = self.this_address();\n let len = log.len() as Field + 4;\n let side_effect = EncryptedLogHash { value: log_hash, counter, length: len, randomness };\n self.encrypted_logs_hashes.push(side_effect);\n\n emit_encrypted_event_log(contract_address, randomness, log, counter);\n }\n\n pub fn emit_raw_note_log(\n &mut self,\n note_hash_counter: u32,\n log: [u8; M],\n log_hash: Field,\n ) {\n let counter = self.next_counter();\n let len = log.len() as Field + 4;\n let side_effect = NoteLogHash { value: log_hash, counter, length: len, note_hash_counter };\n self.note_encrypted_logs_hashes.push(side_effect);\n\n emit_encrypted_note_log(note_hash_counter, log, counter);\n }\n\n pub fn call_private_function(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args: [Field; ARGS_COUNT],\n ) -> PackedReturns {\n let args_hash = hash_args_array(args);\n arguments::pack_arguments_array(args);\n self.call_private_function_with_packed_args(\n contract_address,\n function_selector,\n args_hash,\n false,\n )\n }\n\n pub fn static_call_private_function(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args: [Field; ARGS_COUNT],\n ) -> PackedReturns {\n let args_hash = hash_args_array(args);\n arguments::pack_arguments_array(args);\n self.call_private_function_with_packed_args(\n contract_address,\n function_selector,\n args_hash,\n true,\n )\n }\n\n pub fn call_private_function_no_args(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n ) -> PackedReturns {\n self.call_private_function_with_packed_args(contract_address, function_selector, 0, false)\n }\n\n pub fn static_call_private_function_no_args(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n ) -> PackedReturns {\n self.call_private_function_with_packed_args(contract_address, function_selector, 0, true)\n }\n\n pub fn call_private_function_with_packed_args(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args_hash: Field,\n is_static_call: bool,\n ) -> PackedReturns {\n let mut is_static_call = is_static_call | self.inputs.call_context.is_static_call;\n let start_side_effect_counter = self.side_effect_counter;\n\n // The oracle simulates the private call and returns the value of the side effects counter after execution of\n // the call (which means that end_side_effect_counter - start_side_effect_counter is the number of side effects\n // that took place), along with the hash of the return values. We validate these by requesting a private kernel\n // iteration in which the return values are constrained to hash to `returns_hash` and the side effects counter\n // to increment from start to end.\n let (end_side_effect_counter, returns_hash) = unsafe {\n call_private_function_internal(\n contract_address,\n function_selector,\n args_hash,\n start_side_effect_counter,\n is_static_call,\n )\n };\n\n self.private_call_requests.push(\n PrivateCallRequest {\n call_context: CallContext {\n msg_sender: self.this_address(),\n contract_address,\n function_selector,\n is_static_call,\n },\n args_hash,\n returns_hash,\n start_side_effect_counter,\n end_side_effect_counter,\n },\n );\n\n // TODO (fees) figure out why this crashes the prover and enable it\n // we need this in order to pay fees inside child call contexts\n // assert(\n // (item.public_inputs.min_revertible_side_effect_counter == 0 as u32)\n // | (item.public_inputs.min_revertible_side_effect_counter\n // > self.min_revertible_side_effect_counter)\n // );\n // if item.public_inputs.min_revertible_side_effect_counter\n // > self.min_revertible_side_effect_counter {\n // self.min_revertible_side_effect_counter = item.public_inputs.min_revertible_side_effect_counter;\n // }\n self.side_effect_counter = end_side_effect_counter + 1;\n PackedReturns::new(returns_hash)\n }\n\n pub fn call_public_function(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args: [Field; ARGS_COUNT],\n ) {\n let args_hash = hash_args_array(args);\n arguments::pack_arguments_array(args);\n self.call_public_function_with_packed_args(\n contract_address,\n function_selector,\n args_hash,\n false,\n )\n }\n\n pub fn static_call_public_function(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args: [Field; ARGS_COUNT],\n ) {\n let args_hash = hash_args_array(args);\n arguments::pack_arguments_array(args);\n self.call_public_function_with_packed_args(\n contract_address,\n function_selector,\n args_hash,\n true,\n )\n }\n\n pub fn call_public_function_no_args(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n ) {\n self.call_public_function_with_packed_args(contract_address, function_selector, 0, false)\n }\n\n pub fn static_call_public_function_no_args(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n ) {\n self.call_public_function_with_packed_args(contract_address, function_selector, 0, true)\n }\n\n pub fn call_public_function_with_packed_args(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args_hash: Field,\n is_static_call: bool,\n ) {\n let counter = self.next_counter();\n\n let mut is_static_call = is_static_call | self.inputs.call_context.is_static_call;\n // TODO(https://github.com/AztecProtocol/aztec-packages/issues/8985): Fix this.\n // WARNING: This is insecure and should be temporary!\n // The oracle repacks the arguments and returns a new args_hash.\n // new_args = [selector, ...old_args], so as to make it suitable to call the public dispatch function.\n // We don't validate or compute it in the circuit because a) it's harder to do with slices, and\n // b) this is only temporary.\n let args_hash = enqueue_public_function_call_internal(\n contract_address,\n function_selector,\n args_hash,\n counter,\n is_static_call,\n );\n\n // Public calls are rerouted through the dispatch function.\n let function_selector = comptime { FunctionSelector::from_field(PUBLIC_DISPATCH_SELECTOR) };\n\n let call_request = PublicCallRequest {\n msg_sender: self.this_address(),\n contract_address,\n function_selector,\n is_static_call,\n args_hash,\n };\n\n self.public_call_requests.push(Counted::new(call_request, counter));\n }\n\n pub fn set_public_teardown_function(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args: [Field; ARGS_COUNT],\n ) {\n let args_hash = hash_args_array(args);\n arguments::pack_arguments_array(args);\n self.set_public_teardown_function_with_packed_args(\n contract_address,\n function_selector,\n args_hash,\n false,\n )\n }\n\n pub fn set_public_teardown_function_with_packed_args(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args_hash: Field,\n is_static_call: bool,\n ) {\n let counter = self.next_counter();\n\n let mut is_static_call = is_static_call | self.inputs.call_context.is_static_call;\n // TODO(https://github.com/AztecProtocol/aztec-packages/issues/8985): Fix this.\n // WARNING: This is insecure and should be temporary!\n // The oracle repacks the arguments and returns a new args_hash.\n // new_args = [selector, ...old_args], so as to make it suitable to call the public dispatch function.\n // We don't validate or compute it in the circuit because a) it's harder to do with slices, and\n // b) this is only temporary.\n let args_hash = set_public_teardown_function_call_internal(\n contract_address,\n function_selector,\n args_hash,\n counter,\n is_static_call,\n );\n\n let function_selector = comptime { FunctionSelector::from_field(PUBLIC_DISPATCH_SELECTOR) };\n\n self.public_teardown_call_request = PublicCallRequest {\n msg_sender: self.this_address(),\n contract_address,\n function_selector,\n is_static_call,\n args_hash,\n };\n }\n\n fn next_counter(&mut self) -> u32 {\n let counter = self.side_effect_counter;\n self.side_effect_counter += 1;\n counter\n }\n}\n\nimpl Empty for PrivateContext {\n fn empty() -> Self {\n PrivateContext {\n inputs: PrivateContextInputs::empty(),\n side_effect_counter: 0 as u32,\n min_revertible_side_effect_counter: 0 as u32,\n is_fee_payer: false,\n args_hash: 0,\n return_hash: 0,\n max_block_number: MaxBlockNumber::empty(),\n note_hash_read_requests: BoundedVec::new(),\n nullifier_read_requests: BoundedVec::new(),\n key_validation_requests_and_generators: BoundedVec::new(),\n note_hashes: BoundedVec::new(),\n nullifiers: BoundedVec::new(),\n private_call_requests: BoundedVec::new(),\n public_call_requests: BoundedVec::new(),\n public_teardown_call_request: PublicCallRequest::empty(),\n l2_to_l1_msgs: BoundedVec::new(),\n historical_header: Header::empty(),\n note_encrypted_logs_hashes: BoundedVec::new(),\n encrypted_logs_hashes: BoundedVec::new(),\n contract_class_logs_hashes: BoundedVec::new(),\n last_key_validation_requests: [Option::none(); NUM_KEY_TYPES],\n }\n }\n}\n","path":"/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.65.0/noir-projects/aztec-nr/aztec/src/context/private_context.nr"},"127":{"source":"use dep::protocol_types::{\n abis::function_selector::FunctionSelector, address::AztecAddress, traits::Deserialize,\n};\n\nuse crate::context::{gas::GasOpts, private_context::PrivateContext, public_context::PublicContext};\n\nuse crate::hash::hash_args;\nuse crate::oracle::arguments::pack_arguments;\n\npub trait CallInterface {\n fn get_args(self) -> [Field] {\n self.args\n }\n\n fn get_selector(self) -> FunctionSelector {\n self.selector\n }\n\n fn get_name(self) -> str {\n self.name\n }\n\n fn get_contract_address(self) -> AztecAddress {\n self.target_contract\n }\n\n fn get_is_static(self) -> bool {\n self.is_static\n }\n}\n\npub struct PrivateCallInterface {\n pub target_contract: AztecAddress,\n pub selector: FunctionSelector,\n pub name: str,\n pub args_hash: Field,\n pub args: [Field],\n pub return_type: T,\n pub is_static: bool,\n}\n\nimpl PrivateCallInterface {\n pub fn call(self, context: &mut PrivateContext) -> T\n where\n T: Deserialize,\n {\n pack_arguments(self.args);\n let returns = context.call_private_function_with_packed_args(\n self.target_contract,\n self.selector,\n self.args_hash,\n false,\n );\n let unpacked: T = returns.unpack_into();\n unpacked\n }\n\n pub fn view(self, context: &mut PrivateContext) -> T\n where\n T: Deserialize,\n {\n pack_arguments(self.args);\n let returns = context.call_private_function_with_packed_args(\n self.target_contract,\n self.selector,\n self.args_hash,\n true,\n );\n returns.unpack_into()\n }\n}\n\nimpl CallInterface for PrivateVoidCallInterface {}\n\npub struct PrivateVoidCallInterface {\n pub target_contract: AztecAddress,\n pub selector: FunctionSelector,\n pub name: str,\n pub args_hash: Field,\n pub args: [Field],\n pub return_type: (),\n pub is_static: bool,\n}\n\nimpl PrivateVoidCallInterface {\n pub fn call(self, context: &mut PrivateContext) {\n pack_arguments(self.args);\n context\n .call_private_function_with_packed_args(\n self.target_contract,\n self.selector,\n self.args_hash,\n false,\n )\n .assert_empty();\n }\n\n pub fn view(self, context: &mut PrivateContext) {\n pack_arguments(self.args);\n context\n .call_private_function_with_packed_args(\n self.target_contract,\n self.selector,\n self.args_hash,\n true,\n )\n .assert_empty();\n }\n}\n\nimpl CallInterface for PrivateStaticCallInterface {}\n\npub struct PrivateStaticCallInterface {\n pub target_contract: AztecAddress,\n pub selector: FunctionSelector,\n pub name: str,\n pub args_hash: Field,\n pub args: [Field],\n pub return_type: T,\n pub is_static: bool,\n}\n\nimpl PrivateStaticCallInterface {\n pub fn view(self, context: &mut PrivateContext) -> T\n where\n T: Deserialize,\n {\n pack_arguments(self.args);\n let returns = context.call_private_function_with_packed_args(\n self.target_contract,\n self.selector,\n self.args_hash,\n true,\n );\n returns.unpack_into()\n }\n}\n\nimpl CallInterface for PrivateStaticVoidCallInterface {}\n\npub struct PrivateStaticVoidCallInterface {\n pub target_contract: AztecAddress,\n pub selector: FunctionSelector,\n pub name: str,\n pub args_hash: Field,\n pub args: [Field],\n pub return_type: (),\n pub is_static: bool,\n}\n\nimpl PrivateStaticVoidCallInterface {\n pub fn view(self, context: &mut PrivateContext) {\n pack_arguments(self.args);\n context\n .call_private_function_with_packed_args(\n self.target_contract,\n self.selector,\n self.args_hash,\n true,\n )\n .assert_empty();\n }\n}\n\nimpl CallInterface for PublicCallInterface {}\n\npub struct PublicCallInterface {\n pub target_contract: AztecAddress,\n pub selector: FunctionSelector,\n pub name: str,\n pub args: [Field],\n pub gas_opts: GasOpts,\n pub return_type: T,\n pub is_static: bool,\n}\n\nimpl PublicCallInterface {\n pub fn with_gas(self: &mut Self, gas_opts: GasOpts) -> &mut Self {\n self.gas_opts = gas_opts;\n self\n }\n\n pub unconstrained fn call(self, context: &mut PublicContext) -> T\n where\n T: Deserialize,\n {\n let returns = context.call_public_function(\n self.target_contract,\n self.selector,\n self.args,\n self.gas_opts,\n );\n Deserialize::deserialize(returns.as_array::())\n }\n\n pub unconstrained fn view(self, context: &mut PublicContext) -> T\n where\n T: Deserialize,\n {\n let returns = context.static_call_public_function(\n self.target_contract,\n self.selector,\n self.args,\n self.gas_opts,\n );\n Deserialize::deserialize(returns.as_array::())\n }\n\n pub fn enqueue(self, context: &mut PrivateContext) {\n let args_hash = hash_args(self.args);\n pack_arguments(self.args);\n context.call_public_function_with_packed_args(\n self.target_contract,\n self.selector,\n args_hash,\n /*static=*/\n false,\n )\n }\n\n pub fn enqueue_view(self, context: &mut PrivateContext) {\n let args_hash = hash_args(self.args);\n pack_arguments(self.args);\n context.call_public_function_with_packed_args(\n self.target_contract,\n self.selector,\n args_hash,\n /*static=*/\n true,\n )\n }\n}\n\nimpl CallInterface for PublicVoidCallInterface {}\n\npub struct PublicVoidCallInterface {\n pub target_contract: AztecAddress,\n pub selector: FunctionSelector,\n pub name: str,\n pub args: [Field],\n pub return_type: (),\n pub is_static: bool,\n pub gas_opts: GasOpts,\n}\n\nimpl PublicVoidCallInterface {\n pub fn with_gas(self: &mut Self, gas_opts: GasOpts) -> &mut Self {\n self.gas_opts = gas_opts;\n self\n }\n\n pub unconstrained fn call(self, context: &mut PublicContext) {\n let returns = context.call_public_function(\n self.target_contract,\n self.selector,\n self.args,\n self.gas_opts,\n );\n assert(returns.len() == 0);\n }\n\n pub unconstrained fn view(self, context: &mut PublicContext) {\n let returns = context.static_call_public_function(\n self.target_contract,\n self.selector,\n self.args,\n self.gas_opts,\n );\n assert(returns.len() == 0);\n }\n\n pub fn enqueue(self, context: &mut PrivateContext) {\n let args_hash = hash_args(self.args);\n pack_arguments(self.args);\n context.call_public_function_with_packed_args(\n self.target_contract,\n self.selector,\n args_hash,\n /*static=*/\n false,\n )\n }\n\n pub fn enqueue_view(self, context: &mut PrivateContext) {\n let args_hash = hash_args(self.args);\n pack_arguments(self.args);\n context.call_public_function_with_packed_args(\n self.target_contract,\n self.selector,\n args_hash,\n /*static=*/\n true,\n )\n }\n}\n\nimpl CallInterface for PublicStaticCallInterface {}\n\npub struct PublicStaticCallInterface {\n pub target_contract: AztecAddress,\n pub selector: FunctionSelector,\n pub name: str,\n pub args: [Field],\n pub return_type: T,\n pub is_static: bool,\n pub gas_opts: GasOpts,\n}\n\nimpl PublicStaticCallInterface {\n pub fn with_gas(self: &mut Self, gas_opts: GasOpts) -> &mut Self {\n self.gas_opts = gas_opts;\n self\n }\n\n pub unconstrained fn view(self, context: &mut PublicContext) -> T\n where\n T: Deserialize,\n {\n let returns = context.static_call_public_function(\n self.target_contract,\n self.selector,\n self.args,\n self.gas_opts,\n );\n Deserialize::deserialize(returns.as_array::())\n }\n\n pub fn enqueue_view(self, context: &mut PrivateContext) {\n let args_hash = hash_args(self.args);\n pack_arguments(self.args);\n context.call_public_function_with_packed_args(\n self.target_contract,\n self.selector,\n args_hash,\n /*static=*/\n true,\n )\n }\n}\n\nimpl CallInterface for PublicStaticVoidCallInterface {}\n\npub struct PublicStaticVoidCallInterface {\n target_contract: AztecAddress,\n selector: FunctionSelector,\n name: str,\n args: [Field],\n return_type: (),\n is_static: bool,\n gas_opts: GasOpts,\n}\n\nimpl PublicStaticVoidCallInterface {\n pub fn with_gas(self: &mut Self, gas_opts: GasOpts) -> &mut Self {\n self.gas_opts = gas_opts;\n self\n }\n\n pub unconstrained fn view(self, context: &mut PublicContext) {\n let returns = context.static_call_public_function(\n self.target_contract,\n self.selector,\n self.args,\n self.gas_opts,\n );\n assert(returns.len() == 0);\n }\n\n pub fn enqueue_view(self, context: &mut PrivateContext) {\n let args_hash = hash_args(self.args);\n pack_arguments(self.args);\n context.call_public_function_with_packed_args(\n self.target_contract,\n self.selector,\n args_hash,\n /*static=*/\n true,\n )\n }\n}\n","path":"/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.65.0/noir-projects/aztec-nr/aztec/src/context/call_interfaces.nr"},"128":{"source":"use crate::oracle::{\n execution::{get_block_number, get_chain_id, get_contract_address, get_version},\n storage::storage_read,\n};\nuse dep::protocol_types::{address::AztecAddress, traits::Deserialize};\n\npub struct UnconstrainedContext {\n block_number: u32,\n contract_address: AztecAddress,\n version: Field,\n chain_id: Field,\n}\n\nimpl UnconstrainedContext {\n pub unconstrained fn new() -> Self {\n // We could call these oracles on the getters instead of at creation, which makes sense given that they might\n // not even be accessed. However any performance gains are minimal, and we'd rather fail early if a user\n // incorrectly attempts to create an UnconstrainedContext in an environment in which these oracles are not\n // available.\n let block_number = get_block_number();\n let contract_address = get_contract_address();\n let chain_id = get_chain_id();\n let version = get_version();\n Self { block_number, contract_address, version, chain_id }\n }\n\n pub unconstrained fn at(contract_address: AztecAddress) -> Self {\n let block_number = get_block_number();\n let chain_id = get_chain_id();\n let version = get_version();\n Self { block_number, contract_address, version, chain_id }\n }\n\n pub unconstrained fn at_historical(contract_address: AztecAddress, block_number: u32) -> Self {\n let chain_id = get_chain_id();\n let version = get_version();\n Self { block_number, contract_address, version, chain_id }\n }\n\n pub fn block_number(self) -> u32 {\n self.block_number\n }\n\n pub fn this_address(self) -> AztecAddress {\n self.contract_address\n }\n\n pub fn version(self) -> Field {\n self.version\n }\n\n pub fn chain_id(self) -> Field {\n self.chain_id\n }\n\n pub unconstrained fn raw_storage_read(\n self: Self,\n storage_slot: Field,\n ) -> [Field; N] {\n storage_read(self.this_address(), storage_slot, self.block_number())\n }\n\n pub unconstrained fn storage_read(self, storage_slot: Field) -> T\n where\n T: Deserialize,\n {\n T::deserialize(self.raw_storage_read(storage_slot))\n }\n}\n","path":"/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.65.0/noir-projects/aztec-nr/aztec/src/context/unconstrained_context.nr"},"134":{"source":"use crate::context::gas::GasOpts;\nuse crate::hash::{\n compute_l1_to_l2_message_hash, compute_l1_to_l2_message_nullifier, compute_secret_hash,\n};\nuse dep::protocol_types::abis::function_selector::FunctionSelector;\nuse dep::protocol_types::address::{AztecAddress, EthAddress};\nuse dep::protocol_types::constants::MAX_FIELD_VALUE;\nuse dep::protocol_types::traits::{Deserialize, Empty, Serialize};\n\npub struct PublicContext {\n pub args_hash: Option,\n pub compute_args_hash: fn() -> Field,\n}\n\nimpl PublicContext {\n pub fn new(compute_args_hash: fn() -> Field) -> Self {\n PublicContext { args_hash: Option::none(), compute_args_hash }\n }\n\n pub fn emit_unencrypted_log(_self: &mut Self, log: T)\n where\n T: Serialize,\n {\n // AVM opcodes are constrained by the AVM itself\n unsafe { emit_unencrypted_log(Serialize::serialize(log).as_slice()) };\n }\n\n pub fn note_hash_exists(_self: Self, note_hash: Field, leaf_index: Field) -> bool {\n // AVM opcodes are constrained by the AVM itself\n unsafe { note_hash_exists(note_hash, leaf_index) } == 1\n }\n\n pub fn l1_to_l2_msg_exists(_self: Self, msg_hash: Field, msg_leaf_index: Field) -> bool {\n // AVM opcodes are constrained by the AVM itself\n unsafe { l1_to_l2_msg_exists(msg_hash, msg_leaf_index) } == 1\n }\n\n pub fn nullifier_exists(_self: Self, unsiloed_nullifier: Field, address: AztecAddress) -> bool {\n // AVM opcodes are constrained by the AVM itself\n unsafe { nullifier_exists(unsiloed_nullifier, address.to_field()) } == 1\n }\n\n pub fn consume_l1_to_l2_message(\n &mut self,\n content: Field,\n secret: Field,\n sender: EthAddress,\n leaf_index: Field,\n ) {\n let secret_hash = compute_secret_hash(secret);\n let message_hash = compute_l1_to_l2_message_hash(\n sender,\n self.chain_id(),\n /*recipient=*/\n self.this_address(),\n self.version(),\n content,\n secret_hash,\n leaf_index,\n );\n let nullifier = compute_l1_to_l2_message_nullifier(message_hash, secret);\n\n assert(\n !self.nullifier_exists(nullifier, self.this_address()),\n \"L1-to-L2 message is already nullified\",\n );\n assert(\n self.l1_to_l2_msg_exists(message_hash, leaf_index),\n \"Tried to consume nonexistent L1-to-L2 message\",\n );\n\n self.push_nullifier(nullifier);\n }\n\n pub fn message_portal(_self: &mut Self, recipient: EthAddress, content: Field) {\n // AVM opcodes are constrained by the AVM itself\n unsafe { send_l2_to_l1_msg(recipient, content) };\n }\n\n pub unconstrained fn call_public_function(\n _self: &mut Self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args: [Field],\n gas_opts: GasOpts,\n ) -> [Field] {\n let args = args.push_front(function_selector.to_field());\n let success = call(gas_for_call(gas_opts), contract_address, args);\n\n let result_data = returndata_copy(0, returndata_size());\n if !success {\n // Rethrow the revert data.\n avm_revert(result_data);\n }\n result_data\n }\n\n pub unconstrained fn static_call_public_function(\n _self: &mut Self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args: [Field],\n gas_opts: GasOpts,\n ) -> [Field] {\n let args = args.push_front(function_selector.to_field());\n let success = call_static(gas_for_call(gas_opts), contract_address, args);\n\n let result_data = returndata_copy(0, returndata_size());\n if !success {\n // Rethrow the revert data.\n avm_revert(result_data);\n }\n result_data\n }\n\n pub fn push_note_hash(_self: &mut Self, note_hash: Field) {\n // AVM opcodes are constrained by the AVM itself\n unsafe { emit_note_hash(note_hash) };\n }\n pub fn push_nullifier(_self: &mut Self, nullifier: Field) {\n // AVM opcodes are constrained by the AVM itself\n unsafe { emit_nullifier(nullifier) };\n }\n\n pub fn this_address(_self: Self) -> AztecAddress {\n // AVM opcodes are constrained by the AVM itself\n unsafe {\n address()\n }\n }\n pub fn msg_sender(_self: Self) -> AztecAddress {\n // AVM opcodes are constrained by the AVM itself\n unsafe {\n sender()\n }\n }\n pub fn selector(_self: Self) -> FunctionSelector {\n // The selector is the first element of the calldata when calling a public function through dispatch.\n // AVM opcodes are constrained by the AVM itself.\n let raw_selector: [Field; 1] = unsafe { calldata_copy(0, 1) };\n FunctionSelector::from_field(raw_selector[0])\n }\n pub fn get_args_hash(mut self) -> Field {\n if !self.args_hash.is_some() {\n self.args_hash = Option::some((self.compute_args_hash)());\n }\n\n self.args_hash.unwrap_unchecked()\n }\n pub fn transaction_fee(_self: Self) -> Field {\n // AVM opcodes are constrained by the AVM itself\n unsafe {\n transaction_fee()\n }\n }\n\n pub fn chain_id(_self: Self) -> Field {\n // AVM opcodes are constrained by the AVM itself\n unsafe {\n chain_id()\n }\n }\n pub fn version(_self: Self) -> Field {\n // AVM opcodes are constrained by the AVM itself\n unsafe {\n version()\n }\n }\n pub fn block_number(_self: Self) -> Field {\n // AVM opcodes are constrained by the AVM itself\n unsafe {\n block_number()\n }\n }\n pub fn timestamp(_self: Self) -> u64 {\n // AVM opcodes are constrained by the AVM itself\n unsafe {\n timestamp()\n }\n }\n pub fn fee_per_l2_gas(_self: Self) -> Field {\n // AVM opcodes are constrained by the AVM itself\n unsafe {\n fee_per_l2_gas()\n }\n }\n pub fn fee_per_da_gas(_self: Self) -> Field {\n // AVM opcodes are constrained by the AVM itself\n unsafe {\n fee_per_da_gas()\n }\n }\n\n pub fn l2_gas_left(_self: Self) -> Field {\n // AVM opcodes are constrained by the AVM itself\n unsafe {\n l2_gas_left()\n }\n }\n pub fn da_gas_left(_self: Self) -> Field {\n // AVM opcodes are constrained by the AVM itself\n unsafe {\n da_gas_left()\n }\n }\n pub fn is_static_call(_self: Self) -> bool {\n // AVM opcodes are constrained by the AVM itself\n unsafe { is_static_call() } == 1\n }\n\n pub fn raw_storage_read(_self: Self, storage_slot: Field) -> [Field; N] {\n let mut out = [0; N];\n for i in 0..N {\n // AVM opcodes are constrained by the AVM itself\n out[i] = unsafe { storage_read(storage_slot + i as Field) };\n }\n out\n }\n\n pub fn storage_read(self, storage_slot: Field) -> T\n where\n T: Deserialize,\n {\n T::deserialize(self.raw_storage_read(storage_slot))\n }\n\n pub fn raw_storage_write(_self: Self, storage_slot: Field, values: [Field; N]) {\n for i in 0..N {\n // AVM opcodes are constrained by the AVM itself\n unsafe { storage_write(storage_slot + i as Field, values[i]) };\n }\n }\n\n pub fn storage_write(self, storage_slot: Field, value: T)\n where\n T: Serialize,\n {\n self.raw_storage_write(storage_slot, value.serialize());\n }\n}\n\n// Helper functions\nfn gas_for_call(user_gas: GasOpts) -> [Field; 2] {\n // It's ok to use the max possible gas here, because the gas will be\n // capped by the gas left in the (STATIC)CALL instruction.\n [user_gas.l2_gas.unwrap_or(MAX_FIELD_VALUE), user_gas.da_gas.unwrap_or(MAX_FIELD_VALUE)]\n}\n\n// Unconstrained opcode wrappers (do not use directly).\nunconstrained fn address() -> AztecAddress {\n address_opcode()\n}\nunconstrained fn sender() -> AztecAddress {\n sender_opcode()\n}\n// TODO(9396): Remove.\nunconstrained fn portal() -> EthAddress {\n portal_opcode()\n}\n// TODO(9396): Remove.\n//unconstrained fn function_selector() -> u32 {\n// function_selector_opcode()\n//}\nunconstrained fn transaction_fee() -> Field {\n transaction_fee_opcode()\n}\nunconstrained fn chain_id() -> Field {\n chain_id_opcode()\n}\nunconstrained fn version() -> Field {\n version_opcode()\n}\nunconstrained fn block_number() -> Field {\n block_number_opcode()\n}\nunconstrained fn timestamp() -> u64 {\n timestamp_opcode()\n}\nunconstrained fn fee_per_l2_gas() -> Field {\n fee_per_l2_gas_opcode()\n}\nunconstrained fn fee_per_da_gas() -> Field {\n fee_per_da_gas_opcode()\n}\nunconstrained fn l2_gas_left() -> Field {\n l2_gas_left_opcode()\n}\nunconstrained fn da_gas_left() -> Field {\n da_gas_left_opcode()\n}\nunconstrained fn is_static_call() -> Field {\n is_static_call_opcode()\n}\nunconstrained fn note_hash_exists(note_hash: Field, leaf_index: Field) -> u1 {\n note_hash_exists_opcode(note_hash, leaf_index)\n}\nunconstrained fn emit_note_hash(note_hash: Field) {\n emit_note_hash_opcode(note_hash)\n}\nunconstrained fn nullifier_exists(nullifier: Field, address: Field) -> u1 {\n nullifier_exists_opcode(nullifier, address)\n}\nunconstrained fn emit_nullifier(nullifier: Field) {\n emit_nullifier_opcode(nullifier)\n}\nunconstrained fn emit_unencrypted_log(message: [Field]) {\n emit_unencrypted_log_opcode(message)\n}\nunconstrained fn l1_to_l2_msg_exists(msg_hash: Field, msg_leaf_index: Field) -> u1 {\n l1_to_l2_msg_exists_opcode(msg_hash, msg_leaf_index)\n}\nunconstrained fn send_l2_to_l1_msg(recipient: EthAddress, content: Field) {\n send_l2_to_l1_msg_opcode(recipient, content)\n}\nunconstrained fn call(gas: [Field; 2], address: AztecAddress, args: [Field]) -> bool {\n call_opcode(gas, address, args)\n}\nunconstrained fn call_static(gas: [Field; 2], address: AztecAddress, args: [Field]) -> bool {\n call_static_opcode(gas, address, args)\n}\n\npub unconstrained fn calldata_copy(cdoffset: u32, copy_size: u32) -> [Field; N] {\n calldata_copy_opcode(cdoffset, copy_size)\n}\n\nunconstrained fn returndata_size() -> u32 {\n returndata_size_opcode()\n}\n\nunconstrained fn returndata_copy(rdoffset: u32, copy_size: u32) -> [Field] {\n returndata_copy_opcode(rdoffset, copy_size)\n}\n\npub unconstrained fn avm_return(returndata: [Field]) {\n return_opcode(returndata)\n}\n\n// This opcode reverts using the exact data given. In general it should only be used\n// to do rethrows, where the revert data is the same as the original revert data.\n// For normal reverts, use Noir's `assert` which, on top of reverting, will also add\n// an error selector to the revert data.\nunconstrained fn avm_revert(revertdata: [Field]) {\n revert_opcode(revertdata)\n}\n\nunconstrained fn storage_read(storage_slot: Field) -> Field {\n storage_read_opcode(storage_slot)\n}\n\nunconstrained fn storage_write(storage_slot: Field, value: Field) {\n storage_write_opcode(storage_slot, value);\n}\n\nimpl Empty for PublicContext {\n fn empty() -> Self {\n PublicContext::new(|| 0)\n }\n}\n\n// AVM oracles (opcodes) follow, do not use directly.\n#[oracle(avmOpcodeAddress)]\nunconstrained fn address_opcode() -> AztecAddress {}\n\n#[oracle(avmOpcodeSender)]\nunconstrained fn sender_opcode() -> AztecAddress {}\n\n#[oracle(avmOpcodePortal)]\nunconstrained fn portal_opcode() -> EthAddress {}\n\n// TODO(9396): Remove.\n//#[oracle(avmOpcodeFunctionSelector)]\n//unconstrained fn function_selector_opcode() -> u32 {}\n\n#[oracle(avmOpcodeTransactionFee)]\nunconstrained fn transaction_fee_opcode() -> Field {}\n\n#[oracle(avmOpcodeChainId)]\nunconstrained fn chain_id_opcode() -> Field {}\n\n#[oracle(avmOpcodeVersion)]\nunconstrained fn version_opcode() -> Field {}\n\n#[oracle(avmOpcodeBlockNumber)]\nunconstrained fn block_number_opcode() -> Field {}\n\n#[oracle(avmOpcodeTimestamp)]\nunconstrained fn timestamp_opcode() -> u64 {}\n\n#[oracle(avmOpcodeFeePerL2Gas)]\nunconstrained fn fee_per_l2_gas_opcode() -> Field {}\n\n#[oracle(avmOpcodeFeePerDaGas)]\nunconstrained fn fee_per_da_gas_opcode() -> Field {}\n\n#[oracle(avmOpcodeL2GasLeft)]\nunconstrained fn l2_gas_left_opcode() -> Field {}\n\n#[oracle(avmOpcodeDaGasLeft)]\nunconstrained fn da_gas_left_opcode() -> Field {}\n\n#[oracle(avmOpcodeIsStaticCall)]\nunconstrained fn is_static_call_opcode() -> Field {}\n\n#[oracle(avmOpcodeNoteHashExists)]\nunconstrained fn note_hash_exists_opcode(note_hash: Field, leaf_index: Field) -> u1 {}\n\n#[oracle(avmOpcodeEmitNoteHash)]\nunconstrained fn emit_note_hash_opcode(note_hash: Field) {}\n\n#[oracle(avmOpcodeNullifierExists)]\nunconstrained fn nullifier_exists_opcode(nullifier: Field, address: Field) -> u1 {}\n\n#[oracle(avmOpcodeEmitNullifier)]\nunconstrained fn emit_nullifier_opcode(nullifier: Field) {}\n\n#[oracle(avmOpcodeEmitUnencryptedLog)]\nunconstrained fn emit_unencrypted_log_opcode(message: [Field]) {}\n\n#[oracle(avmOpcodeL1ToL2MsgExists)]\nunconstrained fn l1_to_l2_msg_exists_opcode(msg_hash: Field, msg_leaf_index: Field) -> u1 {}\n\n#[oracle(avmOpcodeSendL2ToL1Msg)]\nunconstrained fn send_l2_to_l1_msg_opcode(recipient: EthAddress, content: Field) {}\n\n#[oracle(avmOpcodeCalldataCopy)]\nunconstrained fn calldata_copy_opcode(cdoffset: u32, copy_size: u32) -> [Field; N] {}\n\n#[oracle(avmOpcodeReturndataSize)]\nunconstrained fn returndata_size_opcode() -> u32 {}\n\n#[oracle(avmOpcodeReturndataCopy)]\nunconstrained fn returndata_copy_opcode(rdoffset: u32, copy_size: u32) -> [Field] {}\n\n#[oracle(avmOpcodeReturn)]\nunconstrained fn return_opcode(returndata: [Field]) {}\n\n// This opcode reverts using the exact data given. In general it should only be used\n// to do rethrows, where the revert data is the same as the original revert data.\n// For normal reverts, use Noir's `assert` which, on top of reverting, will also add\n// an error selector to the revert data.\n#[oracle(avmOpcodeRevert)]\nunconstrained fn revert_opcode(revertdata: [Field]) {}\n\n#[oracle(avmOpcodeCall)]\nunconstrained fn call_opcode(\n gas: [Field; 2], // gas allocation: [l2_gas, da_gas]\n address: AztecAddress,\n args: [Field],\n) -> bool {}\n\n#[oracle(avmOpcodeStaticCall)]\nunconstrained fn call_static_opcode(\n gas: [Field; 2], // gas allocation: [l2_gas, da_gas]\n address: AztecAddress,\n args: [Field],\n) -> bool {}\n\n#[oracle(avmOpcodeStorageRead)]\nunconstrained fn storage_read_opcode(storage_slot: Field) -> Field {}\n\n#[oracle(avmOpcodeStorageWrite)]\nunconstrained fn storage_write_opcode(storage_slot: Field, value: Field) {}\n","path":"/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.65.0/noir-projects/aztec-nr/aztec/src/context/public_context.nr"},"136":{"source":"use crate::utils::to_bytes::{arr_to_be_bytes_arr, str_to_be_bytes_arr};\nuse dep::protocol_types::{\n address::{AztecAddress, EthAddress},\n constants::{\n GENERATOR_INDEX__FUNCTION_ARGS, GENERATOR_INDEX__MESSAGE_NULLIFIER,\n GENERATOR_INDEX__SECRET_HASH,\n },\n hash::{poseidon2_hash_with_separator, poseidon2_hash_with_separator_slice, sha256_to_field},\n point::Point,\n traits::Hash,\n};\n\npub use dep::protocol_types::hash::{compute_siloed_nullifier, pedersen_hash};\n\npub fn pedersen_commitment(inputs: [Field; N], hash_index: u32) -> Point {\n std::hash::pedersen_commitment_with_separator(inputs, hash_index)\n}\n\npub fn compute_secret_hash(secret: Field) -> Field {\n poseidon2_hash_with_separator([secret], GENERATOR_INDEX__SECRET_HASH)\n}\n\npub fn compute_unencrypted_log_hash(\n contract_address: AztecAddress,\n log: [u8; N],\n) -> Field {\n let mut hash_bytes = [0; N + 36];\n // Address is converted to 32 bytes in ts\n let address_bytes: [u8; 32] = contract_address.to_field().to_be_bytes();\n for i in 0..32 {\n hash_bytes[i] = address_bytes[i];\n }\n let len_bytes: [u8; 4] = (N as Field).to_be_bytes();\n for i in 0..4 {\n hash_bytes[32 + i] = len_bytes[i];\n }\n for i in 0..N {\n hash_bytes[36 + i] = log[i];\n }\n\n sha256_to_field(hash_bytes)\n}\n\npub fn compute_l1_to_l2_message_hash(\n sender: EthAddress,\n chain_id: Field,\n recipient: AztecAddress,\n version: Field,\n content: Field,\n secret_hash: Field,\n leaf_index: Field,\n) -> Field {\n let mut hash_bytes = [0 as u8; 224];\n let sender_bytes: [u8; 32] = sender.to_field().to_be_bytes();\n let chain_id_bytes: [u8; 32] = chain_id.to_be_bytes();\n let recipient_bytes: [u8; 32] = recipient.to_field().to_be_bytes();\n let version_bytes: [u8; 32] = version.to_be_bytes();\n let content_bytes: [u8; 32] = content.to_be_bytes();\n let secret_hash_bytes: [u8; 32] = secret_hash.to_be_bytes();\n let leaf_index_bytes: [u8; 32] = leaf_index.to_be_bytes();\n\n for i in 0..32 {\n hash_bytes[i] = sender_bytes[i];\n hash_bytes[i + 32] = chain_id_bytes[i];\n hash_bytes[i + 64] = recipient_bytes[i];\n hash_bytes[i + 96] = version_bytes[i];\n hash_bytes[i + 128] = content_bytes[i];\n hash_bytes[i + 160] = secret_hash_bytes[i];\n hash_bytes[i + 192] = leaf_index_bytes[i];\n }\n\n sha256_to_field(hash_bytes)\n}\n\n// The nullifier of a l1 to l2 message is the hash of the message salted with the secret\npub fn compute_l1_to_l2_message_nullifier(message_hash: Field, secret: Field) -> Field {\n poseidon2_hash_with_separator([message_hash, secret], GENERATOR_INDEX__MESSAGE_NULLIFIER)\n}\n\npub struct ArgsHasher {\n pub fields: [Field],\n}\n\nimpl Hash for ArgsHasher {\n fn hash(self) -> Field {\n hash_args(self.fields)\n }\n}\n\nimpl ArgsHasher {\n pub fn new() -> Self {\n Self { fields: [] }\n }\n\n pub fn add(&mut self, field: Field) {\n self.fields = self.fields.push_back(field);\n }\n\n pub fn add_multiple(&mut self, fields: [Field; N]) {\n for i in 0..N {\n self.fields = self.fields.push_back(fields[i]);\n }\n }\n}\n\npub fn hash_args_array(args: [Field; N]) -> Field {\n if args.len() == 0 {\n 0\n } else {\n poseidon2_hash_with_separator(args, GENERATOR_INDEX__FUNCTION_ARGS)\n }\n}\n\npub fn hash_args(args: [Field]) -> Field {\n if args.len() == 0 {\n 0\n } else {\n poseidon2_hash_with_separator_slice(args, GENERATOR_INDEX__FUNCTION_ARGS)\n }\n}\n\n#[test]\nunconstrained fn compute_var_args_hash() {\n let mut input = ArgsHasher::new();\n for i in 0..100 {\n input.add(i as Field);\n }\n let hash = input.hash();\n dep::std::println(hash);\n assert(hash == 0x19b0d74feb06ebde19edd85a28986c97063e84b3b351a8b666c7cac963ce655f);\n}\n\n#[test]\nunconstrained fn compute_unenc_log_hash_array() {\n let contract_address = AztecAddress::from_field(\n 0x233a3e0df23b2b15b324194cb4a151f26c0b7333250781d34cc269d85dc334c6,\n );\n let log = [\n 0x20660de09f35f876e3e69d227b2a35166ad05f09d82d06366ec9b6f65a51fec2,\n 0x1b52bfe3b8689761916f76dc3d38aa8810860db325cd39ca611eed980091f01c,\n 0x2e559c4045c378a56ad13b9edb1e8de4e7ad3b3aa35cc7ba9ec77f7a68fa43a4,\n 0x25d0f689c4a4178a29d59306f2675824d19be6d25e44fa03b03f49c263053dd2,\n 0x2d513a722d6f352dc0961f156afdc5e31495b9f0e35cb069261a8e55e2df67fd,\n ];\n let serialized_log = arr_to_be_bytes_arr(log);\n let hash = compute_unencrypted_log_hash(contract_address, serialized_log);\n assert(hash == 0x0095b2d17ab72f4b27a341f7ac63e49ec73935ae8c9181a0ac02023eb12f3284);\n}\n\n#[test]\nunconstrained fn compute_unenc_log_hash_addr() {\n let contract_address = AztecAddress::from_field(\n 0x233a3e0df23b2b15b324194cb4a151f26c0b7333250781d34cc269d85dc334c6,\n );\n let log = AztecAddress::from_field(\n 0x26aa302d4715fd8a687453cb26d616b0768027bd54bcae56b09d908ecd9f8303,\n );\n let serialized_log: [u8; 32] = log.to_field().to_be_bytes();\n let hash = compute_unencrypted_log_hash(contract_address, serialized_log);\n assert(hash == 0x0083ab647dfb26e7ddee90a0f4209d049d4660cab42000c544b986aaa84c55a3);\n}\n\n#[test]\nunconstrained fn compute_unenc_log_hash_str() {\n let contract_address = AztecAddress::from_field(\n 0x1b401e1146c5c507962287065c81f0ef7590adae3802c533d7549d6bf0a41bd8,\n );\n let log = \"dummy\";\n let serialized_log = str_to_be_bytes_arr(log);\n let hash = compute_unencrypted_log_hash(contract_address, serialized_log);\n assert(hash == 0x00629e88ebd6374f44aa6cfe07e251ecf07213ebc7267e8f6b578ae57ffd6c20);\n}\n\n#[test]\nunconstrained fn compute_unenc_log_hash_longer_str() {\n let contract_address = AztecAddress::from_field(\n 0x1b401e1146c5c507962287065c81f0ef7590adae3802c533d7549d6bf0a41bd8,\n );\n let log = \"Hello this is a string\";\n let serialized_log = str_to_be_bytes_arr(log);\n let hash = compute_unencrypted_log_hash(contract_address, serialized_log);\n assert(hash == 0x0098637962f7d34fa202b7ffad8a07a238c5d1fd897b82a108f7f467fa73b841);\n}\n","path":"/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.65.0/noir-projects/aztec-nr/aztec/src/hash.nr"},"150":{"source":"/// Notifies the simulator that `args` will later be used at some point during execution, referenced by their hash. This\n/// allows the simulator to know how to respond to this future request.\n///\n/// This is only used during private execution, since in public it is the VM itself that keeps track of arguments.\npub fn pack_arguments(args: [Field]) {\n // This oracle call returns nothing: we only call it for its side effects. It is therefore always safe to call. When\n // unpacking however the caller must check that the returned value is indeed the preimage.\n unsafe { pack_arguments_oracle_wrapper(args) };\n}\n\n/// Same as `pack_arguments`, but using arrays instead of slices.\npub fn pack_arguments_array(args: [Field; N]) {\n // This oracle call returns nothing: we only call it for its side effects. It is therefore always safe to call. When\n // unpacking however the caller must check that the returned value is indeed the preimage.\n unsafe { pack_arguments_array_oracle_wrapper(args) };\n}\n\nunconstrained fn pack_arguments_oracle_wrapper(args: [Field]) {\n let _ = pack_arguments_oracle(args);\n}\n\nunconstrained fn pack_arguments_array_oracle_wrapper(args: [Field; N]) {\n let _ = pack_arguments_array_oracle(args);\n}\n\n#[oracle(packArguments)]\nunconstrained fn pack_arguments_oracle(_args: [Field]) -> Field {}\n\n#[oracle(packArgumentsArray)]\nunconstrained fn pack_arguments_array_oracle(_args: [Field; N]) -> Field {}\n","path":"/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.65.0/noir-projects/aztec-nr/aztec/src/oracle/arguments.nr"},"151":{"source":"use dep::protocol_types::{\n address::AztecAddress, constants::CONTRACT_INSTANCE_LENGTH, contract_class_id::ContractClassId,\n contract_instance::ContractInstance,\n};\n\n// NOTE: this is for use in private only\n#[oracle(getContractInstance)]\nunconstrained fn get_contract_instance_oracle(\n _address: AztecAddress,\n) -> [Field; CONTRACT_INSTANCE_LENGTH] {}\n\n// NOTE: this is for use in private only\nunconstrained fn get_contract_instance_internal(\n address: AztecAddress,\n) -> [Field; CONTRACT_INSTANCE_LENGTH] {\n get_contract_instance_oracle(address)\n}\n\n// NOTE: this is for use in private only\npub fn get_contract_instance(address: AztecAddress) -> ContractInstance {\n let instance =\n unsafe { ContractInstance::deserialize(get_contract_instance_internal(address)) };\n // The to_address function combines all values in the instance object to produce an address, so by checking that we\n // get the expected address we validate the entire struct.\n assert_eq(instance.to_address(), address);\n\n instance\n}\n\n// These oracles each return a ContractInstance member\n// plus a boolean indicating whether the instance was found.\n#[oracle(avmOpcodeGetContractInstanceDeployer)]\nunconstrained fn get_contract_instance_deployer_oracle_avm(\n _address: AztecAddress,\n) -> (Field, bool) {}\n#[oracle(avmOpcodeGetContractInstanceClassId)]\nunconstrained fn get_contract_instance_class_id_oracle_avm(\n _address: AztecAddress,\n) -> (Field, bool) {}\n#[oracle(avmOpcodeGetContractInstanceInitializationHash)]\nunconstrained fn get_contract_instance_initialization_hash_oracle_avm(\n _address: AztecAddress,\n) -> (Field, bool) {}\n\npub unconstrained fn get_contract_instance_deployer_internal_avm(\n address: AztecAddress,\n) -> (Field, bool) {\n get_contract_instance_deployer_oracle_avm(address)\n}\npub unconstrained fn get_contract_instance_class_id_internal_avm(\n address: AztecAddress,\n) -> (Field, bool) {\n get_contract_instance_class_id_oracle_avm(address)\n}\npub unconstrained fn get_contract_instance_initialization_hash_internal_avm(\n address: AztecAddress,\n) -> (Field, bool) {\n get_contract_instance_initialization_hash_oracle_avm(address)\n}\n\npub fn get_contract_instance_deployer_avm(address: AztecAddress) -> Option {\n let (member, exists) = get_contract_instance_deployer_internal_avm(address);\n if exists {\n Option::some(AztecAddress::from_field(member))\n } else {\n Option::none()\n }\n}\npub fn get_contract_instance_class_id_avm(address: AztecAddress) -> Option {\n let (member, exists) = get_contract_instance_class_id_internal_avm(address);\n if exists {\n Option::some(ContractClassId::from_field(member))\n } else {\n Option::none()\n }\n}\npub fn get_contract_instance_initialization_hash_avm(address: AztecAddress) -> Option {\n let (member, exists) = get_contract_instance_initialization_hash_internal_avm(address);\n if exists {\n Option::some(member)\n } else {\n Option::none()\n }\n}\n","path":"/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.65.0/noir-projects/aztec-nr/aztec/src/oracle/get_contract_instance.nr"},"158":{"source":"use dep::protocol_types::address::AztecAddress;\n\n#[oracle(getContractAddress)]\nunconstrained fn get_contract_address_oracle() -> AztecAddress {}\n\n#[oracle(getBlockNumber)]\nunconstrained fn get_block_number_oracle() -> u32 {}\n\n#[oracle(getChainId)]\nunconstrained fn get_chain_id_oracle() -> Field {}\n\n#[oracle(getVersion)]\nunconstrained fn get_version_oracle() -> Field {}\n\npub unconstrained fn get_contract_address() -> AztecAddress {\n get_contract_address_oracle()\n}\n\npub unconstrained fn get_block_number() -> u32 {\n get_block_number_oracle()\n}\n\npub unconstrained fn get_chain_id() -> Field {\n get_chain_id_oracle()\n}\n\npub unconstrained fn get_version() -> Field {\n get_version_oracle()\n}\n","path":"/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.65.0/noir-projects/aztec-nr/aztec/src/oracle/execution.nr"},"160":{"source":"use crate::note::{note_header::NoteHeader, note_interface::NoteInterface};\n\nuse dep::protocol_types::{\n address::AztecAddress,\n indexed_tagging_secret::{INDEXED_TAGGING_SECRET_LENGTH, IndexedTaggingSecret},\n utils::arr_copy_slice,\n};\n\n/// Notifies the simulator that a note has been created, so that it can be returned in future read requests in the same\n/// transaction. This note should only be added to the non-volatile database if found in an actual block.\npub fn notify_created_note(\n storage_slot: Field,\n note_type_id: Field,\n serialized_note: [Field; N],\n note_hash: Field,\n counter: u32,\n) {\n // This oracle call returns nothing: we only call it for its side effects. It is therefore always safe to call.\n unsafe {\n notify_created_note_oracle_wrapper(\n storage_slot,\n note_type_id,\n serialized_note,\n note_hash,\n counter,\n )\n };\n}\n\n/// Notifies the simulator that a note has been nullified, so that it is no longer returned in future read requests in\n/// the same transaction. This note should only be removed to the non-volatile database if its nullifier is found in an\n/// actual block.\npub fn notify_nullified_note(nullifier: Field, note_hash: Field, counter: u32) {\n // This oracle call returns nothing: we only call it for its side effects. It is therefore always safe to call.\n unsafe { notify_nullified_note_oracle_wrapper(nullifier, note_hash, counter) };\n}\n\nunconstrained fn notify_created_note_oracle_wrapper(\n storage_slot: Field,\n note_type_id: Field,\n serialized_note: [Field; N],\n note_hash: Field,\n counter: u32,\n) {\n let _ = notify_created_note_oracle(\n storage_slot,\n note_type_id,\n serialized_note,\n note_hash,\n counter,\n );\n}\n\n#[oracle(notifyCreatedNote)]\nunconstrained fn notify_created_note_oracle(\n _storage_slot: Field,\n _note_type_id: Field,\n _serialized_note: [Field; N],\n _note_hash: Field,\n _counter: u32,\n) -> Field {}\n\nunconstrained fn notify_nullified_note_oracle_wrapper(\n nullifier: Field,\n note_hash: Field,\n counter: u32,\n) {\n let _ = notify_nullified_note_oracle(nullifier, note_hash, counter);\n}\n\n#[oracle(notifyNullifiedNote)]\nunconstrained fn notify_nullified_note_oracle(\n _nullifier: Field,\n _note_hash: Field,\n _counter: u32,\n) -> Field {}\n\n#[oracle(getNotes)]\nunconstrained fn get_notes_oracle(\n _storage_slot: Field,\n _num_selects: u8,\n _select_by_indexes: [u8; N],\n _select_by_offsets: [u8; N],\n _select_by_lengths: [u8; N],\n _select_values: [Field; N],\n _select_comparators: [u8; N],\n _sort_by_indexes: [u8; N],\n _sort_by_offsets: [u8; N],\n _sort_by_lengths: [u8; N],\n _sort_order: [u8; N],\n _limit: u32,\n _offset: u32,\n _status: u8,\n _return_size: u32,\n _placeholder_fields: [Field; S],\n) -> [Field; S] {}\n\nunconstrained fn get_notes_oracle_wrapper(\n storage_slot: Field,\n num_selects: u8,\n select_by_indexes: [u8; N],\n select_by_offsets: [u8; N],\n select_by_lengths: [u8; N],\n select_values: [Field; N],\n select_comparators: [u8; N],\n sort_by_indexes: [u8; N],\n sort_by_offsets: [u8; N],\n sort_by_lengths: [u8; N],\n sort_order: [u8; N],\n limit: u32,\n offset: u32,\n status: u8,\n mut placeholder_fields: [Field; S],\n) -> [Field; S] {\n let return_size = placeholder_fields.len() as u32;\n get_notes_oracle(\n storage_slot,\n num_selects,\n select_by_indexes,\n select_by_offsets,\n select_by_lengths,\n select_values,\n select_comparators,\n sort_by_indexes,\n sort_by_offsets,\n sort_by_lengths,\n sort_order,\n limit,\n offset,\n status,\n return_size,\n placeholder_fields,\n )\n}\n\npub unconstrained fn get_notes(\n storage_slot: Field,\n num_selects: u8,\n select_by_indexes: [u8; M],\n select_by_offsets: [u8; M],\n select_by_lengths: [u8; M],\n select_values: [Field; M],\n select_comparators: [u8; M],\n sort_by_indexes: [u8; M],\n sort_by_offsets: [u8; M],\n sort_by_lengths: [u8; M],\n sort_order: [u8; M],\n limit: u32,\n offset: u32,\n status: u8,\n mut placeholder_opt_notes: [Option; S], // TODO: Remove it and use `limit` to initialize the note array.\n placeholder_fields: [Field; NS], // TODO: Remove it and use `limit` to initialize the note array.\n _placeholder_note_length: [Field; N], // Turbofish hack? Compiler breaks calculating read_offset unless we add this parameter\n) -> [Option; S]\nwhere\n Note: NoteInterface,\n{\n sync_notes_oracle_wrapper();\n let fields = get_notes_oracle_wrapper(\n storage_slot,\n num_selects,\n select_by_indexes,\n select_by_offsets,\n select_by_lengths,\n select_values,\n select_comparators,\n sort_by_indexes,\n sort_by_offsets,\n sort_by_lengths,\n sort_order,\n limit,\n offset,\n status,\n placeholder_fields,\n );\n let num_notes = fields[0] as u32;\n let contract_address = AztecAddress::from_field(fields[1]);\n for i in 0..placeholder_opt_notes.len() {\n if i < num_notes {\n // lengths named as per typescript.\n let return_header_length: u32 = 2; // num_notes & contract_address.\n let extra_preimage_length: u32 = 2; // nonce & note_hash_counter.\n let read_offset: u32 = return_header_length + i * (N + extra_preimage_length);\n let nonce = fields[read_offset];\n let note_hash_counter = fields[read_offset + 1] as u32;\n let header = NoteHeader { contract_address, nonce, storage_slot, note_hash_counter };\n let serialized_note = arr_copy_slice(fields, [0; N], read_offset + 2);\n let mut note = Note::deserialize_content(serialized_note);\n note.set_header(header);\n placeholder_opt_notes[i] = Option::some(note);\n };\n }\n placeholder_opt_notes\n}\n\n/// Returns true if the nullifier exists. Note that a `true` value can be constrained by proving existence of the\n/// nullifier, but a `false` value should not be relied upon since other transactions may emit this nullifier before the\n/// current transaction is included in a block. While this might seem of little use at first, certain design patterns\n/// benefit from this abstraction (see e.g. `PrivateMutable`).\npub unconstrained fn check_nullifier_exists(inner_nullifier: Field) -> bool {\n check_nullifier_exists_oracle(inner_nullifier) == 1\n}\n\n#[oracle(checkNullifierExists)]\nunconstrained fn check_nullifier_exists_oracle(_inner_nullifier: Field) -> Field {}\n\n/// Same as `get_app_tagging_secret_as_sender`, except it returns the derived tag as an array of bytes, ready to be included in a\n/// log.\npub unconstrained fn get_app_tag_bytes_as_sender(\n sender: AztecAddress,\n recipient: AztecAddress,\n) -> [u8; 32] {\n let tag = get_app_tagging_secret_as_sender(sender, recipient).compute_tag(recipient);\n tag.to_be_bytes()\n}\n\n/// Returns the tagging secret for a given sender and recipient pair, siloed for the current contract address.\n/// Includes the last known index used to send a note tagged with this secret.\n/// For this to work, PXE must know the ivpsk_m of the sender.\n/// For the recipient's side, only the address is needed.\npub unconstrained fn get_app_tagging_secret_as_sender(\n sender: AztecAddress,\n recipient: AztecAddress,\n) -> IndexedTaggingSecret {\n let result = get_app_tagging_secret_as_sender_oracle(sender, recipient);\n IndexedTaggingSecret::deserialize(result)\n}\n\n#[oracle(getAppTaggingSecretAsSender)]\nunconstrained fn get_app_tagging_secret_as_sender_oracle(\n _sender: AztecAddress,\n _recipient: AztecAddress,\n) -> [Field; INDEXED_TAGGING_SECRET_LENGTH] {}\n\n/// Notifies the simulator that a tag has been used in a note, and to therefore increment the associated index so that\n/// future notes get a different tag and can be discovered by the recipient.\n/// This change should only be persisted in a non-volatile database if the tagged log is found in an actual block -\n/// otherwise e.g. a reverting transaction can cause the sender to accidentally skip indices and later produce notes\n/// that are not found by the recipient.\npub fn increment_app_tagging_secret_index_as_sender(sender: AztecAddress, recipient: AztecAddress) {\n // This oracle call returns nothing: we only call it for its side effects. It is therefore always safe to call.\n unsafe {\n increment_app_tagging_secret_index_as_sender_wrapper(sender, recipient);\n }\n}\n\nunconstrained fn increment_app_tagging_secret_index_as_sender_wrapper(\n sender: AztecAddress,\n recipient: AztecAddress,\n) {\n increment_app_tagging_secret_index_as_sender_oracle(sender, recipient);\n}\n\n#[oracle(incrementAppTaggingSecretIndexAsSender)]\nunconstrained fn increment_app_tagging_secret_index_as_sender_oracle(\n _sender: AztecAddress,\n _recipient: AztecAddress,\n) {}\n\n/// Finds new notes that may have been sent to all registered accounts in PXE in the current contract and makes them available\n/// for later querying via the `get_notes` oracle.\npub fn sync_notes() {\n // This oracle call returns nothing: we only call it for its side effects. It is therefore always safe to call.\n unsafe {\n sync_notes_oracle_wrapper();\n }\n}\n\nunconstrained fn sync_notes_oracle_wrapper() {\n sync_notes_oracle();\n}\n\n#[oracle(syncNotes)]\nunconstrained fn sync_notes_oracle() {}\n","path":"/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.65.0/noir-projects/aztec-nr/aztec/src/oracle/notes.nr"},"161":{"source":"use dep::protocol_types::{abis::function_selector::FunctionSelector, address::AztecAddress};\n\n#[oracle(enqueuePublicFunctionCall)]\nunconstrained fn enqueue_public_function_call_oracle(\n _contract_address: AztecAddress,\n _function_selector: FunctionSelector,\n _args_hash: Field,\n _side_effect_counter: u32,\n _is_static_call: bool,\n) -> Field {}\n\npub unconstrained fn enqueue_public_function_call_internal(\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args_hash: Field,\n side_effect_counter: u32,\n is_static_call: bool,\n) -> Field {\n enqueue_public_function_call_oracle(\n contract_address,\n function_selector,\n args_hash,\n side_effect_counter,\n is_static_call,\n )\n}\n\n#[oracle(setPublicTeardownFunctionCall)]\nunconstrained fn set_public_teardown_function_call_oracle(\n _contract_address: AztecAddress,\n _function_selector: FunctionSelector,\n _args_hash: Field,\n _side_effect_counter: u32,\n _is_static_call: bool,\n) -> Field {}\n\npub unconstrained fn set_public_teardown_function_call_internal(\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args_hash: Field,\n side_effect_counter: u32,\n is_static_call: bool,\n) -> Field {\n set_public_teardown_function_call_oracle(\n contract_address,\n function_selector,\n args_hash,\n side_effect_counter,\n is_static_call,\n )\n}\n\npub fn notify_set_min_revertible_side_effect_counter(counter: u32) {\n unsafe { notify_set_min_revertible_side_effect_counter_oracle_wrapper(counter) };\n}\n\npub unconstrained fn notify_set_min_revertible_side_effect_counter_oracle_wrapper(counter: u32) {\n notify_set_min_revertible_side_effect_counter_oracle(counter);\n}\n\n#[oracle(notifySetMinRevertibleSideEffectCounter)]\nunconstrained fn notify_set_min_revertible_side_effect_counter_oracle(_counter: u32) {}\n","path":"/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.65.0/noir-projects/aztec-nr/aztec/src/oracle/enqueue_public_function_call.nr"},"162":{"source":"use dep::protocol_types::{address::AztecAddress, traits::Deserialize};\n\n#[oracle(storageRead)]\nunconstrained fn storage_read_oracle(\n address: Field,\n storage_slot: Field,\n block_number: Field,\n length: Field,\n) -> [Field; N] {}\n\npub unconstrained fn raw_storage_read(\n address: AztecAddress,\n storage_slot: Field,\n block_number: u32,\n) -> [Field; N] {\n storage_read_oracle(\n address.to_field(),\n storage_slot,\n block_number as Field,\n N as Field,\n )\n}\n\npub unconstrained fn storage_read(\n address: AztecAddress,\n storage_slot: Field,\n block_number: u32,\n) -> T\nwhere\n T: Deserialize,\n{\n T::deserialize(raw_storage_read(address, storage_slot, block_number))\n}\n\nmod tests {\n use crate::oracle::storage::{raw_storage_read, storage_read};\n use dep::protocol_types::address::AztecAddress;\n\n use crate::test::mocks::mock_struct::MockStruct;\n use std::test::OracleMock;\n\n global address = AztecAddress::from_field(29);\n global slot = 7;\n global block_number = 17;\n\n #[test]\n unconstrained fn test_raw_storage_read() {\n let written = MockStruct { a: 13, b: 42 };\n\n let _ = OracleMock::mock(\"storageRead\").returns(written.serialize());\n\n let read: [Field; 2] = raw_storage_read(address, slot, block_number);\n assert_eq(read[0], 13);\n assert_eq(read[1], 42);\n }\n\n #[test]\n unconstrained fn test_storage_read() {\n let written = MockStruct { a: 13, b: 42 };\n\n let _ = OracleMock::mock(\"storageRead\").returns(written.serialize());\n\n let read: MockStruct = storage_read(address, slot, block_number);\n assert_eq(read.a, 13);\n assert_eq(read.b, 42);\n }\n}\n","path":"/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.65.0/noir-projects/aztec-nr/aztec/src/oracle/storage.nr"},"177":{"source":"use dep::protocol_types::{\n abis::function_selector::FunctionSelector, address::AztecAddress,\n constants::GENERATOR_INDEX__CONSTRUCTOR, hash::poseidon2_hash_with_separator,\n};\n\nuse crate::{\n context::{PrivateContext, PublicContext},\n oracle::get_contract_instance::{\n get_contract_instance, get_contract_instance_deployer_avm,\n get_contract_instance_initialization_hash_avm,\n },\n};\n\npub fn mark_as_initialized_public(context: &mut PublicContext) {\n let init_nullifier =\n compute_unsiloed_contract_initialization_nullifier((*context).this_address());\n context.push_nullifier(init_nullifier);\n}\n\npub fn mark_as_initialized_private(context: &mut PrivateContext) {\n let init_nullifier =\n compute_unsiloed_contract_initialization_nullifier((*context).this_address());\n context.push_nullifier(init_nullifier);\n}\n\npub fn assert_is_initialized_public(context: &mut PublicContext) {\n let init_nullifier = compute_unsiloed_contract_initialization_nullifier(context.this_address());\n assert(context.nullifier_exists(init_nullifier, context.this_address()), \"Not initialized\");\n}\n\npub fn assert_is_initialized_private(context: &mut PrivateContext) {\n let init_nullifier = compute_unsiloed_contract_initialization_nullifier(context.this_address());\n context.push_nullifier_read_request(init_nullifier);\n}\n\nfn compute_unsiloed_contract_initialization_nullifier(address: AztecAddress) -> Field {\n address.to_field()\n}\n\npub fn assert_initialization_matches_address_preimage_public(context: PublicContext) {\n let address = context.this_address();\n let deployer = get_contract_instance_deployer_avm(address).unwrap();\n let initialization_hash = get_contract_instance_initialization_hash_avm(address).unwrap();\n let expected_init = compute_initialization_hash(context.selector(), context.get_args_hash());\n assert(initialization_hash == expected_init, \"Initialization hash does not match\");\n assert(\n (deployer.is_zero()) | (deployer == context.msg_sender()),\n \"Initializer address is not the contract deployer\",\n );\n}\n\npub fn assert_initialization_matches_address_preimage_private(context: PrivateContext) {\n let address = context.this_address();\n let instance = get_contract_instance(address);\n let expected_init = compute_initialization_hash(context.selector(), context.get_args_hash());\n assert(instance.initialization_hash == expected_init, \"Initialization hash does not match\");\n assert(\n (instance.deployer.is_zero()) | (instance.deployer == context.msg_sender()),\n \"Initializer address is not the contract deployer\",\n );\n}\n\npub fn compute_initialization_hash(\n init_selector: FunctionSelector,\n init_args_hash: Field,\n) -> Field {\n poseidon2_hash_with_separator(\n [init_selector.to_field(), init_args_hash],\n GENERATOR_INDEX__CONSTRUCTOR,\n )\n}\n","path":"/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.65.0/noir-projects/aztec-nr/aztec/src/initializer.nr"},"183":{"source":"use crate::{\n abis::function_selector::FunctionSelector,\n address::{\n partial_address::PartialAddress, salted_initialization_hash::SaltedInitializationHash,\n },\n constants::{\n AZTEC_ADDRESS_LENGTH, FUNCTION_TREE_HEIGHT, GENERATOR_INDEX__CONTRACT_ADDRESS_V1,\n MAX_FIELD_VALUE,\n },\n contract_class_id::ContractClassId,\n hash::{poseidon2_hash_with_separator, private_functions_root_from_siblings},\n merkle_tree::membership::MembershipWitness,\n public_keys::{IvpkM, NpkM, OvpkM, PublicKeys, TpkM},\n traits::{Deserialize, Empty, FromField, Serialize, ToField},\n utils,\n};\n\n// We do below because `use crate::point::Point;` does not work\nuse dep::std::embedded_curve_ops::EmbeddedCurvePoint as Point;\n\nuse crate::public_keys::AddressPoint;\nuse std::{\n ec::{pow, sqrt},\n embedded_curve_ops::{EmbeddedCurveScalar, fixed_base_scalar_mul as derive_public_key},\n};\n\n// Aztec address\npub struct AztecAddress {\n pub inner: Field,\n}\n\nimpl Eq for AztecAddress {\n fn eq(self, other: Self) -> bool {\n self.to_field() == other.to_field()\n }\n}\n\nimpl Empty for AztecAddress {\n fn empty() -> Self {\n Self { inner: 0 }\n }\n}\n\nimpl ToField for AztecAddress {\n fn to_field(self) -> Field {\n self.inner\n }\n}\n\nimpl FromField for AztecAddress {\n fn from_field(value: Field) -> AztecAddress {\n AztecAddress { inner: value }\n }\n}\n\nimpl Serialize for AztecAddress {\n fn serialize(self: Self) -> [Field; AZTEC_ADDRESS_LENGTH] {\n [self.to_field()]\n }\n}\n\nimpl Deserialize for AztecAddress {\n fn deserialize(fields: [Field; AZTEC_ADDRESS_LENGTH]) -> Self {\n FromField::from_field(fields[0])\n }\n}\n\nimpl AztecAddress {\n pub fn zero() -> Self {\n Self { inner: 0 }\n }\n\n pub fn to_address_point(self) -> AddressPoint {\n // We compute the address point by taking our address, setting it to x, and then solving for y in the\n // equation which defines our bn curve:\n // y^2 = x^3 - 17; x = address\n let x = self.inner;\n let y_squared = pow(x, 3) - 17;\n\n // TODO (#8970): Handle cases where we cannot recover a point from an address\n let mut y = sqrt(y_squared);\n\n // If we get a negative y coordinate (any y where y > MAX_FIELD_VALUE / 2), we pin it to the\n // positive one (any value where y <= MAX_FIELD_VALUE / 2) by subtracting it from the Field modulus\n // note: The field modulus is MAX_FIELD_VALUE + 1\n if (!(y.lt(MAX_FIELD_VALUE / 2) | y.eq(MAX_FIELD_VALUE / 2))) {\n y = (MAX_FIELD_VALUE + 1) - y;\n }\n\n AddressPoint { inner: Point { x: self.inner, y, is_infinite: false } }\n }\n\n pub fn compute(public_keys: PublicKeys, partial_address: PartialAddress) -> AztecAddress {\n let public_keys_hash = public_keys.hash();\n\n let pre_address = poseidon2_hash_with_separator(\n [public_keys_hash.to_field(), partial_address.to_field()],\n GENERATOR_INDEX__CONTRACT_ADDRESS_V1,\n );\n\n let address_point = derive_public_key(EmbeddedCurveScalar::from_field(pre_address)).add(\n public_keys.ivpk_m.to_point(),\n );\n\n // Note that our address is only the x-coordinate of the full address_point. This is okay because when people want to encrypt something and send it to us\n // they can recover our full point using the x-coordinate (our address itself). To do this, they recompute the y-coordinate according to the equation y^2 = x^3 - 17.\n // When they do this, they may get a positive y-coordinate (a value that is less than or equal to MAX_FIELD_VALUE / 2) or\n // a negative y-coordinate (a value that is more than MAX_FIELD_VALUE), and we cannot dictate which one they get and hence the recovered point may sometimes be different than the one\n // our secrect can decrypt. Regardless though, they should and will always encrypt using point with the positive y-coordinate by convention.\n // This ensures that everyone encrypts to the same point given an arbitrary x-coordinate (address). This is allowed because even though our original point may not have a positive y-coordinate,\n // with our original secret, we will be able to derive the secret to the point with the flipped (and now positive) y-coordinate that everyone encrypts to.\n AztecAddress::from_field(address_point.x)\n }\n\n pub fn compute_from_private_function(\n function_selector: FunctionSelector,\n function_vk_hash: Field,\n function_leaf_membership_witness: MembershipWitness,\n contract_class_artifact_hash: Field,\n contract_class_public_bytecode_commitment: Field,\n salted_initialization_hash: SaltedInitializationHash,\n public_keys: PublicKeys,\n ) -> Self {\n let private_functions_root = private_functions_root_from_siblings(\n function_selector,\n function_vk_hash,\n function_leaf_membership_witness.leaf_index,\n function_leaf_membership_witness.sibling_path,\n );\n\n let contract_class_id = ContractClassId::compute(\n contract_class_artifact_hash,\n private_functions_root,\n contract_class_public_bytecode_commitment,\n );\n\n // Compute contract address using the preimage which includes the class_id.\n let partial_address = PartialAddress::compute_from_salted_initialization_hash(\n contract_class_id,\n salted_initialization_hash,\n );\n\n AztecAddress::compute(public_keys, partial_address)\n }\n\n pub fn is_zero(self) -> bool {\n self.inner == 0\n }\n\n pub fn assert_is_zero(self) {\n assert(self.to_field() == 0);\n }\n\n pub fn conditional_assign(predicate: bool, lhs: Self, rhs: Self) -> Self {\n let result = utils::conditional_assign(predicate, rhs.to_field(), lhs.to_field());\n Self { inner: result }\n }\n}\n\n#[test]\nfn compute_address_from_partial_and_pub_keys() {\n let public_keys = PublicKeys {\n npk_m: NpkM {\n inner: Point {\n x: 0x22f7fcddfa3ce3e8f0cc8e82d7b94cdd740afa3e77f8e4a63ea78a239432dcab,\n y: 0x0471657de2b6216ade6c506d28fbc22ba8b8ed95c871ad9f3e3984e90d9723a7,\n is_infinite: false,\n },\n },\n ivpk_m: IvpkM {\n inner: Point {\n x: 0x111223493147f6785514b1c195bb37a2589f22a6596d30bb2bb145fdc9ca8f1e,\n y: 0x273bbffd678edce8fe30e0deafc4f66d58357c06fd4a820285294b9746c3be95,\n is_infinite: false,\n },\n },\n ovpk_m: OvpkM {\n inner: Point {\n x: 0x09115c96e962322ffed6522f57194627136b8d03ac7469109707f5e44190c484,\n y: 0x0c49773308a13d740a7f0d4f0e6163b02c5a408b6f965856b6a491002d073d5b,\n is_infinite: false,\n },\n },\n tpk_m: TpkM {\n inner: Point {\n x: 0x00d3d81beb009873eb7116327cf47c612d5758ef083d4fda78e9b63980b2a762,\n y: 0x2f567d22d2b02fe1f4ad42db9d58a36afd1983e7e2909d1cab61cafedad6193a,\n is_infinite: false,\n },\n },\n };\n\n let partial_address = PartialAddress::from_field(\n 0x0a7c585381b10f4666044266a02405bf6e01fa564c8517d4ad5823493abd31de,\n );\n\n let address = AztecAddress::compute(public_keys, partial_address);\n\n // The following value was generated by `derivation.test.ts`.\n // --> Run the test with AZTEC_GENERATE_TEST_DATA=1 flag to update test data.\n let expected_computed_address_from_partial_and_pubkeys =\n 0x24e4646f58b9fbe7d38e317db8d5636c423fbbdfbe119fc190fe9c64747e0c62;\n assert(address.to_field() == expected_computed_address_from_partial_and_pubkeys);\n}\n\n#[test]\nfn from_field_to_field() {\n let address = AztecAddress { inner: 37 };\n assert_eq(FromField::from_field(address.to_field()), address);\n}\n\n#[test]\nfn serde() {\n let address = AztecAddress { inner: 37 };\n assert_eq(Deserialize::deserialize(address.serialize()), address);\n}\n","path":"/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.65.0/noir-projects/noir-protocol-circuits/crates/types/src/address/aztec_address.nr"},"194":{"source":"use crate::traits::{Deserialize, Serialize};\n\nglobal BOOL_SERIALIZED_LEN: u32 = 1;\nglobal U8_SERIALIZED_LEN: u32 = 1;\nglobal U16_SERIALIZED_LEN: u32 = 1;\nglobal U32_SERIALIZED_LEN: u32 = 1;\nglobal U64_SERIALIZED_LEN: u32 = 1;\nglobal U128_SERIALIZED_LEN: u32 = 1;\nglobal FIELD_SERIALIZED_LEN: u32 = 1;\nglobal I8_SERIALIZED_LEN: u32 = 1;\nglobal I16_SERIALIZED_LEN: u32 = 1;\nglobal I32_SERIALIZED_LEN: u32 = 1;\nglobal I64_SERIALIZED_LEN: u32 = 1;\n\nimpl Serialize for bool {\n fn serialize(self) -> [Field; BOOL_SERIALIZED_LEN] {\n [self as Field]\n }\n}\n\nimpl Deserialize for bool {\n fn deserialize(fields: [Field; BOOL_SERIALIZED_LEN]) -> bool {\n fields[0] as bool\n }\n}\n\nimpl Serialize for u8 {\n fn serialize(self) -> [Field; U8_SERIALIZED_LEN] {\n [self as Field]\n }\n}\n\nimpl Deserialize for u8 {\n fn deserialize(fields: [Field; U8_SERIALIZED_LEN]) -> Self {\n fields[0] as u8\n }\n}\n\nimpl Serialize for u16 {\n fn serialize(self) -> [Field; U16_SERIALIZED_LEN] {\n [self as Field]\n }\n}\n\nimpl Deserialize for u16 {\n fn deserialize(fields: [Field; U16_SERIALIZED_LEN]) -> Self {\n fields[0] as u16\n }\n}\n\nimpl Serialize for u32 {\n fn serialize(self) -> [Field; U32_SERIALIZED_LEN] {\n [self as Field]\n }\n}\n\nimpl Deserialize for u32 {\n fn deserialize(fields: [Field; U32_SERIALIZED_LEN]) -> Self {\n fields[0] as u32\n }\n}\n\nimpl Serialize for u64 {\n fn serialize(self) -> [Field; U64_SERIALIZED_LEN] {\n [self as Field]\n }\n}\n\nimpl Deserialize for u64 {\n fn deserialize(fields: [Field; U64_SERIALIZED_LEN]) -> Self {\n fields[0] as u64\n }\n}\n\nimpl Serialize for U128 {\n fn serialize(self) -> [Field; U128_SERIALIZED_LEN] {\n [self.to_integer()]\n }\n}\n\nimpl Deserialize for U128 {\n fn deserialize(fields: [Field; U128_SERIALIZED_LEN]) -> Self {\n U128::from_integer(fields[0])\n }\n}\n\nimpl Serialize for Field {\n fn serialize(self) -> [Field; FIELD_SERIALIZED_LEN] {\n [self]\n }\n}\n\nimpl Deserialize for Field {\n fn deserialize(fields: [Field; FIELD_SERIALIZED_LEN]) -> Self {\n fields[0]\n }\n}\n\nimpl Serialize for i8 {\n fn serialize(self) -> [Field; I8_SERIALIZED_LEN] {\n [self as Field]\n }\n}\n\nimpl Deserialize for i8 {\n fn deserialize(fields: [Field; I8_SERIALIZED_LEN]) -> Self {\n fields[0] as i8\n }\n}\n\nimpl Serialize for i16 {\n fn serialize(self) -> [Field; I16_SERIALIZED_LEN] {\n [self as Field]\n }\n}\n\nimpl Deserialize for i16 {\n fn deserialize(fields: [Field; I16_SERIALIZED_LEN]) -> Self {\n fields[0] as i16\n }\n}\n\nimpl Serialize for i32 {\n fn serialize(self) -> [Field; I32_SERIALIZED_LEN] {\n [self as Field]\n }\n}\n\nimpl Deserialize for i32 {\n fn deserialize(fields: [Field; I32_SERIALIZED_LEN]) -> Self {\n fields[0] as i32\n }\n}\n\nimpl Serialize for i64 {\n fn serialize(self) -> [Field; I64_SERIALIZED_LEN] {\n [self as Field]\n }\n}\n\nimpl Deserialize for i64 {\n fn deserialize(fields: [Field; I64_SERIALIZED_LEN]) -> Self {\n fields[0] as i64\n }\n}\n\nimpl Serialize for [T; N]\nwhere\n T: Serialize,\n{\n fn serialize(self) -> [Field; N * M] {\n let mut result: [Field; N * M] = std::mem::zeroed();\n let mut serialized: [Field; M] = std::mem::zeroed();\n for i in 0..N {\n serialized = self[i].serialize();\n for j in 0..M {\n result[i * M + j] = serialized[j];\n }\n }\n result\n }\n}\n\nimpl Deserialize for [T; N]\nwhere\n T: Deserialize,\n{\n fn deserialize(fields: [Field; N * M]) -> Self {\n let mut reader = crate::utils::reader::Reader::new(fields);\n let mut result: [T; N] = std::mem::zeroed();\n reader.read_struct_array::(Deserialize::deserialize, result)\n }\n}\n\n#[test]\nfn test_u16_serialization() {\n let a: u16 = 10;\n assert_eq(a, u16::deserialize(a.serialize()));\n}\n\n#[test]\nfn test_i8_serialization() {\n let a: i8 = -10;\n assert_eq(a, i8::deserialize(a.serialize()));\n}\n\n#[test]\nfn test_i16_serialization() {\n let a: i16 = -10;\n assert_eq(a, i16::deserialize(a.serialize()));\n}\n\n#[test]\nfn test_i32_serialization() {\n let a: i32 = -10;\n assert_eq(a, i32::deserialize(a.serialize()));\n}\n\n#[test]\nfn test_i64_serialization() {\n let a: i64 = -10;\n assert_eq(a, i64::deserialize(a.serialize()));\n}\n","path":"/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.65.0/noir-projects/noir-protocol-circuits/crates/types/src/type_serialization.nr"},"212":{"source":"pub struct Reader {\n data: [Field; N],\n offset: u32,\n}\n\nimpl Reader {\n pub fn new(data: [Field; N]) -> Self {\n Self { data, offset: 0 }\n }\n\n pub fn read(&mut self) -> Field {\n let result = self.data[self.offset];\n self.offset += 1;\n result\n }\n\n pub fn read_u32(&mut self) -> u32 {\n self.read() as u32\n }\n\n pub fn read_bool(&mut self) -> bool {\n self.read() as bool\n }\n\n pub fn read_array(&mut self) -> [Field; K] {\n let mut result = [0; K];\n for i in 0..K {\n result[i] = self.data[self.offset + i];\n }\n self.offset += K;\n result\n }\n\n pub fn read_struct(&mut self, deserialise: fn([Field; K]) -> T) -> T {\n let result = deserialise(self.read_array());\n result\n }\n\n pub fn read_struct_array(\n &mut self,\n deserialise: fn([Field; K]) -> T,\n mut result: [T; C],\n ) -> [T; C] {\n for i in 0..C {\n result[i] = self.read_struct(deserialise);\n }\n result\n }\n\n pub fn finish(self) {\n assert(self.offset == self.data.len(), \"Reader did not read all data\");\n }\n}\n","path":"/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.65.0/noir-projects/noir-protocol-circuits/crates/types/src/utils/reader.nr"},"227":{"source":"use crate::meta::{derive_deserialize, derive_serialize};\nuse crate::utils::field::field_from_bytes;\n\n// Trait: is_empty\n//\n// The general is_empty trait checks if a data type is is empty,\n// and it defines empty for the basic data types as 0.\n//\n// If a Field is equal to zero, then it is regarded as zero.\n// We will go with this definition for now, however it can be problematic\n// if a value can actually be zero. In a future refactor, we can\n// use the optional type for safety. Doing it now would lead to a worse devex\n// and would make it harder to sync up with the cpp code.\n// Preferred over Default trait to convey intent, as default doesn't necessarily mean empty.\npub trait Empty {\n fn empty() -> Self;\n}\n\nimpl Empty for Field {\n fn empty() -> Self {\n 0\n }\n}\n\nimpl Empty for u1 {\n fn empty() -> Self {\n 0\n }\n}\nimpl Empty for u8 {\n fn empty() -> Self {\n 0\n }\n}\nimpl Empty for u32 {\n fn empty() -> Self {\n 0\n }\n}\nimpl Empty for u64 {\n fn empty() -> Self {\n 0\n }\n}\nimpl Empty for U128 {\n fn empty() -> Self {\n U128::from_integer(0)\n }\n}\n\npub fn is_empty(item: T) -> bool\nwhere\n T: Empty + Eq,\n{\n item.eq(T::empty())\n}\n\npub fn is_empty_array(array: [T; N]) -> bool\nwhere\n T: Empty + Eq,\n{\n array.all(|elem| is_empty(elem))\n}\n\npub trait Hash {\n fn hash(self) -> Field;\n}\n\npub trait ToField {\n fn to_field(self) -> Field;\n}\n\nimpl ToField for Field {\n fn to_field(self) -> Field {\n self\n }\n}\n\nimpl ToField for bool {\n fn to_field(self) -> Field {\n self as Field\n }\n}\nimpl ToField for u1 {\n fn to_field(self) -> Field {\n self as Field\n }\n}\nimpl ToField for u8 {\n fn to_field(self) -> Field {\n self as Field\n }\n}\nimpl ToField for u32 {\n fn to_field(self) -> Field {\n self as Field\n }\n}\nimpl ToField for u64 {\n fn to_field(self) -> Field {\n self as Field\n }\n}\nimpl ToField for U128 {\n fn to_field(self) -> Field {\n self.to_integer()\n }\n}\nimpl ToField for str {\n fn to_field(self) -> Field {\n assert(N < 32, \"String doesn't fit in a field, consider using Serialize instead\");\n field_from_bytes(self.as_bytes(), true)\n }\n}\n\npub trait FromField {\n fn from_field(value: Field) -> Self;\n}\n\nimpl FromField for Field {\n fn from_field(value: Field) -> Self {\n value\n }\n}\n\nimpl FromField for bool {\n fn from_field(value: Field) -> Self {\n value as bool\n }\n}\nimpl FromField for u1 {\n fn from_field(value: Field) -> Self {\n value as u1\n }\n}\nimpl FromField for u8 {\n fn from_field(value: Field) -> Self {\n value as u8\n }\n}\nimpl FromField for u32 {\n fn from_field(value: Field) -> Self {\n value as u32\n }\n}\nimpl FromField for u64 {\n fn from_field(value: Field) -> Self {\n value as u64\n }\n}\nimpl FromField for U128 {\n fn from_field(value: Field) -> Self {\n U128::from_integer(value)\n }\n}\n\n// docs:start:serialize\n#[derive_via(derive_serialize)]\npub trait Serialize {\n fn serialize(self) -> [Field; N];\n}\n// docs:end:serialize\n\nimpl Serialize for str {\n fn serialize(self) -> [Field; N] {\n let bytes = self.as_bytes();\n let mut fields = [0; N];\n for i in 0..bytes.len() {\n fields[i] = bytes[i] as Field;\n }\n fields\n }\n}\n\n// docs:start:deserialize\n#[derive_via(derive_deserialize)]\npub trait Deserialize {\n fn deserialize(fields: [Field; N]) -> Self;\n}\n// docs:end:deserialize\n\nimpl Deserialize for str {\n fn deserialize(fields: [Field; N]) -> Self {\n str::from(fields.map(|value| value as u8))\n }\n}\n","path":"/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.65.0/noir-projects/noir-protocol-circuits/crates/types/src/traits.nr"},"229":{"source":"use crate::{\n abis::{\n contract_class_function_leaf_preimage::ContractClassFunctionLeafPreimage,\n function_selector::FunctionSelector,\n log_hash::{LogHash, ScopedEncryptedLogHash, ScopedLogHash},\n note_hash::ScopedNoteHash,\n nullifier::ScopedNullifier,\n },\n address::{AztecAddress, EthAddress},\n constants::{\n FUNCTION_TREE_HEIGHT, GENERATOR_INDEX__NOTE_HASH_NONCE, GENERATOR_INDEX__OUTER_NULLIFIER,\n GENERATOR_INDEX__SILOED_NOTE_HASH, GENERATOR_INDEX__UNIQUE_NOTE_HASH,\n },\n merkle_tree::root::root_from_sibling_path,\n messaging::l2_to_l1_message::{L2ToL1Message, ScopedL2ToL1Message},\n traits::{is_empty, ToField},\n utils::field::field_from_bytes_32_trunc,\n};\nuse super::utils::field::field_from_bytes;\n\npub fn sha256_to_field(bytes_to_hash: [u8; N]) -> Field {\n let sha256_hashed = std::hash::sha256(bytes_to_hash);\n let hash_in_a_field = field_from_bytes_32_trunc(sha256_hashed);\n\n hash_in_a_field\n}\n\npub fn private_functions_root_from_siblings(\n selector: FunctionSelector,\n vk_hash: Field,\n function_leaf_index: Field,\n function_leaf_sibling_path: [Field; FUNCTION_TREE_HEIGHT],\n) -> Field {\n let function_leaf_preimage = ContractClassFunctionLeafPreimage { selector, vk_hash };\n let function_leaf = function_leaf_preimage.hash();\n root_from_sibling_path(\n function_leaf,\n function_leaf_index,\n function_leaf_sibling_path,\n )\n}\n\nfn compute_note_hash_nonce(tx_hash: Field, note_index_in_tx: u32) -> Field {\n // Hashing tx hash with note index in tx is guaranteed to be unique\n poseidon2_hash_with_separator(\n [tx_hash, note_index_in_tx as Field],\n GENERATOR_INDEX__NOTE_HASH_NONCE,\n )\n}\n\npub fn compute_unique_note_hash(nonce: Field, note_hash: Field) -> Field {\n let inputs = [nonce, note_hash];\n poseidon2_hash_with_separator(inputs, GENERATOR_INDEX__UNIQUE_NOTE_HASH)\n}\n\npub fn compute_siloed_note_hash(app: AztecAddress, unique_note_hash: Field) -> Field {\n poseidon2_hash_with_separator(\n [app.to_field(), unique_note_hash],\n GENERATOR_INDEX__SILOED_NOTE_HASH,\n )\n}\n\n/// Siloing in the context of Aztec refers to the process of hashing a note hash with a contract address (this way\n/// the note hash is scoped to a specific contract). This is used to prevent intermingling of notes between contracts.\npub fn silo_note_hash(note_hash: ScopedNoteHash, tx_hash: Field, note_index_in_tx: u32) -> Field {\n if note_hash.contract_address.is_zero() {\n 0\n } else {\n let nonce = compute_note_hash_nonce(tx_hash, note_index_in_tx);\n let unique_note_hash = compute_unique_note_hash(nonce, note_hash.value());\n compute_siloed_note_hash(note_hash.contract_address, unique_note_hash)\n }\n}\n\npub fn compute_siloed_nullifier(app: AztecAddress, nullifier: Field) -> Field {\n poseidon2_hash_with_separator(\n [app.to_field(), nullifier],\n GENERATOR_INDEX__OUTER_NULLIFIER,\n )\n}\n\npub fn silo_nullifier(nullifier: ScopedNullifier) -> Field {\n if nullifier.contract_address.is_zero() {\n nullifier.value() // Return value instead of 0 because the first nullifier's contract address is zero.\n } else {\n compute_siloed_nullifier(nullifier.contract_address, nullifier.value())\n }\n}\n\npub fn silo_encrypted_log_hash(log_hash: ScopedLogHash) -> Field {\n // We assume contract address has already been masked\n if log_hash.contract_address.is_zero() {\n 0\n } else {\n accumulate_sha256(\n [log_hash.contract_address.to_field(), log_hash.log_hash.value],\n )\n }\n}\n\npub fn mask_encrypted_log_hash(scoped_log: ScopedEncryptedLogHash) -> AztecAddress {\n if scoped_log.contract_address.is_zero() {\n AztecAddress::from_field(0)\n } else if (scoped_log.log_hash.randomness == 0) {\n scoped_log.contract_address\n } else {\n AztecAddress::from_field(poseidon2_hash_with_separator(\n [scoped_log.contract_address.to_field(), scoped_log.log_hash.randomness],\n 0,\n ))\n }\n}\n\nfn compute_siloed_unencrypted_log_hash(address: AztecAddress, log_hash: Field) -> Field {\n accumulate_sha256([address.to_field(), log_hash])\n}\n\npub fn silo_unencrypted_log_hash(log_hash: ScopedLogHash) -> Field {\n if log_hash.contract_address.is_zero() {\n 0\n } else {\n compute_siloed_unencrypted_log_hash(log_hash.contract_address, log_hash.value())\n }\n}\n\npub fn merkle_hash(left: Field, right: Field) -> Field {\n poseidon2_hash([left, right])\n}\n\npub fn compute_l2_to_l1_hash(\n contract_address: AztecAddress,\n recipient: EthAddress,\n content: Field,\n rollup_version_id: Field,\n chain_id: Field,\n) -> Field {\n let mut bytes: BoundedVec = BoundedVec::new();\n\n let inputs =\n [contract_address.to_field(), rollup_version_id, recipient.to_field(), chain_id, content];\n for i in 0..inputs.len() {\n // TODO are bytes be in fr.to_buffer() ?\n let item_bytes: [u8; 32] = inputs[i].to_be_bytes();\n for j in 0..32 {\n bytes.push(item_bytes[j]);\n }\n }\n\n sha256_to_field(bytes.storage())\n}\n\npub fn silo_l2_to_l1_message(\n msg: ScopedL2ToL1Message,\n rollup_version_id: Field,\n chain_id: Field,\n) -> Field {\n if msg.contract_address.is_zero() {\n 0\n } else {\n compute_l2_to_l1_hash(\n msg.contract_address,\n msg.message.recipient,\n msg.message.content,\n rollup_version_id,\n chain_id,\n )\n }\n}\n\n// Computes sha256 hash of 2 input hashes.\n//\n// NB: This method now takes in two 31 byte fields - it assumes that any input\n// is the result of a sha_to_field hash and => is truncated\n//\n// TODO(Jan and David): This is used for the encrypted_log hashes.\n// Can we check to see if we can just use hash_to_field or pedersen_compress here?\n//\npub fn accumulate_sha256(input: [Field; 2]) -> Field {\n // This is a note about the cpp code, since it takes an array of Fields\n // instead of a U128.\n // 4 Field elements when converted to bytes will usually\n // occupy 4 * 32 = 128 bytes.\n // However, this function is making the assumption that each Field\n // only occupies 128 bits.\n //\n // TODO(David): This does not seem to be getting guaranteed anywhere in the code?\n // Concatentate two fields into 32x2 = 64 bytes\n // accumulate_sha256 assumes that the inputs are pre-truncated 31 byte numbers\n let mut hash_input_flattened = [0; 64];\n for offset in 0..input.len() {\n let input_as_bytes: [u8; 32] = input[offset].to_be_bytes();\n for byte_index in 0..32 {\n hash_input_flattened[offset * 32 + byte_index] = input_as_bytes[byte_index];\n }\n }\n\n sha256_to_field(hash_input_flattened)\n}\n\n// Computes the final logs hash for a tx.\npub fn compute_tx_logs_hash(logs: [LogHash; N]) -> Field {\n // Convert each field element into a byte array and append the bytes to `hash_input_flattened`\n let mut hash_input_flattened = [0; N * 32];\n for offset in 0..N {\n // TODO: This is not checking that the decomposition is smaller than P\n let input_as_bytes: [u8; 32] = logs[offset].value.to_be_radix(256);\n for byte_index in 0..32 {\n hash_input_flattened[offset * 32 + byte_index] = input_as_bytes[byte_index];\n }\n }\n // Ideally we would push to a slice then hash, but there is no sha_slice\n // Hardcode to 256 bytes for now\n let mut hash = sha256_to_field(hash_input_flattened);\n // Not having a 0 value hash for empty logs causes issues with empty txs\n // used for padding. Returning early is currently unsupported.\n // We always provide sorted logs here, so 0 being empty means all are empty.\n if is_empty(logs[0]) {\n hash = 0;\n }\n hash\n}\n\npub fn verification_key_hash(key: [Field; N]) -> Field {\n crate::hash::poseidon2_hash(key)\n}\n\n#[inline_always]\npub fn pedersen_hash(inputs: [Field; N], hash_index: u32) -> Field {\n std::hash::pedersen_hash_with_separator(inputs, hash_index)\n}\n\npub fn poseidon2_hash(inputs: [Field; N]) -> Field {\n std::hash::poseidon2::Poseidon2::hash(inputs, N)\n}\n\n#[no_predicates]\npub fn poseidon2_hash_with_separator(inputs: [Field; N], separator: T) -> Field\nwhere\n T: ToField,\n{\n // We manually hash the inputs here, since we cannot express with the type system a constant size inputs array of N + 1\n let in_len = N + 1;\n let two_pow_64 = 18446744073709551616;\n let iv: Field = (in_len as Field) * two_pow_64;\n let mut sponge = std::hash::poseidon2::Poseidon2::new(iv);\n sponge.absorb(separator.to_field());\n\n for i in 0..inputs.len() {\n sponge.absorb(inputs[i]);\n }\n\n sponge.squeeze()\n}\n\npub fn poseidon2_hash_with_separator_slice(inputs: [Field], separator: T) -> Field\nwhere\n T: ToField,\n{\n let in_len = inputs.len() + 1;\n let two_pow_64 = 18446744073709551616;\n let iv: Field = (in_len as Field) * two_pow_64;\n let mut sponge = std::hash::poseidon2::Poseidon2::new(iv);\n sponge.absorb(separator.to_field());\n\n for i in 0..inputs.len() {\n sponge.absorb(inputs[i]);\n }\n\n sponge.squeeze()\n}\n\n#[no_predicates]\npub fn poseidon2_hash_bytes(inputs: [u8; N]) -> Field {\n // We manually hash the inputs here, since we cannot express with the type system a constant size inputs array of Math.ceil(N/31)\n let mut in_len = N / 31;\n let mut has_padding = false;\n if N % 31 != 0 {\n in_len += 1;\n has_padding = true;\n }\n\n let two_pow_64 = 18446744073709551616;\n let iv: Field = (in_len as Field) * two_pow_64;\n let mut sponge = std::hash::poseidon2::Poseidon2::new(iv);\n\n let mut current_field = [0; 31];\n for i in 0..inputs.len() {\n let index = i % 31;\n current_field[index] = inputs[i];\n if index == 30 {\n sponge.absorb(field_from_bytes(current_field, false));\n current_field = [0; 31];\n }\n }\n if has_padding {\n sponge.absorb(field_from_bytes(current_field, false));\n }\n\n sponge.squeeze()\n}\n\n#[test]\nfn smoke_sha256_to_field() {\n let full_buffer = [\n 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,\n 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,\n 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70,\n 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,\n 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,\n 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130,\n 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148,\n 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,\n ];\n let result = sha256_to_field(full_buffer);\n\n assert(result == 0x448ebbc9e1a31220a2f3830c18eef61b9bd070e5084b7fa2a359fe729184c7);\n\n // to show correctness of the current ver (truncate one byte) vs old ver (mod full bytes):\n let result_bytes = std::hash::sha256(full_buffer);\n let truncated_field = crate::utils::field::field_from_bytes_32_trunc(result_bytes);\n assert(truncated_field == result);\n let mod_res = result + (result_bytes[31] as Field);\n assert(mod_res == 0x448ebbc9e1a31220a2f3830c18eef61b9bd070e5084b7fa2a359fe729184e0);\n}\n\n#[test]\nfn compute_l2_l1_hash() {\n // All zeroes\n let hash_result =\n compute_l2_to_l1_hash(AztecAddress::from_field(0), EthAddress::zero(), 0, 0, 0);\n assert(hash_result == 0xb393978842a0fa3d3e1470196f098f473f9678e72463cb65ec4ab5581856c2);\n\n // Non-zero case\n let hash_result = compute_l2_to_l1_hash(\n AztecAddress::from_field(1),\n EthAddress::from_field(3),\n 5,\n 2,\n 4,\n );\n assert(hash_result == 0x3f88c1044a05e5340ed20466276500f6d45ca5603913b9091e957161734e16);\n}\n\n#[test]\nfn silo_l2_to_l1_message_matches_typescript() {\n let version = 4;\n let chainId = 5;\n\n let hash = silo_l2_to_l1_message(\n ScopedL2ToL1Message {\n message: L2ToL1Message { recipient: EthAddress::from_field(1), content: 2, counter: 0 },\n contract_address: AztecAddress::from_field(3),\n },\n version,\n chainId,\n );\n\n // The following value was generated by `l2_to_l1_message.test.ts`\n let hash_from_typescript = 0x00c6155d69febb9d5039b374dd4f77bf57b7c881709aa524a18acaa0bd57476a;\n\n assert_eq(hash, hash_from_typescript);\n}\n","path":"/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.65.0/noir-projects/noir-protocol-circuits/crates/types/src/hash.nr"},"262":{"source":"use crate::traits::{Deserialize, Empty, FromField, Serialize, ToField};\n\npub struct FunctionSelector {\n // 1st 4-bytes of abi-encoding of function.\n pub inner: u32,\n}\n\nimpl Eq for FunctionSelector {\n fn eq(self, function_selector: FunctionSelector) -> bool {\n function_selector.inner == self.inner\n }\n}\n\nimpl Serialize<1> for FunctionSelector {\n fn serialize(self: Self) -> [Field; 1] {\n [self.inner as Field]\n }\n}\n\nimpl Deserialize<1> for FunctionSelector {\n fn deserialize(fields: [Field; 1]) -> Self {\n Self { inner: fields[0] as u32 }\n }\n}\n\nimpl FromField for FunctionSelector {\n fn from_field(field: Field) -> Self {\n Self { inner: field as u32 }\n }\n}\n\nimpl ToField for FunctionSelector {\n fn to_field(self) -> Field {\n self.inner as Field\n }\n}\n\nimpl Empty for FunctionSelector {\n fn empty() -> Self {\n Self { inner: 0 as u32 }\n }\n}\n\nimpl FunctionSelector {\n pub fn from_u32(value: u32) -> Self {\n Self { inner: value }\n }\n\n pub fn from_signature(signature: str) -> Self {\n let bytes = signature.as_bytes();\n let hash = crate::hash::poseidon2_hash_bytes(bytes);\n\n // `hash` is automatically truncated to fit within 32 bits.\n FunctionSelector::from_field(hash)\n }\n\n pub fn zero() -> Self {\n Self { inner: 0 }\n }\n}\n\n#[test]\nfn test_is_valid_selector() {\n let selector = FunctionSelector::from_signature(\"IS_VALID()\");\n assert_eq(selector.to_field(), 0x73cdda47);\n}\n\n#[test]\nfn test_long_selector() {\n let selector =\n FunctionSelector::from_signature(\"foo_and_bar_and_baz_and_foo_bar_baz_and_bar_foo\");\n assert_eq(selector.to_field(), 0x7590a997);\n}\n","path":"/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.65.0/noir-projects/noir-protocol-circuits/crates/types/src/abis/function_selector.nr"},"311":{"source":"use crate::{hash::poseidon2_hash, traits::ToField};\n\npub fn derive_storage_slot_in_map(storage_slot: Field, key: K) -> Field\nwhere\n K: ToField,\n{\n poseidon2_hash([storage_slot, key.to_field()])\n}\n\nmod test {\n use crate::{address::AztecAddress, storage::map::derive_storage_slot_in_map};\n\n #[test]\n fn test_derive_storage_slot_in_map_matches_typescript() {\n let map_slot = 0x132258fb6962c4387ba659d9556521102d227549a386d39f0b22d1890d59c2b5;\n let key = AztecAddress::from_field(\n 0x302dbc2f9b50a73283d5fb2f35bc01eae8935615817a0b4219a057b2ba8a5a3f,\n );\n\n let slot = derive_storage_slot_in_map(map_slot, key);\n\n // The following value was generated by `map_slot.test.ts`\n let slot_from_typescript =\n 0x15b9fe39449affd8b377461263e9d2b610b9ad40580553500b4e41d9cbd887ac;\n\n assert_eq(slot, slot_from_typescript);\n }\n}\n","path":"/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.65.0/noir-projects/noir-protocol-circuits/crates/types/src/storage/map.nr"}}} \ No newline at end of file +{"noir_version":"1.0.0-beta.0+a46035ba69b0a659897fe25271c346e005925a6c-x8664","name":"SimpleLogging","functions":[{"name":"constructor","is_unconstrained":true,"custom_attributes":["public","initializer"],"abi":{"parameters":[],"return_type":null,"error_types":{"2233873454491509486":{"error_kind":"string","string":"Initializer address is not the contract deployer"},"5019202896831570965":{"error_kind":"string","string":"attempt to add with overflow"},"16761564377371454734":{"error_kind":"string","string":"Array index out of bounds"},"17618083556256589634":{"error_kind":"string","string":"Initialization hash does not match"},"17843811134343075018":{"error_kind":"string","string":"Stack too deep"}}},"bytecode":"H4sIAAAAAAAA/+VaT2skRRSvnume///cXUVQBHHBgyDdk4lJECES/62IIl4EF6TJ9OBANlmSUVhP8wn8FJ4EL3r04tG7F7+GngQvpkO9mV9+87pmknQFln0wVHe9V++9+tWrV9VVE5glBbYMTQEFLqYim9PX9qFp3yvAr57/9u17fDNKmmS3TP278WirqfSvRP8v9Aee/M9J9HvCP65bPQfzpX7si9htnP9aZhkTvvosY+azz3fX9PNn+9w5/w3sc/rdo88eH56Ms3fH49Ps7Ezaon8GdBZRrvM+6/wwmx2cHM9O08PZg+OzWXp8mL2XPT46eZKdVshOSO+Rfa4otgIq1/kquNeIv2/L+GaUiP462CxJ92KeNPz4HkeE9/O2zLG6Y5+7ZjWuGsTDmK6DjhcdOmoOHaGiIyIdL9lSMMKcW+a8ugN6DdnK4/5N++yK+wfH09k0PZp+n86mJ8cfpWff8AzgaOYVyhDfmM1nQEQ6X7Vlju4r9llGIQQdPMoR8HCU7zt01Bw6AkVHRDpet6XvFUkb5eCWbDfN6viVuRvhcTFK3zzNnqEWq1UFa7HfMqsxVCYWAd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HonrL18N4P8ePV1Iz/1tgFj46tvhPqvp5+jg/1RkO2PIfn5Q4QfP8QMO+c1w6cb2pJ6H8x7S7UZdsPjuOWyg9Qd1SxC59QiuYT4Zn7unjoQc0/8yM48chzYcvK+RPy/v0a2uUlRw7N282VMRzX1z3majOy/koCsBmIN5DTQ8LwAPt6ADQL3IFFAIxfOW9O9HZtfe/JGrldPQFYDsQYafsmZ4kvO7HuQ10CigUI+hCPXuyYg0ECogUgDWQ3EGshpIK+BRANpRgRoRsTIFVAj9xvtINRApIGsBhruXDp+BiGSHuQ1kGigoIBGTvlPQKCBUAORBrIaiDWQZkSgZkSMnKJLbCPkem/CkRNjp6GR01ETEGgg1ECkgawGYg3k8usIHDmRLQGJBgoKaPgrVB8Xajybc2T4G6sQ78sWHPYQzEcoH7H5yPA4MBjvH2s89yCngbwGEg0UFNDI0mECAg2EGog0kNVAmhHhNCPCaUaE04wIpxkRXjMihreyn5xOhjeFD3H5IVAfcfmIz0ckHwnZyPDSyOSkJfkTsORPwJI/AUv+BDy8HDKNuHxkuPddNyyD730gGF4ImUZCNjK83eM0AvkI5iOUj6R6fwDJ7/2Q3/vDqzLTiOQjIRchY/IRyEcwH6F8xOYjnI+4fMTnI5KP5Pc+5Hcl5Hcl5HclZHblZ/Pon+uX7fXN7v61Idp/vj/evm2fHg8P3/597v5z87Ld7bYPV88vT7f3d+8v91e7p9v2fxtz+PGLmhKDrP/dbnXUPARPF+Clfdi+YtQs/xOb5qjNkf8D","brillig_names":["constructor"]},{"name":"public_dispatch","is_unconstrained":true,"custom_attributes":["public"],"abi":{"parameters":[{"name":"selector","type":{"kind":"field"},"visibility":"private"}],"return_type":null,"error_types":{"206160798890201757":{"error_kind":"string","string":"Storage slot 0 not allowed. Storage slots must start from 1."},"2233873454491509486":{"error_kind":"string","string":"Initializer address is not the contract deployer"},"5019202896831570965":{"error_kind":"string","string":"attempt to add with overflow"},"10176877060487216746":{"error_kind":"string","string":"Function add_to_counter_public can only be called internally"},"13699457482007836410":{"error_kind":"string","string":"Not initialized"},"16541607464495309456":{"error_kind":"fmtstring","length":16,"item_types":[]},"16761564377371454734":{"error_kind":"string","string":"Array index out of bounds"},"17618083556256589634":{"error_kind":"string","string":"Initialization hash does not match"},"17843811134343075018":{"error_kind":"string","string":"Stack too deep"}}},"bytecode":"H4sIAAAAAAAA/+1d3YtkRxWvO909Hz3T87Hf2eiDRBBF5PbHzPTggyNrjBExEAkKPvVO98SBzewyOwmuIMyLihgfhEAeEzRq3gwElIAoCIEI/jU++qJ7N/d0/+bXv1tz73TV7hgtGO7tW3XPV51z6tSpqjuJm5Qkv9bptxNtdvNrOltpB4SVniLSx0QRU7+rfXxdyn/PQX0tINNLhDck/H7a6y0J/gLS313KYcaUj8GMAD9dyOHcOpnAZ16y0sp/ow7ZO4sP/5bzZ0vULkZ/RpR3elnQb7gyPn+dnOZzDuQxKw3t7f12p9/vI19ZaXhoMjrqkeRh8OfjwO8aXw2QY03wZPhbQu5JwdVgcZ3harq4tuvjDem3+3VqzzIogtWoCGtJ1MXo07qHb8S/JnidI74VrLqH7znB9+PCE9smG+60f3gmv2Y20iYaIo0bm2aHqHsOcHGpiTb2LPOr7+YvtUQ7K2uCJ+6/GuHkZ77+qxGseQFL2a3RhfZk71o/LBCe3fx3Olvp+PhGn234V3J6szJ47ZUX7u3dHY5eHB2/enToqLCLrcNzFlej4J0atMfiU1UXQDw7ne5OpzfcYvrUUForoCMJRIsVHkoDwt6KrGbjMHQxPO1jd2Z9tOMmOvJmfq/cTUL9thSH905C+JzTYYXhb7qow+s4rFgieopCgczkr+b3Y5O/NbhzZzg4Hty6e+8BMsGC5CsbckLI7NlCwW/lIPB+TdDQKKDPuQnj+MwXA1m7TxqelngvKbgaHn7GeBTNPkM8Lx5fjLoMdQGNaM/4WHHTxepagJvlvOqKZbMGdTgGc1ExkfGbOdovzk3gcjumtQl1LaqL1VecG4ile4uEZzkAHtMv7P/d/JrOVDpb625ad1cK8AbW6yHrLpaquss6vw51yBsXpdfGb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wzQ7NnhmbPDJ1Wd67WwdU6ulonV+vsat0tT5eNWWR+PmCJ37+uWnm5hWFmoQjpx4cJCPEnMied38ox5VRjvv1aDkJyjai6WnedY+DKOQZieQAFxYV1cLWOrtbJ1Tq7WhdX69HVenK1rq7Ws6d1dM1VdM1VdM1VdM1VdM1VdM1VdM1VvGGu5lxrzKfGUU8aD7LSOiHM79wSUm39MAljmlsHjpXWk+Cn02vXHBbbAoC3m2We3hL++KtfOcsgSLF+9s741ToFV+vgah1drZOrdXa1Lq7Wo6v15GpdXa275iq75iq75iq75iq75irfMFcFK40JZ22asphquhfjvGOdolJN97gITRLgqu5lxSLBAWmhe971AuBdMADeFQPA6t1Bdu5AjBtOINayynhletW2xSGKdwfRu4Pk3YF6d+BcGwLWjXKw7pSDdasc0nWqtFlHAIk9jYuncXPdsrVw2bppD9Zde7Bu24N13x6sG/dg3bkH69Y9WPfuwbp5D2ouUbdGWq2RztZIZ2ukszXS2Rpp151ocN2KBte9aHDdjAbX3Whw3Y5G1+1odN2ORtftaHTdjsbArtbF1Xp0tZ5craurdddcBddcBddcBddcBddcBddcBddcBddcBddcBddcBddcRddcRddcRddcRddcRddcRddcRddcRddcRddcRddcJddcJddcJddcJddcJddcJddcJddcJddcJddcJddcZddcZddcZddcZddcZddcZddcZddcZddcZddcZddcFddcFddcFddcFddcFddcFddcFddcFddcFddcFddcja65Gl1zNbrmanTN1eiaq9E1V6NrrkbXXI2uuRpdczW55mpyzdV0Za6SlGI10kpjTXPNk+Za+TdNI+K1MaGePjabXuS98KZBefOgvKVT3gRz4+lfcck7Dso7DcpbB+Wdx+StYVDeMCjvXvWyxrtXvazx7lUva7wH1UsdVC91UL3UQfVSB9XLPKhe5kH1Mnc7D1J53iHOS97d5mXkwjvRkvcvyct89v3065chFEI3TKAbJtgNE+qGCXfDRLphErthkrphot0w6WaOhW7mWOhmjoVu5ljoZo6FbuZY6GaOhW7mWPiZc6yEwkQra83MWBqzxCVvHZR3HpM3hkF5w6C8r1QS5v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6ma2PZzP1UT237up2pi0890kHVCOsg6IR1knZD4EH6m9Wo8ofkZR87PL3iFqB2SzZD1cqttCNghaIeQHcJ2iNgh0Q6xRx/t0V8/oVnKmXYS9UfIepHLNgTskNXox1J+ExfVN2m9KmUbwnaI2CHRDkl2iNoh2QxZ36LdhoAdYo8+26PP9uhfeJetp8Ps9OwsPsTwgopNqAs7RFw2ZUAWeXPhpWUFlBtAF16nVUDQAlpfwEE6HWuTZQGiFtD6T85hnqmmf13S0xZQbgCtn8hUA63/5FL24EAkLUDYAqIWELeApAUUW0CpBaQtoNwAunAuUQXUMiK0ZURoy4jQlhGhLSNCL4yIlAsoLyTgwvFMFZC2gHID6MKpRVSOPQOixRxx4SCiCohaQNwCkhZQbAGlFpC2gLIdpBcOQqmAoAWELaALI0K4gGJagLgFJC2g2AJKLSBtAeUG0IVPwSsgsK8j9MJHyhUQtYC4BbR+2ub2get66V7AVGQj6qKrS7fxbYOgBYQtIGoBrf/mk4KXR5SAC5C0gGILKLWAtAWUG0AXPvypgKAFhC0gagG1jAhqGRHUMiKoZURQy4iglhHBLSPiQl14PolupiUIW0DUAuIG0PpudyrTcpKwgKxGKfPcTY7LXrIZsv4wvQ0BO+TC5lOpJ4eQZAGiFhC3gKQFFFtAqQWkLaDcALp0wO82CFpALSNCW0aEtowIbRkR2jIitGVErD8Tb04n6ycF53IVRKYlhOwQtkPEDol2SDJPWtk+AWfzBJxDsEPADkE7hOyQ9ejHeVjmlBcQsUOiHZLsELVDshmy/uC6DalFfwVijz7Yo7/+wLoNETsk2iHJDlE7xJ77aM99tOc+2qOP9uijPfpojz7ao4/2UKI9lGQPJRlD+W36679vPz+8fff44cuEePqf/3x8//Xh08fXP7/+7+/5/7z7/PD4+PDXm78/f3r/4Y9/Pn948/jp/dP/uwuv//g9ZrhPgBOVp2jHlO6jpumv5zmJQe8Z6enPJ5rK6V45TxwmHv8H","brillig_names":["public_dispatch"]},{"name":"increase_counter_public","is_unconstrained":true,"custom_attributes":["public"],"abi":{"parameters":[{"name":"counter_id","type":{"kind":"field"},"visibility":"private"}],"return_type":null,"error_types":{"5019202896831570965":{"error_kind":"string","string":"attempt to add with overflow"},"13699457482007836410":{"error_kind":"string","string":"Not initialized"},"16761564377371454734":{"error_kind":"string","string":"Array index out of bounds"},"17843811134343075018":{"error_kind":"string","string":"Stack too deep"}}},"bytecode":"H4sIAAAAAAAA/9VZzWocRxDu0ezM/kneseSIQCDPMLO78mpvCsG3kJzyAJPdmSCwZSMpIYFA9jVyyTH3QC4JBHyzwQfji28GG/wgdouu2W9qalcrq9o/DUvPdFd/9VVVd3VvT2CWJXB1i70bQebI1en1SqaIldZIrjNilVGvXd119Rb0h4pGd5leTfzDdDzuCvYp8h91HaZP/xCmB/y07XC+XizxuS227Lh3nEM0pvP213dtXSbnI54e/Z3uCfxJl7XzH+aPEPwRrKiNqcePyhbzGV+nR0o2JaY5h1rvwY5P2YZI34ahZAPp2X77S9xz/vO97x7M7s+Lr+bz0+LsLGB2SfylchXM6AqYn3PMb3+6e/e4PC5O7/xyfHbewI4FbHreMrJtnBfKYZHyoy1Hrk6vV7KI2fClq20u+G8Nh0CNw+0Zn5PK+FVOjf3gV3tk2wv+ZEj4HT/8C8LvesEfV/7p+eFf+afvx/8V/20//KeEv+MH/4Dwb/jxT4U/8IOfEn7ixz/VGfSmF/xhxX/Xj3+q/Lbnxz8lnT9umWWhfYh0fwbteufVbLrJ+Qb19xhXXT5pFjB9xIf7h/Zz8t2+wDUR+ngO3hf07At6JKw9RawbilgdRaxdRawdRay2ItZNRaxtRSzNOMaKWJq+15wTiSJW/yO1MVLE0pz3A0UszVzYU8QKFbE08wSt7YHA8xbTEwp6wjV6+D5vy7r7Eum/5oc4r5D+nmn6xMd5JdrQr9J/ZUX/HAYMH/nEgn8olm2hj7BoH4oAC+VjsBHl8ZnGY9u5qxMBs8U4tE3THmwj/1ouJ8w2vE8MVtSEy9v4ekBeJO/7jt3vmlp+I/A1JykO0ncBq/M3aKefMfX5hmNj6Ef5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e+uyp8EhPxeUEvec8XtuzyoS+npWe0mf6IYM1z+CtMzBQLxioFwzUCwbqBQPzBgPzBgPzBgPzBgPzBgPzhgAeCOCBAB4I4IEAHgjggQAeCOCBAB4I4EEBPCiABwXwoAAeFMCDAnhQAA8K4EEBPCiABwp4oIAHCniggAcKeKCABwp4oIAHCniggAcV8KACHlTAgwp4UAEPKuBBBTyogAcV8KACHhjggQEeGOCBAR4Y4IEBHhjggQEeGOCBAR444IEDHjjggQMeOOCBAx444IEDHjjggR/3gMth44HtxCrT6rjINNfd1+t2zjqu8jnb+65DzvsVab9dEwuHYuHky+IwjcH90zzF4Vg4EgunxMLRWDg1Fo7FwvFQOJRi4VAsnFhVmWJVZYpVlSlWVaZYVZliVWWKVZXzpVU+3BFjFp/iXPrLUjngVJ7inPPL8o93q/7e06PsjRNwap2AWifIrRNw6wTSOkFpnUBbJ6itE7Qeydx6JEvrkSytR7K0HsnSeiRL65EsrUeynGEkl3RIYCcmWJd8CJaiU5waC8di4XgonJJi4RyvVyI64ojq1zhn/XsZFQ71W7pc+qd91QOOyRSnxMLRWDg1Fo7FwvFQOJpi4dD/w/HpolkvvXf49RpeORaOxMIpsXA0Fk6s7Si1WDgeCqemWDgUCydWVa6xqnKNVZVrrKpcY1XlGqgq7/rmr/lmOb9ZLd4OG96/rG8/nD3c/n5a/HMM8WnzeLu4e9kshgOJ72cRh/qVE89ylv5tDgOEzGfkPrzptG+mGVkZmrRvat+0nqHn+AM=","brillig_names":["increase_counter_public"]},{"name":"compute_note_hash_and_optionally_a_nullifier","is_unconstrained":true,"custom_attributes":[],"abi":{"parameters":[{"name":"contract_address","type":{"kind":"struct","path":"aztec::protocol_types::address::aztec_address::AztecAddress","fields":[{"name":"inner","type":{"kind":"field"}}]},"visibility":"private"},{"name":"nonce","type":{"kind":"field"},"visibility":"private"},{"name":"storage_slot","type":{"kind":"field"},"visibility":"private"},{"name":"note_type_id","type":{"kind":"field"},"visibility":"private"},{"name":"compute_nullifier","type":{"kind":"boolean"},"visibility":"private"},{"name":"serialized_note","type":{"kind":"array","length":0,"type":{"kind":"field"}},"visibility":"private"}],"return_type":{"abi_type":{"kind":"array","length":4,"type":{"kind":"field"}},"visibility":"public"},"error_types":{"16541607464495309456":{"error_kind":"fmtstring","length":16,"item_types":[]},"17843811134343075018":{"error_kind":"string","string":"Stack too deep"}}},"bytecode":"H4sIAAAAAAAA/9VZ227aQBBdsI2xiQmFP4jUt1ayCdc3pF7yHSiBL+gH+KEv7VeXFTv2YTypkJipykjRGs/6zNkz4931pufONjz99cJ1HNqB6xr12YW2vM0qRazSkmfvTnj274RndCc8Y0WePYGnb+l9S9z5nUvd+X3sOPFhn+gI/O5vQCzo79Bmoe2DXzExVSYMVgt/Uy5eM3dpyvyfs4CZ2uAvCX9og18S7y91i49jobhRaF/qVssXeMZbEa6xiAmXfH3wfWW+CHzfmA9r+DvzYd0TJ9JtAGNRrKuNdV5obCmMrfdO61yrHd4jrXNnWqMV5TxjfDh/4lNQn7rlM2C+GHwZ8yXgI/19+wT9eO5T6PcZ7vOajFy3hslPOUetLWoqNsA/2ULSneckri9jow91j0HPJ6aPxVqB+ljo7/WZvcOfrr2ltWssYnqiRqTZEPszXwa+uL6Mk4ffMcRBLOKRsP6fwu/H0A7gGXp+IsQfsPgXvIV7qBHHioR71N+/kx/D9cid6+cn9XfdeUpvU71aSHO2Hv66wc9s+B8JP7fBXxH+yAa/2cs8mODPS8IvbPhvCX9sUz/NXvLRhv+B8Ccm+IsDrbsfXGvN/BCup3Bfb+6uqmv2RBg/Z1yt9kRTxofrg+uv980ErhPBx3M4E+LMhDgSVqaI9aCI9fifjnGoiDVSxBorYmnmMVXE0tQrV8QqFLE0615TL8qjtE/ztgtteaNJ+zRF/Erap2l+u5PWVF+xoCGOL2H9fzCdRyY8qzmtOfSuUwyMXRjFvna9pviFwId454LvlkPZw3Jz3G6W29OWrFrNt00+C8aV38NvIpyPsb+09kv7PkWtS+m7fwy6eovBVzBfAj7iKH33j434X6M/xp8IPr7+X5vLqeuuhyM2bjzj2qmMuT3/k87mjeev5bXvJsXPXXe+/lfni6gP30vnAteJ4OP7k1yIkwtx7hGLn9Gjhr6uSae4bv1auVxv2n9w0VyUuMtzf8fiJ6z/r/Abx0btLXP+cb2vjs/74365f3tbvO6nDN9bH3T6A/vRhmkVHwAA","debug_symbols":"tdfRioQgFAbgd/HaC49aZq+yLIOVDYJYWC0s0buvDbO7w8zl8N8EJ06fIf7I2dngu+16CWmcFtZ+7CxOvVvDlEq1H5x1OcQYrpfH10ycD6tu/cvs0lkuq8sra5XkzKeBtVqUr8cQPWtrefCXRvPbaMxfY0XHJ2dWo+AKBdco2KDgBgVbEExCwGSCyRImK5isYXIFk2uYbGByA5NhGSRYBgmWQYJlkGAZJFgGCZZBei+DVt0by7a+0AZHNzjawmgpcDThaImjFY7WOLrC0bg0SlwaJS6NEpTGo1RfLgfXRX+fmcYt9Q8j1Po9+6dpas5T74ct+3Ou+h+pzkOsNNf6douXgsr/kTJlkbLQDw==","brillig_names":["compute_note_hash_and_optionally_a_nullifier"]},{"name":"sync_notes","is_unconstrained":true,"custom_attributes":[],"abi":{"parameters":[],"return_type":null,"error_types":{"17843811134343075018":{"error_kind":"string","string":"Stack too deep"}}},"bytecode":"H4sIAAAAAAAA/9VUyw6CMBBseURBOaiJ3kz8gyIYOJJ49x8akKMe8OKNT5eabbqpVRKlJkzSbEs3szNlW0oUKESPvAH9tGnIFdhBDCA6aN/tRgFr9hviQKs7JH/O0iQw+BtQ/5OfWtIvIPktnT+bAM+xVfzYi6w77UaIesKWZ/nPbHpe9fhc/MFnh32k1caghm+uIYci3RuYR4Y8iRlRd9prh/eV5YzJei7w++RVO67va/lrWIeafvmOFV/qrDMe1wmv+YFXVVrypcYv4KBzGnMvbGHe1wvY45yo3mjul/J0vZ0b0gNB8gCVxsvQjgYAAA==","debug_symbols":"nZLNCoQgFIXf5a5bpGY/vkoMYWUhiIbZwBC9+1g0QzO00c2FI+c7G78VetEuYyP1YGZg9QrKdNxJo31atwRaK5WSY3N9hnQ/CB39eeJ6j7Pj1gEjOAGhe2BZ6ulBKgEsx9sjAYQD+ySwnwX2aVgf3+5XGU1PosqK4ssgSg6IxkB5DFTEQGUERG4/vqKk+kCUlr/Q5uOTW8lbJU6xhkV3F8/caxJ/yk3WdKJfrNjlu3jnb42KBGM/66ff","brillig_names":["sync_notes"]},{"name":"add_to_counter_public","is_unconstrained":true,"custom_attributes":["public","internal"],"abi":{"parameters":[{"name":"counter_id","type":{"kind":"field"},"visibility":"private"}],"return_type":null,"error_types":{"206160798890201757":{"error_kind":"string","string":"Storage slot 0 not allowed. Storage slots must start from 1."},"5019202896831570965":{"error_kind":"string","string":"attempt to add with overflow"},"10176877060487216746":{"error_kind":"string","string":"Function add_to_counter_public can only be called internally"},"13699457482007836410":{"error_kind":"string","string":"Not initialized"},"16761564377371454734":{"error_kind":"string","string":"Array index out of bounds"},"17843811134343075018":{"error_kind":"string","string":"Stack too deep"}}},"bytecode":"H4sIAAAAAAAA/+1aS28jRRBuP8bv13qzu0hIcODADc3YTpzczCIeErCgXSTEDa9nvIq0sCgJiKP/AxIXfgZCHLgiceTOhZ/BASGRjrriL9/UjONkOgoSLVk9M1VT76rurnHJrEfJzVW6NwrOzM3h9UZUIK3wgpB5SmQp9cxdNN19GeCVApVuEt8i6e+Hk0lT0a9A+cdNR9OnfYSmB/ph3dF5a7Wmz7rY0XX3GEPyTuP013bPmoTnw58e7R3eVeQXXlbPd8keZbBHKWM25qL/ZJTJZowzK0ingdns10qBelQBNitYB+RfJR2qBeoQFK/DaGDS9Vj4dE5/A3c9/+aLj75avIiTN+P4KDk+LpFegSK/NrahWduC5ktM89HXz58fLg+To7e/PTw+SdGuK7TlupyhG8uFeDjYX0UvygHp8IqbbS34EGzSZ5s8Sb6Mk6Pb5DpDqgSKTDWCCe5rbrZqf+yu/aVKFDdJnuJor5fUNuhd4BKykHLUMekhsC7wLhOsR3IhrA8wLn8DgNUIdgdgAcGGANPKpYwK3aMNbVw8Ab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BiKN9tkztd2L3YjzoJBdz0dZs/7RWd3LjRYjiuVWeHlfq/wZifNBj7kwbjftBgXDPVBWX4aAEEOT83XDMFoxBnM6vaQpzNLFQLcTaz9izE2cxyshBnMyvEfJy+nRvKvJ/ilFAwaGJyc1JYHUFp5+6zBaG0c+t+DRSpJrs3fDscQWnnPv8FoagOJYbSzhMEC0Jp53GDKij29O8LfFxo27mXvQaKmv5hzPDrPFOgoa1uF4TC06cUoPD0KQUoPH2Knq6pSa1tBEV1KDEUnj6lAIWnTylAaefZpQWhtPPA5YJQeDraPJSGtr9dEApPR1uAwtPRFqB0R5uAojqUGEp3tAko3dEmoHRHm4DC1NHa6RYu7X0EhamjzUJpaEvcBaEwdbR5KDzNG55uC0WMrtE2tLfsglB4mrcCFJ7mrQCFp3krQOFp3gpQeJq3PJSGdtpdEApP81aAwvNyZAFKd7QJKKpDiaEwdbRaTVBMdJGpoX2HF4TC1NHmoTB1tHkoTB1tFkpDeyUvCIWpo81D6beMxreMKp6OtgBFdSgxFJ6OtgCFgXkb42Tgx8Y4GVisQ5zt7NRfiDM5n1aF41s9368f0ht5ehW68SbqJb3NZV6i6iW6XvLNgjv3CDB8t8FeXuQoIk8QfbeBWV4kKSKgiJAiUhSRpogoGWEpGWEpGWEpGeEoGeEoGZHenydbTtJb3XgZdgzyGEtsvcTVS3y1JL2NRF4iq4uWry/Avr4A+/oC7OsLcPrR57zE1kvSs29CWnob3ZuTfvw4J8H0w7l5iayXQL0E6yWqXlKa/YSkevZR2HqJq5f4akn6QZa8RNZLoF6C9RJVL9H1kvrZl/WzL+tnX9bPPtTPPtRPJdRPJdRPJVRO5dfw6u/7/fr+YfP8NigOb35sH9/Xu+3x5fs/r+Gdh/16s1m/3L3ud4/PTx/757vN7vHw3kocf/zCYSmEWg9DGc8pK2+sObw4nC1O3DgYehx6/Rc=","brillig_names":["add_to_counter_public"]},{"name":"get_counter_value","is_unconstrained":true,"custom_attributes":[],"abi":{"parameters":[{"name":"counter_id","type":{"kind":"field"},"visibility":"private"}],"return_type":{"abi_type":{"kind":"field"},"visibility":"public"},"error_types":{"206160798890201757":{"error_kind":"string","string":"Storage slot 0 not allowed. Storage slots must start from 1."},"5019202896831570965":{"error_kind":"string","string":"attempt to add with overflow"},"16761564377371454734":{"error_kind":"string","string":"Array index out of bounds"},"17843811134343075018":{"error_kind":"string","string":"Stack too deep"}}},"bytecode":"H4sIAAAAAAAA/9VaP28jRRSfjf+unbV9ueROCAmJAtFQ7Dp2nFAZjoYGCYSQKJd4c5yARCShtxAFLRIlPQ0fgwLRQIXEl6CgpCJzzLN//u3btZPsWNxI1uzOe/P+vzczOw7Mfy1wP9vqMMZNxqauj+/XkgppxQHLGWyoTKCMvekeQve+A/BahQYIFVmqon8cj8ahyetcofyHoaPp0z5C0wP9uOXoPJkv6bMutkVmNUlwTvvmtwt4tr0D9GSOT1vd+Hrk2VbJQ1NsH2uDX92ztUXPPT/Nrt/+/OL0s/e++uKT7JIzDSXVxrFZqntLqk8uzq8v09Prt2azy+zqiimU5T1T7QDVT9Nn5+/OmFrjbtQ+yi6vnl2cM7XmhtTEny0Ym7o+vl9LJJ7bJBvyxdpUZc3Q6i5HAvLvkKxVx3VA/EQeto/Evdiuo8g6UGAteEYY8ukofDRa7CO04bQae8SRyduD+aJMFfpitGlsCP+O8RqrSZnP0D4cG11F1oECC+i5q/DpKny2RatvimP9rvGM8wUvVOZNXR/frg15gH0ivJHvLoxXGD/jTeNZ+HdM3hc+4nmX5CmKDbFdpMg6UGAcg5HCJ1L4vEi0JEa3lRuRMi8o6IUPj5WtKSHpgzJwTdDWyLCET1fhU7a+3FUfTeayvL8tH891ItbstUt6RBXq0SOcacV6YL70iHffjw0XZ9GBH/pDof/AD/3FnhzPVxID9szwPozbn5xKGmaZizh3AHDE/xpofuie+8r8qIAfnq0Qv1fA72PXi/2afuwX7wFdQ7w8f6c4E99JbGMTGMYl13aMKa6TqBfXtocAQ39x4xM12sKecX4HuownTYsRXgsbih4Cayp6aOtRWW1vEA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jNCfIzgiSbEzTniJBzjgg554iQc44IOeeIkHOOiPwMYxdPJ/n5tzwP84R6mYTkJ/u5HCLrQ1R9iK4PMdUnLVV/Alb1J2BVfwLW9Sfg/EwHl0NEfUh+75twWHrrkxBVH6LrQ0x9iK0PcfUhvjrElPZ+JqR+75v6vZ//q6HLIao+RNeH1H/2Tf1n39R/9k39Z9/Wf/Zt/d639Xvf1u99W7/3bf3et/W70tbvSlu/K13lrvwcHv11v1/fP2xWr0PE+OT79vFtvdseH779/RKeedivN5v1893Lfve4enrfr+42u8fxuQU7/vNTOL+UnP0a12scHzKxFMyOD/nhWbkUTg+vOrzyPw==","brillig_names":["get_counter_value"]},{"name":"increase_counter_private","is_unconstrained":false,"custom_attributes":["private"],"abi":{"parameters":[{"name":"inputs","type":{"kind":"struct","path":"aztec::context::inputs::private_context_inputs::PrivateContextInputs","fields":[{"name":"call_context","type":{"kind":"struct","path":"aztec::protocol_types::abis::call_context::CallContext","fields":[{"name":"msg_sender","type":{"kind":"struct","path":"aztec::protocol_types::address::aztec_address::AztecAddress","fields":[{"name":"inner","type":{"kind":"field"}}]}},{"name":"contract_address","type":{"kind":"struct","path":"aztec::protocol_types::address::aztec_address::AztecAddress","fields":[{"name":"inner","type":{"kind":"field"}}]}},{"name":"function_selector","type":{"kind":"struct","path":"aztec::protocol_types::abis::function_selector::FunctionSelector","fields":[{"name":"inner","type":{"kind":"integer","sign":"unsigned","width":32}}]}},{"name":"is_static_call","type":{"kind":"boolean"}}]}},{"name":"historical_header","type":{"kind":"struct","path":"aztec::protocol_types::header::Header","fields":[{"name":"last_archive","type":{"kind":"struct","path":"aztec::protocol_types::abis::append_only_tree_snapshot::AppendOnlyTreeSnapshot","fields":[{"name":"root","type":{"kind":"field"}},{"name":"next_available_leaf_index","type":{"kind":"integer","sign":"unsigned","width":32}}]}},{"name":"content_commitment","type":{"kind":"struct","path":"aztec::protocol_types::content_commitment::ContentCommitment","fields":[{"name":"num_txs","type":{"kind":"field"}},{"name":"txs_effects_hash","type":{"kind":"field"}},{"name":"in_hash","type":{"kind":"field"}},{"name":"out_hash","type":{"kind":"field"}}]}},{"name":"state","type":{"kind":"struct","path":"aztec::protocol_types::state_reference::StateReference","fields":[{"name":"l1_to_l2_message_tree","type":{"kind":"struct","path":"aztec::protocol_types::abis::append_only_tree_snapshot::AppendOnlyTreeSnapshot","fields":[{"name":"root","type":{"kind":"field"}},{"name":"next_available_leaf_index","type":{"kind":"integer","sign":"unsigned","width":32}}]}},{"name":"partial","type":{"kind":"struct","path":"aztec::protocol_types::partial_state_reference::PartialStateReference","fields":[{"name":"note_hash_tree","type":{"kind":"struct","path":"aztec::protocol_types::abis::append_only_tree_snapshot::AppendOnlyTreeSnapshot","fields":[{"name":"root","type":{"kind":"field"}},{"name":"next_available_leaf_index","type":{"kind":"integer","sign":"unsigned","width":32}}]}},{"name":"nullifier_tree","type":{"kind":"struct","path":"aztec::protocol_types::abis::append_only_tree_snapshot::AppendOnlyTreeSnapshot","fields":[{"name":"root","type":{"kind":"field"}},{"name":"next_available_leaf_index","type":{"kind":"integer","sign":"unsigned","width":32}}]}},{"name":"public_data_tree","type":{"kind":"struct","path":"aztec::protocol_types::abis::append_only_tree_snapshot::AppendOnlyTreeSnapshot","fields":[{"name":"root","type":{"kind":"field"}},{"name":"next_available_leaf_index","type":{"kind":"integer","sign":"unsigned","width":32}}]}}]}}]}},{"name":"global_variables","type":{"kind":"struct","path":"aztec::protocol_types::abis::global_variables::GlobalVariables","fields":[{"name":"chain_id","type":{"kind":"field"}},{"name":"version","type":{"kind":"field"}},{"name":"block_number","type":{"kind":"field"}},{"name":"slot_number","type":{"kind":"field"}},{"name":"timestamp","type":{"kind":"integer","sign":"unsigned","width":64}},{"name":"coinbase","type":{"kind":"struct","path":"aztec::protocol_types::address::eth_address::EthAddress","fields":[{"name":"inner","type":{"kind":"field"}}]}},{"name":"fee_recipient","type":{"kind":"struct","path":"aztec::protocol_types::address::aztec_address::AztecAddress","fields":[{"name":"inner","type":{"kind":"field"}}]}},{"name":"gas_fees","type":{"kind":"struct","path":"aztec::protocol_types::abis::gas_fees::GasFees","fields":[{"name":"fee_per_da_gas","type":{"kind":"field"}},{"name":"fee_per_l2_gas","type":{"kind":"field"}}]}}]}},{"name":"total_fees","type":{"kind":"field"}},{"name":"total_mana_used","type":{"kind":"field"}}]}},{"name":"tx_context","type":{"kind":"struct","path":"aztec::protocol_types::transaction::tx_context::TxContext","fields":[{"name":"chain_id","type":{"kind":"field"}},{"name":"version","type":{"kind":"field"}},{"name":"gas_settings","type":{"kind":"struct","path":"aztec::protocol_types::abis::gas_settings::GasSettings","fields":[{"name":"gas_limits","type":{"kind":"struct","path":"aztec::protocol_types::abis::gas::Gas","fields":[{"name":"da_gas","type":{"kind":"integer","sign":"unsigned","width":32}},{"name":"l2_gas","type":{"kind":"integer","sign":"unsigned","width":32}}]}},{"name":"teardown_gas_limits","type":{"kind":"struct","path":"aztec::protocol_types::abis::gas::Gas","fields":[{"name":"da_gas","type":{"kind":"integer","sign":"unsigned","width":32}},{"name":"l2_gas","type":{"kind":"integer","sign":"unsigned","width":32}}]}},{"name":"max_fees_per_gas","type":{"kind":"struct","path":"aztec::protocol_types::abis::gas_fees::GasFees","fields":[{"name":"fee_per_da_gas","type":{"kind":"field"}},{"name":"fee_per_l2_gas","type":{"kind":"field"}}]}}]}}]}},{"name":"start_side_effect_counter","type":{"kind":"integer","sign":"unsigned","width":32}}]},"visibility":"private"},{"name":"counter_id","type":{"kind":"field"},"visibility":"private"}],"return_type":{"abi_type":{"kind":"struct","path":"aztec::protocol_types::abis::private_circuit_public_inputs::PrivateCircuitPublicInputs","fields":[{"name":"call_context","type":{"kind":"struct","path":"aztec::protocol_types::abis::call_context::CallContext","fields":[{"name":"msg_sender","type":{"kind":"struct","path":"aztec::protocol_types::address::aztec_address::AztecAddress","fields":[{"name":"inner","type":{"kind":"field"}}]}},{"name":"contract_address","type":{"kind":"struct","path":"aztec::protocol_types::address::aztec_address::AztecAddress","fields":[{"name":"inner","type":{"kind":"field"}}]}},{"name":"function_selector","type":{"kind":"struct","path":"aztec::protocol_types::abis::function_selector::FunctionSelector","fields":[{"name":"inner","type":{"kind":"integer","sign":"unsigned","width":32}}]}},{"name":"is_static_call","type":{"kind":"boolean"}}]}},{"name":"args_hash","type":{"kind":"field"}},{"name":"returns_hash","type":{"kind":"field"}},{"name":"min_revertible_side_effect_counter","type":{"kind":"integer","sign":"unsigned","width":32}},{"name":"is_fee_payer","type":{"kind":"boolean"}},{"name":"max_block_number","type":{"kind":"struct","path":"aztec::protocol_types::abis::max_block_number::MaxBlockNumber","fields":[{"name":"_opt","type":{"kind":"struct","path":"std::option::Option","fields":[{"name":"_is_some","type":{"kind":"boolean"}},{"name":"_value","type":{"kind":"integer","sign":"unsigned","width":32}}]}}]}},{"name":"note_hash_read_requests","type":{"kind":"array","length":16,"type":{"kind":"struct","path":"aztec::protocol_types::abis::read_request::ReadRequest","fields":[{"name":"value","type":{"kind":"field"}},{"name":"counter","type":{"kind":"integer","sign":"unsigned","width":32}}]}}},{"name":"nullifier_read_requests","type":{"kind":"array","length":16,"type":{"kind":"struct","path":"aztec::protocol_types::abis::read_request::ReadRequest","fields":[{"name":"value","type":{"kind":"field"}},{"name":"counter","type":{"kind":"integer","sign":"unsigned","width":32}}]}}},{"name":"key_validation_requests_and_generators","type":{"kind":"array","length":16,"type":{"kind":"struct","path":"aztec::protocol_types::abis::validation_requests::key_validation_request_and_generator::KeyValidationRequestAndGenerator","fields":[{"name":"request","type":{"kind":"struct","path":"aztec::protocol_types::abis::validation_requests::key_validation_request::KeyValidationRequest","fields":[{"name":"pk_m","type":{"kind":"struct","path":"std::embedded_curve_ops::EmbeddedCurvePoint","fields":[{"name":"x","type":{"kind":"field"}},{"name":"y","type":{"kind":"field"}},{"name":"is_infinite","type":{"kind":"boolean"}}]}},{"name":"sk_app","type":{"kind":"field"}}]}},{"name":"sk_app_generator","type":{"kind":"field"}}]}}},{"name":"note_hashes","type":{"kind":"array","length":16,"type":{"kind":"struct","path":"aztec::protocol_types::abis::note_hash::NoteHash","fields":[{"name":"value","type":{"kind":"field"}},{"name":"counter","type":{"kind":"integer","sign":"unsigned","width":32}}]}}},{"name":"nullifiers","type":{"kind":"array","length":16,"type":{"kind":"struct","path":"aztec::protocol_types::abis::nullifier::Nullifier","fields":[{"name":"value","type":{"kind":"field"}},{"name":"counter","type":{"kind":"integer","sign":"unsigned","width":32}},{"name":"note_hash","type":{"kind":"field"}}]}}},{"name":"private_call_requests","type":{"kind":"array","length":5,"type":{"kind":"struct","path":"aztec::protocol_types::abis::private_call_request::PrivateCallRequest","fields":[{"name":"call_context","type":{"kind":"struct","path":"aztec::protocol_types::abis::call_context::CallContext","fields":[{"name":"msg_sender","type":{"kind":"struct","path":"aztec::protocol_types::address::aztec_address::AztecAddress","fields":[{"name":"inner","type":{"kind":"field"}}]}},{"name":"contract_address","type":{"kind":"struct","path":"aztec::protocol_types::address::aztec_address::AztecAddress","fields":[{"name":"inner","type":{"kind":"field"}}]}},{"name":"function_selector","type":{"kind":"struct","path":"aztec::protocol_types::abis::function_selector::FunctionSelector","fields":[{"name":"inner","type":{"kind":"integer","sign":"unsigned","width":32}}]}},{"name":"is_static_call","type":{"kind":"boolean"}}]}},{"name":"args_hash","type":{"kind":"field"}},{"name":"returns_hash","type":{"kind":"field"}},{"name":"start_side_effect_counter","type":{"kind":"integer","sign":"unsigned","width":32}},{"name":"end_side_effect_counter","type":{"kind":"integer","sign":"unsigned","width":32}}]}}},{"name":"public_call_requests","type":{"kind":"array","length":16,"type":{"kind":"struct","path":"aztec::protocol_types::abis::side_effect::counted::Counted","fields":[{"name":"inner","type":{"kind":"struct","path":"aztec::protocol_types::abis::public_call_request::PublicCallRequest","fields":[{"name":"msg_sender","type":{"kind":"struct","path":"aztec::protocol_types::address::aztec_address::AztecAddress","fields":[{"name":"inner","type":{"kind":"field"}}]}},{"name":"contract_address","type":{"kind":"struct","path":"aztec::protocol_types::address::aztec_address::AztecAddress","fields":[{"name":"inner","type":{"kind":"field"}}]}},{"name":"function_selector","type":{"kind":"struct","path":"aztec::protocol_types::abis::function_selector::FunctionSelector","fields":[{"name":"inner","type":{"kind":"integer","sign":"unsigned","width":32}}]}},{"name":"is_static_call","type":{"kind":"boolean"}},{"name":"args_hash","type":{"kind":"field"}}]}},{"name":"counter","type":{"kind":"integer","sign":"unsigned","width":32}}]}}},{"name":"public_teardown_call_request","type":{"kind":"struct","path":"aztec::protocol_types::abis::public_call_request::PublicCallRequest","fields":[{"name":"msg_sender","type":{"kind":"struct","path":"aztec::protocol_types::address::aztec_address::AztecAddress","fields":[{"name":"inner","type":{"kind":"field"}}]}},{"name":"contract_address","type":{"kind":"struct","path":"aztec::protocol_types::address::aztec_address::AztecAddress","fields":[{"name":"inner","type":{"kind":"field"}}]}},{"name":"function_selector","type":{"kind":"struct","path":"aztec::protocol_types::abis::function_selector::FunctionSelector","fields":[{"name":"inner","type":{"kind":"integer","sign":"unsigned","width":32}}]}},{"name":"is_static_call","type":{"kind":"boolean"}},{"name":"args_hash","type":{"kind":"field"}}]}},{"name":"l2_to_l1_msgs","type":{"kind":"array","length":2,"type":{"kind":"struct","path":"aztec::protocol_types::messaging::l2_to_l1_message::L2ToL1Message","fields":[{"name":"recipient","type":{"kind":"struct","path":"aztec::protocol_types::address::eth_address::EthAddress","fields":[{"name":"inner","type":{"kind":"field"}}]}},{"name":"content","type":{"kind":"field"}},{"name":"counter","type":{"kind":"integer","sign":"unsigned","width":32}}]}}},{"name":"private_logs","type":{"kind":"array","length":16,"type":{"kind":"struct","path":"aztec::protocol_types::abis::private_log::PrivateLogData","fields":[{"name":"log","type":{"kind":"struct","path":"aztec::protocol_types::abis::log::Log","fields":[{"name":"fields","type":{"kind":"array","length":18,"type":{"kind":"field"}}}]}},{"name":"note_hash_counter","type":{"kind":"integer","sign":"unsigned","width":32}},{"name":"counter","type":{"kind":"integer","sign":"unsigned","width":32}}]}}},{"name":"contract_class_logs_hashes","type":{"kind":"array","length":1,"type":{"kind":"struct","path":"aztec::protocol_types::abis::log_hash::LogHash","fields":[{"name":"value","type":{"kind":"field"}},{"name":"counter","type":{"kind":"integer","sign":"unsigned","width":32}},{"name":"length","type":{"kind":"field"}}]}}},{"name":"start_side_effect_counter","type":{"kind":"integer","sign":"unsigned","width":32}},{"name":"end_side_effect_counter","type":{"kind":"integer","sign":"unsigned","width":32}},{"name":"historical_header","type":{"kind":"struct","path":"aztec::protocol_types::header::Header","fields":[{"name":"last_archive","type":{"kind":"struct","path":"aztec::protocol_types::abis::append_only_tree_snapshot::AppendOnlyTreeSnapshot","fields":[{"name":"root","type":{"kind":"field"}},{"name":"next_available_leaf_index","type":{"kind":"integer","sign":"unsigned","width":32}}]}},{"name":"content_commitment","type":{"kind":"struct","path":"aztec::protocol_types::content_commitment::ContentCommitment","fields":[{"name":"num_txs","type":{"kind":"field"}},{"name":"txs_effects_hash","type":{"kind":"field"}},{"name":"in_hash","type":{"kind":"field"}},{"name":"out_hash","type":{"kind":"field"}}]}},{"name":"state","type":{"kind":"struct","path":"aztec::protocol_types::state_reference::StateReference","fields":[{"name":"l1_to_l2_message_tree","type":{"kind":"struct","path":"aztec::protocol_types::abis::append_only_tree_snapshot::AppendOnlyTreeSnapshot","fields":[{"name":"root","type":{"kind":"field"}},{"name":"next_available_leaf_index","type":{"kind":"integer","sign":"unsigned","width":32}}]}},{"name":"partial","type":{"kind":"struct","path":"aztec::protocol_types::partial_state_reference::PartialStateReference","fields":[{"name":"note_hash_tree","type":{"kind":"struct","path":"aztec::protocol_types::abis::append_only_tree_snapshot::AppendOnlyTreeSnapshot","fields":[{"name":"root","type":{"kind":"field"}},{"name":"next_available_leaf_index","type":{"kind":"integer","sign":"unsigned","width":32}}]}},{"name":"nullifier_tree","type":{"kind":"struct","path":"aztec::protocol_types::abis::append_only_tree_snapshot::AppendOnlyTreeSnapshot","fields":[{"name":"root","type":{"kind":"field"}},{"name":"next_available_leaf_index","type":{"kind":"integer","sign":"unsigned","width":32}}]}},{"name":"public_data_tree","type":{"kind":"struct","path":"aztec::protocol_types::abis::append_only_tree_snapshot::AppendOnlyTreeSnapshot","fields":[{"name":"root","type":{"kind":"field"}},{"name":"next_available_leaf_index","type":{"kind":"integer","sign":"unsigned","width":32}}]}}]}}]}},{"name":"global_variables","type":{"kind":"struct","path":"aztec::protocol_types::abis::global_variables::GlobalVariables","fields":[{"name":"chain_id","type":{"kind":"field"}},{"name":"version","type":{"kind":"field"}},{"name":"block_number","type":{"kind":"field"}},{"name":"slot_number","type":{"kind":"field"}},{"name":"timestamp","type":{"kind":"integer","sign":"unsigned","width":64}},{"name":"coinbase","type":{"kind":"struct","path":"aztec::protocol_types::address::eth_address::EthAddress","fields":[{"name":"inner","type":{"kind":"field"}}]}},{"name":"fee_recipient","type":{"kind":"struct","path":"aztec::protocol_types::address::aztec_address::AztecAddress","fields":[{"name":"inner","type":{"kind":"field"}}]}},{"name":"gas_fees","type":{"kind":"struct","path":"aztec::protocol_types::abis::gas_fees::GasFees","fields":[{"name":"fee_per_da_gas","type":{"kind":"field"}},{"name":"fee_per_l2_gas","type":{"kind":"field"}}]}}]}},{"name":"total_fees","type":{"kind":"field"}},{"name":"total_mana_used","type":{"kind":"field"}}]}},{"name":"tx_context","type":{"kind":"struct","path":"aztec::protocol_types::transaction::tx_context::TxContext","fields":[{"name":"chain_id","type":{"kind":"field"}},{"name":"version","type":{"kind":"field"}},{"name":"gas_settings","type":{"kind":"struct","path":"aztec::protocol_types::abis::gas_settings::GasSettings","fields":[{"name":"gas_limits","type":{"kind":"struct","path":"aztec::protocol_types::abis::gas::Gas","fields":[{"name":"da_gas","type":{"kind":"integer","sign":"unsigned","width":32}},{"name":"l2_gas","type":{"kind":"integer","sign":"unsigned","width":32}}]}},{"name":"teardown_gas_limits","type":{"kind":"struct","path":"aztec::protocol_types::abis::gas::Gas","fields":[{"name":"da_gas","type":{"kind":"integer","sign":"unsigned","width":32}},{"name":"l2_gas","type":{"kind":"integer","sign":"unsigned","width":32}}]}},{"name":"max_fees_per_gas","type":{"kind":"struct","path":"aztec::protocol_types::abis::gas_fees::GasFees","fields":[{"name":"fee_per_da_gas","type":{"kind":"field"}},{"name":"fee_per_l2_gas","type":{"kind":"field"}}]}}]}}]}}]},"visibility":"databus"},"error_types":{"5019202896831570965":{"error_kind":"string","string":"attempt to add with overflow"},"17843811134343075018":{"error_kind":"string","string":"Stack too deep"}}},"bytecode":"H4sIAAAAAAAA/+XdBXRT99/H8dSA4rTI2PANt2ib4O7uDpWUMdzm0rm7O1Pm7sp8Y+6+scFccYfn892ScRvCznn+veH/vM9zz3mftkl68/rdpmma3PxumufvpXaGx7Mz/e/P01RG7KOd1CThtPhH5+dZSS5XJclp1ZKcViPJabWSnFZX9Ug4rXGSyzVJclrTJKc1S3Ja89hpziUt9rFH7GPAmxcMRvP9UV/AV+D1RwrDIW8wVJgX9oV9oXCo2B8OBKLhYDg/UhjJ90Z8wUDUVxKKBEq8fy+VM/asy1uuxV+USmcV15xebyqdVf9zpz/xBLPlqEyH1X5eu2Kft/Ds+byK4/Sqsc/j31dNX1dXNVTNjD2nx5f0hG3gLd/ia+7i9qzl3s/dV+Z3OmPv3y23t4PTXt7tkJOi7ZAT2w6ZCdsg2eLm9aclrDvN5eto4UnN/UXKbiw5Lt5YclN0Y8l13Fjif2g9Kf5BpnlS+4Ms77oj/kDEHyzOS+U2qLaf/vh5y7f4ciDODPfW5XXekdkD1zJL4p1EeX+x3dwILT2p+WG5PWYX7wB8rSBjTndxzK0hY3bxl9LXZj+N2Vu+xdfWxe1H+SPRzsNwtoc4O0CcHSFOL8Tpgzj9EGcA4gxCnCGIMw/izIc4wxBnBOLsBHF2hji7QJxdIc5uEGd3iLMHxNkT4uwFcfaGOPtAnH0hzn4QZ3+IcwDEORDiHARxDoY4h0CcQyHOYRDncIhzRIqc/5dfFxy5n8bsLd/iG+Xi9qsFeb1otIfhHANxjoU4x0Gc4yHOCRDnRIhzEsQ5GeKcAnFOhTinQZzTIc4ZEGcBxFkIcRZBnMUQZxTi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ls5gDeCGTNGfIrg/j+BHR0AGncDMfohgIVctoaS/Fw1XfDJ9g15SBcLayS1/gifnjzn+nqhvO5Cf6VuW1P6W3eVjydEXl4QxeEFG84kMjSfjE9hqtnfIoLP9Qw9rNqPV5GdPQP9zAp65v9sL8jWhYM26umnq1fTqzwriR2e7BcMIThciudsW0/yIk37ESR5xMr92ChZGbH4SyVANuRgtooNjMD/Kri5nTRVVjaf7dp5EDubuc5NOUhk23XpeLfZdFQsy1CKqylBoiCM9EtGuEO65nbbC3CIXoobIXw==","brillig_names":["pack_arguments_oracle_wrapper","enqueue_public_function_call_internal"]}],"outputs":{"structs":{"functions":[{"kind":"struct","path":"SimpleLogging::constructor_abi","fields":[{"name":"parameters","type":{"kind":"struct","path":"SimpleLogging::constructor_parameters","fields":[]}}]},{"kind":"struct","path":"SimpleLogging::increase_counter_private_abi","fields":[{"name":"parameters","type":{"kind":"struct","path":"SimpleLogging::increase_counter_private_parameters","fields":[{"name":"counter_id","type":{"kind":"field"}}]}}]},{"kind":"struct","path":"SimpleLogging::add_to_counter_public_abi","fields":[{"name":"parameters","type":{"kind":"struct","path":"SimpleLogging::add_to_counter_public_parameters","fields":[{"name":"counter_id","type":{"kind":"field"}}]}}]},{"kind":"struct","path":"SimpleLogging::increase_counter_public_abi","fields":[{"name":"parameters","type":{"kind":"struct","path":"SimpleLogging::increase_counter_public_parameters","fields":[{"name":"counter_id","type":{"kind":"field"}}]}}]}]},"globals":{"storage":[{"kind":"struct","fields":[{"name":"contract_name","value":{"kind":"string","value":"SimpleLogging"}},{"name":"fields","value":{"kind":"struct","fields":[{"name":"counters","value":{"kind":"struct","fields":[{"name":"slot","value":{"kind":"integer","sign":false,"value":"0000000000000000000000000000000000000000000000000000000000000001"}}]}}]}}]}]}},"file_map":{"26":{"source":"use crate::default::Default;\nuse crate::hash::Hasher;\n\ncomptime global RATE: u32 = 3;\n\npub struct Poseidon2 {\n cache: [Field; 3],\n state: [Field; 4],\n cache_size: u32,\n squeeze_mode: bool, // 0 => absorb, 1 => squeeze\n}\n\nimpl Poseidon2 {\n #[no_predicates]\n pub fn hash(input: [Field; N], message_size: u32) -> Field {\n Poseidon2::hash_internal(input, message_size, message_size != N)\n }\n\n pub(crate) fn new(iv: Field) -> Poseidon2 {\n let mut result =\n Poseidon2 { cache: [0; 3], state: [0; 4], cache_size: 0, squeeze_mode: false };\n result.state[RATE] = iv;\n result\n }\n\n fn perform_duplex(&mut self) {\n // add the cache into sponge state\n for i in 0..RATE {\n // We effectively zero-pad the cache by only adding to the state\n // cache that is less than the specified `cache_size`\n if i < self.cache_size {\n self.state[i] += self.cache[i];\n }\n }\n self.state = crate::hash::poseidon2_permutation(self.state, 4);\n }\n\n fn absorb(&mut self, input: Field) {\n assert(!self.squeeze_mode);\n if self.cache_size == RATE {\n // If we're absorbing, and the cache is full, apply the sponge permutation to compress the cache\n self.perform_duplex();\n self.cache[0] = input;\n self.cache_size = 1;\n } else {\n // If we're absorbing, and the cache is not full, add the input into the cache\n self.cache[self.cache_size] = input;\n self.cache_size += 1;\n }\n }\n\n fn squeeze(&mut self) -> Field {\n assert(!self.squeeze_mode);\n // If we're in absorb mode, apply sponge permutation to compress the cache.\n self.perform_duplex();\n self.squeeze_mode = true;\n\n // Pop one item off the top of the permutation and return it.\n self.state[0]\n }\n\n fn hash_internal(\n input: [Field; N],\n in_len: u32,\n is_variable_length: bool,\n ) -> Field {\n let two_pow_64 = 18446744073709551616;\n let iv: Field = (in_len as Field) * two_pow_64;\n let mut sponge = Poseidon2::new(iv);\n for i in 0..input.len() {\n if i < in_len {\n sponge.absorb(input[i]);\n }\n }\n\n // In the case where the hash preimage is variable-length, we append `1` to the end of the input, to distinguish\n // from fixed-length hashes. (the combination of this additional field element + the hash IV ensures\n // fixed-length and variable-length hashes do not collide)\n if is_variable_length {\n sponge.absorb(1);\n }\n sponge.squeeze()\n }\n}\n\npub struct Poseidon2Hasher {\n _state: [Field],\n}\n\nimpl Hasher for Poseidon2Hasher {\n fn finish(self) -> Field {\n let iv: Field = (self._state.len() as Field) * 18446744073709551616; // iv = (self._state.len() << 64)\n let mut sponge = Poseidon2::new(iv);\n for i in 0..self._state.len() {\n sponge.absorb(self._state[i]);\n }\n sponge.squeeze()\n }\n\n fn write(&mut self, input: Field) {\n self._state = self._state.push_back(input);\n }\n}\n\nimpl Default for Poseidon2Hasher {\n fn default() -> Self {\n Poseidon2Hasher { _state: &[] }\n }\n}\n","path":"std/hash/poseidon2.nr"},"50":{"source":"use crate::cmp::{Eq, Ord, Ordering};\nuse crate::default::Default;\nuse crate::hash::{Hash, Hasher};\n\npub struct Option {\n _is_some: bool,\n _value: T,\n}\n\nimpl Option {\n /// Constructs a None value\n pub fn none() -> Self {\n Self { _is_some: false, _value: crate::mem::zeroed() }\n }\n\n /// Constructs a Some wrapper around the given value\n pub fn some(_value: T) -> Self {\n Self { _is_some: true, _value }\n }\n\n /// True if this Option is None\n pub fn is_none(self) -> bool {\n !self._is_some\n }\n\n /// True if this Option is Some\n pub fn is_some(self) -> bool {\n self._is_some\n }\n\n /// Asserts `self.is_some()` and returns the wrapped value.\n pub fn unwrap(self) -> T {\n assert(self._is_some);\n self._value\n }\n\n /// Returns the inner value without asserting `self.is_some()`\n /// Note that if `self` is `None`, there is no guarantee what value will be returned,\n /// only that it will be of type `T`.\n pub fn unwrap_unchecked(self) -> T {\n self._value\n }\n\n /// Returns the wrapped value if `self.is_some()`. Otherwise, returns the given default value.\n pub fn unwrap_or(self, default: T) -> T {\n if self._is_some {\n self._value\n } else {\n default\n }\n }\n\n /// Returns the wrapped value if `self.is_some()`. Otherwise, calls the given function to return\n /// a default value.\n pub fn unwrap_or_else(self, default: fn[Env]() -> T) -> T {\n if self._is_some {\n self._value\n } else {\n default()\n }\n }\n\n /// Asserts `self.is_some()` with a provided custom message and returns the contained `Some` value\n pub fn expect(self, message: fmtstr) -> T {\n assert(self.is_some(), message);\n self._value\n }\n\n /// If self is `Some(x)`, this returns `Some(f(x))`. Otherwise, this returns `None`.\n pub fn map(self, f: fn[Env](T) -> U) -> Option {\n if self._is_some {\n Option::some(f(self._value))\n } else {\n Option::none()\n }\n }\n\n /// If self is `Some(x)`, this returns `f(x)`. Otherwise, this returns the given default value.\n pub fn map_or(self, default: U, f: fn[Env](T) -> U) -> U {\n if self._is_some {\n f(self._value)\n } else {\n default\n }\n }\n\n /// If self is `Some(x)`, this returns `f(x)`. Otherwise, this returns `default()`.\n pub fn map_or_else(self, default: fn[Env1]() -> U, f: fn[Env2](T) -> U) -> U {\n if self._is_some {\n f(self._value)\n } else {\n default()\n }\n }\n\n /// Returns None if self is None. Otherwise, this returns `other`.\n pub fn and(self, other: Self) -> Self {\n if self.is_none() {\n Option::none()\n } else {\n other\n }\n }\n\n /// If self is None, this returns None. Otherwise, this calls the given function\n /// with the Some value contained within self, and returns the result of that call.\n ///\n /// In some languages this function is called `flat_map` or `bind`.\n pub fn and_then(self, f: fn[Env](T) -> Option) -> Option {\n if self._is_some {\n f(self._value)\n } else {\n Option::none()\n }\n }\n\n /// If self is Some, return self. Otherwise, return `other`.\n pub fn or(self, other: Self) -> Self {\n if self._is_some {\n self\n } else {\n other\n }\n }\n\n /// If self is Some, return self. Otherwise, return `default()`.\n pub fn or_else(self, default: fn[Env]() -> Self) -> Self {\n if self._is_some {\n self\n } else {\n default()\n }\n }\n\n // If only one of the two Options is Some, return that option.\n // Otherwise, if both options are Some or both are None, None is returned.\n pub fn xor(self, other: Self) -> Self {\n if self._is_some {\n if other._is_some {\n Option::none()\n } else {\n self\n }\n } else if other._is_some {\n other\n } else {\n Option::none()\n }\n }\n\n /// Returns `Some(x)` if self is `Some(x)` and `predicate(x)` is true.\n /// Otherwise, this returns `None`\n pub fn filter(self, predicate: fn[Env](T) -> bool) -> Self {\n if self._is_some {\n if predicate(self._value) {\n self\n } else {\n Option::none()\n }\n } else {\n Option::none()\n }\n }\n\n /// Flattens an Option> into a Option.\n /// This returns None if the outer Option is None. Otherwise, this returns the inner Option.\n pub fn flatten(option: Option>) -> Option {\n if option._is_some {\n option._value\n } else {\n Option::none()\n }\n }\n}\n\nimpl Default for Option {\n fn default() -> Self {\n Option::none()\n }\n}\n\nimpl Eq for Option\nwhere\n T: Eq,\n{\n fn eq(self, other: Self) -> bool {\n if self._is_some == other._is_some {\n if self._is_some {\n self._value == other._value\n } else {\n true\n }\n } else {\n false\n }\n }\n}\n\nimpl Hash for Option\nwhere\n T: Hash,\n{\n fn hash(self, state: &mut H)\n where\n H: Hasher,\n {\n self._is_some.hash(state);\n if self._is_some {\n self._value.hash(state);\n }\n }\n}\n\n// For this impl we're declaring Option::none < Option::some\nimpl Ord for Option\nwhere\n T: Ord,\n{\n fn cmp(self, other: Self) -> Ordering {\n if self._is_some {\n if other._is_some {\n self._value.cmp(other._value)\n } else {\n Ordering::greater()\n }\n } else if other._is_some {\n Ordering::less()\n } else {\n Ordering::equal()\n }\n }\n}\n","path":"std/option.nr"},"51":{"source":"pub fn panic(message: fmtstr) -> U {\n assert(false, message);\n crate::mem::zeroed()\n}\n","path":"std/panic.nr"},"62":{"source":"use dep::aztec::macros::aztec;\n\n#[aztec]\ncontract SimpleLogging {\n use dep::aztec::prelude::{Map, PublicMutable};\n use dep::aztec::{\n //keys::getters::get_public_keys,\n macros::{storage::storage, functions::{public, initializer, private, internal}},\n };\n #[storage]\n struct Storage {\n counters: Map, Context>,\n }\n\n #[public]\n #[initializer]\n fn constructor() {\n }\n\n #[private]\n fn increase_counter_private(counter_id: Field) {\n //let msg_sender_npk_m_hash = get_public_keys(context.msg_sender()).npk_m.hash();\n //let secret = context.request_nsk_app(msg_sender_npk_m_hash); // get secret key of caller of function\n //let nullifier = std::hash::pedersen_hash([context.msg_sender().to_field(), secret]); // derive nullifier from sender and secret\n //context.push_nullifier(nullifier);\n SimpleLogging::at(context.this_address()).add_to_counter_public(counter_id).enqueue(\n &mut context,\n );\n }\n\n #[public]\n #[internal]\n fn add_to_counter_public(counter_id: Field) {\n let new_counter_value = storage.counters.at(counter_id).read() + 1;\n storage.counters.at(counter_id).write(new_counter_value);\n }\n\n #[public]\n fn increase_counter_public(counter_id: Field) {\n context.emit_unencrypted_log(/*message=*/\"Counter increased public\");\n SimpleLogging::at(context.this_address()).add_to_counter_public(counter_id);\n }\n unconstrained fn get_counter_value(counter_id: Field) -> pub Field {\n storage.counters.at(counter_id).read()\n }\n}\n","path":"/home/filip/c/chicmoz/services/event-cannon/src/contract-projects/SimpleLogging/src/main.nr"},"102":{"source":"use crate::state_vars::storage::Storage;\nuse dep::protocol_types::{\n storage::map::derive_storage_slot_in_map,\n traits::{Deserialize, Serialize, ToField},\n};\n\n// docs:start:map\npub struct Map {\n context: Context,\n storage_slot: Field,\n state_var_constructor: fn(Context, Field) -> V,\n}\n// docs:end:map\n\nimpl Storage for Map\nwhere\n T: Serialize + Deserialize,\n{}\n\nimpl Map {\n // docs:start:new\n pub fn new(\n context: Context,\n storage_slot: Field,\n state_var_constructor: fn(Context, Field) -> V,\n ) -> Self {\n assert(storage_slot != 0, \"Storage slot 0 not allowed. Storage slots must start from 1.\");\n Map { context, storage_slot, state_var_constructor }\n }\n // docs:end:new\n\n // docs:start:at\n pub fn at(self, key: K) -> V\n where\n K: ToField,\n {\n // TODO(#1204): use a generator index for the storage slot\n let derived_storage_slot = derive_storage_slot_in_map(self.storage_slot, key);\n\n let state_var_constructor = self.state_var_constructor;\n state_var_constructor(self.context, derived_storage_slot)\n }\n // docs:end:at\n}\n","path":"/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.66.0/noir-projects/aztec-nr/aztec/src/state_vars/map.nr"},"115":{"source":"use crate::context::{PublicContext, UnconstrainedContext};\nuse crate::state_vars::storage::Storage;\nuse dep::protocol_types::traits::{Deserialize, Serialize};\n\n// docs:start:public_mutable_struct\npub struct PublicMutable {\n context: Context,\n storage_slot: Field,\n}\n// docs:end:public_mutable_struct\n\nimpl Storage for PublicMutable\nwhere\n T: Serialize + Deserialize,\n{}\n\nimpl PublicMutable {\n // docs:start:public_mutable_struct_new\n pub fn new(\n // Note: Passing the contexts to new(...) just to have an interface compatible with a Map.\n context: Context,\n storage_slot: Field,\n ) -> Self {\n assert(storage_slot != 0, \"Storage slot 0 not allowed. Storage slots must start from 1.\");\n PublicMutable { context, storage_slot }\n }\n // docs:end:public_mutable_struct_new\n}\n\nimpl PublicMutable\nwhere\n T: Serialize + Deserialize,\n{\n // docs:start:public_mutable_struct_read\n pub fn read(self) -> T {\n self.context.storage_read(self.storage_slot)\n }\n // docs:end:public_mutable_struct_read\n\n // docs:start:public_mutable_struct_write\n pub fn write(self, value: T) {\n self.context.storage_write(self.storage_slot, value);\n }\n // docs:end:public_mutable_struct_write\n}\n\nimpl PublicMutable\nwhere\n T: Deserialize,\n{\n pub unconstrained fn read(self) -> T {\n self.context.storage_read(self.storage_slot)\n }\n}\n","path":"/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.66.0/noir-projects/aztec-nr/aztec/src/state_vars/public_mutable.nr"},"119":{"source":"use crate::{\n context::{inputs::PrivateContextInputs, packed_returns::PackedReturns},\n hash::{ArgsHasher, hash_args_array},\n keys::constants::{NULLIFIER_INDEX, NUM_KEY_TYPES, OUTGOING_INDEX, sk_generators},\n messaging::process_l1_to_l2_message,\n oracle::{\n arguments,\n call_private_function::call_private_function_internal,\n enqueue_public_function_call::{\n enqueue_public_function_call_internal, notify_set_min_revertible_side_effect_counter,\n set_public_teardown_function_call_internal,\n },\n header::get_header_at,\n key_validation_request::get_key_validation_request,\n returns::pack_returns,\n },\n};\nuse dep::protocol_types::{\n abis::{\n call_context::CallContext,\n function_selector::FunctionSelector,\n log::Log,\n log_hash::LogHash,\n max_block_number::MaxBlockNumber,\n note_hash::NoteHash,\n nullifier::Nullifier,\n private_call_request::PrivateCallRequest,\n private_circuit_public_inputs::PrivateCircuitPublicInputs,\n private_log::PrivateLogData,\n public_call_request::PublicCallRequest,\n read_request::ReadRequest,\n side_effect::Counted,\n validation_requests::{KeyValidationRequest, KeyValidationRequestAndGenerator},\n },\n address::{AztecAddress, EthAddress},\n constants::{\n MAX_CONTRACT_CLASS_LOGS_PER_CALL, MAX_ENQUEUED_CALLS_PER_CALL,\n MAX_KEY_VALIDATION_REQUESTS_PER_CALL, MAX_L2_TO_L1_MSGS_PER_CALL,\n MAX_NOTE_HASH_READ_REQUESTS_PER_CALL, MAX_NOTE_HASHES_PER_CALL,\n MAX_NULLIFIER_READ_REQUESTS_PER_CALL, MAX_NULLIFIERS_PER_CALL,\n MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL, MAX_PRIVATE_LOGS_PER_CALL,\n PRIVATE_LOG_SIZE_IN_FIELDS, PUBLIC_DISPATCH_SELECTOR,\n },\n header::Header,\n messaging::l2_to_l1_message::L2ToL1Message,\n traits::Empty,\n};\n\n// When finished, one can call .finish() to convert back to the abi\npub struct PrivateContext {\n // docs:start:private-context\n pub inputs: PrivateContextInputs,\n pub side_effect_counter: u32,\n\n pub min_revertible_side_effect_counter: u32,\n pub is_fee_payer: bool,\n\n pub args_hash: Field,\n pub return_hash: Field,\n\n pub max_block_number: MaxBlockNumber,\n\n pub note_hash_read_requests: BoundedVec,\n pub nullifier_read_requests: BoundedVec,\n key_validation_requests_and_generators: BoundedVec,\n\n pub note_hashes: BoundedVec,\n pub nullifiers: BoundedVec,\n\n pub private_call_requests: BoundedVec,\n pub public_call_requests: BoundedVec, MAX_ENQUEUED_CALLS_PER_CALL>,\n pub public_teardown_call_request: PublicCallRequest,\n pub l2_to_l1_msgs: BoundedVec,\n // docs:end:private-context\n\n // Header of a block whose state is used during private execution (not the block the transaction is included in).\n pub historical_header: Header,\n\n pub private_logs: BoundedVec,\n pub contract_class_logs_hashes: BoundedVec,\n\n // Contains the last key validation request for each key type. This is used to cache the last request and avoid\n // fetching the same request multiple times.\n // The index of the array corresponds to the key type (0 nullifier, 1 incoming, 2 outgoing, 3 tagging).\n pub last_key_validation_requests: [Option; NUM_KEY_TYPES],\n}\n\nimpl PrivateContext {\n pub fn new(inputs: PrivateContextInputs, args_hash: Field) -> PrivateContext {\n PrivateContext {\n inputs,\n side_effect_counter: inputs.start_side_effect_counter + 1,\n min_revertible_side_effect_counter: 0,\n is_fee_payer: false,\n args_hash,\n return_hash: 0,\n max_block_number: MaxBlockNumber::empty(),\n note_hash_read_requests: BoundedVec::new(),\n nullifier_read_requests: BoundedVec::new(),\n key_validation_requests_and_generators: BoundedVec::new(),\n note_hashes: BoundedVec::new(),\n nullifiers: BoundedVec::new(),\n historical_header: inputs.historical_header,\n private_call_requests: BoundedVec::new(),\n public_call_requests: BoundedVec::new(),\n public_teardown_call_request: PublicCallRequest::empty(),\n l2_to_l1_msgs: BoundedVec::new(),\n private_logs: BoundedVec::new(),\n contract_class_logs_hashes: BoundedVec::new(),\n last_key_validation_requests: [Option::none(); NUM_KEY_TYPES],\n }\n }\n\n pub fn msg_sender(self) -> AztecAddress {\n self.inputs.call_context.msg_sender\n }\n\n pub fn this_address(self) -> AztecAddress {\n self.inputs.call_context.contract_address\n }\n\n pub fn chain_id(self) -> Field {\n self.inputs.tx_context.chain_id\n }\n\n pub fn version(self) -> Field {\n self.inputs.tx_context.version\n }\n\n pub fn selector(self) -> FunctionSelector {\n self.inputs.call_context.function_selector\n }\n\n pub fn get_args_hash(self) -> Field {\n self.args_hash\n }\n\n pub fn push_note_hash(&mut self, note_hash: Field) {\n self.note_hashes.push(NoteHash { value: note_hash, counter: self.next_counter() });\n }\n\n pub fn push_nullifier(&mut self, nullifier: Field) {\n self.nullifiers.push(\n Nullifier { value: nullifier, note_hash: 0, counter: self.next_counter() },\n );\n }\n\n pub fn push_nullifier_for_note_hash(&mut self, nullifier: Field, nullified_note_hash: Field) {\n self.nullifiers.push(\n Nullifier {\n value: nullifier,\n note_hash: nullified_note_hash,\n counter: self.next_counter(),\n },\n );\n }\n\n // Returns the header of a block whose state is used during private execution (not the block the transaction is\n // included in).\n pub fn get_header(self) -> Header {\n self.historical_header\n }\n\n // Returns the header of an arbitrary block whose block number is less than or equal to the block number\n // of historical header.\n pub fn get_header_at(self, block_number: u32) -> Header {\n get_header_at(block_number, self)\n }\n\n pub fn set_return_hash(&mut self, returns_hasher: ArgsHasher) {\n pack_returns(returns_hasher.fields);\n self.return_hash = returns_hasher.hash();\n }\n\n pub fn finish(self) -> PrivateCircuitPublicInputs {\n PrivateCircuitPublicInputs {\n call_context: self.inputs.call_context,\n args_hash: self.args_hash,\n returns_hash: self.return_hash,\n min_revertible_side_effect_counter: self.min_revertible_side_effect_counter,\n is_fee_payer: self.is_fee_payer,\n max_block_number: self.max_block_number,\n note_hash_read_requests: self.note_hash_read_requests.storage(),\n nullifier_read_requests: self.nullifier_read_requests.storage(),\n key_validation_requests_and_generators: self\n .key_validation_requests_and_generators\n .storage(),\n note_hashes: self.note_hashes.storage(),\n nullifiers: self.nullifiers.storage(),\n private_call_requests: self.private_call_requests.storage(),\n public_call_requests: self.public_call_requests.storage(),\n public_teardown_call_request: self.public_teardown_call_request,\n l2_to_l1_msgs: self.l2_to_l1_msgs.storage(),\n start_side_effect_counter: self.inputs.start_side_effect_counter,\n end_side_effect_counter: self.side_effect_counter,\n private_logs: self.private_logs.storage(),\n contract_class_logs_hashes: self.contract_class_logs_hashes.storage(),\n historical_header: self.historical_header,\n tx_context: self.inputs.tx_context,\n }\n }\n\n pub fn set_as_fee_payer(&mut self) {\n dep::protocol_types::debug_log::debug_log_format(\n \"Setting {0} as fee payer\",\n [self.this_address().to_field()],\n );\n self.is_fee_payer = true;\n }\n\n pub fn end_setup(&mut self) {\n // dep::protocol_types::debug_log::debug_log_format(\n // \"Ending setup at counter {0}\",\n // [self.side_effect_counter as Field]\n // );\n self.min_revertible_side_effect_counter = self.side_effect_counter;\n notify_set_min_revertible_side_effect_counter(self.min_revertible_side_effect_counter);\n }\n\n // docs:start:max-block-number\n pub fn set_tx_max_block_number(&mut self, max_block_number: u32) {\n // docs:end:max-block-number\n self.max_block_number =\n MaxBlockNumber::min_with_u32(self.max_block_number, max_block_number);\n }\n\n pub fn push_note_hash_read_request(&mut self, note_hash: Field) {\n let side_effect = ReadRequest { value: note_hash, counter: self.next_counter() };\n self.note_hash_read_requests.push(side_effect);\n }\n\n pub fn push_nullifier_read_request(&mut self, nullifier: Field) {\n let request = ReadRequest { value: nullifier, counter: self.next_counter() };\n self.nullifier_read_requests.push(request);\n }\n\n pub fn request_nsk_app(&mut self, npk_m_hash: Field) -> Field {\n self.request_sk_app(npk_m_hash, NULLIFIER_INDEX)\n }\n\n pub fn request_ovsk_app(&mut self, ovpk_m_hash: Field) -> Field {\n self.request_sk_app(ovpk_m_hash, OUTGOING_INDEX)\n }\n\n fn request_sk_app(&mut self, pk_m_hash: Field, key_index: Field) -> Field {\n let cached_request =\n self.last_key_validation_requests[key_index].unwrap_or(KeyValidationRequest::empty());\n\n if cached_request.pk_m.hash() == pk_m_hash {\n // We get a match so the cached request is the latest one\n cached_request.sk_app\n } else {\n // We didn't get a match meaning the cached result is stale\n // Typically we'd validate keys by showing that they are the preimage of `pk_m_hash`, but that'd require\n // the oracle returning the master secret keys, which could cause malicious contracts to leak it or learn\n // about secrets from other contracts. We therefore silo secret keys, and rely on the private kernel to\n // validate that we siloed secret key corresponds to correct siloing of the master secret key that hashes\n // to `pk_m_hash`.\n let request = unsafe { get_key_validation_request(pk_m_hash, key_index) };\n assert(request.pk_m.hash() == pk_m_hash);\n\n self.key_validation_requests_and_generators.push(\n KeyValidationRequestAndGenerator {\n request,\n sk_app_generator: sk_generators[key_index],\n },\n );\n self.last_key_validation_requests[key_index] = Option::some(request);\n request.sk_app\n }\n }\n\n // docs:start:context_message_portal\n pub fn message_portal(&mut self, recipient: EthAddress, content: Field) {\n // docs:end:context_message_portal\n let message = L2ToL1Message { recipient, content, counter: self.next_counter() };\n self.l2_to_l1_msgs.push(message);\n }\n\n // docs:start:context_consume_l1_to_l2_message\n // docs:start:consume_l1_to_l2_message\n pub fn consume_l1_to_l2_message(\n &mut self,\n content: Field,\n secret: Field,\n sender: EthAddress,\n leaf_index: Field,\n ) {\n // docs:end:context_consume_l1_to_l2_message\n let nullifier = process_l1_to_l2_message(\n self.historical_header.state.l1_to_l2_message_tree.root,\n self.this_address(),\n sender,\n self.chain_id(),\n self.version(),\n content,\n secret,\n leaf_index,\n );\n\n // Push nullifier (and the \"commitment\" corresponding to this can be \"empty\")\n self.push_nullifier(nullifier)\n }\n // docs:end:consume_l1_to_l2_message\n\n pub fn emit_private_log(&mut self, log: [Field; PRIVATE_LOG_SIZE_IN_FIELDS]) {\n let counter = self.next_counter();\n let private_log = PrivateLogData { log: Log::new(log), note_hash_counter: 0, counter };\n self.private_logs.push(private_log);\n }\n\n pub fn emit_raw_note_log(\n &mut self,\n log: [Field; PRIVATE_LOG_SIZE_IN_FIELDS],\n note_hash_counter: u32,\n ) {\n let counter = self.next_counter();\n let private_log = PrivateLogData { log: Log::new(log), note_hash_counter, counter };\n self.private_logs.push(private_log);\n }\n\n pub fn call_private_function(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args: [Field; ARGS_COUNT],\n ) -> PackedReturns {\n let args_hash = hash_args_array(args);\n arguments::pack_arguments_array(args);\n self.call_private_function_with_packed_args(\n contract_address,\n function_selector,\n args_hash,\n false,\n )\n }\n\n pub fn static_call_private_function(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args: [Field; ARGS_COUNT],\n ) -> PackedReturns {\n let args_hash = hash_args_array(args);\n arguments::pack_arguments_array(args);\n self.call_private_function_with_packed_args(\n contract_address,\n function_selector,\n args_hash,\n true,\n )\n }\n\n pub fn call_private_function_no_args(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n ) -> PackedReturns {\n self.call_private_function_with_packed_args(contract_address, function_selector, 0, false)\n }\n\n pub fn static_call_private_function_no_args(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n ) -> PackedReturns {\n self.call_private_function_with_packed_args(contract_address, function_selector, 0, true)\n }\n\n pub fn call_private_function_with_packed_args(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args_hash: Field,\n is_static_call: bool,\n ) -> PackedReturns {\n let mut is_static_call = is_static_call | self.inputs.call_context.is_static_call;\n let start_side_effect_counter = self.side_effect_counter;\n\n // The oracle simulates the private call and returns the value of the side effects counter after execution of\n // the call (which means that end_side_effect_counter - start_side_effect_counter is the number of side effects\n // that took place), along with the hash of the return values. We validate these by requesting a private kernel\n // iteration in which the return values are constrained to hash to `returns_hash` and the side effects counter\n // to increment from start to end.\n let (end_side_effect_counter, returns_hash) = unsafe {\n call_private_function_internal(\n contract_address,\n function_selector,\n args_hash,\n start_side_effect_counter,\n is_static_call,\n )\n };\n\n self.private_call_requests.push(\n PrivateCallRequest {\n call_context: CallContext {\n msg_sender: self.this_address(),\n contract_address,\n function_selector,\n is_static_call,\n },\n args_hash,\n returns_hash,\n start_side_effect_counter,\n end_side_effect_counter,\n },\n );\n\n // TODO (fees) figure out why this crashes the prover and enable it\n // we need this in order to pay fees inside child call contexts\n // assert(\n // (item.public_inputs.min_revertible_side_effect_counter == 0 as u32)\n // | (item.public_inputs.min_revertible_side_effect_counter\n // > self.min_revertible_side_effect_counter)\n // );\n // if item.public_inputs.min_revertible_side_effect_counter\n // > self.min_revertible_side_effect_counter {\n // self.min_revertible_side_effect_counter = item.public_inputs.min_revertible_side_effect_counter;\n // }\n self.side_effect_counter = end_side_effect_counter + 1;\n PackedReturns::new(returns_hash)\n }\n\n pub fn call_public_function(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args: [Field; ARGS_COUNT],\n ) {\n let args_hash = hash_args_array(args);\n arguments::pack_arguments_array(args);\n self.call_public_function_with_packed_args(\n contract_address,\n function_selector,\n args_hash,\n false,\n )\n }\n\n pub fn static_call_public_function(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args: [Field; ARGS_COUNT],\n ) {\n let args_hash = hash_args_array(args);\n arguments::pack_arguments_array(args);\n self.call_public_function_with_packed_args(\n contract_address,\n function_selector,\n args_hash,\n true,\n )\n }\n\n pub fn call_public_function_no_args(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n ) {\n self.call_public_function_with_packed_args(contract_address, function_selector, 0, false)\n }\n\n pub fn static_call_public_function_no_args(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n ) {\n self.call_public_function_with_packed_args(contract_address, function_selector, 0, true)\n }\n\n pub fn call_public_function_with_packed_args(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args_hash: Field,\n is_static_call: bool,\n ) {\n let counter = self.next_counter();\n\n let mut is_static_call = is_static_call | self.inputs.call_context.is_static_call;\n // TODO(https://github.com/AztecProtocol/aztec-packages/issues/8985): Fix this.\n // WARNING: This is insecure and should be temporary!\n // The oracle repacks the arguments and returns a new args_hash.\n // new_args = [selector, ...old_args], so as to make it suitable to call the public dispatch function.\n // We don't validate or compute it in the circuit because a) it's harder to do with slices, and\n // b) this is only temporary.\n let args_hash = enqueue_public_function_call_internal(\n contract_address,\n function_selector,\n args_hash,\n counter,\n is_static_call,\n );\n\n // Public calls are rerouted through the dispatch function.\n let function_selector = comptime { FunctionSelector::from_field(PUBLIC_DISPATCH_SELECTOR) };\n\n let call_request = PublicCallRequest {\n msg_sender: self.this_address(),\n contract_address,\n function_selector,\n is_static_call,\n args_hash,\n };\n\n self.public_call_requests.push(Counted::new(call_request, counter));\n }\n\n pub fn set_public_teardown_function(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args: [Field; ARGS_COUNT],\n ) {\n let args_hash = hash_args_array(args);\n arguments::pack_arguments_array(args);\n self.set_public_teardown_function_with_packed_args(\n contract_address,\n function_selector,\n args_hash,\n false,\n )\n }\n\n pub fn set_public_teardown_function_with_packed_args(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args_hash: Field,\n is_static_call: bool,\n ) {\n let counter = self.next_counter();\n\n let mut is_static_call = is_static_call | self.inputs.call_context.is_static_call;\n // TODO(https://github.com/AztecProtocol/aztec-packages/issues/8985): Fix this.\n // WARNING: This is insecure and should be temporary!\n // The oracle repacks the arguments and returns a new args_hash.\n // new_args = [selector, ...old_args], so as to make it suitable to call the public dispatch function.\n // We don't validate or compute it in the circuit because a) it's harder to do with slices, and\n // b) this is only temporary.\n let args_hash = set_public_teardown_function_call_internal(\n contract_address,\n function_selector,\n args_hash,\n counter,\n is_static_call,\n );\n\n let function_selector = comptime { FunctionSelector::from_field(PUBLIC_DISPATCH_SELECTOR) };\n\n self.public_teardown_call_request = PublicCallRequest {\n msg_sender: self.this_address(),\n contract_address,\n function_selector,\n is_static_call,\n args_hash,\n };\n }\n\n fn next_counter(&mut self) -> u32 {\n let counter = self.side_effect_counter;\n self.side_effect_counter += 1;\n counter\n }\n}\n\nimpl Empty for PrivateContext {\n fn empty() -> Self {\n PrivateContext {\n inputs: PrivateContextInputs::empty(),\n side_effect_counter: 0 as u32,\n min_revertible_side_effect_counter: 0 as u32,\n is_fee_payer: false,\n args_hash: 0,\n return_hash: 0,\n max_block_number: MaxBlockNumber::empty(),\n note_hash_read_requests: BoundedVec::new(),\n nullifier_read_requests: BoundedVec::new(),\n key_validation_requests_and_generators: BoundedVec::new(),\n note_hashes: BoundedVec::new(),\n nullifiers: BoundedVec::new(),\n private_call_requests: BoundedVec::new(),\n public_call_requests: BoundedVec::new(),\n public_teardown_call_request: PublicCallRequest::empty(),\n l2_to_l1_msgs: BoundedVec::new(),\n historical_header: Header::empty(),\n private_logs: BoundedVec::new(),\n contract_class_logs_hashes: BoundedVec::new(),\n last_key_validation_requests: [Option::none(); NUM_KEY_TYPES],\n }\n }\n}\n","path":"/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.66.0/noir-projects/aztec-nr/aztec/src/context/private_context.nr"},"120":{"source":"use dep::protocol_types::{\n abis::function_selector::FunctionSelector, address::AztecAddress, traits::Deserialize,\n};\n\nuse crate::context::{gas::GasOpts, private_context::PrivateContext, public_context::PublicContext};\n\nuse crate::hash::hash_args;\nuse crate::oracle::arguments::pack_arguments;\n\npub trait CallInterface {\n fn get_args(self) -> [Field] {\n self.args\n }\n\n fn get_selector(self) -> FunctionSelector {\n self.selector\n }\n\n fn get_name(self) -> str {\n self.name\n }\n\n fn get_contract_address(self) -> AztecAddress {\n self.target_contract\n }\n\n fn get_is_static(self) -> bool {\n self.is_static\n }\n}\n\npub struct PrivateCallInterface {\n pub target_contract: AztecAddress,\n pub selector: FunctionSelector,\n pub name: str,\n pub args_hash: Field,\n pub args: [Field],\n pub return_type: T,\n pub is_static: bool,\n}\n\nimpl PrivateCallInterface {\n pub fn call(self, context: &mut PrivateContext) -> T\n where\n T: Deserialize,\n {\n pack_arguments(self.args);\n let returns = context.call_private_function_with_packed_args(\n self.target_contract,\n self.selector,\n self.args_hash,\n false,\n );\n let unpacked: T = returns.unpack_into();\n unpacked\n }\n\n pub fn view(self, context: &mut PrivateContext) -> T\n where\n T: Deserialize,\n {\n pack_arguments(self.args);\n let returns = context.call_private_function_with_packed_args(\n self.target_contract,\n self.selector,\n self.args_hash,\n true,\n );\n returns.unpack_into()\n }\n}\n\nimpl CallInterface for PrivateVoidCallInterface {}\n\npub struct PrivateVoidCallInterface {\n pub target_contract: AztecAddress,\n pub selector: FunctionSelector,\n pub name: str,\n pub args_hash: Field,\n pub args: [Field],\n pub return_type: (),\n pub is_static: bool,\n}\n\nimpl PrivateVoidCallInterface {\n pub fn call(self, context: &mut PrivateContext) {\n pack_arguments(self.args);\n context\n .call_private_function_with_packed_args(\n self.target_contract,\n self.selector,\n self.args_hash,\n false,\n )\n .assert_empty();\n }\n\n pub fn view(self, context: &mut PrivateContext) {\n pack_arguments(self.args);\n context\n .call_private_function_with_packed_args(\n self.target_contract,\n self.selector,\n self.args_hash,\n true,\n )\n .assert_empty();\n }\n}\n\nimpl CallInterface for PrivateStaticCallInterface {}\n\npub struct PrivateStaticCallInterface {\n pub target_contract: AztecAddress,\n pub selector: FunctionSelector,\n pub name: str,\n pub args_hash: Field,\n pub args: [Field],\n pub return_type: T,\n pub is_static: bool,\n}\n\nimpl PrivateStaticCallInterface {\n pub fn view(self, context: &mut PrivateContext) -> T\n where\n T: Deserialize,\n {\n pack_arguments(self.args);\n let returns = context.call_private_function_with_packed_args(\n self.target_contract,\n self.selector,\n self.args_hash,\n true,\n );\n returns.unpack_into()\n }\n}\n\nimpl CallInterface for PrivateStaticVoidCallInterface {}\n\npub struct PrivateStaticVoidCallInterface {\n pub target_contract: AztecAddress,\n pub selector: FunctionSelector,\n pub name: str,\n pub args_hash: Field,\n pub args: [Field],\n pub return_type: (),\n pub is_static: bool,\n}\n\nimpl PrivateStaticVoidCallInterface {\n pub fn view(self, context: &mut PrivateContext) {\n pack_arguments(self.args);\n context\n .call_private_function_with_packed_args(\n self.target_contract,\n self.selector,\n self.args_hash,\n true,\n )\n .assert_empty();\n }\n}\n\nimpl CallInterface for PublicCallInterface {}\n\npub struct PublicCallInterface {\n pub target_contract: AztecAddress,\n pub selector: FunctionSelector,\n pub name: str,\n pub args: [Field],\n pub gas_opts: GasOpts,\n pub return_type: T,\n pub is_static: bool,\n}\n\nimpl PublicCallInterface {\n pub fn with_gas(self: &mut Self, gas_opts: GasOpts) -> &mut Self {\n self.gas_opts = gas_opts;\n self\n }\n\n pub unconstrained fn call(self, context: &mut PublicContext) -> T\n where\n T: Deserialize,\n {\n let returns = context.call_public_function(\n self.target_contract,\n self.selector,\n self.args,\n self.gas_opts,\n );\n Deserialize::deserialize(returns.as_array::())\n }\n\n pub unconstrained fn view(self, context: &mut PublicContext) -> T\n where\n T: Deserialize,\n {\n let returns = context.static_call_public_function(\n self.target_contract,\n self.selector,\n self.args,\n self.gas_opts,\n );\n Deserialize::deserialize(returns.as_array::())\n }\n\n pub fn enqueue(self, context: &mut PrivateContext) {\n let args_hash = hash_args(self.args);\n pack_arguments(self.args);\n context.call_public_function_with_packed_args(\n self.target_contract,\n self.selector,\n args_hash,\n /*static=*/\n false,\n )\n }\n\n pub fn enqueue_view(self, context: &mut PrivateContext) {\n let args_hash = hash_args(self.args);\n pack_arguments(self.args);\n context.call_public_function_with_packed_args(\n self.target_contract,\n self.selector,\n args_hash,\n /*static=*/\n true,\n )\n }\n}\n\nimpl CallInterface for PublicVoidCallInterface {}\n\npub struct PublicVoidCallInterface {\n pub target_contract: AztecAddress,\n pub selector: FunctionSelector,\n pub name: str,\n pub args: [Field],\n pub return_type: (),\n pub is_static: bool,\n pub gas_opts: GasOpts,\n}\n\nimpl PublicVoidCallInterface {\n pub fn with_gas(self: &mut Self, gas_opts: GasOpts) -> &mut Self {\n self.gas_opts = gas_opts;\n self\n }\n\n pub unconstrained fn call(self, context: &mut PublicContext) {\n let returns = context.call_public_function(\n self.target_contract,\n self.selector,\n self.args,\n self.gas_opts,\n );\n assert(returns.len() == 0);\n }\n\n pub unconstrained fn view(self, context: &mut PublicContext) {\n let returns = context.static_call_public_function(\n self.target_contract,\n self.selector,\n self.args,\n self.gas_opts,\n );\n assert(returns.len() == 0);\n }\n\n pub fn enqueue(self, context: &mut PrivateContext) {\n let args_hash = hash_args(self.args);\n pack_arguments(self.args);\n context.call_public_function_with_packed_args(\n self.target_contract,\n self.selector,\n args_hash,\n /*static=*/\n false,\n )\n }\n\n pub fn enqueue_view(self, context: &mut PrivateContext) {\n let args_hash = hash_args(self.args);\n pack_arguments(self.args);\n context.call_public_function_with_packed_args(\n self.target_contract,\n self.selector,\n args_hash,\n /*static=*/\n true,\n )\n }\n}\n\nimpl CallInterface for PublicStaticCallInterface {}\n\npub struct PublicStaticCallInterface {\n pub target_contract: AztecAddress,\n pub selector: FunctionSelector,\n pub name: str,\n pub args: [Field],\n pub return_type: T,\n pub is_static: bool,\n pub gas_opts: GasOpts,\n}\n\nimpl PublicStaticCallInterface {\n pub fn with_gas(self: &mut Self, gas_opts: GasOpts) -> &mut Self {\n self.gas_opts = gas_opts;\n self\n }\n\n pub unconstrained fn view(self, context: &mut PublicContext) -> T\n where\n T: Deserialize,\n {\n let returns = context.static_call_public_function(\n self.target_contract,\n self.selector,\n self.args,\n self.gas_opts,\n );\n Deserialize::deserialize(returns.as_array::())\n }\n\n pub fn enqueue_view(self, context: &mut PrivateContext) {\n let args_hash = hash_args(self.args);\n pack_arguments(self.args);\n context.call_public_function_with_packed_args(\n self.target_contract,\n self.selector,\n args_hash,\n /*static=*/\n true,\n )\n }\n}\n\nimpl CallInterface for PublicStaticVoidCallInterface {}\n\npub struct PublicStaticVoidCallInterface {\n target_contract: AztecAddress,\n selector: FunctionSelector,\n name: str,\n args: [Field],\n return_type: (),\n is_static: bool,\n gas_opts: GasOpts,\n}\n\nimpl PublicStaticVoidCallInterface {\n pub fn with_gas(self: &mut Self, gas_opts: GasOpts) -> &mut Self {\n self.gas_opts = gas_opts;\n self\n }\n\n pub unconstrained fn view(self, context: &mut PublicContext) {\n let returns = context.static_call_public_function(\n self.target_contract,\n self.selector,\n self.args,\n self.gas_opts,\n );\n assert(returns.len() == 0);\n }\n\n pub fn enqueue_view(self, context: &mut PrivateContext) {\n let args_hash = hash_args(self.args);\n pack_arguments(self.args);\n context.call_public_function_with_packed_args(\n self.target_contract,\n self.selector,\n args_hash,\n /*static=*/\n true,\n )\n }\n}\n","path":"/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.66.0/noir-projects/aztec-nr/aztec/src/context/call_interfaces.nr"},"121":{"source":"use crate::oracle::{\n execution::{get_block_number, get_chain_id, get_contract_address, get_version},\n storage::storage_read,\n};\nuse dep::protocol_types::{address::AztecAddress, traits::Deserialize};\n\npub struct UnconstrainedContext {\n block_number: u32,\n contract_address: AztecAddress,\n version: Field,\n chain_id: Field,\n}\n\nimpl UnconstrainedContext {\n pub unconstrained fn new() -> Self {\n // We could call these oracles on the getters instead of at creation, which makes sense given that they might\n // not even be accessed. However any performance gains are minimal, and we'd rather fail early if a user\n // incorrectly attempts to create an UnconstrainedContext in an environment in which these oracles are not\n // available.\n let block_number = get_block_number();\n let contract_address = get_contract_address();\n let chain_id = get_chain_id();\n let version = get_version();\n Self { block_number, contract_address, version, chain_id }\n }\n\n pub unconstrained fn at(contract_address: AztecAddress) -> Self {\n let block_number = get_block_number();\n let chain_id = get_chain_id();\n let version = get_version();\n Self { block_number, contract_address, version, chain_id }\n }\n\n pub unconstrained fn at_historical(contract_address: AztecAddress, block_number: u32) -> Self {\n let chain_id = get_chain_id();\n let version = get_version();\n Self { block_number, contract_address, version, chain_id }\n }\n\n pub fn block_number(self) -> u32 {\n self.block_number\n }\n\n pub fn this_address(self) -> AztecAddress {\n self.contract_address\n }\n\n pub fn version(self) -> Field {\n self.version\n }\n\n pub fn chain_id(self) -> Field {\n self.chain_id\n }\n\n pub unconstrained fn raw_storage_read(\n self: Self,\n storage_slot: Field,\n ) -> [Field; N] {\n storage_read(self.this_address(), storage_slot, self.block_number())\n }\n\n pub unconstrained fn storage_read(self, storage_slot: Field) -> T\n where\n T: Deserialize,\n {\n T::deserialize(self.raw_storage_read(storage_slot))\n }\n}\n","path":"/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.66.0/noir-projects/aztec-nr/aztec/src/context/unconstrained_context.nr"},"127":{"source":"use crate::context::gas::GasOpts;\nuse crate::hash::{\n compute_l1_to_l2_message_hash, compute_l1_to_l2_message_nullifier, compute_secret_hash,\n};\nuse dep::protocol_types::abis::function_selector::FunctionSelector;\nuse dep::protocol_types::address::{AztecAddress, EthAddress};\nuse dep::protocol_types::constants::MAX_FIELD_VALUE;\nuse dep::protocol_types::traits::{Deserialize, Empty, Serialize};\n\npub struct PublicContext {\n pub args_hash: Option,\n pub compute_args_hash: fn() -> Field,\n}\n\nimpl PublicContext {\n pub fn new(compute_args_hash: fn() -> Field) -> Self {\n PublicContext { args_hash: Option::none(), compute_args_hash }\n }\n\n pub fn emit_unencrypted_log(_self: &mut Self, log: T)\n where\n T: Serialize,\n {\n // AVM opcodes are constrained by the AVM itself\n unsafe { emit_unencrypted_log(Serialize::serialize(log).as_slice()) };\n }\n\n pub fn note_hash_exists(_self: Self, note_hash: Field, leaf_index: Field) -> bool {\n // AVM opcodes are constrained by the AVM itself\n unsafe { note_hash_exists(note_hash, leaf_index) } == 1\n }\n\n pub fn l1_to_l2_msg_exists(_self: Self, msg_hash: Field, msg_leaf_index: Field) -> bool {\n // AVM opcodes are constrained by the AVM itself\n unsafe { l1_to_l2_msg_exists(msg_hash, msg_leaf_index) } == 1\n }\n\n pub fn nullifier_exists(_self: Self, unsiloed_nullifier: Field, address: AztecAddress) -> bool {\n // AVM opcodes are constrained by the AVM itself\n unsafe { nullifier_exists(unsiloed_nullifier, address.to_field()) } == 1\n }\n\n pub fn consume_l1_to_l2_message(\n &mut self,\n content: Field,\n secret: Field,\n sender: EthAddress,\n leaf_index: Field,\n ) {\n let secret_hash = compute_secret_hash(secret);\n let message_hash = compute_l1_to_l2_message_hash(\n sender,\n self.chain_id(),\n /*recipient=*/\n self.this_address(),\n self.version(),\n content,\n secret_hash,\n leaf_index,\n );\n let nullifier = compute_l1_to_l2_message_nullifier(message_hash, secret);\n\n assert(\n !self.nullifier_exists(nullifier, self.this_address()),\n \"L1-to-L2 message is already nullified\",\n );\n assert(\n self.l1_to_l2_msg_exists(message_hash, leaf_index),\n \"Tried to consume nonexistent L1-to-L2 message\",\n );\n\n self.push_nullifier(nullifier);\n }\n\n pub fn message_portal(_self: &mut Self, recipient: EthAddress, content: Field) {\n // AVM opcodes are constrained by the AVM itself\n unsafe { send_l2_to_l1_msg(recipient, content) };\n }\n\n pub unconstrained fn call_public_function(\n _self: &mut Self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args: [Field],\n gas_opts: GasOpts,\n ) -> [Field] {\n let args = args.push_front(function_selector.to_field());\n let success = call(gas_for_call(gas_opts), contract_address, args);\n\n let result_data = returndata_copy(0, returndata_size());\n if !success {\n // Rethrow the revert data.\n avm_revert(result_data);\n }\n result_data\n }\n\n pub unconstrained fn static_call_public_function(\n _self: &mut Self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args: [Field],\n gas_opts: GasOpts,\n ) -> [Field] {\n let args = args.push_front(function_selector.to_field());\n let success = call_static(gas_for_call(gas_opts), contract_address, args);\n\n let result_data = returndata_copy(0, returndata_size());\n if !success {\n // Rethrow the revert data.\n avm_revert(result_data);\n }\n result_data\n }\n\n pub fn push_note_hash(_self: &mut Self, note_hash: Field) {\n // AVM opcodes are constrained by the AVM itself\n unsafe { emit_note_hash(note_hash) };\n }\n pub fn push_nullifier(_self: &mut Self, nullifier: Field) {\n // AVM opcodes are constrained by the AVM itself\n unsafe { emit_nullifier(nullifier) };\n }\n\n pub fn this_address(_self: Self) -> AztecAddress {\n // AVM opcodes are constrained by the AVM itself\n unsafe {\n address()\n }\n }\n pub fn msg_sender(_self: Self) -> AztecAddress {\n // AVM opcodes are constrained by the AVM itself\n unsafe {\n sender()\n }\n }\n pub fn selector(_self: Self) -> FunctionSelector {\n // The selector is the first element of the calldata when calling a public function through dispatch.\n // AVM opcodes are constrained by the AVM itself.\n let raw_selector: [Field; 1] = unsafe { calldata_copy(0, 1) };\n FunctionSelector::from_field(raw_selector[0])\n }\n pub fn get_args_hash(mut self) -> Field {\n if !self.args_hash.is_some() {\n self.args_hash = Option::some((self.compute_args_hash)());\n }\n\n self.args_hash.unwrap_unchecked()\n }\n pub fn transaction_fee(_self: Self) -> Field {\n // AVM opcodes are constrained by the AVM itself\n unsafe {\n transaction_fee()\n }\n }\n\n pub fn chain_id(_self: Self) -> Field {\n // AVM opcodes are constrained by the AVM itself\n unsafe {\n chain_id()\n }\n }\n pub fn version(_self: Self) -> Field {\n // AVM opcodes are constrained by the AVM itself\n unsafe {\n version()\n }\n }\n pub fn block_number(_self: Self) -> Field {\n // AVM opcodes are constrained by the AVM itself\n unsafe {\n block_number()\n }\n }\n pub fn timestamp(_self: Self) -> u64 {\n // AVM opcodes are constrained by the AVM itself\n unsafe {\n timestamp()\n }\n }\n pub fn fee_per_l2_gas(_self: Self) -> Field {\n // AVM opcodes are constrained by the AVM itself\n unsafe {\n fee_per_l2_gas()\n }\n }\n pub fn fee_per_da_gas(_self: Self) -> Field {\n // AVM opcodes are constrained by the AVM itself\n unsafe {\n fee_per_da_gas()\n }\n }\n\n pub fn l2_gas_left(_self: Self) -> Field {\n // AVM opcodes are constrained by the AVM itself\n unsafe {\n l2_gas_left()\n }\n }\n pub fn da_gas_left(_self: Self) -> Field {\n // AVM opcodes are constrained by the AVM itself\n unsafe {\n da_gas_left()\n }\n }\n pub fn is_static_call(_self: Self) -> bool {\n // AVM opcodes are constrained by the AVM itself\n unsafe { is_static_call() } == 1\n }\n\n pub fn raw_storage_read(_self: Self, storage_slot: Field) -> [Field; N] {\n let mut out = [0; N];\n for i in 0..N {\n // AVM opcodes are constrained by the AVM itself\n out[i] = unsafe { storage_read(storage_slot + i as Field) };\n }\n out\n }\n\n pub fn storage_read(self, storage_slot: Field) -> T\n where\n T: Deserialize,\n {\n T::deserialize(self.raw_storage_read(storage_slot))\n }\n\n pub fn raw_storage_write(_self: Self, storage_slot: Field, values: [Field; N]) {\n for i in 0..N {\n // AVM opcodes are constrained by the AVM itself\n unsafe { storage_write(storage_slot + i as Field, values[i]) };\n }\n }\n\n pub fn storage_write(self, storage_slot: Field, value: T)\n where\n T: Serialize,\n {\n self.raw_storage_write(storage_slot, value.serialize());\n }\n}\n\n// Helper functions\nfn gas_for_call(user_gas: GasOpts) -> [Field; 2] {\n // It's ok to use the max possible gas here, because the gas will be\n // capped by the gas left in the (STATIC)CALL instruction.\n [user_gas.l2_gas.unwrap_or(MAX_FIELD_VALUE), user_gas.da_gas.unwrap_or(MAX_FIELD_VALUE)]\n}\n\n// Unconstrained opcode wrappers (do not use directly).\nunconstrained fn address() -> AztecAddress {\n address_opcode()\n}\nunconstrained fn sender() -> AztecAddress {\n sender_opcode()\n}\nunconstrained fn transaction_fee() -> Field {\n transaction_fee_opcode()\n}\nunconstrained fn chain_id() -> Field {\n chain_id_opcode()\n}\nunconstrained fn version() -> Field {\n version_opcode()\n}\nunconstrained fn block_number() -> Field {\n block_number_opcode()\n}\nunconstrained fn timestamp() -> u64 {\n timestamp_opcode()\n}\nunconstrained fn fee_per_l2_gas() -> Field {\n fee_per_l2_gas_opcode()\n}\nunconstrained fn fee_per_da_gas() -> Field {\n fee_per_da_gas_opcode()\n}\nunconstrained fn l2_gas_left() -> Field {\n l2_gas_left_opcode()\n}\nunconstrained fn da_gas_left() -> Field {\n da_gas_left_opcode()\n}\nunconstrained fn is_static_call() -> Field {\n is_static_call_opcode()\n}\nunconstrained fn note_hash_exists(note_hash: Field, leaf_index: Field) -> u1 {\n note_hash_exists_opcode(note_hash, leaf_index)\n}\nunconstrained fn emit_note_hash(note_hash: Field) {\n emit_note_hash_opcode(note_hash)\n}\nunconstrained fn nullifier_exists(nullifier: Field, address: Field) -> u1 {\n nullifier_exists_opcode(nullifier, address)\n}\nunconstrained fn emit_nullifier(nullifier: Field) {\n emit_nullifier_opcode(nullifier)\n}\nunconstrained fn emit_unencrypted_log(message: [Field]) {\n emit_unencrypted_log_opcode(message)\n}\nunconstrained fn l1_to_l2_msg_exists(msg_hash: Field, msg_leaf_index: Field) -> u1 {\n l1_to_l2_msg_exists_opcode(msg_hash, msg_leaf_index)\n}\nunconstrained fn send_l2_to_l1_msg(recipient: EthAddress, content: Field) {\n send_l2_to_l1_msg_opcode(recipient, content)\n}\nunconstrained fn call(gas: [Field; 2], address: AztecAddress, args: [Field]) -> bool {\n call_opcode(gas, address, args)\n}\nunconstrained fn call_static(gas: [Field; 2], address: AztecAddress, args: [Field]) -> bool {\n call_static_opcode(gas, address, args)\n}\n\npub unconstrained fn calldata_copy(cdoffset: u32, copy_size: u32) -> [Field; N] {\n calldata_copy_opcode(cdoffset, copy_size)\n}\n\nunconstrained fn returndata_size() -> u32 {\n returndata_size_opcode()\n}\n\nunconstrained fn returndata_copy(rdoffset: u32, copy_size: u32) -> [Field] {\n returndata_copy_opcode(rdoffset, copy_size)\n}\n\npub unconstrained fn avm_return(returndata: [Field]) {\n return_opcode(returndata)\n}\n\n// This opcode reverts using the exact data given. In general it should only be used\n// to do rethrows, where the revert data is the same as the original revert data.\n// For normal reverts, use Noir's `assert` which, on top of reverting, will also add\n// an error selector to the revert data.\nunconstrained fn avm_revert(revertdata: [Field]) {\n revert_opcode(revertdata)\n}\n\nunconstrained fn storage_read(storage_slot: Field) -> Field {\n storage_read_opcode(storage_slot)\n}\n\nunconstrained fn storage_write(storage_slot: Field, value: Field) {\n storage_write_opcode(storage_slot, value);\n}\n\nimpl Empty for PublicContext {\n fn empty() -> Self {\n PublicContext::new(|| 0)\n }\n}\n\n// AVM oracles (opcodes) follow, do not use directly.\n#[oracle(avmOpcodeAddress)]\nunconstrained fn address_opcode() -> AztecAddress {}\n\n#[oracle(avmOpcodeSender)]\nunconstrained fn sender_opcode() -> AztecAddress {}\n\n#[oracle(avmOpcodeTransactionFee)]\nunconstrained fn transaction_fee_opcode() -> Field {}\n\n#[oracle(avmOpcodeChainId)]\nunconstrained fn chain_id_opcode() -> Field {}\n\n#[oracle(avmOpcodeVersion)]\nunconstrained fn version_opcode() -> Field {}\n\n#[oracle(avmOpcodeBlockNumber)]\nunconstrained fn block_number_opcode() -> Field {}\n\n#[oracle(avmOpcodeTimestamp)]\nunconstrained fn timestamp_opcode() -> u64 {}\n\n#[oracle(avmOpcodeFeePerL2Gas)]\nunconstrained fn fee_per_l2_gas_opcode() -> Field {}\n\n#[oracle(avmOpcodeFeePerDaGas)]\nunconstrained fn fee_per_da_gas_opcode() -> Field {}\n\n#[oracle(avmOpcodeL2GasLeft)]\nunconstrained fn l2_gas_left_opcode() -> Field {}\n\n#[oracle(avmOpcodeDaGasLeft)]\nunconstrained fn da_gas_left_opcode() -> Field {}\n\n#[oracle(avmOpcodeIsStaticCall)]\nunconstrained fn is_static_call_opcode() -> Field {}\n\n#[oracle(avmOpcodeNoteHashExists)]\nunconstrained fn note_hash_exists_opcode(note_hash: Field, leaf_index: Field) -> u1 {}\n\n#[oracle(avmOpcodeEmitNoteHash)]\nunconstrained fn emit_note_hash_opcode(note_hash: Field) {}\n\n#[oracle(avmOpcodeNullifierExists)]\nunconstrained fn nullifier_exists_opcode(nullifier: Field, address: Field) -> u1 {}\n\n#[oracle(avmOpcodeEmitNullifier)]\nunconstrained fn emit_nullifier_opcode(nullifier: Field) {}\n\n#[oracle(avmOpcodeEmitUnencryptedLog)]\nunconstrained fn emit_unencrypted_log_opcode(message: [Field]) {}\n\n#[oracle(avmOpcodeL1ToL2MsgExists)]\nunconstrained fn l1_to_l2_msg_exists_opcode(msg_hash: Field, msg_leaf_index: Field) -> u1 {}\n\n#[oracle(avmOpcodeSendL2ToL1Msg)]\nunconstrained fn send_l2_to_l1_msg_opcode(recipient: EthAddress, content: Field) {}\n\n#[oracle(avmOpcodeCalldataCopy)]\nunconstrained fn calldata_copy_opcode(cdoffset: u32, copy_size: u32) -> [Field; N] {}\n\n#[oracle(avmOpcodeReturndataSize)]\nunconstrained fn returndata_size_opcode() -> u32 {}\n\n#[oracle(avmOpcodeReturndataCopy)]\nunconstrained fn returndata_copy_opcode(rdoffset: u32, copy_size: u32) -> [Field] {}\n\n#[oracle(avmOpcodeReturn)]\nunconstrained fn return_opcode(returndata: [Field]) {}\n\n// This opcode reverts using the exact data given. In general it should only be used\n// to do rethrows, where the revert data is the same as the original revert data.\n// For normal reverts, use Noir's `assert` which, on top of reverting, will also add\n// an error selector to the revert data.\n#[oracle(avmOpcodeRevert)]\nunconstrained fn revert_opcode(revertdata: [Field]) {}\n\n#[oracle(avmOpcodeCall)]\nunconstrained fn call_opcode(\n gas: [Field; 2], // gas allocation: [l2_gas, da_gas]\n address: AztecAddress,\n args: [Field],\n) -> bool {}\n\n#[oracle(avmOpcodeStaticCall)]\nunconstrained fn call_static_opcode(\n gas: [Field; 2], // gas allocation: [l2_gas, da_gas]\n address: AztecAddress,\n args: [Field],\n) -> bool {}\n\n#[oracle(avmOpcodeStorageRead)]\nunconstrained fn storage_read_opcode(storage_slot: Field) -> Field {}\n\n#[oracle(avmOpcodeStorageWrite)]\nunconstrained fn storage_write_opcode(storage_slot: Field, value: Field) {}\n","path":"/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.66.0/noir-projects/aztec-nr/aztec/src/context/public_context.nr"},"129":{"source":"use crate::utils::to_bytes::{arr_to_be_bytes_arr, str_to_be_bytes_arr};\nuse dep::protocol_types::{\n address::{AztecAddress, EthAddress},\n constants::{\n GENERATOR_INDEX__FUNCTION_ARGS, GENERATOR_INDEX__MESSAGE_NULLIFIER,\n GENERATOR_INDEX__SECRET_HASH,\n },\n hash::{poseidon2_hash_with_separator, poseidon2_hash_with_separator_slice, sha256_to_field},\n point::Point,\n traits::Hash,\n};\n\npub use dep::protocol_types::hash::{compute_siloed_nullifier, pedersen_hash};\n\npub fn pedersen_commitment(inputs: [Field; N], hash_index: u32) -> Point {\n std::hash::pedersen_commitment_with_separator(inputs, hash_index)\n}\n\npub fn compute_secret_hash(secret: Field) -> Field {\n poseidon2_hash_with_separator([secret], GENERATOR_INDEX__SECRET_HASH)\n}\n\npub fn compute_unencrypted_log_hash(\n contract_address: AztecAddress,\n log: [u8; N],\n) -> Field {\n let mut hash_bytes = [0; N + 36];\n // Address is converted to 32 bytes in ts\n let address_bytes: [u8; 32] = contract_address.to_field().to_be_bytes();\n for i in 0..32 {\n hash_bytes[i] = address_bytes[i];\n }\n let len_bytes: [u8; 4] = (N as Field).to_be_bytes();\n for i in 0..4 {\n hash_bytes[32 + i] = len_bytes[i];\n }\n for i in 0..N {\n hash_bytes[36 + i] = log[i];\n }\n\n sha256_to_field(hash_bytes)\n}\n\npub fn compute_l1_to_l2_message_hash(\n sender: EthAddress,\n chain_id: Field,\n recipient: AztecAddress,\n version: Field,\n content: Field,\n secret_hash: Field,\n leaf_index: Field,\n) -> Field {\n let mut hash_bytes = [0 as u8; 224];\n let sender_bytes: [u8; 32] = sender.to_field().to_be_bytes();\n let chain_id_bytes: [u8; 32] = chain_id.to_be_bytes();\n let recipient_bytes: [u8; 32] = recipient.to_field().to_be_bytes();\n let version_bytes: [u8; 32] = version.to_be_bytes();\n let content_bytes: [u8; 32] = content.to_be_bytes();\n let secret_hash_bytes: [u8; 32] = secret_hash.to_be_bytes();\n let leaf_index_bytes: [u8; 32] = leaf_index.to_be_bytes();\n\n for i in 0..32 {\n hash_bytes[i] = sender_bytes[i];\n hash_bytes[i + 32] = chain_id_bytes[i];\n hash_bytes[i + 64] = recipient_bytes[i];\n hash_bytes[i + 96] = version_bytes[i];\n hash_bytes[i + 128] = content_bytes[i];\n hash_bytes[i + 160] = secret_hash_bytes[i];\n hash_bytes[i + 192] = leaf_index_bytes[i];\n }\n\n sha256_to_field(hash_bytes)\n}\n\n// The nullifier of a l1 to l2 message is the hash of the message salted with the secret\npub fn compute_l1_to_l2_message_nullifier(message_hash: Field, secret: Field) -> Field {\n poseidon2_hash_with_separator([message_hash, secret], GENERATOR_INDEX__MESSAGE_NULLIFIER)\n}\n\npub struct ArgsHasher {\n pub fields: [Field],\n}\n\nimpl Hash for ArgsHasher {\n fn hash(self) -> Field {\n hash_args(self.fields)\n }\n}\n\nimpl ArgsHasher {\n pub fn new() -> Self {\n Self { fields: [] }\n }\n\n pub fn add(&mut self, field: Field) {\n self.fields = self.fields.push_back(field);\n }\n\n pub fn add_multiple(&mut self, fields: [Field; N]) {\n for i in 0..N {\n self.fields = self.fields.push_back(fields[i]);\n }\n }\n}\n\npub fn hash_args_array(args: [Field; N]) -> Field {\n if args.len() == 0 {\n 0\n } else {\n poseidon2_hash_with_separator(args, GENERATOR_INDEX__FUNCTION_ARGS)\n }\n}\n\npub fn hash_args(args: [Field]) -> Field {\n if args.len() == 0 {\n 0\n } else {\n poseidon2_hash_with_separator_slice(args, GENERATOR_INDEX__FUNCTION_ARGS)\n }\n}\n\n#[test]\nunconstrained fn compute_var_args_hash() {\n let mut input = ArgsHasher::new();\n for i in 0..100 {\n input.add(i as Field);\n }\n let hash = input.hash();\n dep::std::println(hash);\n assert(hash == 0x19b0d74feb06ebde19edd85a28986c97063e84b3b351a8b666c7cac963ce655f);\n}\n\n#[test]\nunconstrained fn compute_unenc_log_hash_array() {\n let contract_address = AztecAddress::from_field(\n 0x233a3e0df23b2b15b324194cb4a151f26c0b7333250781d34cc269d85dc334c6,\n );\n let log = [\n 0x20660de09f35f876e3e69d227b2a35166ad05f09d82d06366ec9b6f65a51fec2,\n 0x1b52bfe3b8689761916f76dc3d38aa8810860db325cd39ca611eed980091f01c,\n 0x2e559c4045c378a56ad13b9edb1e8de4e7ad3b3aa35cc7ba9ec77f7a68fa43a4,\n 0x25d0f689c4a4178a29d59306f2675824d19be6d25e44fa03b03f49c263053dd2,\n 0x2d513a722d6f352dc0961f156afdc5e31495b9f0e35cb069261a8e55e2df67fd,\n ];\n let serialized_log = arr_to_be_bytes_arr(log);\n let hash = compute_unencrypted_log_hash(contract_address, serialized_log);\n assert(hash == 0x0095b2d17ab72f4b27a341f7ac63e49ec73935ae8c9181a0ac02023eb12f3284);\n}\n\n#[test]\nunconstrained fn compute_unenc_log_hash_addr() {\n let contract_address = AztecAddress::from_field(\n 0x233a3e0df23b2b15b324194cb4a151f26c0b7333250781d34cc269d85dc334c6,\n );\n let log = AztecAddress::from_field(\n 0x26aa302d4715fd8a687453cb26d616b0768027bd54bcae56b09d908ecd9f8303,\n );\n let serialized_log: [u8; 32] = log.to_field().to_be_bytes();\n let hash = compute_unencrypted_log_hash(contract_address, serialized_log);\n assert(hash == 0x0083ab647dfb26e7ddee90a0f4209d049d4660cab42000c544b986aaa84c55a3);\n}\n\n#[test]\nunconstrained fn compute_unenc_log_hash_str() {\n let contract_address = AztecAddress::from_field(\n 0x1b401e1146c5c507962287065c81f0ef7590adae3802c533d7549d6bf0a41bd8,\n );\n let log = \"dummy\";\n let serialized_log = str_to_be_bytes_arr(log);\n let hash = compute_unencrypted_log_hash(contract_address, serialized_log);\n assert(hash == 0x00629e88ebd6374f44aa6cfe07e251ecf07213ebc7267e8f6b578ae57ffd6c20);\n}\n\n#[test]\nunconstrained fn compute_unenc_log_hash_longer_str() {\n let contract_address = AztecAddress::from_field(\n 0x1b401e1146c5c507962287065c81f0ef7590adae3802c533d7549d6bf0a41bd8,\n );\n let log = \"Hello this is a string\";\n let serialized_log = str_to_be_bytes_arr(log);\n let hash = compute_unencrypted_log_hash(contract_address, serialized_log);\n assert(hash == 0x0098637962f7d34fa202b7ffad8a07a238c5d1fd897b82a108f7f467fa73b841);\n}\n","path":"/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.66.0/noir-projects/aztec-nr/aztec/src/hash.nr"},"143":{"source":"/// Notifies the simulator that `args` will later be used at some point during execution, referenced by their hash. This\n/// allows the simulator to know how to respond to this future request.\n///\n/// This is only used during private execution, since in public it is the VM itself that keeps track of arguments.\npub fn pack_arguments(args: [Field]) {\n // This oracle call returns nothing: we only call it for its side effects. It is therefore always safe to call. When\n // unpacking however the caller must check that the returned value is indeed the preimage.\n unsafe { pack_arguments_oracle_wrapper(args) };\n}\n\n/// Same as `pack_arguments`, but using arrays instead of slices.\npub fn pack_arguments_array(args: [Field; N]) {\n // This oracle call returns nothing: we only call it for its side effects. It is therefore always safe to call. When\n // unpacking however the caller must check that the returned value is indeed the preimage.\n unsafe { pack_arguments_array_oracle_wrapper(args) };\n}\n\nunconstrained fn pack_arguments_oracle_wrapper(args: [Field]) {\n let _ = pack_arguments_oracle(args);\n}\n\nunconstrained fn pack_arguments_array_oracle_wrapper(args: [Field; N]) {\n let _ = pack_arguments_array_oracle(args);\n}\n\n#[oracle(packArguments)]\nunconstrained fn pack_arguments_oracle(_args: [Field]) -> Field {}\n\n#[oracle(packArgumentsArray)]\nunconstrained fn pack_arguments_array_oracle(_args: [Field; N]) -> Field {}\n","path":"/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.66.0/noir-projects/aztec-nr/aztec/src/oracle/arguments.nr"},"144":{"source":"use dep::protocol_types::{\n address::AztecAddress, constants::CONTRACT_INSTANCE_LENGTH, contract_class_id::ContractClassId,\n contract_instance::ContractInstance,\n};\n\n// NOTE: this is for use in private only\n#[oracle(getContractInstance)]\nunconstrained fn get_contract_instance_oracle(\n _address: AztecAddress,\n) -> [Field; CONTRACT_INSTANCE_LENGTH] {}\n\n// NOTE: this is for use in private only\nunconstrained fn get_contract_instance_internal(\n address: AztecAddress,\n) -> [Field; CONTRACT_INSTANCE_LENGTH] {\n get_contract_instance_oracle(address)\n}\n\n// NOTE: this is for use in private only\npub fn get_contract_instance(address: AztecAddress) -> ContractInstance {\n let instance =\n unsafe { ContractInstance::deserialize(get_contract_instance_internal(address)) };\n // The to_address function combines all values in the instance object to produce an address, so by checking that we\n // get the expected address we validate the entire struct.\n assert_eq(instance.to_address(), address);\n\n instance\n}\n\n// These oracles each return a ContractInstance member\n// plus a boolean indicating whether the instance was found.\n#[oracle(avmOpcodeGetContractInstanceDeployer)]\nunconstrained fn get_contract_instance_deployer_oracle_avm(\n _address: AztecAddress,\n) -> (Field, bool) {}\n#[oracle(avmOpcodeGetContractInstanceClassId)]\nunconstrained fn get_contract_instance_class_id_oracle_avm(\n _address: AztecAddress,\n) -> (Field, bool) {}\n#[oracle(avmOpcodeGetContractInstanceInitializationHash)]\nunconstrained fn get_contract_instance_initialization_hash_oracle_avm(\n _address: AztecAddress,\n) -> (Field, bool) {}\n\npub unconstrained fn get_contract_instance_deployer_internal_avm(\n address: AztecAddress,\n) -> (Field, bool) {\n get_contract_instance_deployer_oracle_avm(address)\n}\npub unconstrained fn get_contract_instance_class_id_internal_avm(\n address: AztecAddress,\n) -> (Field, bool) {\n get_contract_instance_class_id_oracle_avm(address)\n}\npub unconstrained fn get_contract_instance_initialization_hash_internal_avm(\n address: AztecAddress,\n) -> (Field, bool) {\n get_contract_instance_initialization_hash_oracle_avm(address)\n}\n\npub fn get_contract_instance_deployer_avm(address: AztecAddress) -> Option {\n let (member, exists) = get_contract_instance_deployer_internal_avm(address);\n if exists {\n Option::some(AztecAddress::from_field(member))\n } else {\n Option::none()\n }\n}\npub fn get_contract_instance_class_id_avm(address: AztecAddress) -> Option {\n let (member, exists) = get_contract_instance_class_id_internal_avm(address);\n if exists {\n Option::some(ContractClassId::from_field(member))\n } else {\n Option::none()\n }\n}\npub fn get_contract_instance_initialization_hash_avm(address: AztecAddress) -> Option {\n let (member, exists) = get_contract_instance_initialization_hash_internal_avm(address);\n if exists {\n Option::some(member)\n } else {\n Option::none()\n }\n}\n","path":"/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.66.0/noir-projects/aztec-nr/aztec/src/oracle/get_contract_instance.nr"},"151":{"source":"use dep::protocol_types::address::AztecAddress;\n\n#[oracle(getContractAddress)]\nunconstrained fn get_contract_address_oracle() -> AztecAddress {}\n\n#[oracle(getBlockNumber)]\nunconstrained fn get_block_number_oracle() -> u32 {}\n\n#[oracle(getChainId)]\nunconstrained fn get_chain_id_oracle() -> Field {}\n\n#[oracle(getVersion)]\nunconstrained fn get_version_oracle() -> Field {}\n\npub unconstrained fn get_contract_address() -> AztecAddress {\n get_contract_address_oracle()\n}\n\npub unconstrained fn get_block_number() -> u32 {\n get_block_number_oracle()\n}\n\npub unconstrained fn get_chain_id() -> Field {\n get_chain_id_oracle()\n}\n\npub unconstrained fn get_version() -> Field {\n get_version_oracle()\n}\n","path":"/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.66.0/noir-projects/aztec-nr/aztec/src/oracle/execution.nr"},"153":{"source":"use crate::note::{note_header::NoteHeader, note_interface::NoteInterface};\n\nuse dep::protocol_types::{\n address::AztecAddress,\n indexed_tagging_secret::{INDEXED_TAGGING_SECRET_LENGTH, IndexedTaggingSecret},\n utils::arr_copy_slice,\n};\n\n/// Notifies the simulator that a note has been created, so that it can be returned in future read requests in the same\n/// transaction. This note should only be added to the non-volatile database if found in an actual block.\npub fn notify_created_note(\n storage_slot: Field,\n note_type_id: Field,\n serialized_note: [Field; N],\n note_hash: Field,\n counter: u32,\n) {\n // This oracle call returns nothing: we only call it for its side effects. It is therefore always safe to call.\n unsafe {\n notify_created_note_oracle_wrapper(\n storage_slot,\n note_type_id,\n serialized_note,\n note_hash,\n counter,\n )\n };\n}\n\n/// Notifies the simulator that a note has been nullified, so that it is no longer returned in future read requests in\n/// the same transaction. This note should only be removed to the non-volatile database if its nullifier is found in an\n/// actual block.\npub fn notify_nullified_note(nullifier: Field, note_hash: Field, counter: u32) {\n // This oracle call returns nothing: we only call it for its side effects. It is therefore always safe to call.\n unsafe { notify_nullified_note_oracle_wrapper(nullifier, note_hash, counter) };\n}\n\nunconstrained fn notify_created_note_oracle_wrapper(\n storage_slot: Field,\n note_type_id: Field,\n serialized_note: [Field; N],\n note_hash: Field,\n counter: u32,\n) {\n let _ = notify_created_note_oracle(\n storage_slot,\n note_type_id,\n serialized_note,\n note_hash,\n counter,\n );\n}\n\n#[oracle(notifyCreatedNote)]\nunconstrained fn notify_created_note_oracle(\n _storage_slot: Field,\n _note_type_id: Field,\n _serialized_note: [Field; N],\n _note_hash: Field,\n _counter: u32,\n) -> Field {}\n\nunconstrained fn notify_nullified_note_oracle_wrapper(\n nullifier: Field,\n note_hash: Field,\n counter: u32,\n) {\n let _ = notify_nullified_note_oracle(nullifier, note_hash, counter);\n}\n\n#[oracle(notifyNullifiedNote)]\nunconstrained fn notify_nullified_note_oracle(\n _nullifier: Field,\n _note_hash: Field,\n _counter: u32,\n) -> Field {}\n\n#[oracle(getNotes)]\nunconstrained fn get_notes_oracle(\n _storage_slot: Field,\n _num_selects: u8,\n _select_by_indexes: [u8; N],\n _select_by_offsets: [u8; N],\n _select_by_lengths: [u8; N],\n _select_values: [Field; N],\n _select_comparators: [u8; N],\n _sort_by_indexes: [u8; N],\n _sort_by_offsets: [u8; N],\n _sort_by_lengths: [u8; N],\n _sort_order: [u8; N],\n _limit: u32,\n _offset: u32,\n _status: u8,\n _return_size: u32,\n _placeholder_fields: [Field; S],\n) -> [Field; S] {}\n\nunconstrained fn get_notes_oracle_wrapper(\n storage_slot: Field,\n num_selects: u8,\n select_by_indexes: [u8; N],\n select_by_offsets: [u8; N],\n select_by_lengths: [u8; N],\n select_values: [Field; N],\n select_comparators: [u8; N],\n sort_by_indexes: [u8; N],\n sort_by_offsets: [u8; N],\n sort_by_lengths: [u8; N],\n sort_order: [u8; N],\n limit: u32,\n offset: u32,\n status: u8,\n mut placeholder_fields: [Field; S],\n) -> [Field; S] {\n let return_size = placeholder_fields.len() as u32;\n get_notes_oracle(\n storage_slot,\n num_selects,\n select_by_indexes,\n select_by_offsets,\n select_by_lengths,\n select_values,\n select_comparators,\n sort_by_indexes,\n sort_by_offsets,\n sort_by_lengths,\n sort_order,\n limit,\n offset,\n status,\n return_size,\n placeholder_fields,\n )\n}\n\npub unconstrained fn get_notes(\n storage_slot: Field,\n num_selects: u8,\n select_by_indexes: [u8; M],\n select_by_offsets: [u8; M],\n select_by_lengths: [u8; M],\n select_values: [Field; M],\n select_comparators: [u8; M],\n sort_by_indexes: [u8; M],\n sort_by_offsets: [u8; M],\n sort_by_lengths: [u8; M],\n sort_order: [u8; M],\n limit: u32,\n offset: u32,\n status: u8,\n mut placeholder_opt_notes: [Option; S], // TODO: Remove it and use `limit` to initialize the note array.\n placeholder_fields: [Field; NS], // TODO: Remove it and use `limit` to initialize the note array.\n _placeholder_note_length: [Field; N], // Turbofish hack? Compiler breaks calculating read_offset unless we add this parameter\n) -> [Option; S]\nwhere\n Note: NoteInterface,\n{\n sync_notes_oracle_wrapper();\n let fields = get_notes_oracle_wrapper(\n storage_slot,\n num_selects,\n select_by_indexes,\n select_by_offsets,\n select_by_lengths,\n select_values,\n select_comparators,\n sort_by_indexes,\n sort_by_offsets,\n sort_by_lengths,\n sort_order,\n limit,\n offset,\n status,\n placeholder_fields,\n );\n let num_notes = fields[0] as u32;\n let contract_address = AztecAddress::from_field(fields[1]);\n for i in 0..placeholder_opt_notes.len() {\n if i < num_notes {\n // lengths named as per typescript.\n let return_header_length: u32 = 2; // num_notes & contract_address.\n let extra_preimage_length: u32 = 2; // nonce & note_hash_counter.\n let read_offset: u32 = return_header_length + i * (N + extra_preimage_length);\n let nonce = fields[read_offset];\n let note_hash_counter = fields[read_offset + 1] as u32;\n let header = NoteHeader { contract_address, nonce, storage_slot, note_hash_counter };\n let serialized_note = arr_copy_slice(fields, [0; N], read_offset + 2);\n let mut note = Note::deserialize_content(serialized_note);\n note.set_header(header);\n placeholder_opt_notes[i] = Option::some(note);\n };\n }\n placeholder_opt_notes\n}\n\n/// Returns true if the nullifier exists. Note that a `true` value can be constrained by proving existence of the\n/// nullifier, but a `false` value should not be relied upon since other transactions may emit this nullifier before the\n/// current transaction is included in a block. While this might seem of little use at first, certain design patterns\n/// benefit from this abstraction (see e.g. `PrivateMutable`).\npub unconstrained fn check_nullifier_exists(inner_nullifier: Field) -> bool {\n check_nullifier_exists_oracle(inner_nullifier) == 1\n}\n\n#[oracle(checkNullifierExists)]\nunconstrained fn check_nullifier_exists_oracle(_inner_nullifier: Field) -> Field {}\n\n/// Same as `get_app_tagging_secret_as_sender`, except it returns the derived tag, ready to be included in a log.\npub unconstrained fn get_app_tag_as_sender(sender: AztecAddress, recipient: AztecAddress) -> Field {\n get_app_tagging_secret_as_sender(sender, recipient).compute_tag(recipient)\n}\n\n/// Returns the tagging secret for a given sender and recipient pair, siloed for the current contract address.\n/// Includes the last known index used to send a note tagged with this secret.\n/// For this to work, PXE must know the ivpsk_m of the sender.\n/// For the recipient's side, only the address is needed.\npub unconstrained fn get_app_tagging_secret_as_sender(\n sender: AztecAddress,\n recipient: AztecAddress,\n) -> IndexedTaggingSecret {\n let result = get_app_tagging_secret_as_sender_oracle(sender, recipient);\n IndexedTaggingSecret::deserialize(result)\n}\n\n#[oracle(getAppTaggingSecretAsSender)]\nunconstrained fn get_app_tagging_secret_as_sender_oracle(\n _sender: AztecAddress,\n _recipient: AztecAddress,\n) -> [Field; INDEXED_TAGGING_SECRET_LENGTH] {}\n\n/// Notifies the simulator that a tag has been used in a note, and to therefore increment the associated index so that\n/// future notes get a different tag and can be discovered by the recipient.\n/// This change should only be persisted in a non-volatile database if the tagged log is found in an actual block -\n/// otherwise e.g. a reverting transaction can cause the sender to accidentally skip indices and later produce notes\n/// that are not found by the recipient.\npub fn increment_app_tagging_secret_index_as_sender(sender: AztecAddress, recipient: AztecAddress) {\n // This oracle call returns nothing: we only call it for its side effects. It is therefore always safe to call.\n unsafe {\n increment_app_tagging_secret_index_as_sender_wrapper(sender, recipient);\n }\n}\n\nunconstrained fn increment_app_tagging_secret_index_as_sender_wrapper(\n sender: AztecAddress,\n recipient: AztecAddress,\n) {\n increment_app_tagging_secret_index_as_sender_oracle(sender, recipient);\n}\n\n#[oracle(incrementAppTaggingSecretIndexAsSender)]\nunconstrained fn increment_app_tagging_secret_index_as_sender_oracle(\n _sender: AztecAddress,\n _recipient: AztecAddress,\n) {}\n\n/// Finds new notes that may have been sent to all registered accounts in PXE in the current contract and makes them available\n/// for later querying via the `get_notes` oracle.\npub fn sync_notes() {\n // This oracle call returns nothing: we only call it for its side effects. It is therefore always safe to call.\n unsafe {\n sync_notes_oracle_wrapper();\n }\n}\n\nunconstrained fn sync_notes_oracle_wrapper() {\n sync_notes_oracle();\n}\n\n#[oracle(syncNotes)]\nunconstrained fn sync_notes_oracle() {}\n","path":"/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.66.0/noir-projects/aztec-nr/aztec/src/oracle/notes.nr"},"154":{"source":"use dep::protocol_types::{abis::function_selector::FunctionSelector, address::AztecAddress};\n\n#[oracle(enqueuePublicFunctionCall)]\nunconstrained fn enqueue_public_function_call_oracle(\n _contract_address: AztecAddress,\n _function_selector: FunctionSelector,\n _args_hash: Field,\n _side_effect_counter: u32,\n _is_static_call: bool,\n) -> Field {}\n\npub unconstrained fn enqueue_public_function_call_internal(\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args_hash: Field,\n side_effect_counter: u32,\n is_static_call: bool,\n) -> Field {\n enqueue_public_function_call_oracle(\n contract_address,\n function_selector,\n args_hash,\n side_effect_counter,\n is_static_call,\n )\n}\n\n#[oracle(setPublicTeardownFunctionCall)]\nunconstrained fn set_public_teardown_function_call_oracle(\n _contract_address: AztecAddress,\n _function_selector: FunctionSelector,\n _args_hash: Field,\n _side_effect_counter: u32,\n _is_static_call: bool,\n) -> Field {}\n\npub unconstrained fn set_public_teardown_function_call_internal(\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args_hash: Field,\n side_effect_counter: u32,\n is_static_call: bool,\n) -> Field {\n set_public_teardown_function_call_oracle(\n contract_address,\n function_selector,\n args_hash,\n side_effect_counter,\n is_static_call,\n )\n}\n\npub fn notify_set_min_revertible_side_effect_counter(counter: u32) {\n unsafe { notify_set_min_revertible_side_effect_counter_oracle_wrapper(counter) };\n}\n\npub unconstrained fn notify_set_min_revertible_side_effect_counter_oracle_wrapper(counter: u32) {\n notify_set_min_revertible_side_effect_counter_oracle(counter);\n}\n\n#[oracle(notifySetMinRevertibleSideEffectCounter)]\nunconstrained fn notify_set_min_revertible_side_effect_counter_oracle(_counter: u32) {}\n","path":"/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.66.0/noir-projects/aztec-nr/aztec/src/oracle/enqueue_public_function_call.nr"},"155":{"source":"use dep::protocol_types::{address::AztecAddress, traits::Deserialize};\n\n#[oracle(storageRead)]\nunconstrained fn storage_read_oracle(\n address: Field,\n storage_slot: Field,\n block_number: Field,\n length: Field,\n) -> [Field; N] {}\n\npub unconstrained fn raw_storage_read(\n address: AztecAddress,\n storage_slot: Field,\n block_number: u32,\n) -> [Field; N] {\n storage_read_oracle(\n address.to_field(),\n storage_slot,\n block_number as Field,\n N as Field,\n )\n}\n\npub unconstrained fn storage_read(\n address: AztecAddress,\n storage_slot: Field,\n block_number: u32,\n) -> T\nwhere\n T: Deserialize,\n{\n T::deserialize(raw_storage_read(address, storage_slot, block_number))\n}\n\nmod tests {\n use crate::oracle::storage::{raw_storage_read, storage_read};\n use dep::protocol_types::address::AztecAddress;\n\n use crate::test::mocks::mock_struct::MockStruct;\n use std::test::OracleMock;\n\n global address: AztecAddress = AztecAddress::from_field(29);\n global slot: Field = 7;\n global block_number: u32 = 17;\n\n #[test]\n unconstrained fn test_raw_storage_read() {\n let written = MockStruct { a: 13, b: 42 };\n\n let _ = OracleMock::mock(\"storageRead\").returns(written.serialize());\n\n let read: [Field; 2] = raw_storage_read(address, slot, block_number);\n assert_eq(read[0], 13);\n assert_eq(read[1], 42);\n }\n\n #[test]\n unconstrained fn test_storage_read() {\n let written = MockStruct { a: 13, b: 42 };\n\n let _ = OracleMock::mock(\"storageRead\").returns(written.serialize());\n\n let read: MockStruct = storage_read(address, slot, block_number);\n assert_eq(read.a, 13);\n assert_eq(read.b, 42);\n }\n}\n","path":"/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.66.0/noir-projects/aztec-nr/aztec/src/oracle/storage.nr"},"170":{"source":"use dep::protocol_types::{\n abis::function_selector::FunctionSelector, address::AztecAddress,\n constants::GENERATOR_INDEX__CONSTRUCTOR, hash::poseidon2_hash_with_separator,\n};\n\nuse crate::{\n context::{PrivateContext, PublicContext},\n oracle::get_contract_instance::{\n get_contract_instance, get_contract_instance_deployer_avm,\n get_contract_instance_initialization_hash_avm,\n },\n};\n\npub fn mark_as_initialized_public(context: &mut PublicContext) {\n let init_nullifier =\n compute_unsiloed_contract_initialization_nullifier((*context).this_address());\n context.push_nullifier(init_nullifier);\n}\n\npub fn mark_as_initialized_private(context: &mut PrivateContext) {\n let init_nullifier =\n compute_unsiloed_contract_initialization_nullifier((*context).this_address());\n context.push_nullifier(init_nullifier);\n}\n\npub fn assert_is_initialized_public(context: &mut PublicContext) {\n let init_nullifier = compute_unsiloed_contract_initialization_nullifier(context.this_address());\n assert(context.nullifier_exists(init_nullifier, context.this_address()), \"Not initialized\");\n}\n\npub fn assert_is_initialized_private(context: &mut PrivateContext) {\n let init_nullifier = compute_unsiloed_contract_initialization_nullifier(context.this_address());\n context.push_nullifier_read_request(init_nullifier);\n}\n\nfn compute_unsiloed_contract_initialization_nullifier(address: AztecAddress) -> Field {\n address.to_field()\n}\n\npub fn assert_initialization_matches_address_preimage_public(context: PublicContext) {\n let address = context.this_address();\n let deployer = get_contract_instance_deployer_avm(address).unwrap();\n let initialization_hash = get_contract_instance_initialization_hash_avm(address).unwrap();\n let expected_init = compute_initialization_hash(context.selector(), context.get_args_hash());\n assert(initialization_hash == expected_init, \"Initialization hash does not match\");\n assert(\n (deployer.is_zero()) | (deployer == context.msg_sender()),\n \"Initializer address is not the contract deployer\",\n );\n}\n\npub fn assert_initialization_matches_address_preimage_private(context: PrivateContext) {\n let address = context.this_address();\n let instance = get_contract_instance(address);\n let expected_init = compute_initialization_hash(context.selector(), context.get_args_hash());\n assert(instance.initialization_hash == expected_init, \"Initialization hash does not match\");\n assert(\n (instance.deployer.is_zero()) | (instance.deployer == context.msg_sender()),\n \"Initializer address is not the contract deployer\",\n );\n}\n\npub fn compute_initialization_hash(\n init_selector: FunctionSelector,\n init_args_hash: Field,\n) -> Field {\n poseidon2_hash_with_separator(\n [init_selector.to_field(), init_args_hash],\n GENERATOR_INDEX__CONSTRUCTOR,\n )\n}\n","path":"/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.66.0/noir-projects/aztec-nr/aztec/src/initializer.nr"},"176":{"source":"use crate::{\n abis::function_selector::FunctionSelector,\n address::{\n partial_address::PartialAddress, salted_initialization_hash::SaltedInitializationHash,\n },\n constants::{\n AZTEC_ADDRESS_LENGTH, FUNCTION_TREE_HEIGHT, GENERATOR_INDEX__CONTRACT_ADDRESS_V1,\n MAX_FIELD_VALUE,\n },\n contract_class_id::ContractClassId,\n hash::{poseidon2_hash_with_separator, private_functions_root_from_siblings},\n merkle_tree::membership::MembershipWitness,\n public_keys::{IvpkM, NpkM, OvpkM, PublicKeys, TpkM},\n traits::{Deserialize, Empty, FromField, Serialize, ToField},\n utils,\n};\n\n// We do below because `use crate::point::Point;` does not work\nuse dep::std::embedded_curve_ops::EmbeddedCurvePoint as Point;\n\nuse crate::public_keys::AddressPoint;\nuse ec::{pow, sqrt};\nuse std::embedded_curve_ops::{EmbeddedCurveScalar, fixed_base_scalar_mul as derive_public_key};\n\n// Aztec address\npub struct AztecAddress {\n pub inner: Field,\n}\n\nimpl Eq for AztecAddress {\n fn eq(self, other: Self) -> bool {\n self.to_field() == other.to_field()\n }\n}\n\nimpl Empty for AztecAddress {\n fn empty() -> Self {\n Self { inner: 0 }\n }\n}\n\nimpl ToField for AztecAddress {\n fn to_field(self) -> Field {\n self.inner\n }\n}\n\nimpl FromField for AztecAddress {\n fn from_field(value: Field) -> AztecAddress {\n AztecAddress { inner: value }\n }\n}\n\nimpl Serialize for AztecAddress {\n fn serialize(self: Self) -> [Field; AZTEC_ADDRESS_LENGTH] {\n [self.to_field()]\n }\n}\n\nimpl Deserialize for AztecAddress {\n fn deserialize(fields: [Field; AZTEC_ADDRESS_LENGTH]) -> Self {\n FromField::from_field(fields[0])\n }\n}\n\nimpl AztecAddress {\n pub fn zero() -> Self {\n Self { inner: 0 }\n }\n\n pub fn to_address_point(self) -> AddressPoint {\n // We compute the address point by taking our address, setting it to x, and then solving for y in the\n // equation which defines our bn curve:\n // y^2 = x^3 - 17; x = address\n let x = self.inner;\n let y_squared = pow(x, 3) - 17;\n\n // TODO (#8970): Handle cases where we cannot recover a point from an address\n let mut y = sqrt(y_squared);\n\n // If we get a negative y coordinate (any y where y > MAX_FIELD_VALUE / 2), we pin it to the\n // positive one (any value where y <= MAX_FIELD_VALUE / 2) by subtracting it from the Field modulus\n // note: The field modulus is MAX_FIELD_VALUE + 1\n if (!(y.lt(MAX_FIELD_VALUE / 2) | y.eq(MAX_FIELD_VALUE / 2))) {\n y = (MAX_FIELD_VALUE + 1) - y;\n }\n\n AddressPoint { inner: Point { x: self.inner, y, is_infinite: false } }\n }\n\n pub fn compute(public_keys: PublicKeys, partial_address: PartialAddress) -> AztecAddress {\n let public_keys_hash = public_keys.hash();\n\n let pre_address = poseidon2_hash_with_separator(\n [public_keys_hash.to_field(), partial_address.to_field()],\n GENERATOR_INDEX__CONTRACT_ADDRESS_V1,\n );\n\n let address_point = derive_public_key(EmbeddedCurveScalar::from_field(pre_address)).add(\n public_keys.ivpk_m.to_point(),\n );\n\n // Note that our address is only the x-coordinate of the full address_point. This is okay because when people want to encrypt something and send it to us\n // they can recover our full point using the x-coordinate (our address itself). To do this, they recompute the y-coordinate according to the equation y^2 = x^3 - 17.\n // When they do this, they may get a positive y-coordinate (a value that is less than or equal to MAX_FIELD_VALUE / 2) or\n // a negative y-coordinate (a value that is more than MAX_FIELD_VALUE), and we cannot dictate which one they get and hence the recovered point may sometimes be different than the one\n // our secrect can decrypt. Regardless though, they should and will always encrypt using point with the positive y-coordinate by convention.\n // This ensures that everyone encrypts to the same point given an arbitrary x-coordinate (address). This is allowed because even though our original point may not have a positive y-coordinate,\n // with our original secret, we will be able to derive the secret to the point with the flipped (and now positive) y-coordinate that everyone encrypts to.\n AztecAddress::from_field(address_point.x)\n }\n\n pub fn compute_from_private_function(\n function_selector: FunctionSelector,\n function_vk_hash: Field,\n function_leaf_membership_witness: MembershipWitness,\n contract_class_artifact_hash: Field,\n contract_class_public_bytecode_commitment: Field,\n salted_initialization_hash: SaltedInitializationHash,\n public_keys: PublicKeys,\n ) -> Self {\n let private_functions_root = private_functions_root_from_siblings(\n function_selector,\n function_vk_hash,\n function_leaf_membership_witness.leaf_index,\n function_leaf_membership_witness.sibling_path,\n );\n\n let contract_class_id = ContractClassId::compute(\n contract_class_artifact_hash,\n private_functions_root,\n contract_class_public_bytecode_commitment,\n );\n\n // Compute contract address using the preimage which includes the class_id.\n let partial_address = PartialAddress::compute_from_salted_initialization_hash(\n contract_class_id,\n salted_initialization_hash,\n );\n\n AztecAddress::compute(public_keys, partial_address)\n }\n\n pub fn is_zero(self) -> bool {\n self.inner == 0\n }\n\n pub fn assert_is_zero(self) {\n assert(self.to_field() == 0);\n }\n\n pub fn conditional_assign(predicate: bool, lhs: Self, rhs: Self) -> Self {\n let result = utils::conditional_assign(predicate, rhs.to_field(), lhs.to_field());\n Self { inner: result }\n }\n}\n\n#[test]\nfn compute_address_from_partial_and_pub_keys() {\n let public_keys = PublicKeys {\n npk_m: NpkM {\n inner: Point {\n x: 0x22f7fcddfa3ce3e8f0cc8e82d7b94cdd740afa3e77f8e4a63ea78a239432dcab,\n y: 0x0471657de2b6216ade6c506d28fbc22ba8b8ed95c871ad9f3e3984e90d9723a7,\n is_infinite: false,\n },\n },\n ivpk_m: IvpkM {\n inner: Point {\n x: 0x111223493147f6785514b1c195bb37a2589f22a6596d30bb2bb145fdc9ca8f1e,\n y: 0x273bbffd678edce8fe30e0deafc4f66d58357c06fd4a820285294b9746c3be95,\n is_infinite: false,\n },\n },\n ovpk_m: OvpkM {\n inner: Point {\n x: 0x09115c96e962322ffed6522f57194627136b8d03ac7469109707f5e44190c484,\n y: 0x0c49773308a13d740a7f0d4f0e6163b02c5a408b6f965856b6a491002d073d5b,\n is_infinite: false,\n },\n },\n tpk_m: TpkM {\n inner: Point {\n x: 0x00d3d81beb009873eb7116327cf47c612d5758ef083d4fda78e9b63980b2a762,\n y: 0x2f567d22d2b02fe1f4ad42db9d58a36afd1983e7e2909d1cab61cafedad6193a,\n is_infinite: false,\n },\n },\n };\n\n let partial_address = PartialAddress::from_field(\n 0x0a7c585381b10f4666044266a02405bf6e01fa564c8517d4ad5823493abd31de,\n );\n\n let address = AztecAddress::compute(public_keys, partial_address);\n\n // The following value was generated by `derivation.test.ts`.\n // --> Run the test with AZTEC_GENERATE_TEST_DATA=1 flag to update test data.\n let expected_computed_address_from_partial_and_pubkeys =\n 0x24e4646f58b9fbe7d38e317db8d5636c423fbbdfbe119fc190fe9c64747e0c62;\n assert(address.to_field() == expected_computed_address_from_partial_and_pubkeys);\n}\n\n#[test]\nfn compute_preaddress_from_partial_and_pub_keys() {\n let pre_address = poseidon2_hash_with_separator([1, 2], GENERATOR_INDEX__CONTRACT_ADDRESS_V1);\n let expected_computed_preaddress_from_partial_and_pubkey =\n 0x23ce9be3fa3c846b0f9245cc796902e731d04f086e8a42473bb29e405fc98075;\n assert(pre_address == expected_computed_preaddress_from_partial_and_pubkey);\n}\n\n#[test]\nfn from_field_to_field() {\n let address = AztecAddress { inner: 37 };\n assert_eq(FromField::from_field(address.to_field()), address);\n}\n\n#[test]\nfn serde() {\n let address = AztecAddress { inner: 37 };\n assert_eq(Deserialize::deserialize(address.serialize()), address);\n}\n","path":"/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.66.0/noir-projects/noir-protocol-circuits/crates/types/src/address/aztec_address.nr"},"187":{"source":"use crate::traits::{Deserialize, Serialize};\n\nglobal BOOL_SERIALIZED_LEN: u32 = 1;\nglobal U8_SERIALIZED_LEN: u32 = 1;\nglobal U16_SERIALIZED_LEN: u32 = 1;\nglobal U32_SERIALIZED_LEN: u32 = 1;\nglobal U64_SERIALIZED_LEN: u32 = 1;\nglobal U128_SERIALIZED_LEN: u32 = 1;\nglobal FIELD_SERIALIZED_LEN: u32 = 1;\nglobal I8_SERIALIZED_LEN: u32 = 1;\nglobal I16_SERIALIZED_LEN: u32 = 1;\nglobal I32_SERIALIZED_LEN: u32 = 1;\nglobal I64_SERIALIZED_LEN: u32 = 1;\n\nimpl Serialize for bool {\n fn serialize(self) -> [Field; BOOL_SERIALIZED_LEN] {\n [self as Field]\n }\n}\n\nimpl Deserialize for bool {\n fn deserialize(fields: [Field; BOOL_SERIALIZED_LEN]) -> bool {\n fields[0] as bool\n }\n}\n\nimpl Serialize for u8 {\n fn serialize(self) -> [Field; U8_SERIALIZED_LEN] {\n [self as Field]\n }\n}\n\nimpl Deserialize for u8 {\n fn deserialize(fields: [Field; U8_SERIALIZED_LEN]) -> Self {\n fields[0] as u8\n }\n}\n\nimpl Serialize for u16 {\n fn serialize(self) -> [Field; U16_SERIALIZED_LEN] {\n [self as Field]\n }\n}\n\nimpl Deserialize for u16 {\n fn deserialize(fields: [Field; U16_SERIALIZED_LEN]) -> Self {\n fields[0] as u16\n }\n}\n\nimpl Serialize for u32 {\n fn serialize(self) -> [Field; U32_SERIALIZED_LEN] {\n [self as Field]\n }\n}\n\nimpl Deserialize for u32 {\n fn deserialize(fields: [Field; U32_SERIALIZED_LEN]) -> Self {\n fields[0] as u32\n }\n}\n\nimpl Serialize for u64 {\n fn serialize(self) -> [Field; U64_SERIALIZED_LEN] {\n [self as Field]\n }\n}\n\nimpl Deserialize for u64 {\n fn deserialize(fields: [Field; U64_SERIALIZED_LEN]) -> Self {\n fields[0] as u64\n }\n}\n\nimpl Serialize for U128 {\n fn serialize(self) -> [Field; U128_SERIALIZED_LEN] {\n [self.to_integer()]\n }\n}\n\nimpl Deserialize for U128 {\n fn deserialize(fields: [Field; U128_SERIALIZED_LEN]) -> Self {\n U128::from_integer(fields[0])\n }\n}\n\nimpl Serialize for Field {\n fn serialize(self) -> [Field; FIELD_SERIALIZED_LEN] {\n [self]\n }\n}\n\nimpl Deserialize for Field {\n fn deserialize(fields: [Field; FIELD_SERIALIZED_LEN]) -> Self {\n fields[0]\n }\n}\n\nimpl Serialize for i8 {\n fn serialize(self) -> [Field; I8_SERIALIZED_LEN] {\n [self as Field]\n }\n}\n\nimpl Deserialize for i8 {\n fn deserialize(fields: [Field; I8_SERIALIZED_LEN]) -> Self {\n fields[0] as i8\n }\n}\n\nimpl Serialize for i16 {\n fn serialize(self) -> [Field; I16_SERIALIZED_LEN] {\n [self as Field]\n }\n}\n\nimpl Deserialize for i16 {\n fn deserialize(fields: [Field; I16_SERIALIZED_LEN]) -> Self {\n fields[0] as i16\n }\n}\n\nimpl Serialize for i32 {\n fn serialize(self) -> [Field; I32_SERIALIZED_LEN] {\n [self as Field]\n }\n}\n\nimpl Deserialize for i32 {\n fn deserialize(fields: [Field; I32_SERIALIZED_LEN]) -> Self {\n fields[0] as i32\n }\n}\n\nimpl Serialize for i64 {\n fn serialize(self) -> [Field; I64_SERIALIZED_LEN] {\n [self as Field]\n }\n}\n\nimpl Deserialize for i64 {\n fn deserialize(fields: [Field; I64_SERIALIZED_LEN]) -> Self {\n fields[0] as i64\n }\n}\n\nimpl Serialize for [T; N]\nwhere\n T: Serialize,\n{\n fn serialize(self) -> [Field; N * M] {\n let mut result: [Field; N * M] = std::mem::zeroed();\n let mut serialized: [Field; M] = std::mem::zeroed();\n for i in 0..N {\n serialized = self[i].serialize();\n for j in 0..M {\n result[i * M + j] = serialized[j];\n }\n }\n result\n }\n}\n\nimpl Deserialize for [T; N]\nwhere\n T: Deserialize,\n{\n fn deserialize(fields: [Field; N * M]) -> Self {\n let mut reader = crate::utils::reader::Reader::new(fields);\n let mut result: [T; N] = std::mem::zeroed();\n reader.read_struct_array::(Deserialize::deserialize, result)\n }\n}\n\n#[test]\nfn test_u16_serialization() {\n let a: u16 = 10;\n assert_eq(a, u16::deserialize(a.serialize()));\n}\n\n#[test]\nfn test_i8_serialization() {\n let a: i8 = -10;\n assert_eq(a, i8::deserialize(a.serialize()));\n}\n\n#[test]\nfn test_i16_serialization() {\n let a: i16 = -10;\n assert_eq(a, i16::deserialize(a.serialize()));\n}\n\n#[test]\nfn test_i32_serialization() {\n let a: i32 = -10;\n assert_eq(a, i32::deserialize(a.serialize()));\n}\n\n#[test]\nfn test_i64_serialization() {\n let a: i64 = -10;\n assert_eq(a, i64::deserialize(a.serialize()));\n}\n","path":"/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.66.0/noir-projects/noir-protocol-circuits/crates/types/src/type_serialization.nr"},"205":{"source":"pub struct Reader {\n data: [Field; N],\n offset: u32,\n}\n\nimpl Reader {\n pub fn new(data: [Field; N]) -> Self {\n Self { data, offset: 0 }\n }\n\n pub fn read(&mut self) -> Field {\n let result = self.data[self.offset];\n self.offset += 1;\n result\n }\n\n pub fn read_u32(&mut self) -> u32 {\n self.read() as u32\n }\n\n pub fn read_bool(&mut self) -> bool {\n self.read() as bool\n }\n\n pub fn read_array(&mut self) -> [Field; K] {\n let mut result = [0; K];\n for i in 0..K {\n result[i] = self.data[self.offset + i];\n }\n self.offset += K;\n result\n }\n\n pub fn read_struct(&mut self, deserialise: fn([Field; K]) -> T) -> T {\n let result = deserialise(self.read_array());\n result\n }\n\n pub fn read_struct_array(\n &mut self,\n deserialise: fn([Field; K]) -> T,\n mut result: [T; C],\n ) -> [T; C] {\n for i in 0..C {\n result[i] = self.read_struct(deserialise);\n }\n result\n }\n\n pub fn finish(self) {\n assert(self.offset == self.data.len(), \"Reader did not read all data\");\n }\n}\n","path":"/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.66.0/noir-projects/noir-protocol-circuits/crates/types/src/utils/reader.nr"},"220":{"source":"use crate::meta::{derive_deserialize, derive_serialize};\nuse crate::utils::field::field_from_bytes;\n\n// Trait: is_empty\n//\n// The general is_empty trait checks if a data type is is empty,\n// and it defines empty for the basic data types as 0.\n//\n// If a Field is equal to zero, then it is regarded as zero.\n// We will go with this definition for now, however it can be problematic\n// if a value can actually be zero. In a future refactor, we can\n// use the optional type for safety. Doing it now would lead to a worse devex\n// and would make it harder to sync up with the cpp code.\n// Preferred over Default trait to convey intent, as default doesn't necessarily mean empty.\npub trait Empty {\n fn empty() -> Self;\n}\n\nimpl Empty for Field {\n fn empty() -> Self {\n 0\n }\n}\n\nimpl Empty for u1 {\n fn empty() -> Self {\n 0\n }\n}\nimpl Empty for u8 {\n fn empty() -> Self {\n 0\n }\n}\nimpl Empty for u32 {\n fn empty() -> Self {\n 0\n }\n}\nimpl Empty for u64 {\n fn empty() -> Self {\n 0\n }\n}\nimpl Empty for U128 {\n fn empty() -> Self {\n U128::from_integer(0)\n }\n}\n\npub fn is_empty(item: T) -> bool\nwhere\n T: Empty + Eq,\n{\n item.eq(T::empty())\n}\n\npub fn is_empty_array(array: [T; N]) -> bool\nwhere\n T: Empty + Eq,\n{\n array.all(|elem| is_empty(elem))\n}\n\npub trait Hash {\n fn hash(self) -> Field;\n}\n\npub trait ToField {\n fn to_field(self) -> Field;\n}\n\nimpl ToField for Field {\n fn to_field(self) -> Field {\n self\n }\n}\n\nimpl ToField for bool {\n fn to_field(self) -> Field {\n self as Field\n }\n}\nimpl ToField for u1 {\n fn to_field(self) -> Field {\n self as Field\n }\n}\nimpl ToField for u8 {\n fn to_field(self) -> Field {\n self as Field\n }\n}\nimpl ToField for u32 {\n fn to_field(self) -> Field {\n self as Field\n }\n}\nimpl ToField for u64 {\n fn to_field(self) -> Field {\n self as Field\n }\n}\nimpl ToField for U128 {\n fn to_field(self) -> Field {\n self.to_integer()\n }\n}\nimpl ToField for str {\n fn to_field(self) -> Field {\n assert(N < 32, \"String doesn't fit in a field, consider using Serialize instead\");\n field_from_bytes(self.as_bytes(), true)\n }\n}\n\npub trait FromField {\n fn from_field(value: Field) -> Self;\n}\n\nimpl FromField for Field {\n fn from_field(value: Field) -> Self {\n value\n }\n}\n\nimpl FromField for bool {\n fn from_field(value: Field) -> Self {\n value as bool\n }\n}\nimpl FromField for u1 {\n fn from_field(value: Field) -> Self {\n value as u1\n }\n}\nimpl FromField for u8 {\n fn from_field(value: Field) -> Self {\n value as u8\n }\n}\nimpl FromField for u32 {\n fn from_field(value: Field) -> Self {\n value as u32\n }\n}\nimpl FromField for u64 {\n fn from_field(value: Field) -> Self {\n value as u64\n }\n}\nimpl FromField for U128 {\n fn from_field(value: Field) -> Self {\n U128::from_integer(value)\n }\n}\n\n// docs:start:serialize\n#[derive_via(derive_serialize)]\npub trait Serialize {\n fn serialize(self) -> [Field; N];\n}\n// docs:end:serialize\n\nimpl Serialize for str {\n fn serialize(self) -> [Field; N] {\n let bytes = self.as_bytes();\n let mut fields = [0; N];\n for i in 0..bytes.len() {\n fields[i] = bytes[i] as Field;\n }\n fields\n }\n}\n\n// docs:start:deserialize\n#[derive_via(derive_deserialize)]\npub trait Deserialize {\n fn deserialize(fields: [Field; N]) -> Self;\n}\n// docs:end:deserialize\n\nimpl Deserialize for str {\n fn deserialize(fields: [Field; N]) -> Self {\n str::from(fields.map(|value| value as u8))\n }\n}\n","path":"/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.66.0/noir-projects/noir-protocol-circuits/crates/types/src/traits.nr"},"222":{"source":"use crate::{\n abis::{\n contract_class_function_leaf_preimage::ContractClassFunctionLeafPreimage,\n function_selector::FunctionSelector,\n log_hash::{LogHash, ScopedLogHash},\n note_hash::ScopedNoteHash,\n nullifier::ScopedNullifier,\n private_log::{PrivateLog, PrivateLogData},\n side_effect::scoped::Scoped,\n },\n address::{AztecAddress, EthAddress},\n constants::{\n FUNCTION_TREE_HEIGHT, GENERATOR_INDEX__NOTE_HASH_NONCE, GENERATOR_INDEX__OUTER_NULLIFIER,\n GENERATOR_INDEX__SILOED_NOTE_HASH, GENERATOR_INDEX__UNIQUE_NOTE_HASH,\n },\n merkle_tree::root::root_from_sibling_path,\n messaging::l2_to_l1_message::{L2ToL1Message, ScopedL2ToL1Message},\n traits::{is_empty, ToField},\n utils::field::field_from_bytes_32_trunc,\n};\nuse super::utils::field::field_from_bytes;\n\npub fn sha256_to_field(bytes_to_hash: [u8; N]) -> Field {\n let sha256_hashed = std::hash::sha256(bytes_to_hash);\n let hash_in_a_field = field_from_bytes_32_trunc(sha256_hashed);\n\n hash_in_a_field\n}\n\npub fn private_functions_root_from_siblings(\n selector: FunctionSelector,\n vk_hash: Field,\n function_leaf_index: Field,\n function_leaf_sibling_path: [Field; FUNCTION_TREE_HEIGHT],\n) -> Field {\n let function_leaf_preimage = ContractClassFunctionLeafPreimage { selector, vk_hash };\n let function_leaf = function_leaf_preimage.hash();\n root_from_sibling_path(\n function_leaf,\n function_leaf_index,\n function_leaf_sibling_path,\n )\n}\n\nfn compute_note_hash_nonce(tx_hash: Field, note_index_in_tx: u32) -> Field {\n // Hashing tx hash with note index in tx is guaranteed to be unique\n poseidon2_hash_with_separator(\n [tx_hash, note_index_in_tx as Field],\n GENERATOR_INDEX__NOTE_HASH_NONCE,\n )\n}\n\npub fn compute_unique_note_hash(nonce: Field, note_hash: Field) -> Field {\n let inputs = [nonce, note_hash];\n poseidon2_hash_with_separator(inputs, GENERATOR_INDEX__UNIQUE_NOTE_HASH)\n}\n\npub fn compute_siloed_note_hash(app: AztecAddress, unique_note_hash: Field) -> Field {\n poseidon2_hash_with_separator(\n [app.to_field(), unique_note_hash],\n GENERATOR_INDEX__SILOED_NOTE_HASH,\n )\n}\n\n/// Siloing in the context of Aztec refers to the process of hashing a note hash with a contract address (this way\n/// the note hash is scoped to a specific contract). This is used to prevent intermingling of notes between contracts.\npub fn silo_note_hash(note_hash: ScopedNoteHash, tx_hash: Field, note_index_in_tx: u32) -> Field {\n if note_hash.contract_address.is_zero() {\n 0\n } else {\n let nonce = compute_note_hash_nonce(tx_hash, note_index_in_tx);\n let unique_note_hash = compute_unique_note_hash(nonce, note_hash.value());\n compute_siloed_note_hash(note_hash.contract_address, unique_note_hash)\n }\n}\n\npub fn compute_siloed_nullifier(app: AztecAddress, nullifier: Field) -> Field {\n poseidon2_hash_with_separator(\n [app.to_field(), nullifier],\n GENERATOR_INDEX__OUTER_NULLIFIER,\n )\n}\n\npub fn silo_nullifier(nullifier: ScopedNullifier) -> Field {\n if nullifier.contract_address.is_zero() {\n nullifier.value() // Return value instead of 0 because the first nullifier's contract address is zero.\n } else {\n compute_siloed_nullifier(nullifier.contract_address, nullifier.value())\n }\n}\n\npub fn compute_siloed_private_log_field(contract_address: AztecAddress, field: Field) -> Field {\n poseidon2_hash([contract_address.to_field(), field])\n}\n\npub fn silo_private_log(private_log: Scoped) -> PrivateLog {\n if private_log.contract_address.is_zero() {\n private_log.inner.log\n } else {\n let mut fields = private_log.inner.log.fields;\n fields[0] = compute_siloed_private_log_field(private_log.contract_address, fields[0]);\n PrivateLog { fields }\n }\n}\n\nfn compute_siloed_unencrypted_log_hash(address: AztecAddress, log_hash: Field) -> Field {\n accumulate_sha256([address.to_field(), log_hash])\n}\n\npub fn silo_unencrypted_log_hash(log_hash: ScopedLogHash) -> Field {\n if log_hash.contract_address.is_zero() {\n 0\n } else {\n compute_siloed_unencrypted_log_hash(log_hash.contract_address, log_hash.value())\n }\n}\n\npub fn merkle_hash(left: Field, right: Field) -> Field {\n poseidon2_hash([left, right])\n}\n\npub fn compute_l2_to_l1_hash(\n contract_address: AztecAddress,\n recipient: EthAddress,\n content: Field,\n rollup_version_id: Field,\n chain_id: Field,\n) -> Field {\n let mut bytes: BoundedVec = BoundedVec::new();\n\n let inputs =\n [contract_address.to_field(), rollup_version_id, recipient.to_field(), chain_id, content];\n for i in 0..inputs.len() {\n // TODO are bytes be in fr.to_buffer() ?\n let item_bytes: [u8; 32] = inputs[i].to_be_bytes();\n for j in 0..32 {\n bytes.push(item_bytes[j]);\n }\n }\n\n sha256_to_field(bytes.storage())\n}\n\npub fn silo_l2_to_l1_message(\n msg: ScopedL2ToL1Message,\n rollup_version_id: Field,\n chain_id: Field,\n) -> Field {\n if msg.contract_address.is_zero() {\n 0\n } else {\n compute_l2_to_l1_hash(\n msg.contract_address,\n msg.message.recipient,\n msg.message.content,\n rollup_version_id,\n chain_id,\n )\n }\n}\n\n// Computes sha256 hash of 2 input hashes.\n//\n// NB: This method now takes in two 31 byte fields - it assumes that any input\n// is the result of a sha_to_field hash and => is truncated\n//\n// TODO(Jan and David): This is used for the encrypted_log hashes.\n// Can we check to see if we can just use hash_to_field or pedersen_compress here?\n//\npub fn accumulate_sha256(input: [Field; 2]) -> Field {\n // This is a note about the cpp code, since it takes an array of Fields\n // instead of a U128.\n // 4 Field elements when converted to bytes will usually\n // occupy 4 * 32 = 128 bytes.\n // However, this function is making the assumption that each Field\n // only occupies 128 bits.\n //\n // TODO(David): This does not seem to be getting guaranteed anywhere in the code?\n // Concatentate two fields into 32x2 = 64 bytes\n // accumulate_sha256 assumes that the inputs are pre-truncated 31 byte numbers\n let mut hash_input_flattened = [0; 64];\n for offset in 0..input.len() {\n let input_as_bytes: [u8; 32] = input[offset].to_be_bytes();\n for byte_index in 0..32 {\n hash_input_flattened[offset * 32 + byte_index] = input_as_bytes[byte_index];\n }\n }\n\n sha256_to_field(hash_input_flattened)\n}\n\n// Computes the final logs hash for a tx.\npub fn compute_tx_logs_hash(logs: [LogHash; N]) -> Field {\n // Convert each field element into a byte array and append the bytes to `hash_input_flattened`\n let mut hash_input_flattened = [0; N * 32];\n for offset in 0..N {\n // TODO: This is not checking that the decomposition is smaller than P\n let input_as_bytes: [u8; 32] = logs[offset].value.to_be_radix(256);\n for byte_index in 0..32 {\n hash_input_flattened[offset * 32 + byte_index] = input_as_bytes[byte_index];\n }\n }\n // Ideally we would push to a slice then hash, but there is no sha_slice\n // Hardcode to 256 bytes for now\n let mut hash = sha256_to_field(hash_input_flattened);\n // Not having a 0 value hash for empty logs causes issues with empty txs\n // used for padding. Returning early is currently unsupported.\n // We always provide sorted logs here, so 0 being empty means all are empty.\n if is_empty(logs[0]) {\n hash = 0;\n }\n hash\n}\n\npub fn verification_key_hash(key: [Field; N]) -> Field {\n crate::hash::poseidon2_hash(key)\n}\n\n#[inline_always]\npub fn pedersen_hash(inputs: [Field; N], hash_index: u32) -> Field {\n std::hash::pedersen_hash_with_separator(inputs, hash_index)\n}\n\npub fn poseidon2_hash(inputs: [Field; N]) -> Field {\n std::hash::poseidon2::Poseidon2::hash(inputs, N)\n}\n\n#[no_predicates]\npub fn poseidon2_hash_with_separator(inputs: [Field; N], separator: T) -> Field\nwhere\n T: ToField,\n{\n // We manually hash the inputs here, since we cannot express with the type system a constant size inputs array of N + 1\n let in_len = N + 1;\n let two_pow_64 = 18446744073709551616;\n let iv: Field = (in_len as Field) * two_pow_64;\n let mut sponge = std::hash::poseidon2::Poseidon2::new(iv);\n sponge.absorb(separator.to_field());\n\n for i in 0..inputs.len() {\n sponge.absorb(inputs[i]);\n }\n\n sponge.squeeze()\n}\n\npub fn poseidon2_hash_with_separator_slice(inputs: [Field], separator: T) -> Field\nwhere\n T: ToField,\n{\n let in_len = inputs.len() + 1;\n let two_pow_64 = 18446744073709551616;\n let iv: Field = (in_len as Field) * two_pow_64;\n let mut sponge = std::hash::poseidon2::Poseidon2::new(iv);\n sponge.absorb(separator.to_field());\n\n for i in 0..inputs.len() {\n sponge.absorb(inputs[i]);\n }\n\n sponge.squeeze()\n}\n\n#[no_predicates]\npub fn poseidon2_hash_bytes(inputs: [u8; N]) -> Field {\n // We manually hash the inputs here, since we cannot express with the type system a constant size inputs array of Math.ceil(N/31)\n let mut in_len = N / 31;\n let mut has_padding = false;\n if N % 31 != 0 {\n in_len += 1;\n has_padding = true;\n }\n\n let two_pow_64 = 18446744073709551616;\n let iv: Field = (in_len as Field) * two_pow_64;\n let mut sponge = std::hash::poseidon2::Poseidon2::new(iv);\n\n let mut current_field = [0; 31];\n for i in 0..inputs.len() {\n let index = i % 31;\n current_field[index] = inputs[i];\n if index == 30 {\n sponge.absorb(field_from_bytes(current_field, false));\n current_field = [0; 31];\n }\n }\n if has_padding {\n sponge.absorb(field_from_bytes(current_field, false));\n }\n\n sponge.squeeze()\n}\n\n#[test]\nfn smoke_sha256_to_field() {\n let full_buffer = [\n 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,\n 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,\n 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70,\n 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,\n 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,\n 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130,\n 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148,\n 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,\n ];\n let result = sha256_to_field(full_buffer);\n\n assert(result == 0x448ebbc9e1a31220a2f3830c18eef61b9bd070e5084b7fa2a359fe729184c7);\n\n // to show correctness of the current ver (truncate one byte) vs old ver (mod full bytes):\n let result_bytes = std::hash::sha256(full_buffer);\n let truncated_field = crate::utils::field::field_from_bytes_32_trunc(result_bytes);\n assert(truncated_field == result);\n let mod_res = result + (result_bytes[31] as Field);\n assert(mod_res == 0x448ebbc9e1a31220a2f3830c18eef61b9bd070e5084b7fa2a359fe729184e0);\n}\n\n#[test]\nfn compute_l2_l1_hash() {\n // All zeroes\n let hash_result =\n compute_l2_to_l1_hash(AztecAddress::from_field(0), EthAddress::zero(), 0, 0, 0);\n assert(hash_result == 0xb393978842a0fa3d3e1470196f098f473f9678e72463cb65ec4ab5581856c2);\n\n // Non-zero case\n let hash_result = compute_l2_to_l1_hash(\n AztecAddress::from_field(1),\n EthAddress::from_field(3),\n 5,\n 2,\n 4,\n );\n assert(hash_result == 0x3f88c1044a05e5340ed20466276500f6d45ca5603913b9091e957161734e16);\n}\n\n#[test]\nfn silo_l2_to_l1_message_matches_typescript() {\n let version = 4;\n let chainId = 5;\n\n let hash = silo_l2_to_l1_message(\n ScopedL2ToL1Message {\n message: L2ToL1Message { recipient: EthAddress::from_field(1), content: 2, counter: 0 },\n contract_address: AztecAddress::from_field(3),\n },\n version,\n chainId,\n );\n\n // The following value was generated by `l2_to_l1_message.test.ts`\n let hash_from_typescript = 0x00c6155d69febb9d5039b374dd4f77bf57b7c881709aa524a18acaa0bd57476a;\n\n assert_eq(hash, hash_from_typescript);\n}\n","path":"/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.66.0/noir-projects/noir-protocol-circuits/crates/types/src/hash.nr"},"255":{"source":"use crate::traits::{Deserialize, Empty, FromField, Serialize, ToField};\n\npub struct FunctionSelector {\n // 1st 4-bytes of abi-encoding of function.\n pub inner: u32,\n}\n\nimpl Eq for FunctionSelector {\n fn eq(self, function_selector: FunctionSelector) -> bool {\n function_selector.inner == self.inner\n }\n}\n\nimpl Serialize<1> for FunctionSelector {\n fn serialize(self: Self) -> [Field; 1] {\n [self.inner as Field]\n }\n}\n\nimpl Deserialize<1> for FunctionSelector {\n fn deserialize(fields: [Field; 1]) -> Self {\n Self { inner: fields[0] as u32 }\n }\n}\n\nimpl FromField for FunctionSelector {\n fn from_field(field: Field) -> Self {\n Self { inner: field as u32 }\n }\n}\n\nimpl ToField for FunctionSelector {\n fn to_field(self) -> Field {\n self.inner as Field\n }\n}\n\nimpl Empty for FunctionSelector {\n fn empty() -> Self {\n Self { inner: 0 as u32 }\n }\n}\n\nimpl FunctionSelector {\n pub fn from_u32(value: u32) -> Self {\n Self { inner: value }\n }\n\n pub fn from_signature(signature: str) -> Self {\n let bytes = signature.as_bytes();\n let hash = crate::hash::poseidon2_hash_bytes(bytes);\n\n // `hash` is automatically truncated to fit within 32 bits.\n FunctionSelector::from_field(hash)\n }\n\n pub fn zero() -> Self {\n Self { inner: 0 }\n }\n}\n\n#[test]\nfn test_is_valid_selector() {\n let selector = FunctionSelector::from_signature(\"IS_VALID()\");\n assert_eq(selector.to_field(), 0x73cdda47);\n}\n\n#[test]\nfn test_long_selector() {\n let selector =\n FunctionSelector::from_signature(\"foo_and_bar_and_baz_and_foo_bar_baz_and_bar_foo\");\n assert_eq(selector.to_field(), 0x7590a997);\n}\n","path":"/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.66.0/noir-projects/noir-protocol-circuits/crates/types/src/abis/function_selector.nr"},"308":{"source":"use crate::{hash::poseidon2_hash, traits::ToField};\n\npub fn derive_storage_slot_in_map(storage_slot: Field, key: K) -> Field\nwhere\n K: ToField,\n{\n poseidon2_hash([storage_slot, key.to_field()])\n}\n\nmod test {\n use crate::{address::AztecAddress, storage::map::derive_storage_slot_in_map};\n\n #[test]\n fn test_derive_storage_slot_in_map_matches_typescript() {\n let map_slot = 0x132258fb6962c4387ba659d9556521102d227549a386d39f0b22d1890d59c2b5;\n let key = AztecAddress::from_field(\n 0x302dbc2f9b50a73283d5fb2f35bc01eae8935615817a0b4219a057b2ba8a5a3f,\n );\n\n let slot = derive_storage_slot_in_map(map_slot, key);\n\n // The following value was generated by `map_slot.test.ts`\n let slot_from_typescript =\n 0x15b9fe39449affd8b377461263e9d2b610b9ad40580553500b4e41d9cbd887ac;\n\n assert_eq(slot, slot_from_typescript);\n }\n}\n","path":"/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.66.0/noir-projects/noir-protocol-circuits/crates/types/src/storage/map.nr"}}} \ No newline at end of file diff --git a/services/explorer-api/migrations/0000_dry_puppet_master.sql b/services/explorer-api/migrations/0000_white_liz_osborn.sql similarity index 97% rename from services/explorer-api/migrations/0000_dry_puppet_master.sql rename to services/explorer-api/migrations/0000_white_liz_osborn.sql index 154d5ae9..fe03b9fa 100644 --- a/services/explorer-api/migrations/0000_dry_puppet_master.sql +++ b/services/explorer-api/migrations/0000_white_liz_osborn.sql @@ -44,7 +44,6 @@ CREATE TABLE IF NOT EXISTS "logs" ( "tx_effect_to_logs_id" uuid NOT NULL, "type" varchar(20) NOT NULL, "data" "bytea" NOT NULL, - "masked_contract_address" varchar(66), "contract_address" varchar(66) ); --> statement-breakpoint @@ -67,9 +66,8 @@ CREATE TABLE IF NOT EXISTS "tx_effect" ( "note_hashes" jsonb NOT NULL, "nullifiers" jsonb NOT NULL, "l2_to_l1_msgs" jsonb NOT NULL, - "note_encrypted_logs_length" bigint NOT NULL, - "encrypted_logs_length" bigint NOT NULL, - "unencrypted_logs_length" bigint NOT NULL + "unencrypted_logs_length" bigint NOT NULL, + "private_logs" jsonb NOT NULL ); --> statement-breakpoint CREATE TABLE IF NOT EXISTS "tx_effect_to_logs" ( @@ -167,7 +165,7 @@ CREATE TABLE IF NOT EXISTS "l2_contract_class_registered" ( "version" bigint NOT NULL, "artifact_hash" varchar(66) NOT NULL, "private_functions_root" varchar(66) NOT NULL, - "packed_public_bytecode" "bytea" NOT NULL, + "packed_bytecode" "bytea" NOT NULL, CONSTRAINT "contract_class_id_version" PRIMARY KEY("contract_class_id","version") ); --> statement-breakpoint @@ -207,8 +205,7 @@ CREATE TABLE IF NOT EXISTS "l2_private_function" ( "private_function_tree_leaf_index" bigint NOT NULL, "artifact_function_tree_sibling_path" jsonb NOT NULL, "artifact_function_tree_leaf_index" bigint NOT NULL, - "private_function_selector_type" varchar NOT NULL, - "private_function_selector_value" varchar NOT NULL, + "private_function_selector_value" bigint NOT NULL, "private_function_metadata_hash" varchar(66) NOT NULL, "private_function_vk_hash" varchar(66) NOT NULL, "private_function_bytecode" "bytea" NOT NULL, @@ -221,8 +218,7 @@ CREATE TABLE IF NOT EXISTS "l2_unconstrained_function" ( "private_functions_artifact_tree_root" varchar(66) NOT NULL, "artifact_function_tree_sibling_path" jsonb NOT NULL, "artifact_function_tree_leaf_index" bigint NOT NULL, - "unconstrained_function_selector_type" varchar NOT NULL, - "unconstrained_function_selector_value" varchar NOT NULL, + "unconstrained_function_selector_value" bigint NOT NULL, "unconstrained_function_metadata_hash" varchar(66) NOT NULL, "unconstrained_function_bytecode" "bytea" NOT NULL, CONSTRAINT "unconstrained_function_contract_class" PRIMARY KEY("contract_class_id","unconstrained_function_selector_value") diff --git a/services/explorer-api/migrations/meta/0000_snapshot.json b/services/explorer-api/migrations/meta/0000_snapshot.json index a0188005..1104b368 100644 --- a/services/explorer-api/migrations/meta/0000_snapshot.json +++ b/services/explorer-api/migrations/meta/0000_snapshot.json @@ -1,5 +1,5 @@ { - "id": "4fe591f8-e500-430d-a332-4c1c8cde201c", + "id": "85e3f291-661b-40ed-afb0-9b7049a65b66", "prevId": "00000000-0000-0000-0000-000000000000", "version": "7", "dialect": "postgresql", @@ -275,12 +275,6 @@ "primaryKey": false, "notNull": true }, - "masked_contract_address": { - "name": "masked_contract_address", - "type": "varchar(66)", - "primaryKey": false, - "notNull": false - }, "contract_address": { "name": "contract_address", "type": "varchar(66)", @@ -419,21 +413,15 @@ "primaryKey": false, "notNull": true }, - "note_encrypted_logs_length": { - "name": "note_encrypted_logs_length", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "encrypted_logs_length": { - "name": "encrypted_logs_length", + "unencrypted_logs_length": { + "name": "unencrypted_logs_length", "type": "bigint", "primaryKey": false, "notNull": true }, - "unencrypted_logs_length": { - "name": "unencrypted_logs_length", - "type": "bigint", + "private_logs": { + "name": "private_logs", + "type": "jsonb", "primaryKey": false, "notNull": true } @@ -1066,8 +1054,8 @@ "primaryKey": false, "notNull": true }, - "packed_public_bytecode": { - "name": "packed_public_bytecode", + "packed_bytecode": { + "name": "packed_bytecode", "type": "bytea", "primaryKey": false, "notNull": true @@ -1319,15 +1307,9 @@ "primaryKey": false, "notNull": true }, - "private_function_selector_type": { - "name": "private_function_selector_type", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, "private_function_selector_value": { "name": "private_function_selector_value", - "type": "varchar", + "type": "bigint", "primaryKey": false, "notNull": true }, @@ -1394,15 +1376,9 @@ "primaryKey": false, "notNull": true }, - "unconstrained_function_selector_type": { - "name": "unconstrained_function_selector_type", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, "unconstrained_function_selector_value": { "name": "unconstrained_function_selector_value", - "type": "varchar", + "type": "bigint", "primaryKey": false, "notNull": true }, diff --git a/services/explorer-api/migrations/meta/_journal.json b/services/explorer-api/migrations/meta/_journal.json index 3ff992f7..8ef22c1e 100644 --- a/services/explorer-api/migrations/meta/_journal.json +++ b/services/explorer-api/migrations/meta/_journal.json @@ -5,8 +5,8 @@ { "idx": 0, "version": "7", - "when": 1733239184791, - "tag": "0000_dry_puppet_master", + "when": 1733836365508, + "tag": "0000_white_liz_osborn", "breakpoints": true } ] diff --git a/services/explorer-api/package.json b/services/explorer-api/package.json index fda1a90d..9666bf4b 100644 --- a/services/explorer-api/package.json +++ b/services/explorer-api/package.json @@ -6,9 +6,9 @@ "license": "Apache-2.0", "dependencies": { "@anatine/zod-openapi": "2.2.6", - "@aztec/aztec.js": "0.65.2", - "@aztec/circuits.js": "0.65.2", - "@aztec/protocol-contracts": "0.65.2", + "@aztec/aztec.js": "0.66.0", + "@aztec/circuits.js": "0.66.0", + "@aztec/protocol-contracts": "0.66.0", "@chicmoz-pkg/backend-utils": "workspace:^", "@chicmoz-pkg/error-middleware": "workspace:^", "@chicmoz-pkg/logger-server": "workspace:^", diff --git a/services/explorer-api/src/constants.ts b/services/explorer-api/src/constants.ts index 9aae6d85..f717d6db 100644 --- a/services/explorer-api/src/constants.ts +++ b/services/explorer-api/src/constants.ts @@ -1,12 +1,23 @@ +import { ChicmozL2VerifiedContractAddressData } from "@chicmoz-pkg/types"; + export const CHAIN_NAME = "AZTEC"; export const SERVICE_NAME = "explorer-api"; -export const DEFAULT_VERIFIED_CONTRACT_ADDRESSES_DEV = [ - "0x11a81043f8c2cb2e95fa28e051f042a87e76c9e42d442188638eb2c07ae445b2", // Account address added by Sandbox - "0x17eafcd0961cc68c56b79305fa6fa8ee49bf8185b2bff279be84f3ceb1ae03ec", // Account address added by Sandbox - "0x12fb76c6e2ccbad0919c554c07257fc69993ddd9c799c62179345b5b82a95dd8", // Account address added by Sandbox -]; +export const DEFAULT_VERIFIED_CONTRACT_ADDRESSES_DEV: ChicmozL2VerifiedContractAddressData[] = + [ + { + contractInstanceAddress: + "0x0e5fe9a23c854f14262bb3b3e88dab8e33412d6db17baa199506f865ed746a0c", + name: "Deployed by Sandbox", + details: + "This contract was deployed by the sandbox environment. Hardcoded address is at least valid for 0.66.0", + contact: "email: test@test.com, discord: test#1234, telegram: @test", + uiUrl: "https://aztec.network", + repoUrl: "https://github.com/AztecProtocol/aztec-packages", + }, + ]; -export const DEFAULT_VERIFIED_CONTRACT_ADDRESSES_PROD: string[] = [ - // TODO: Add verified contract addresses for production -]; +export const DEFAULT_VERIFIED_CONTRACT_ADDRESSES_PROD: ChicmozL2VerifiedContractAddressData[] = + [ + // TODO: Add verified contract addresses for production + ]; diff --git a/services/explorer-api/src/database/controllers/l2TxEffect/get-tx-effect.ts b/services/explorer-api/src/database/controllers/l2TxEffect/get-tx-effect.ts index 39fd2a9f..6ed7d55b 100644 --- a/services/explorer-api/src/database/controllers/l2TxEffect/get-tx-effect.ts +++ b/services/explorer-api/src/database/controllers/l2TxEffect/get-tx-effect.ts @@ -1,13 +1,9 @@ import { ChicmozL2TxEffect, ChicmozL2TxEffectDeluxe, - EncryptedLogEntry, HexString, - NoteEncryptedLogEntry, UnencryptedLogEntry, chicmozL2TxEffectDeluxeSchema, - encryptedLogEntrySchema, - noteEncryptedLogEntrySchema, unencryptedLogEntrySchema, } from "@chicmoz-pkg/types"; import { SQL, and, asc, eq, getTableColumns } from "drizzle-orm"; @@ -44,24 +40,13 @@ type GetTxEffectsByBlockHeight = { export const getTxEffectNestedByHash = async ( txEffectHash: string -): Promise< - Pick< - ChicmozL2TxEffect, - | "publicDataWrites" - | "noteEncryptedLogs" - | "encryptedLogs" - | "unencryptedLogs" - > -> => { +): Promise> => { const publicDataWrites = await db() .select({ ...getTableColumns(publicDataWrite), }) .from(publicDataWrite) - .innerJoin( - txEffect, - eq(txEffect.hash, publicDataWrite.txEffectHash) - ) + .innerJoin(txEffect, eq(txEffect.hash, publicDataWrite.txEffectHash)) .where(eq(publicDataWrite.txEffectHash, txEffectHash)) .orderBy(asc(publicDataWrite.index)) .execute(); @@ -73,48 +58,27 @@ export const getTxEffectNestedByHash = async ( }) .from(txEffectToLogs) .innerJoin(logs, eq(txEffectToLogs.id, logs.txEffectToLogsId)) - .innerJoin(functionLogs, eq(txEffectToLogs.id, functionLogs.txEffectToLogsId)) + .innerJoin( + functionLogs, + eq(txEffectToLogs.id, functionLogs.txEffectToLogsId) + ) .where(eq(txEffectToLogs.txEffectHash, txEffectHash)) .orderBy(asc(functionLogs.index), asc(logs.index)) .execute(); - const { - highestIndexNoteEncryptedLogs, - highestIndexEncryptedLogs, - highestIndexUnencryptedLogs, - } = mixedLogs.reduce( + const { highestIndexUnencryptedLogs } = mixedLogs.reduce( (acc, { functionLogIndex }) => ({ - highestIndexNoteEncryptedLogs: Math.max( - acc.highestIndexNoteEncryptedLogs, - functionLogIndex - ), - highestIndexEncryptedLogs: Math.max( - acc.highestIndexEncryptedLogs, - functionLogIndex - ), highestIndexUnencryptedLogs: Math.max( acc.highestIndexUnencryptedLogs, functionLogIndex ), }), { - highestIndexNoteEncryptedLogs: -1, - highestIndexEncryptedLogs: -1, highestIndexUnencryptedLogs: -1, } ); const initialLogs = { - noteEncryptedLogs: { - functionLogs: new Array<{ logs: NoteEncryptedLogEntry[] }>( - highestIndexNoteEncryptedLogs + 1 - ).fill({ logs: [] }), - }, - encryptedLogs: { - functionLogs: new Array<{ logs: EncryptedLogEntry[] }>( - highestIndexEncryptedLogs + 1 - ).fill({ logs: [] }), - }, unencryptedLogs: { functionLogs: new Array<{ logs: UnencryptedLogEntry[] }>( highestIndexUnencryptedLogs + 1 @@ -123,20 +87,8 @@ export const getTxEffectNestedByHash = async ( }; for (const log of mixedLogs) { - if (log.type === "noteEncrypted") { - const l = noteEncryptedLogEntrySchema.parse(log); - initialLogs.noteEncryptedLogs.functionLogs[ - log.functionLogIndex - ].logs.push(l); - } else if (log.type === "encrypted") { - const l = encryptedLogEntrySchema.parse(log); - initialLogs.encryptedLogs.functionLogs[log.functionLogIndex].logs.push(l); - } else if (log.type === "unencrypted") { - const l = unencryptedLogEntrySchema.parse(log); - initialLogs.unencryptedLogs.functionLogs[log.functionLogIndex].logs.push( - l - ); - } + const l = unencryptedLogEntrySchema.parse(log); + initialLogs.unencryptedLogs.functionLogs[log.functionLogIndex].logs.push(l); } return { @@ -179,10 +131,7 @@ const _getTxEffects = async ( .innerJoin(body, eq(l2Block.hash, body.blockHash)) .innerJoin(txEffect, eq(body.id, txEffect.bodyId)) .innerJoin(header, eq(l2Block.hash, header.blockHash)) - .innerJoin( - globalVariables, - eq(header.id, globalVariables.headerId) - ); + .innerJoin(globalVariables, eq(header.id, globalVariables.headerId)); let whereQuery; @@ -246,10 +195,7 @@ export const getTxEffectDynamicWhere = async ( .innerJoin(body, eq(txEffect.bodyId, body.id)) .innerJoin(l2Block, eq(body.blockHash, l2Block.hash)) .innerJoin(header, eq(l2Block.hash, header.blockHash)) - .innerJoin( - globalVariables, - eq(header.id, globalVariables.headerId) - ) + .innerJoin(globalVariables, eq(header.id, globalVariables.headerId)) .where(whereMatcher) .limit(1) .execute(); diff --git a/services/explorer-api/src/database/controllers/l2block/store.ts b/services/explorer-api/src/database/controllers/l2block/store.ts index 73f6592c..34d3b84e 100644 --- a/services/explorer-api/src/database/controllers/l2block/store.ts +++ b/services/explorer-api/src/database/controllers/l2block/store.ts @@ -2,8 +2,6 @@ import { HexString, type ChicmozL2Block, - type EncryptedLogEntry, - type NoteEncryptedLogEntry, type UnencryptedLogEntry, } from "@chicmoz-pkg/types"; import { v4 as uuidv4 } from "uuid"; @@ -32,7 +30,6 @@ import { export const store = async (block: ChicmozL2Block): Promise => { return await db().transaction(async (dbTx) => { - // Insert l2Block await dbTx.insert(l2Block).values({ hash: block.hash, @@ -51,7 +48,7 @@ export const store = async (block: ChicmozL2Block): Promise => { await dbTx.insert(archive).values({ root: block.archive.root, nextAvailableLeafIndex: block.archive.nextAvailableLeafIndex, - fk: block.hash + fk: block.hash, }); const lastArchiveId = uuidv4(); @@ -81,7 +78,6 @@ export const store = async (block: ChicmozL2Block): Promise => { headerId, }); - const l1ToL2MessageTreeId = uuidv4(); // Insert l1ToL2MessageTree await dbTx.insert(l1ToL2MessageTree).values({ @@ -170,9 +166,8 @@ export const store = async (block: ChicmozL2Block): Promise => { noteHashes: txEff.noteHashes as HexString[], nullifiers: txEff.nullifiers as HexString[], l2ToL1Msgs: txEff.l2ToL1Msgs as HexString[], - noteEncryptedLogsLength: txEff.noteEncryptedLogsLength, - encryptedLogsLength: txEff.encryptedLogsLength, unencryptedLogsLength: txEff.unencryptedLogsLength, + privateLogs: txEff.privateLogs, }); // Insert public data writes @@ -188,8 +183,6 @@ export const store = async (block: ChicmozL2Block): Promise => { } for (const [logType, fLogs] of Object.entries({ - noteEncrypted: txEff.noteEncryptedLogs.functionLogs, - encrypted: txEff.encryptedLogs.functionLogs, unencrypted: txEff.unencryptedLogs.functionLogs, })) { const txEffectToLogsId = uuidv4(); @@ -204,12 +197,10 @@ export const store = async (block: ChicmozL2Block): Promise => { await dbTx.insert(functionLogs).values({ id: functionLogId, index: Number(functionLogIndex), - txEffectToLogsId + txEffectToLogsId, }); for (const [index, log] of Object.entries( - functionLog.logs as Array< - NoteEncryptedLogEntry | EncryptedLogEntry | UnencryptedLogEntry - > + functionLog.logs as Array )) { const logId = uuidv4(); await dbTx.insert(logs).values({ @@ -218,15 +209,11 @@ export const store = async (block: ChicmozL2Block): Promise => { txEffectToLogsId, type: logType, data: log.data, - maskedContractAddress: (log as EncryptedLogEntry) - .maskedContractAddress, - contractAddress: (log as UnencryptedLogEntry).contractAddress, + contractAddress: log.contractAddress, }); - } } } } - }); }; diff --git a/services/explorer-api/src/database/controllers/l2contract/get-class-functions.ts b/services/explorer-api/src/database/controllers/l2contract/get-class-functions.ts index d23fe2c6..869e741d 100644 --- a/services/explorer-api/src/database/controllers/l2contract/get-class-functions.ts +++ b/services/explorer-api/src/database/controllers/l2contract/get-class-functions.ts @@ -39,7 +39,6 @@ export const getL2ContractClassPrivateFunction = async ( artifactFunctionTreeLeafIndex: res[0].artifactFunctionTreeLeafIndex, privateFunction: { selector: { - type: res[0].privateFunction_selector_type, value: res[0].privateFunction_selector_value, }, metadataHash: res[0].privateFunction_metadataHash, @@ -70,7 +69,6 @@ export const getL2ContractClassPrivateFunctions = async ( artifactFunctionTreeLeafIndex: r.artifactFunctionTreeLeafIndex, privateFunction: { selector: { - type: r.privateFunction_selector_type, value: r.privateFunction_selector_value, }, metadataHash: r.privateFunction_metadataHash, @@ -109,7 +107,6 @@ export const getL2ContractClassUnconstrainedFunction = async ( artifactFunctionTreeLeafIndex: res[0].artifactFunctionTreeLeafIndex, unconstrainedFunction: { selector: { - type: res[0].unconstrainedFunction_selector_type, value: res[0].unconstrainedFunction_selector_value, }, metadataHash: res[0].unconstrainedFunction_metadataHash, @@ -137,7 +134,6 @@ export const getL2ContractClassUnconstrainedFunctions = async ( artifactFunctionTreeLeafIndex: r.artifactFunctionTreeLeafIndex, unconstrainedFunction: { selector: { - type: r.unconstrainedFunction_selector_type, value: r.unconstrainedFunction_selector_value, }, metadataHash: r.unconstrainedFunction_metadataHash, diff --git a/services/explorer-api/src/database/controllers/l2contract/get-registered-contract-class.ts b/services/explorer-api/src/database/controllers/l2contract/get-registered-contract-class.ts index f841f573..0f4915ac 100644 --- a/services/explorer-api/src/database/controllers/l2contract/get-registered-contract-class.ts +++ b/services/explorer-api/src/database/controllers/l2contract/get-registered-contract-class.ts @@ -38,7 +38,7 @@ export const getL2RegisteredContractClasses = async ( version: l2ContractClassRegistered.version, artifactHash: l2ContractClassRegistered.artifactHash, privateFunctionsRoot: l2ContractClassRegistered.privateFunctionsRoot, - packedPublicBytecode: l2ContractClassRegistered.packedPublicBytecode, + packedBytecode: l2ContractClassRegistered.packedBytecode, }) .from(l2ContractClassRegistered) .where(whereQuery) @@ -60,7 +60,7 @@ export const getLatestL2RegisteredContractClasses = async (): Promise< version: l2ContractClassRegistered.version, artifactHash: l2ContractClassRegistered.artifactHash, privateFunctionsRoot: l2ContractClassRegistered.privateFunctionsRoot, - packedPublicBytecode: l2ContractClassRegistered.packedPublicBytecode, + packedBytecode: l2ContractClassRegistered.packedBytecode, }) .from(l2ContractClassRegistered) .innerJoin(l2Block, eq(l2Block.hash, l2ContractClassRegistered.blockHash)) diff --git a/services/explorer-api/src/database/controllers/l2contract/store.ts b/services/explorer-api/src/database/controllers/l2contract/store.ts index d30cb5be..e2177bfa 100644 --- a/services/explorer-api/src/database/controllers/l2contract/store.ts +++ b/services/explorer-api/src/database/controllers/l2contract/store.ts @@ -70,7 +70,6 @@ export const storePrivateFunction = async ( .insert(l2PrivateFunction) .values({ ...rest, - privateFunction_selector_type: privateFunction.selector.type, privateFunction_selector_value: privateFunction.selector.value, privateFunction_metadataHash: privateFunction.metadataHash, privateFunction_vkHash: privateFunction.vkHash, @@ -86,7 +85,6 @@ export const storeUnconstrainedFunction = async ( .insert(l2UnconstrainedFunction) .values({ ...rest, - unconstrainedFunction_selector_type: unconstrainedFunction.selector.type, unconstrainedFunction_selector_value: unconstrainedFunction.selector.value, unconstrainedFunction_metadataHash: unconstrainedFunction.metadataHash, diff --git a/services/explorer-api/src/database/controllers/l2contract/utils.ts b/services/explorer-api/src/database/controllers/l2contract/utils.ts index c29296c3..e2e65d3b 100644 --- a/services/explorer-api/src/database/controllers/l2contract/utils.ts +++ b/services/explorer-api/src/database/controllers/l2contract/utils.ts @@ -6,11 +6,12 @@ import { VERIFIED_CONTRACT_ADDRESSES } from "../../../environment.js"; // eslint-disable-next-line @typescript-eslint/no-explicit-any export const parseDeluxe = (contractClass: any, instance: any): ChicmozL2ContractInstanceDeluxe => { + const verifiedInfo = VERIFIED_CONTRACT_ADDRESSES.find(info => info.contractInstanceAddress === instance.address); return chicmozL2ContractInstanceDeluxeSchema.parse({ ...contractClass, - aztecScoutVerified: VERIFIED_CONTRACT_ADDRESSES.some((address) => address === instance.address), + verifiedInfo, blockHash: instance.blockHash, - packedPublicBytecode: Buffer.from(contractClass.packedPublicBytecode), + packedBytecode: Buffer.from(contractClass.packedBytecode), address: instance.address, version: instance.version, salt: instance.salt, diff --git a/services/explorer-api/src/database/controllers/sign-of-life.ts b/services/explorer-api/src/database/controllers/sign-of-life.ts index 714cb620..a57552df 100644 --- a/services/explorer-api/src/database/controllers/sign-of-life.ts +++ b/services/explorer-api/src/database/controllers/sign-of-life.ts @@ -66,6 +66,19 @@ export const getABlockWithTxEffects = async () => { }; }; +export const getSomeTxEffectWithPrivateLogs = async () => { + const dbRes = await db() + .select({ + hash: txEffect.hash, + }) + .from(txEffect) + .where(isNotNull(txEffect.privateLogs)) + .limit(10) + .execute(); + if (dbRes.length === 0) return null; + return dbRes.map((row) => row.hash); +}; + export const getSomeTxEffectWithUnencryptedLogs = async () => { const dbRes = await db() .select({ diff --git a/services/explorer-api/src/database/schema/l2block/body.ts b/services/explorer-api/src/database/schema/l2block/body.ts index 46344aeb..bdad3d3c 100644 --- a/services/explorer-api/src/database/schema/l2block/body.ts +++ b/services/explorer-api/src/database/schema/l2block/body.ts @@ -28,10 +28,7 @@ export const body = pgTable("body", { export const txEffect = pgTable( "tx_effect", { - hash: varchar("hash") - .notNull() - .$type() - .primaryKey(), + hash: varchar("hash").notNull().$type().primaryKey(), txHash: varchar("txHash").notNull().$type(), bodyId: uuid("body_id") .notNull() @@ -44,15 +41,10 @@ export const txEffect = pgTable( noteHashes: jsonb("note_hashes").notNull(), nullifiers: jsonb("nullifiers").notNull(), l2ToL1Msgs: jsonb("l2_to_l1_msgs").notNull().$type(), - noteEncryptedLogsLength: generateFrNumberColumn( - "note_encrypted_logs_length" - ).notNull(), - encryptedLogsLength: generateFrNumberColumn( - "encrypted_logs_length" - ).notNull(), unencryptedLogsLength: generateFrNumberColumn( "unencrypted_logs_length" ).notNull(), + privateLogs: jsonb("private_logs").notNull(), }, (table) => ({ txHashIndex: index("tx_hash_index").on(table.txHash), @@ -61,7 +53,9 @@ export const txEffect = pgTable( export const publicDataWrite = pgTable("public_data_write", { id: uuid("id").primaryKey().defaultRandom(), - txEffectHash: varchar("tx_effect_hash").notNull().references(() => txEffect.hash, { onDelete: "cascade" }), + txEffectHash: varchar("tx_effect_hash") + .notNull() + .references(() => txEffect.hash, { onDelete: "cascade" }), index: integer("index").notNull(), leafSlot: generateFrColumn("leaf_slot").notNull(), value: generateFrColumn("value").notNull(), @@ -74,9 +68,8 @@ export const logs = pgTable("logs", { txEffectToLogsId: uuid("tx_effect_to_logs_id") .notNull() .references(() => txEffectToLogs.id, { onDelete: "cascade" }), - type: varchar("type", { length: 20 }).notNull(), // 'noteEncrypted', 'encrypted', or 'unencrypted' + type: varchar("type", { length: 20 }).notNull(), // unencrypted data: bufferType("data").notNull(), - maskedContractAddress: generateFrColumn("masked_contract_address"), contractAddress: generateAztecAddressColumn("contract_address"), }); @@ -90,5 +83,7 @@ export const functionLogs = pgTable("function_logs", { export const txEffectToLogs = pgTable("tx_effect_to_logs", { id: uuid("id").primaryKey().defaultRandom(), - txEffectHash: varchar("tx_effect_hash").notNull().references(() => txEffect.hash, { onDelete: "cascade" }), + txEffectHash: varchar("tx_effect_hash") + .notNull() + .references(() => txEffect.hash, { onDelete: "cascade" }), }); diff --git a/services/explorer-api/src/database/schema/l2contract/index.ts b/services/explorer-api/src/database/schema/l2contract/index.ts index 7138f65b..68b3c3fa 100644 --- a/services/explorer-api/src/database/schema/l2contract/index.ts +++ b/services/explorer-api/src/database/schema/l2contract/index.ts @@ -107,7 +107,7 @@ export const l2ContractClassRegistered = pgTable( version: bigint("version", { mode: "number" }).notNull(), artifactHash: generateFrColumn("artifact_hash").notNull(), privateFunctionsRoot: generateFrColumn("private_functions_root").notNull(), - packedPublicBytecode: bufferType("packed_public_bytecode").notNull(), + packedBytecode: bufferType("packed_bytecode").notNull(), }, (t) => ({ primaryKey: primaryKey({ @@ -153,11 +153,8 @@ export const l2PrivateFunction = pgTable( artifactFunctionTreeLeafIndex: bigint("artifact_function_tree_leaf_index", { mode: "number", }).notNull(), - privateFunction_selector_type: varchar( - "private_function_selector_type" - ).notNull(), // TODO: enum - privateFunction_selector_value: varchar( - "private_function_selector_value" + privateFunction_selector_value: bigint( + "private_function_selector_value", { mode: "number" } ).notNull(), privateFunction_metadataHash: generateFrColumn( "private_function_metadata_hash" @@ -189,11 +186,8 @@ export const l2UnconstrainedFunction = pgTable( artifactFunctionTreeLeafIndex: bigint("artifact_function_tree_leaf_index", { mode: "number", }).notNull(), - unconstrainedFunction_selector_type: varchar( - "unconstrained_function_selector_type" - ).notNull(), // TODO: enum - unconstrainedFunction_selector_value: varchar( - "unconstrained_function_selector_value" + unconstrainedFunction_selector_value: bigint( + "unconstrained_function_selector_value", { mode: "number" } ).notNull(), unconstrainedFunction_metadataHash: generateFrColumn( "unconstrained_function_metadata_hash" diff --git a/services/explorer-api/src/event-handler/on-block/contracts.ts b/services/explorer-api/src/event-handler/on-block/contracts.ts index 7c17a7f6..c8b322b5 100644 --- a/services/explorer-api/src/event-handler/on-block/contracts.ts +++ b/services/explorer-api/src/event-handler/on-block/contracts.ts @@ -4,8 +4,7 @@ import { ContractInstanceDeployedEvent, PrivateFunctionBroadcastedEvent, UnconstrainedFunctionBroadcastedEvent, -} from "@aztec/circuits.js"; -import { ProtocolContractAddress } from "@aztec/protocol-contracts"; +} from "@aztec/protocol-contracts"; import { chicmozL2ContractClassRegisteredEventSchema, chicmozL2ContractInstanceDeployedEventSchema, @@ -19,12 +18,16 @@ import { import { controllers } from "../../database/index.js"; import { logger } from "../../logger.js"; import { handleDuplicateError } from "../utils.js"; +import { + type ContractInstanceWithAddress, + type ContractClassPublic, +} from "@aztec/circuits.js"; const parseObjs = ( blockHash: string, objs: ( - | ContractClassRegisteredEvent - | ContractInstanceDeployedEvent + | ContractClassPublic + | ContractInstanceWithAddress | PrivateFunctionBroadcastedEvent | UnconstrainedFunctionBroadcastedEvent )[], @@ -41,6 +44,8 @@ const parseObjs = ( } catch (e) { // eslint-disable-next-line @typescript-eslint/restrict-template-expressions logger.error(`Failed to parse object: ${e}`); + logger.error((e as Error).stack); + logger.error(JSON.stringify(obj, null, 2)); } } return parsedObjs; @@ -60,55 +65,57 @@ const storeObj = async ( } }; +// NOTE: reference for parsing in aztec-packages: yarn-project/archiver/src/archiver/archiver.ts export const storeContracts = async (b: L2Block, blockHash: string) => { - const encryptedBlockLogs = b.body.txEffects.flatMap((txEffect) => - txEffect.encryptedLogs.unrollLogs() - ); - const contractInstances = - ContractInstanceDeployedEvent.fromLogs(encryptedBlockLogs); - - const contractClassLogs = b.body.txEffects.flatMap((txEffect) => - txEffect.contractClassLogs.unrollLogs() - ); - const contractClasses = ContractClassRegisteredEvent.fromLogs( - contractClassLogs, - ProtocolContractAddress.ContractClassRegisterer + const privateLogs = b.body.txEffects.flatMap( + (txEffect) => txEffect.privateLogs ); + const contractInstances = privateLogs + .filter((log) => + ContractInstanceDeployedEvent.isContractInstanceDeployedEvent(log) + ) + .map((log) => ContractInstanceDeployedEvent.fromLog(log)) + .map((e) => e.toContractInstance()); - const unencryptedBlockLogs = b.body.txEffects.flatMap((txEffect) => - txEffect.unencryptedLogs.unrollLogs() - ); - const privateFnEvents = PrivateFunctionBroadcastedEvent.fromLogs( - unencryptedBlockLogs, - ProtocolContractAddress.ContractClassRegisterer - ); - const unconstrainedFnEvents = UnconstrainedFunctionBroadcastedEvent.fromLogs( - unencryptedBlockLogs, - ProtocolContractAddress.ContractClassRegisterer - ); + const contractClassLogs = b.body.txEffects + .flatMap((txEffect) => (txEffect ? [txEffect.contractClassLogs] : [])) + .flatMap((txLog) => txLog.unrollLogs()); - if ( - contractClasses.length > 0 - ) { - logger.info( - contractClasses.map((contractClass) => contractClass.contractClassId.toString()) - ); - } + const contractClasses = contractClassLogs + .filter((log) => + ContractClassRegisteredEvent.isContractClassRegisteredEvent(log.data) + ) + .map((log) => ContractClassRegisteredEvent.fromLog(log.data)) + .map((e) => e.toContractClassPublic()); - if ( - contractInstances.length > 0 - ) { - logger.info( - contractInstances.map((contractInstance) => `Contract instance: ${contractInstance.address.toString()} Contract class: ${contractInstance.contractClassId.toString()}`) - ); - } + const privateFnEvents = contractClassLogs + .filter((log) => + PrivateFunctionBroadcastedEvent.isPrivateFunctionBroadcastedEvent( + log.data + ) + ) + .map((log) => PrivateFunctionBroadcastedEvent.fromLog(log.data)); + const unconstrainedFnEvents = contractClassLogs + .filter((log) => + UnconstrainedFunctionBroadcastedEvent.isUnconstrainedFunctionBroadcastedEvent( + log.data + ) + ) + .map((log) => UnconstrainedFunctionBroadcastedEvent.fromLog(log.data)); logger.info( `📜 Parsing and storing ${contractClasses.length} contract classes and ${contractInstances.length} contract instances, ${privateFnEvents.length} private function events, and ${unconstrainedFnEvents.length} unconstrained function events` ); + const contractClassesWithId = contractClasses.map((contractClass) => { + return { + ...contractClass, + contractClassId: contractClass.id + }; + }); + const parsedContractClasses: ChicmozL2ContractClassRegisteredEvent[] = - parseObjs(blockHash, contractClasses, (contractClass) => + parseObjs(blockHash, contractClassesWithId, (contractClass) => chicmozL2ContractClassRegisteredEventSchema.parse(contractClass) ); const parsedContractInstances: ChicmozL2ContractInstanceDeployedEvent[] = diff --git a/services/explorer-api/src/event-handler/on-block/index.ts b/services/explorer-api/src/event-handler/on-block/index.ts index 0e8dc3a0..b2f8073d 100644 --- a/services/explorer-api/src/event-handler/on-block/index.ts +++ b/services/explorer-api/src/event-handler/on-block/index.ts @@ -5,7 +5,7 @@ import { controllers } from "../../database/index.js"; import { logger } from "../../logger.js"; import { storeContracts } from "./contracts.js"; import { handleDuplicateBlockError } from "../utils.js"; -import {L2Block} from "@aztec/aztec.js"; +import { L2Block } from "@aztec/aztec.js"; const truncateString = (value: string) => { const startHash = value.substring(0, 100); @@ -15,13 +15,22 @@ const truncateString = (value: string) => { const hackyLogBlock = (b: L2Block) => { const blockString = JSON.stringify(b, null, 2); - const logString = blockString.split(":").map((v) => { - if (v.length > 200 && v.includes(",")) - return truncateString(v); - - return v; - }).join(":"); + const logString = blockString + .split(":") + .map((v) => { + if (v.length > 200 && v.includes(",")) return truncateString(v); + + return v; + }) + .join(":"); logger.error(`🚫 Block: ${logString}`); + b.body.txEffects.forEach((txEffect) => { + txEffect.privateLogs.forEach((log) => { + log.toFields().forEach((field) => { + logger.error(`🚫 TxEffect: ${field.toString()}`); + }); + }); + }); }; export const onBlock = async ({ block, blockNumber }: NewBlockEvent) => { @@ -38,7 +47,7 @@ export const onBlock = async ({ block, blockNumber }: NewBlockEvent) => { } catch (e) { logger.error( // eslint-disable-next-line @typescript-eslint/restrict-template-expressions - `Failed to parse block ${blockNumber}: ${(e as Error)?.stack ?? e}`, + `Failed to parse block ${blockNumber}: ${(e as Error)?.stack ?? e}` ); hackyLogBlock(b); return; @@ -50,7 +59,7 @@ export const onBlock = async ({ block, blockNumber }: NewBlockEvent) => { const storeBlock = async (parsedBlock: ChicmozL2Block) => { logger.info( - `🧢 Storing block ${parsedBlock.height} (hash: ${parsedBlock.hash})`, + `🧢 Storing block ${parsedBlock.height} (hash: ${parsedBlock.hash})` ); await controllers.l2Block.store(parsedBlock).catch(async (e) => { const isNewChain = await handleDuplicateBlockError( diff --git a/services/explorer-api/src/http-server/express-config.ts b/services/explorer-api/src/http-server/express-config.ts index d7f7dfb3..726419c0 100644 --- a/services/explorer-api/src/http-server/express-config.ts +++ b/services/explorer-api/src/http-server/express-config.ts @@ -2,7 +2,7 @@ import bodyParser from "body-parser"; import cors from "cors"; import express from "express"; import helmet from "helmet"; -//import morgan from "morgan"; +import morgan from "morgan"; import { init as initApiRoutes } from "./routes/index.js"; import { createErrorMiddleware } from "@chicmoz-pkg/error-middleware"; import { genereateOpenApiSpec } from "./open-api-spec.js"; @@ -35,7 +35,7 @@ export function setup( parameterLimit: options.PARAMETER_LIMIT, }) ); - //app.use(morgan("common")); + app.use(morgan("common")); const router = express.Router(); router.get("/health", geHealthHandler); diff --git a/services/explorer-api/src/http-server/routes/controllers/index.ts b/services/explorer-api/src/http-server/routes/controllers/index.ts index 1d74d601..f342e3e2 100644 --- a/services/explorer-api/src/http-server/routes/controllers/index.ts +++ b/services/explorer-api/src/http-server/routes/controllers/index.ts @@ -5,5 +5,6 @@ export * from "./txs.js"; export * from "./contract-classes.js"; export * from "./contract-class-functions.js"; export * from "./contract-instances.js"; +export * from "./verified-contracts.js"; export * from "./search.js"; export * from "./stats.js"; diff --git a/services/explorer-api/src/http-server/routes/controllers/inofficial.ts b/services/explorer-api/src/http-server/routes/controllers/inofficial.ts index 9e8aed04..de43b8af 100644 --- a/services/explorer-api/src/http-server/routes/controllers/inofficial.ts +++ b/services/explorer-api/src/http-server/routes/controllers/inofficial.ts @@ -29,6 +29,7 @@ export const GET_ROUTES = asyncHandler(async (_req, res) => { await db.signOfLife.getABlockWithContractInstances(); const { privateFunction, unconstrainedFunction } = await db.signOfLife.getL2ContractFunctions(); + const somePrivateLogsTxEffects = await db.signOfLife.getSomeTxEffectWithPrivateLogs(); const someUnencryptedLogsTxEffects = await db.signOfLife.getSomeTxEffectWithUnencryptedLogs(); const r = [paths.latestHeight, paths.latestBlock, `${paths.blocks}?from=0`]; const searchRoutes = []; @@ -130,7 +131,7 @@ export const GET_ROUTES = asyncHandler(async (_req, res) => { r.push( paths.contractClassPrivateFunction .replace(`:${classId}`, privateFunction.classId) - .replace(`:${functionSelector}`, privateFunction.functionSelector) + .replace(`:${functionSelector}`, privateFunction.functionSelector.toString()) ); } if (unconstrainedFunction) { @@ -143,7 +144,7 @@ export const GET_ROUTES = asyncHandler(async (_req, res) => { r.push( paths.contractClassUnconstrainedFunction .replace(`:${classId}`, unconstrainedFunction.classId) - .replace(`:${functionSelector}`, unconstrainedFunction.functionSelector) + .replace(`:${functionSelector}`, unconstrainedFunction.functionSelector.toString()) ); } else { r.push(paths.contractClassPrivateFunctions + "NOT FOUND"); @@ -172,7 +173,12 @@ export const GET_ROUTES = asyncHandler(async (_req, res) => { .join("")}
-

Some unencrypted logs tx effects

+

Some tx effects with logs

+
    + ${somePrivateLogsTxEffects + ?.map((hash) => `
  • ${hash}
  • `) + .join("")} +
    ${someUnencryptedLogsTxEffects ?.map((hash) => `
  • ${hash}
  • `) diff --git a/services/explorer-api/src/http-server/routes/controllers/utils/db-wrapper.ts b/services/explorer-api/src/http-server/routes/controllers/utils/db-wrapper.ts index e0275c78..786cb7aa 100644 --- a/services/explorer-api/src/http-server/routes/controllers/utils/db-wrapper.ts +++ b/services/explorer-api/src/http-server/routes/controllers/utils/db-wrapper.ts @@ -4,7 +4,9 @@ import { dbParseErrorCallback } from "../../../../database/controllers/utils.js" import { CACHE_LATEST_TTL_SECONDS, CACHE_TTL_SECONDS, + NODE_ENV, } from "../../../../environment.js"; +import { logger } from "../../../../logger.js"; const LATEST_HEIGHT = "latestHeight"; @@ -41,7 +43,10 @@ export const get = async ( const cacheKey = keys.join("-"); const cachedVal = await c().get(cacheKey); const isCached = cachedVal !== null && cachedVal !== undefined; - if (isCached) return cachedVal; + if (isCached) { + if (NODE_ENV === "development") logger.info(`CACHE_HIT: ${cacheKey}`); + return cachedVal; + } const dbRes = await dbFn().catch(dbParseErrorCallback); if (dbRes !== null && dbRes !== undefined) { diff --git a/services/explorer-api/src/http-server/routes/controllers/utils/open-api-responses.ts b/services/explorer-api/src/http-server/routes/controllers/utils/open-api-responses.ts index 77836b13..92021175 100644 --- a/services/explorer-api/src/http-server/routes/controllers/utils/open-api-responses.ts +++ b/services/explorer-api/src/http-server/routes/controllers/utils/open-api-responses.ts @@ -8,6 +8,7 @@ import { chicmozL2TxEffectDeluxeSchema, chicmozL2UnconstrainedFunctionBroadcastedEventSchema, chicmozSearchResultsSchema, + chicmozL2VerifiedContractAddressDataSchema, } from "@chicmoz-pkg/types"; import { generateSchema } from "@anatine/zod-openapi"; @@ -45,4 +46,7 @@ export const contractClassUnconstrainedFunctionResponseArray = getResponse(z.arr export const contractInstanceResponse = getResponse(chicmozL2ContractInstanceDeluxeSchema); export const contractInstanceResponseArray = getResponse(z.array(chicmozL2ContractInstanceDeluxeSchema)); +export const verifiedContractResponse = getResponse(chicmozL2VerifiedContractAddressDataSchema); +export const verifiedContractResponseArray = getResponse(z.array(chicmozL2VerifiedContractAddressDataSchema)); + export const searchResultResponse = getResponse(chicmozSearchResultsSchema); diff --git a/services/explorer-api/src/http-server/routes/controllers/verified-contracts.ts b/services/explorer-api/src/http-server/routes/controllers/verified-contracts.ts new file mode 100644 index 00000000..82c23452 --- /dev/null +++ b/services/explorer-api/src/http-server/routes/controllers/verified-contracts.ts @@ -0,0 +1,49 @@ +import { RequestHandler } from "express"; +import { VERIFIED_CONTRACT_ADDRESSES } from "../../../environment.js"; +import { + verifiedContractResponse, + verifiedContractResponseArray, +} from "./utils/open-api-responses.js"; +import { getVerifiedContractSchema } from "../paths_and_validation.js"; + +export const openapi_GET_VERIFIED_CONTRACTS = { + "/l2/verified-contracts": { + get: { + summary: "Get the latest block", + responses: verifiedContractResponseArray, + }, + }, +}; + +export const GET_L2_VERIFIED_CONTRACTS: RequestHandler = (_req, res) => { + res.status(200).send(JSON.stringify(VERIFIED_CONTRACT_ADDRESSES)); +}; + +export const openapi_GET_VERIFIED_CONTRACT = { + "/l2/verified-contracts/{contractInstanceAddress}": { + get: { + summary: "Get a verified contract by address", + parameters: [ + { + name: "contractInstanceAddress", + in: "path", + required: true, + schema: { + type: "string", + }, + }, + ], + responses: verifiedContractResponse, + }, + }, +}; + +export const GET_L2_VERIFIED_CONTRACT: RequestHandler = (req, res) => { + const contractInstanceAddress = + getVerifiedContractSchema.parse(req).params.address; + const verifiedInfo = VERIFIED_CONTRACT_ADDRESSES.find( + (info) => info.contractInstanceAddress === contractInstanceAddress + ); + if (!verifiedInfo) throw new Error("Contract not found"); // TODO: ensure this resolves in a 404 + res.status(200).send(JSON.stringify(verifiedInfo)); +}; diff --git a/services/explorer-api/src/http-server/routes/index.ts b/services/explorer-api/src/http-server/routes/index.ts index 028804e4..4070d9c3 100644 --- a/services/explorer-api/src/http-server/routes/index.ts +++ b/services/explorer-api/src/http-server/routes/index.ts @@ -33,7 +33,7 @@ export const openApiPaths = { ...controller.openapi_SEARCH, }; -const statsPaths = [ +const otherPaths = [ { path: paths.statsTotalTxEffects, controller: controller.GET_STATS_TOTAL_TX_EFFECTS, @@ -62,7 +62,7 @@ const statsPaths = [ const checkDocsStatus = () => { const totalPaths = Object.keys(paths).length; - const totalStatsPaths = statsPaths.length; + const totalStatsPaths = otherPaths.length; const totalOpenApiPaths = Object.keys(openApiPaths).length; try { assert(totalPaths - totalStatsPaths === totalOpenApiPaths); @@ -102,9 +102,12 @@ export const init = ({ router }: { router: Router }) => { router.get(paths.contractInstance, controller.GET_L2_CONTRACT_INSTANCE); router.get(paths.contractInstances, controller.GET_L2_CONTRACT_INSTANCES); + router.get(paths.verifiedContract, controller.GET_L2_VERIFIED_CONTRACT); + router.get(paths.verifiedContracts, controller.GET_L2_VERIFIED_CONTRACTS); + router.get(paths.search, controller.L2_SEARCH); - statsPaths.forEach(({ path, controller }) => { + otherPaths.forEach(({ path, controller }) => { router.get(path, controller); }); diff --git a/services/explorer-api/src/http-server/routes/paths_and_validation.ts b/services/explorer-api/src/http-server/routes/paths_and_validation.ts index af973999..b4159f74 100644 --- a/services/explorer-api/src/http-server/routes/paths_and_validation.ts +++ b/services/explorer-api/src/http-server/routes/paths_and_validation.ts @@ -39,6 +39,9 @@ export const paths = { search: "/l2/search", + verifiedContract: `/l2/verified-contracts/:${address}`, + verifiedContracts: "/l2/verified-contracts", + statsTotalTxEffects: "/l2/stats/total-tx-effects", statsTotalTxEffectsLast24h: "/l2/stats/tx-effects-last-24h", statsTotalContracts: "/l2/stats/total-contracts", @@ -115,7 +118,7 @@ export const getContractClassPrivateFunctionsSchema = getContractClassesByClassI export const getContractClassPrivateFunctionSchema = z.object({ params: z.object({ [classId]: hexStringSchema, - [functionSelector]: hexStringSchema, + [functionSelector]: z.coerce.number().nonnegative(), }), }); export const getContractClassUnconstrainedFunctionsSchema = getContractClassPrivateFunctionsSchema; @@ -124,6 +127,8 @@ export const getContractClassUnconstrainedFunctionSchema = getContractClassPriva export const getContractInstancesByContractClassIdSchema = getContractClassesByClassIdSchema; +export const getVerifiedContractSchema = getContractInstanceSchema; + export const getSearchSchema = z.object({ query: chicmozSearchQuerySchema, }); diff --git a/services/explorer-ui/src/api/index.ts b/services/explorer-ui/src/api/index.ts index 67b29e44..84456ef1 100644 --- a/services/explorer-ui/src/api/index.ts +++ b/services/explorer-ui/src/api/index.ts @@ -1,4 +1,5 @@ export * from "./contract"; +export * from "./verified-contract"; export * from "./block"; export * from "./tx-effect"; export * from "./tx"; diff --git a/services/explorer-ui/src/api/verified-contract.ts b/services/explorer-ui/src/api/verified-contract.ts new file mode 100644 index 00000000..e4b6c3c2 --- /dev/null +++ b/services/explorer-ui/src/api/verified-contract.ts @@ -0,0 +1,29 @@ +import { + chicmozL2VerifiedContractAddressDataSchema, + type ChicmozL2VerifiedContractAddressData, +} from "@chicmoz-pkg/types"; +import { aztecExplorer } from "~/service/constants"; +import client, { validateResponse } from "./client"; + +export const VerifiedContractL2API = { + getVerifiedContract: async ( + address: string + ): Promise => { + const response = await client.get( + aztecExplorer.getL2VerifiedContractByInstanceAddress(address) + ); + return validateResponse( + chicmozL2VerifiedContractAddressDataSchema, + response.data + ); + }, + getVerifiedContracts: async (): Promise< + ChicmozL2VerifiedContractAddressData[] + > => { + const response = await client.get(aztecExplorer.getL2VerifiedContracts); + return validateResponse( + chicmozL2VerifiedContractAddressDataSchema.array(), + response.data + ); + }, +}; diff --git a/services/explorer-ui/src/components/copy-text.tsx b/services/explorer-ui/src/components/copy-text.tsx index b9330067..28430b21 100644 --- a/services/explorer-ui/src/components/copy-text.tsx +++ b/services/explorer-ui/src/components/copy-text.tsx @@ -5,6 +5,7 @@ import { Textarea } from "./ui/textarea"; interface Props { additionalClasses?: string; + additionalClassesIcon?: string; toCopy: string; text: string; textArea?: boolean; @@ -12,6 +13,7 @@ interface Props { export const CopyableText: FC = ({ additionalClasses, + additionalClassesIcon, toCopy, textArea = false, text, @@ -27,7 +29,7 @@ export const CopyableText: FC = ({ return (
    -
    +
    {textArea ? ( diff --git a/services/explorer-ui/src/components/info-display/key-value-row.tsx b/services/explorer-ui/src/components/info-display/key-value-row.tsx index 3e995eac..22400e15 100644 --- a/services/explorer-ui/src/components/info-display/key-value-row.tsx +++ b/services/explorer-ui/src/components/info-display/key-value-row.tsx @@ -58,6 +58,7 @@ export const KeyValueRow: FC = ({ text={truncateHashString(value)} toCopy={value} additionalClasses="md:justify-end md:text-end" + additionalClassesIcon="justify-end" /> )} @@ -68,7 +69,7 @@ export const KeyValueRow: FC = ({ rel="noreferrer" className="text-sm flex-grow text-primary-600 text-primary cursor-pointer md:text-end" > - View raw data + {value} ↗️ )} diff --git a/services/explorer-ui/src/hooks/utils.ts b/services/explorer-ui/src/hooks/utils.ts index 29238eea..95bf121b 100644 --- a/services/explorer-ui/src/hooks/utils.ts +++ b/services/explorer-ui/src/hooks/utils.ts @@ -30,4 +30,9 @@ export const queryKeyGenerator = { "deployedContractInstances", classId, ], + verifiedContracts: ["verifiedContracts"], + verifiedContractByInstanceAddress: (address: string) => [ + "verifiedContractByInstanceAddress", + address, + ], }; diff --git a/services/explorer-ui/src/hooks/verified-contract.ts b/services/explorer-ui/src/hooks/verified-contract.ts new file mode 100644 index 00000000..128ac370 --- /dev/null +++ b/services/explorer-ui/src/hooks/verified-contract.ts @@ -0,0 +1,14 @@ +import { type ChicmozL2VerifiedContractAddressData } from "@chicmoz-pkg/types"; +import { type UseQueryResult, useQuery } from "@tanstack/react-query"; +import { VerifiedContractL2API } from "~/api"; +import { queryKeyGenerator } from "./utils"; + +export const useVerifiedContracts = (): UseQueryResult< + ChicmozL2VerifiedContractAddressData[], + Error +> => { + return useQuery({ + queryKey: queryKeyGenerator.verifiedContracts, + queryFn: VerifiedContractL2API.getVerifiedContracts, + }); +}; diff --git a/services/explorer-ui/src/pages/block-details/util.ts b/services/explorer-ui/src/pages/block-details/util.ts index 495893b1..1e528131 100644 --- a/services/explorer-ui/src/pages/block-details/util.ts +++ b/services/explorer-ui/src/pages/block-details/util.ts @@ -47,7 +47,7 @@ export const getBlockDetails = (latestBlock: ChicmozL2BlockLight) => { }, { label: "Raw Data", - value: `/${aztecExplorer.getL2BlockByHash}${latestBlock.height}`, + value: "View raw data", extLink: `${API_URL}/${aztecExplorer.getL2BlockByHash}${latestBlock.height}`, }, ]; diff --git a/services/explorer-ui/src/pages/contract-class-details/index.tsx b/services/explorer-ui/src/pages/contract-class-details/index.tsx index d7b3dfd5..72e3a9c9 100644 --- a/services/explorer-ui/src/pages/contract-class-details/index.tsx +++ b/services/explorer-ui/src/pages/contract-class-details/index.tsx @@ -55,7 +55,7 @@ export const ContractClassDetails: FC = () => { if (!id) return
    No classId
    ; const selectedVersion = classesData?.find( - (contract) => contract.version === Number(version), + (contract) => contract.version === Number(version) ); if (!selectedVersion) return
    No data
    ; @@ -109,7 +109,12 @@ export const ContractClassDetails: FC = () => { {contractClassPrivateFunctionsHookRes.data.map( (privateFunction) => (
    -

    {privateFunction.privateFunction.selector.value}

    +

    + {"0x" + + privateFunction.privateFunction.selector.value.toString( + 16 + )} +

    artifactMetadataHash:{" "} {privateFunction.artifactMetadataHash} @@ -119,7 +124,7 @@ export const ContractClassDetails: FC = () => {

    privateFunctionTreeSiblingPath-{index}: {path}

    - ), + ) )}

    privateFunctionTreeLeafIndex:{" "} @@ -130,17 +135,13 @@ export const ContractClassDetails: FC = () => {

    artifactFunctionTreeSiblingPath-{index}: {path}

    - ), + ) )}

    artifactFunctionTreeLeafIndex:{" "} {privateFunction.artifactFunctionTreeLeafIndex}

    -

    - privateFunction.selector.type:{" "} - {privateFunction.privateFunction.selector.type} -

    privateFunction.selector.value:{" "} {privateFunction.privateFunction.selector.value} @@ -160,7 +161,7 @@ export const ContractClassDetails: FC = () => {


    - ), + ) )}
    )} @@ -172,10 +173,10 @@ export const ContractClassDetails: FC = () => { (unconstrainedFunction) => (

    - { - unconstrainedFunction.unconstrainedFunction.selector - .value - } + {"0x" + + unconstrainedFunction.unconstrainedFunction.selector.value.toString( + 16 + )}

    artifactMetadataHash:{" "} @@ -190,20 +191,13 @@ export const ContractClassDetails: FC = () => {

    artifactFunctionTreeSiblingPath-{index}: {path}

    - ), + ) )}

    artifactFunctionTreeLeafIndex:{" "} {unconstrainedFunction.artifactFunctionTreeLeafIndex}

    -

    - unconstrainedFunction.selector.type:{" "} - { - unconstrainedFunction.unconstrainedFunction.selector - .type - } -

    unconstrainedFunction.selector.value:{" "} { @@ -224,7 +218,7 @@ export const ContractClassDetails: FC = () => {


    - ), + ) )}
    )} diff --git a/services/explorer-ui/src/pages/contract-class-details/util.ts b/services/explorer-ui/src/pages/contract-class-details/util.ts index ab308603..3f139b8c 100644 --- a/services/explorer-ui/src/pages/contract-class-details/util.ts +++ b/services/explorer-ui/src/pages/contract-class-details/util.ts @@ -28,10 +28,7 @@ export const getContractClassKeyValueData = ( }, { label: "API ENDPOINT", - value: `/${aztecExplorer.getL2ContractClassByIdAndVersion( - data.contractClassId, - data.version.toString() - )}`, + value: "View raw data", extLink: `${API_URL}/${aztecExplorer.getL2ContractClassByIdAndVersion( data.contractClassId, data.version.toString() diff --git a/services/explorer-ui/src/pages/contract-instance-details/index.tsx b/services/explorer-ui/src/pages/contract-instance-details/index.tsx index 2fca9e27..d01f9df7 100644 --- a/services/explorer-ui/src/pages/contract-instance-details/index.tsx +++ b/services/explorer-ui/src/pages/contract-instance-details/index.tsx @@ -1,9 +1,11 @@ +import { CheckCircledIcon } from "@radix-ui/react-icons"; +import { Link } from "@tanstack/react-router"; import { useParams } from "@tanstack/react-router"; import { type FC } from "react"; -import { CheckCircledIcon } from "@radix-ui/react-icons"; import { KeyValueDisplay } from "~/components/info-display/key-value-display"; import { useContractInstance } from "~/hooks/"; -import { getContractData } from "./util"; +import { getContractData, getVerifiedContractData } from "./util"; +import { routes } from "~/routes/__root"; export const ContractInstanceDetails: FC = () => { const { address } = useParams({ @@ -20,24 +22,15 @@ export const ContractInstanceDetails: FC = () => { if (error) return
    Error
    ; if (!contractInstanceDetails) return
    No data
    ; - // TODO: link to a page on verified contracts and what verified means - const verifiedIcon = contractInstanceDetails.aztecScoutVerified ? ( -
    - -
    - Contract verified by Aztec Scout -
    -
    - ) : ( -
    Not verified
    - ); + const verfiedContractData = getVerifiedContractData(contractInstanceDetails); + return (

    - Contract instance details {verifiedIcon} + Contract instance details

    @@ -48,6 +41,28 @@ export const ContractInstanceDetails: FC = () => {
    + {verfiedContractData && ( +
    +
    +

    + Verified contract data +
    + + +
    + Read more about verified contracts here. +
    + +
    +

    +
    +
    +
    + +
    +
    +
    + )}
    ); diff --git a/services/explorer-ui/src/pages/contract-instance-details/util.ts b/services/explorer-ui/src/pages/contract-instance-details/util.ts index fdd41d1b..6d3574f6 100644 --- a/services/explorer-ui/src/pages/contract-instance-details/util.ts +++ b/services/explorer-ui/src/pages/contract-instance-details/util.ts @@ -2,6 +2,9 @@ import { type ChicmozL2ContractInstanceDeluxe } from "@chicmoz-pkg/types"; import { routes } from "~/routes/__root"; import { API_URL, aztecExplorer } from "~/service/constants"; +const HARDCODED_DEPLOYER = + "0x0000000000000000000000000000000000000000000000000000000000000000"; + export const getContractData = (data: ChicmozL2ContractInstanceDeluxe) => { const link = `${routes.contracts.route}${routes.contracts.children.classes.route}/${data.contractClassId}/versions/${data.version}`; const displayData = [ @@ -23,16 +26,51 @@ export const getContractData = (data: ChicmozL2ContractInstanceDeluxe) => { { label: "DEPLOYER", value: data.deployer }, { label: "RAW DATA", - value: `/${aztecExplorer.getL2ContractInstance(data.address)}`, - extLink: `${API_URL}/${aztecExplorer.getL2ContractInstance(data.address)}`, + value: "View raw data", + extLink: `${API_URL}/${aztecExplorer.getL2ContractInstance( + data.address + )}`, }, ]; - if (data.aztecScoutVerified) { + const isDeployerContract = + process.env.NODE_ENV === "development" && + data.deployer === HARDCODED_DEPLOYER; + if (isDeployerContract && !data.verifiedInfo) { displayData.push({ - label: "VERIFIED ✅", - value: "Contract deployer verified by Aztec Scout.", + label: "DEPLOYER CONTRACT 🤖", + value: + "This is a contract deployed by the hard-coded deployer. This message will only appear in development mode. But linking to verified contracts for good measure.", link: routes.verifiedContracts.route, }); } return displayData; }; + +export const getVerifiedContractData = (data: ChicmozL2ContractInstanceDeluxe) => { + return data.verifiedInfo + ? [ + { + label: "NAME", + value: data.verifiedInfo.name, + }, + { + label: "DETAILS", + value: data.verifiedInfo.details.slice(0, 50) + "...", + }, + { + label: "CONTACT", + value: data.verifiedInfo.contact, + }, + { + label: "UI URL", + value: data.verifiedInfo.uiUrl, + extLink: data.verifiedInfo.uiUrl, + }, + { + label: "REPO URL", + value: data.verifiedInfo.repoUrl, + extLink: data.verifiedInfo.repoUrl, + }, + ] + : undefined; +}; diff --git a/services/explorer-ui/src/pages/dev.tsx b/services/explorer-ui/src/pages/dev.tsx new file mode 100644 index 00000000..142bc46c --- /dev/null +++ b/services/explorer-ui/src/pages/dev.tsx @@ -0,0 +1,12 @@ +import { type FC } from "react"; + +export const DevPage: FC = () => { + return ( +
    +

    Dev Page

    +
    +

    Aztec.js version : 0.66.0

    +
    +
    + ); +}; diff --git a/services/explorer-ui/src/pages/tx-effect-details/constants.ts b/services/explorer-ui/src/pages/tx-effect-details/constants.ts index 306a2920..8a51592f 100644 --- a/services/explorer-ui/src/pages/tx-effect-details/constants.ts +++ b/services/explorer-ui/src/pages/tx-effect-details/constants.ts @@ -1,9 +1,8 @@ import { z } from "zod"; export type tabId = - | "encryptedLogs" + | "privateLogs" | "unencryptedLogs" - | "noteEncryptedLogs" | "nullifiers" | "noteHashes" | "l2ToL1Msgs" @@ -11,9 +10,8 @@ export type tabId = // Define the tab IDs array export const tabIds = [ - "encryptedLogs", + "privateLogs", "unencryptedLogs", - "noteEncryptedLogs", "nullifiers", "noteHashes", "l2ToL1Msgs", @@ -30,9 +28,8 @@ export const tabSchema = z.object({ export type Tab = z.infer; export const txEffectTabs: Tab[] = [ - { id: "encryptedLogs", label: "Encrypted logs" }, + { id: "privateLogs", label: "Private logs" }, { id: "unencryptedLogs", label: "Unencrypted logs" }, - { id: "noteEncryptedLogs", label: "Note encryped logs" }, { id: "nullifiers", label: "Nullifiers" }, { id: "noteHashes", label: "Note hashes" }, { id: "l2ToL1Msgs", label: "L2 to L1 messages" }, diff --git a/services/explorer-ui/src/pages/tx-effect-details/index.tsx b/services/explorer-ui/src/pages/tx-effect-details/index.tsx index 22df7fb4..6e295ce7 100644 --- a/services/explorer-ui/src/pages/tx-effect-details/index.tsx +++ b/services/explorer-ui/src/pages/tx-effect-details/index.tsx @@ -10,45 +10,27 @@ const naiveDecode = (data: Buffer): string => { // TODO let counterZero = 0; let counterAbove128 = 0; - let counterAbove255 = 0; - let sum = 0; - let totCount = 0; - const res = data.toString("hex").match(/.{1,64}/g) + const res = data + .toString("hex") + .match(/.{1,64}/g) ?.map((hex) => parseInt(hex, 16)) .map((charCode): string => { - if (charCode === 0) { - counterZero++; - } else { - //console.log(`charCode: ${charCode} char: ${String.fromCharCode(charCode)}`); - } - if (charCode > 128) { - counterAbove128++; - } - if (charCode > 255) { - counterAbove255++; - } - sum += charCode; - totCount++; + if (charCode === 0) counterZero++; + if (charCode > 128) counterAbove128++; const char = String.fromCharCode(charCode); return char; }) - .join(""); - const avg = sum / totCount; - //console.log("avg", avg); - //console.log("counterAbove128", counterAbove128); - //console.log("counterAbove255", counterAbove255); - //console.log("counterZero", counterZero); - //console.log("totCount", totCount); - return res ?? ""; + .join("") ?? ""; + const isProbablyADecodedString = counterZero === 0 && counterAbove128 === 0; + return isProbablyADecodedString ? res : data.toString("hex"); }; export const TxEffectDetails: FC = () => { - const [selectedTab, setSelectedTab] = useState("encryptedLogs"); + const [selectedTab, setSelectedTab] = useState("unencryptedLogs"); const { hash } = useParams({ from: "/tx-effects/$hash", }); const { data: txEffects, isLoading, error } = useGetTxEffectByHash(hash); - console.log(txEffects); const txEffectData = mapTxEffectsData(txEffects); useEffect(() => { @@ -90,32 +72,28 @@ export const TxEffectDetails: FC = () => { selectedItem={selectedTab} />
    - {selectedTab === "encryptedLogs" && ( + {selectedTab === "privateLogs" && (
    - {txEffects.encryptedLogs.functionLogs.map( - (encryption, index) => { - const entries = encryption.logs.map((log) => { - return Object.entries(log).map(([key, value]) => { - return { - label: key, - value: - value instanceof Buffer ? value.toString() : value, - isClickable: false, - }; - }); - }); - // Flatten the nested arrays - const flattenedEntries = entries.flat(); - - // Render KeyValueDisplay with the flattened entries - return ( -
    -

    Log {index + 1}

    - -
    - ); - } - )} + {txEffects.privateLogs.map((log, index) => { + //const entries = log.map((logNbr, i) => ({ + // label: `Log ${i + 1}`, + // value: logNbr.toString(), + // isClickable: false, + //})); + const entries = [ + { + label: "data", + value: log.toString(), + isClickable: false, + }, + ]; + return ( +
    +

    Log {index + 1}

    + +
    + ); + })}
    )} {selectedTab === "unencryptedLogs" && ( @@ -161,32 +139,6 @@ export const TxEffectDetails: FC = () => { ))}
    )} - {selectedTab === "noteEncryptedLogs" && ( -
    - {txEffects.noteEncryptedLogs.functionLogs.map( - (noteEncryptedLogs, index) => { - const entries = noteEncryptedLogs.logs.map((log) => { - return Object.entries(log).map(([key, value]) => ({ - label: key, - value: - value instanceof Buffer ? value.toString() : value, - isClickable: false, - })); - }); - // Flatten the nested arrays - const flattenedEntries = entries.flat(); - - // Render KeyValueDisplay with the flattened entries - return ( -
    -

    Log {index + 1}

    - -
    - ); - } - )} -
    - )} {selectedTab === "noteHashes" && (
    {txEffects.noteHashes.map((nullifier) => ( diff --git a/services/explorer-ui/src/pages/tx-effect-details/utils.ts b/services/explorer-ui/src/pages/tx-effect-details/utils.ts index c3237713..46dbf2fa 100644 --- a/services/explorer-ui/src/pages/tx-effect-details/utils.ts +++ b/services/explorer-ui/src/pages/tx-effect-details/utils.ts @@ -3,6 +3,7 @@ import { type tabId } from "./constants"; import { formatTimeSince } from "~/lib/utils"; import { API_URL, aztecExplorer } from "~/service/constants"; export type TxEffectDataType = + | string[][] | string[] | Array<{ logs: Array<{ data: Buffer; contractAddress: string }> }> | Array<{ @@ -39,7 +40,7 @@ export const getTxEffectData = (data: ChicmozL2TxEffectDeluxe) => [ }, { label: "RAW DATA", - value: `/${aztecExplorer.getL2TxEffectByHash}${data.hash}`, + value: "View raw data", extLink: `${API_URL}/${aztecExplorer.getL2TxEffectByHash}${data.hash}`, }, ]; @@ -50,22 +51,13 @@ export const mapTxEffectsData = ( if (!data) return {}; const effectsMap: Record = { - encryptedLogs: data.encryptedLogs?.functionLogs?.filter( - (log) => log.logs.length > 0 - ).length - ? data.encryptedLogs.functionLogs.filter((log) => log.logs.length > 0) - : undefined, + privateLogs: data.privateLogs.length ? data.privateLogs : undefined, unencryptedLogs: data.unencryptedLogs?.functionLogs?.filter( (log) => log.logs.length > 0 ).length ? data.unencryptedLogs.functionLogs : undefined, nullifiers: data.nullifiers?.length ? data.nullifiers : undefined, - noteEncryptedLogs: data.noteEncryptedLogs?.functionLogs?.filter( - (log) => log.logs.length > 0 - ).length - ? data.noteEncryptedLogs.functionLogs - : undefined, noteHashes: data.noteHashes?.length ? data.noteHashes : undefined, l2ToL1Msgs: data.l2ToL1Msgs?.length ? data.l2ToL1Msgs : undefined, publicDataWrites: data.publicDataWrites?.length diff --git a/services/explorer-ui/src/pages/verified-contracts.tsx b/services/explorer-ui/src/pages/verified-contracts.tsx index 39d40986..60837e55 100644 --- a/services/explorer-ui/src/pages/verified-contracts.tsx +++ b/services/explorer-ui/src/pages/verified-contracts.tsx @@ -1,7 +1,12 @@ import { type FC } from "react"; -// TODO: make verified contracts link process env +import { Link } from "@tanstack/react-router"; +import { useVerifiedContracts } from "~/hooks/verified-contract"; +import { routes } from "~/routes/__root"; +const contractInstanceDetailsRoute = + routes.contracts.route + routes.contracts.children.instances.route + "/"; export const VerifiedContracts: FC = () => { + const { data, isError, isLoading } = useVerifiedContracts(); return (

    Verified contracts

    @@ -13,7 +18,7 @@ export const VerifiedContracts: FC = () => {

    ⚠️ Please note that this does not mean that the contract is safe to - use. ⚠️ + use, nor that we endorse the contract. ⚠️


    @@ -27,6 +32,45 @@ export const VerifiedContracts: FC = () => { . If you think your contract should be verified, please create a PR to that file.

    +
    +
    +

    Verified contracts:

    + {isLoading &&

    Loading...

    } + {isError &&

    Something went wrong...

    } + {data && data.length === 0 &&

    No verified contracts found

    } + {data && data.length > 0 && ( + + )}
    ); diff --git a/services/explorer-ui/src/routeTree.gen.ts b/services/explorer-ui/src/routeTree.gen.ts index 7f5925e0..c66f307e 100644 --- a/services/explorer-ui/src/routeTree.gen.ts +++ b/services/explorer-ui/src/routeTree.gen.ts @@ -19,6 +19,7 @@ import { Route as TermsAndConditionsImport } from './routes/terms-and-conditions const VerifiedContractsLazyImport = createFileRoute('/verified-contracts')() const PrivacyPolicyLazyImport = createFileRoute('/privacy-policy')() +const DevLazyImport = createFileRoute('/dev')() const AboutUsLazyImport = createFileRoute('/about-us')() const IndexLazyImport = createFileRoute('/')() const TxEffectsIndexLazyImport = createFileRoute('/tx-effects/')() @@ -49,6 +50,11 @@ const PrivacyPolicyLazyRoute = PrivacyPolicyLazyImport.update({ import('./routes/privacy-policy.lazy').then((d) => d.Route), ) +const DevLazyRoute = DevLazyImport.update({ + path: '/dev', + getParentRoute: () => rootRoute, +} as any).lazy(() => import('./routes/dev.lazy').then((d) => d.Route)) + const AboutUsLazyRoute = AboutUsLazyImport.update({ path: '/about-us', getParentRoute: () => rootRoute, @@ -140,6 +146,13 @@ declare module '@tanstack/react-router' { preLoaderRoute: typeof AboutUsLazyImport parentRoute: typeof rootRoute } + '/dev': { + id: '/dev' + path: '/dev' + fullPath: '/dev' + preLoaderRoute: typeof DevLazyImport + parentRoute: typeof rootRoute + } '/privacy-policy': { id: '/privacy-policy' path: '/privacy-policy' @@ -212,6 +225,7 @@ export const routeTree = rootRoute.addChildren({ IndexLazyRoute, TermsAndConditionsRoute, AboutUsLazyRoute, + DevLazyRoute, PrivacyPolicyLazyRoute, VerifiedContractsLazyRoute, BlocksBlockNumberLazyRoute, @@ -234,6 +248,7 @@ export const routeTree = rootRoute.addChildren({ "/", "/terms-and-conditions", "/about-us", + "/dev", "/privacy-policy", "/verified-contracts", "/blocks/$blockNumber", @@ -254,6 +269,9 @@ export const routeTree = rootRoute.addChildren({ "/about-us": { "filePath": "about-us.lazy.tsx" }, + "/dev": { + "filePath": "dev.lazy.tsx" + }, "/privacy-policy": { "filePath": "privacy-policy.lazy.tsx" }, diff --git a/services/explorer-ui/src/routes/dev.lazy.tsx b/services/explorer-ui/src/routes/dev.lazy.tsx new file mode 100644 index 00000000..56183cf6 --- /dev/null +++ b/services/explorer-ui/src/routes/dev.lazy.tsx @@ -0,0 +1,6 @@ +import { createLazyFileRoute } from "@tanstack/react-router"; +import { DevPage } from "~/pages/dev"; + +export const Route = createLazyFileRoute("/dev")({ + component: DevPage, +}); diff --git a/services/explorer-ui/src/service/constants.ts b/services/explorer-ui/src/service/constants.ts index a22b875e..b618b777 100644 --- a/services/explorer-ui/src/service/constants.ts +++ b/services/explorer-ui/src/service/constants.ts @@ -35,6 +35,9 @@ export const aztecExplorer = { `l2/blocks/${hash}/contract-instances`, getL2ContractInstancesByClassId: (classId: string) => `l2/contract-classes/${classId}/contract-instances`, + getL2VerifiedContracts: "l2/verified-contracts", + getL2VerifiedContractByInstanceAddress: (address: string) => + `l2/verified-contracts/${address}`, getL2TotalTxEffects: "l2/stats/total-tx-effects", getL2TotalTxEffectsLast24h: "/l2/stats/tx-effects-last-24h", diff --git a/yarn.lock b/yarn.lock index 2e0b5fd3..e84d2982 100644 --- a/yarn.lock +++ b/yarn.lock @@ -41,43 +41,43 @@ __metadata: languageName: node linkType: hard -"@aztec/accounts@npm:0.65.2": - version: 0.65.2 - resolution: "@aztec/accounts@npm:0.65.2" - dependencies: - "@aztec/aztec.js": "npm:0.65.2" - "@aztec/circuit-types": "npm:0.65.2" - "@aztec/circuits.js": "npm:0.65.2" - "@aztec/entrypoints": "npm:0.65.2" - "@aztec/ethereum": "npm:0.65.2" - "@aztec/foundation": "npm:0.65.2" - "@aztec/types": "npm:0.65.2" +"@aztec/accounts@npm:0.66.0": + version: 0.66.0 + resolution: "@aztec/accounts@npm:0.66.0" + dependencies: + "@aztec/aztec.js": "npm:0.66.0" + "@aztec/circuit-types": "npm:0.66.0" + "@aztec/circuits.js": "npm:0.66.0" + "@aztec/entrypoints": "npm:0.66.0" + "@aztec/ethereum": "npm:0.66.0" + "@aztec/foundation": "npm:0.66.0" + "@aztec/types": "npm:0.66.0" tslib: "npm:^2.4.0" - checksum: 8eb1d7ca9c27e354beffb4d7333995fb1a5ca5a42f2a0f0a2ebdc1ecf738ab2231afd7217e0f16dedf530cd96717df7a9a3d6dcf69c9c91a30f211f28d8842fa + checksum: edd31c634eacc8c769ef69bf46960deda25ca45460115a1b54bca3fd97d8d1a49e219356c542455d9a3cf00c9e738b9ea21e72435186450ea3e6c46f3c0fc9fc languageName: node linkType: hard -"@aztec/aztec.js@npm:0.65.2": - version: 0.65.2 - resolution: "@aztec/aztec.js@npm:0.65.2" +"@aztec/aztec.js@npm:0.66.0": + version: 0.66.0 + resolution: "@aztec/aztec.js@npm:0.66.0" dependencies: - "@aztec/circuit-types": "npm:0.65.2" - "@aztec/circuits.js": "npm:0.65.2" - "@aztec/ethereum": "npm:0.65.2" - "@aztec/foundation": "npm:0.65.2" - "@aztec/l1-artifacts": "npm:0.65.2" - "@aztec/protocol-contracts": "npm:0.65.2" - "@aztec/types": "npm:0.65.2" + "@aztec/circuit-types": "npm:0.66.0" + "@aztec/circuits.js": "npm:0.66.0" + "@aztec/ethereum": "npm:0.66.0" + "@aztec/foundation": "npm:0.66.0" + "@aztec/l1-artifacts": "npm:0.66.0" + "@aztec/protocol-contracts": "npm:0.66.0" + "@aztec/types": "npm:0.66.0" axios: "npm:^1.7.2" tslib: "npm:^2.4.0" viem: "npm:^2.7.15" - checksum: 56ad980c547c6776182689dc75f7e5a8af7cbc4dda3ee43c96aa169c8e680cc9281169b6ca90fc92b846f14169908389a0b4f5993aa561e0f56f4d00d999f82c + checksum: 60eb34b05a71d7f35b7031e51c6990f6fb2985369369e89f6a43ec8f0462852b3b324c7407cae7c24c804d1c7044bde9a2d2e56a6c6fc1c4a079fba996412205 languageName: node linkType: hard -"@aztec/bb.js@npm:0.65.2": - version: 0.65.2 - resolution: "@aztec/bb.js@npm:0.65.2" +"@aztec/bb.js@npm:0.66.0": + version: 0.66.0 + resolution: "@aztec/bb.js@npm:0.66.0" dependencies: comlink: "npm:^4.4.1" commander: "npm:^10.0.1" @@ -87,82 +87,82 @@ __metadata: tslib: "npm:^2.4.0" bin: bb.js: dest/node/main.js - checksum: 25276709999c00d5c0efbfb8c8ef22dcc9975db7606325073bd5e17ec0d772ac276af7e07e58c13c35fc2ef8dbf73fd8286cf37b3c740b3f33c02a34e76550a4 + checksum: edafaf80355ac04778802e97c85be21cbdbe8309e55445b06587072d8aa780f3c56a100243a28f5158732eb7f78932849d2a7598e4af0af85ad9ac9d97337a8b languageName: node linkType: hard -"@aztec/circuit-types@npm:0.65.2": - version: 0.65.2 - resolution: "@aztec/circuit-types@npm:0.65.2" +"@aztec/circuit-types@npm:0.66.0": + version: 0.66.0 + resolution: "@aztec/circuit-types@npm:0.66.0" dependencies: - "@aztec/circuits.js": "npm:0.65.2" - "@aztec/ethereum": "npm:0.65.2" - "@aztec/foundation": "npm:0.65.2" - "@aztec/types": "npm:0.65.2" + "@aztec/circuits.js": "npm:0.66.0" + "@aztec/ethereum": "npm:0.66.0" + "@aztec/foundation": "npm:0.66.0" + "@aztec/types": "npm:0.66.0" browserify-cipher: "npm:^1.0.1" lodash.clonedeep: "npm:^4.5.0" lodash.isequal: "npm:^4.5.0" lodash.times: "npm:^4.3.2" tslib: "npm:^2.5.0" zod: "npm:^3.23.8" - checksum: 91b6547ba6c2d784f5cf9ffdecacaa3d40664db20d22c6919a52ee3048ab803b01877a482d7f0fbd9c46bc872c5cdb054aa7a34534124e5e65b287ac94687ec4 + checksum: dda40b0641327d48c54c39bc5eab8a64e46c08d43ef0e37e2a17642d02dc54985f919a6a739dedc260118b68b30ef33bbf141d88983f58b9d38f1b107dfadcc9 languageName: node linkType: hard -"@aztec/circuits.js@npm:0.65.2": - version: 0.65.2 - resolution: "@aztec/circuits.js@npm:0.65.2" +"@aztec/circuits.js@npm:0.66.0": + version: 0.66.0 + resolution: "@aztec/circuits.js@npm:0.66.0" dependencies: - "@aztec/bb.js": "npm:0.65.2" - "@aztec/ethereum": "npm:0.65.2" - "@aztec/foundation": "npm:0.65.2" - "@aztec/types": "npm:0.65.2" + "@aztec/bb.js": "npm:0.66.0" + "@aztec/ethereum": "npm:0.66.0" + "@aztec/foundation": "npm:0.66.0" + "@aztec/types": "npm:0.66.0" eslint: "npm:^8.35.0" - lodash.chunk: "npm:^4.2.0" tslib: "npm:^2.4.0" zod: "npm:^3.23.8" - checksum: 24c5e656ace2c47dbcf9056eca4c5dccf7cbc3f4c5daf1c8ada93c32d29789b6d3fa579c1fdbe4096bf80b2f2ca68af56e20cb9e7549fc06913629f0ea48d624 + checksum: 46b9eceb46110d49ed59a88d4a38da830f160b9f32ac09f8154d0e15175bc9775a6256acd1020a9becebb92761544c5b9dda177574d404208a8f849e162a2c3e languageName: node linkType: hard -"@aztec/entrypoints@npm:0.65.2": - version: 0.65.2 - resolution: "@aztec/entrypoints@npm:0.65.2" +"@aztec/entrypoints@npm:0.66.0": + version: 0.66.0 + resolution: "@aztec/entrypoints@npm:0.66.0" dependencies: - "@aztec/aztec.js": "npm:0.65.2" - "@aztec/circuit-types": "npm:0.65.2" - "@aztec/circuits.js": "npm:0.65.2" - "@aztec/foundation": "npm:0.65.2" - "@aztec/protocol-contracts": "npm:0.65.2" + "@aztec/aztec.js": "npm:0.66.0" + "@aztec/circuit-types": "npm:0.66.0" + "@aztec/circuits.js": "npm:0.66.0" + "@aztec/foundation": "npm:0.66.0" + "@aztec/protocol-contracts": "npm:0.66.0" tslib: "npm:^2.4.0" - checksum: 47c531c2511a314533f4d128015df181ed383a70f12130c9f612ea96f5b3453eab861298509c472629c781ec1e660e1ec32c68e380c0a05e6b041affe72063b4 + checksum: 4e420f2e3881b22064b3139cd7ef08fb41d10938e15c40fb576d1e45c06cfad4254bbff0aa6f04786625ec75137b579b4ea074f8ba5a70074687cc16fed012ad languageName: node linkType: hard -"@aztec/ethereum@npm:0.65.2": - version: 0.65.2 - resolution: "@aztec/ethereum@npm:0.65.2" +"@aztec/ethereum@npm:0.66.0": + version: 0.66.0 + resolution: "@aztec/ethereum@npm:0.66.0" dependencies: - "@aztec/foundation": "npm:0.65.2" - "@aztec/l1-artifacts": "npm:0.65.2" + "@aztec/foundation": "npm:0.66.0" + "@aztec/l1-artifacts": "npm:0.66.0" "@viem/anvil": "npm:^0.0.10" dotenv: "npm:^16.0.3" get-port: "npm:^7.1.0" tslib: "npm:^2.4.0" viem: "npm:^2.7.15" zod: "npm:^3.23.8" - checksum: 3e20cd40640adcfb0db17b50ed3b22d20b929c384348aa805fcaa6d6847c077efc2be159e4db64c62f5ab5495b3c30aad75bcd2101ab6f3297900d580fa7f76c + checksum: 7cc88fdcdc857e9b3fcfd28f86d98757beb5d8ce0c98b2a7d0e054abfa8751b18def54c8ef10dce9a250a889e9b38c1227cd7a8d75b706996885c3a0454e10f4 languageName: node linkType: hard -"@aztec/foundation@npm:0.65.2": - version: 0.65.2 - resolution: "@aztec/foundation@npm:0.65.2" +"@aztec/foundation@npm:0.66.0": + version: 0.66.0 + resolution: "@aztec/foundation@npm:0.66.0" dependencies: - "@aztec/bb.js": "npm:0.65.2" + "@aztec/bb.js": "npm:0.66.0" "@koa/cors": "npm:^5.0.0" "@noble/curves": "npm:^1.2.0" bn.js: "npm:^5.2.1" + colorette: "npm:^2.0.20" debug: "npm:^4.3.4" detect-node: "npm:^2.1.0" elliptic: "npm:^6.5.4" @@ -177,51 +177,54 @@ __metadata: lodash.clonedeepwith: "npm:^4.5.0" memdown: "npm:^6.1.1" pako: "npm:^2.1.0" + pino: "npm:^9.5.0" + pino-pretty: "npm:^13.0.0" sha3: "npm:^2.1.4" zod: "npm:^3.23.8" - checksum: 4d662ab734c1bf5e05ff0a4162e52e911eeefa6b110edb54f7f0ce95e7e5a2d35501e786e35d8464f29ad27f47cbcc7f69bbdc0bb5231d9170022d7e11e18962 + checksum: 40f674b536833d397f7960b6680e57ea58e9c58e09b40b96e537aafeaa194f9366a3241943971504a7f4f6451e4ddffc9c138f68ddb27d51a7819bbc7e159e90 languageName: node linkType: hard -"@aztec/l1-artifacts@npm:0.65.2": - version: 0.65.2 - resolution: "@aztec/l1-artifacts@npm:0.65.2" +"@aztec/l1-artifacts@npm:0.66.0": + version: 0.66.0 + resolution: "@aztec/l1-artifacts@npm:0.66.0" dependencies: tslib: "npm:^2.4.0" - checksum: 46f6f10414808c386e0ff75566e08181e816469dcc45d9821e01daca0985e064ec35b9d899369f69738eafa11df4fb9457ea123a402da28079ce7cf12e335f02 + checksum: bed22a886eeb3f0d1f6c1d9cb22e4265b4cdbda57970bcbdc2cc7005ecc9c0ee557e1c392e29edafb728e2ea2b1eb85f1edbdd7cbb35312aabdbdbf43cdda17a languageName: node linkType: hard -"@aztec/noir-contracts.js@npm:0.65.2": - version: 0.65.2 - resolution: "@aztec/noir-contracts.js@npm:0.65.2" +"@aztec/noir-contracts.js@npm:0.66.0": + version: 0.66.0 + resolution: "@aztec/noir-contracts.js@npm:0.66.0" dependencies: - "@aztec/aztec.js": "npm:0.65.2" + "@aztec/aztec.js": "npm:0.66.0" tslib: "npm:^2.4.0" - checksum: 27c5473707069b3715165d1050bad4a10ea408283eb71faf0a75799a7e38d8b043922c0a5c8e79055393d7e74f8cb32035f22062cca58ab6d24242e45b609210 + checksum: f90737fb41cf4c50bc223be0b69c1f5f0ce9c5652ba1bde1ba6729a56c7a590c66a99a7c51ac2c4020fe9201e7ad9b777812bf6e20cd97dd314f5ea0e311713a languageName: node linkType: hard -"@aztec/protocol-contracts@npm:0.65.2": - version: 0.65.2 - resolution: "@aztec/protocol-contracts@npm:0.65.2" +"@aztec/protocol-contracts@npm:0.66.0": + version: 0.66.0 + resolution: "@aztec/protocol-contracts@npm:0.66.0" dependencies: - "@aztec/circuits.js": "npm:0.65.2" - "@aztec/foundation": "npm:0.65.2" - "@aztec/types": "npm:0.65.2" + "@aztec/circuits.js": "npm:0.66.0" + "@aztec/foundation": "npm:0.66.0" + "@aztec/types": "npm:0.66.0" + lodash.chunk: "npm:^4.2.0" lodash.omit: "npm:^4.5.0" tslib: "npm:^2.4.0" - checksum: 8f9a1e8f3d3c5d321baa4321fa71bcbbf125b467d2bed3bd4799f761552570afa7821ff7b5ad5cf5b56ea7f5cbf2e6fa373ed444bfbc34c537a5c7d4caabed88 + checksum: c1e8f8e0ff4a1d9c2dae212a16ea4f39d88b8c7fac1a283da850afee48654b60d65d604f003c35033f2977581586a30066aef7f7d1371ac425d14987b551206e languageName: node linkType: hard -"@aztec/types@npm:0.65.2": - version: 0.65.2 - resolution: "@aztec/types@npm:0.65.2" +"@aztec/types@npm:0.66.0": + version: 0.66.0 + resolution: "@aztec/types@npm:0.66.0" dependencies: - "@aztec/ethereum": "npm:0.65.2" - "@aztec/foundation": "npm:0.65.2" - checksum: 152f5c76ffafc6508e7cdff4a6bb6fb8ae744dcb8f826e3dc5d439bd4f1b82320f47fc24ee35c9b628b93e0670ed4b0f7ac8394be816e96bd312f5db3378eb1c + "@aztec/ethereum": "npm:0.66.0" + "@aztec/foundation": "npm:0.66.0" + checksum: d2adad06a76d4c39bac6c924710ba990a81407d5112404e60a47bc6c8070b688862148d7ea322cff9bd4e3c0867b9afd0563f3aaa93dfe6056a14f3095b7bec3 languageName: node linkType: hard @@ -769,7 +772,7 @@ __metadata: version: 0.0.0-use.local resolution: "@chicmoz-pkg/backend-utils@workspace:packages/backend-utils" dependencies: - "@aztec/aztec.js": "npm:0.65.2" + "@aztec/aztec.js": "npm:0.66.0" "@chicmoz-pkg/types": "workspace:^" "@typescript-eslint/eslint-plugin": "npm:6.11.0" "@typescript-eslint/parser": "npm:6.11.0" @@ -849,7 +852,7 @@ __metadata: version: 0.0.0-use.local resolution: "@chicmoz-pkg/message-registry@workspace:packages/message-registry" dependencies: - "@aztec/aztec.js": "npm:0.65.2" + "@aztec/aztec.js": "npm:0.66.0" "@chicmoz-pkg/types": "workspace:^" "@typescript-eslint/eslint-plugin": "npm:6.11.0" "@typescript-eslint/parser": "npm:6.11.0" @@ -925,8 +928,8 @@ __metadata: version: 0.0.0-use.local resolution: "@chicmoz/aztec-listener@workspace:services/aztec-listener" dependencies: - "@aztec/aztec.js": "npm:0.65.2" - "@aztec/circuits.js": "npm:0.65.2" + "@aztec/aztec.js": "npm:0.66.0" + "@aztec/circuits.js": "npm:0.66.0" "@chicmoz-pkg/logger-server": "workspace:^" "@chicmoz-pkg/message-bus": "workspace:^" "@chicmoz-pkg/message-registry": "workspace:^" @@ -976,8 +979,8 @@ __metadata: version: 0.0.0-use.local resolution: "@chicmoz/ethereum-listener@workspace:services/ethereum-listener" dependencies: - "@aztec/aztec.js": "npm:0.65.2" - "@aztec/l1-artifacts": "npm:0.65.2" + "@aztec/aztec.js": "npm:0.66.0" + "@aztec/l1-artifacts": "npm:0.66.0" "@chicmoz-pkg/logger-server": "workspace:^" "@chicmoz-pkg/message-bus": "workspace:^" "@chicmoz-pkg/message-registry": "workspace:^" @@ -1000,10 +1003,10 @@ __metadata: version: 0.0.0-use.local resolution: "@chicmoz/event-cannon@workspace:services/event-cannon" dependencies: - "@aztec/accounts": "npm:0.65.2" - "@aztec/aztec.js": "npm:0.65.2" - "@aztec/l1-artifacts": "npm:0.65.2" - "@aztec/noir-contracts.js": "npm:0.65.2" + "@aztec/accounts": "npm:0.66.0" + "@aztec/aztec.js": "npm:0.66.0" + "@aztec/l1-artifacts": "npm:0.66.0" + "@aztec/noir-contracts.js": "npm:0.66.0" "@chicmoz-pkg/logger-server": "workspace:^" "@types/node": "npm:20.5.0" "@typescript-eslint/eslint-plugin": "npm:6.11.0" @@ -1023,9 +1026,9 @@ __metadata: resolution: "@chicmoz/explorer-api@workspace:services/explorer-api" dependencies: "@anatine/zod-openapi": "npm:2.2.6" - "@aztec/aztec.js": "npm:0.65.2" - "@aztec/circuits.js": "npm:0.65.2" - "@aztec/protocol-contracts": "npm:0.65.2" + "@aztec/aztec.js": "npm:0.66.0" + "@aztec/circuits.js": "npm:0.66.0" + "@aztec/protocol-contracts": "npm:0.66.0" "@chicmoz-pkg/backend-utils": "workspace:^" "@chicmoz-pkg/error-middleware": "workspace:^" "@chicmoz-pkg/logger-server": "workspace:^" @@ -5403,6 +5406,13 @@ __metadata: languageName: node linkType: hard +"atomic-sleep@npm:^1.0.0": + version: 1.0.0 + resolution: "atomic-sleep@npm:1.0.0" + checksum: e329a6665512736a9bbb073e1761b4ec102f7926cce35037753146a9db9c8104f5044c1662e4a863576ce544fb8be27cd2be6bc8c1a40147d03f31eb1cfb6e8a + languageName: node + linkType: hard + "auto-bind@npm:*, auto-bind@npm:5.0.1": version: 5.0.1 resolution: "auto-bind@npm:5.0.1" @@ -6177,7 +6187,7 @@ __metadata: languageName: node linkType: hard -"colorette@npm:^2.0.20": +"colorette@npm:^2.0.20, colorette@npm:^2.0.7": version: 2.0.20 resolution: "colorette@npm:2.0.20" checksum: e94116ff33b0ff56f3b83b9ace895e5bf87c2a7a47b3401b8c3f3226e050d5ef76cf4072fb3325f9dc24d1698f9b730baf4e05eeaf861d74a1883073f4c98a40 @@ -6439,6 +6449,13 @@ __metadata: languageName: node linkType: hard +"dateformat@npm:^4.6.3": + version: 4.6.3 + resolution: "dateformat@npm:4.6.3" + checksum: e2023b905e8cfe2eb8444fb558562b524807a51cdfe712570f360f873271600b5c94aebffaf11efb285e2c072264a7cf243eadb68f3eba0f8cc85fb86cd25df6 + languageName: node + linkType: hard + "debug@npm:2.6.9": version: 2.6.9 resolution: "debug@npm:2.6.9" @@ -6901,6 +6918,15 @@ __metadata: languageName: node linkType: hard +"end-of-stream@npm:^1.1.0": + version: 1.4.4 + resolution: "end-of-stream@npm:1.4.4" + dependencies: + once: "npm:^1.4.0" + checksum: 870b423afb2d54bb8d243c63e07c170409d41e20b47eeef0727547aea5740bd6717aca45597a9f2745525667a6b804c1e7bede41f856818faee5806dd9ff3975 + languageName: node + linkType: hard + "enhanced-resolve@npm:^5.15.0": version: 5.17.1 resolution: "enhanced-resolve@npm:5.17.1" @@ -7895,6 +7921,13 @@ __metadata: languageName: node linkType: hard +"fast-copy@npm:^3.0.2": + version: 3.0.2 + resolution: "fast-copy@npm:3.0.2" + checksum: 02e8b9fd03c8c024d2987760ce126456a0e17470850b51e11a1c3254eed6832e4733ded2d93316c82bc0b36aeb991ad1ff48d1ba95effe7add7c3ab8d8eb554a + languageName: node + linkType: hard + "fast-deep-equal@npm:^3.1.1, fast-deep-equal@npm:^3.1.3": version: 3.1.3 resolution: "fast-deep-equal@npm:3.1.3" @@ -7929,6 +7962,13 @@ __metadata: languageName: node linkType: hard +"fast-redact@npm:^3.1.1": + version: 3.5.0 + resolution: "fast-redact@npm:3.5.0" + checksum: 7e2ce4aad6e7535e0775bf12bd3e4f2e53d8051d8b630e0fa9e67f68cb0b0e6070d2f7a94b1d0522ef07e32f7c7cda5755e2b677a6538f1e9070ca053c42343a + languageName: node + linkType: hard + "fast-safe-stringify@npm:^2.1.1": version: 2.1.1 resolution: "fast-safe-stringify@npm:2.1.1" @@ -8528,6 +8568,13 @@ __metadata: languageName: node linkType: hard +"help-me@npm:^5.0.0": + version: 5.0.0 + resolution: "help-me@npm:5.0.0" + checksum: 054c0e2e9ae2231c85ab5e04f75109b9d068ffcc54e58fb22079822a5ace8ff3d02c66fd45379c902ad5ab825e5d2e1451fcc2f7eab1eb49e7d488133ba4cacb + languageName: node + linkType: hard + "hexoid@npm:^1.0.0": version: 1.0.0 resolution: "hexoid@npm:1.0.0" @@ -9610,6 +9657,13 @@ __metadata: languageName: node linkType: hard +"joycon@npm:^3.1.1": + version: 3.1.1 + resolution: "joycon@npm:3.1.1" + checksum: 131fb1e98c9065d067fd49b6e685487ac4ad4d254191d7aa2c9e3b90f4e9ca70430c43cad001602bdbdabcf58717d3b5c5b7461c1bd8e39478c8de706b3fe6ae + languageName: node + linkType: hard + "js-tokens@npm:^3.0.0 || ^4.0.0, js-tokens@npm:^4.0.0": version: 4.0.0 resolution: "js-tokens@npm:4.0.0" @@ -10764,6 +10818,13 @@ __metadata: languageName: node linkType: hard +"on-exit-leak-free@npm:^2.1.0": + version: 2.1.2 + resolution: "on-exit-leak-free@npm:2.1.2" + checksum: faea2e1c9d696ecee919026c32be8d6a633a7ac1240b3b87e944a380e8a11dc9c95c4a1f8fb0568de7ab8db3823e790f12bda45296b1d111e341aad3922a0570 + languageName: node + linkType: hard + "on-finished@npm:2.4.1, on-finished@npm:^2.3.0": version: 2.4.1 resolution: "on-finished@npm:2.4.1" @@ -10789,7 +10850,7 @@ __metadata: languageName: node linkType: hard -"once@npm:^1.3.0, once@npm:^1.4.0": +"once@npm:^1.3.0, once@npm:^1.3.1, once@npm:^1.4.0": version: 1.4.0 resolution: "once@npm:1.4.0" dependencies: @@ -11171,6 +11232,66 @@ __metadata: languageName: node linkType: hard +"pino-abstract-transport@npm:^2.0.0": + version: 2.0.0 + resolution: "pino-abstract-transport@npm:2.0.0" + dependencies: + split2: "npm:^4.0.0" + checksum: 02c05b8f2ffce0d7c774c8e588f61e8b77de8ccb5f8125afd4a7325c9ea0e6af7fb78168999657712ae843e4462bb70ac550dfd6284f930ee57f17f486f25a9f + languageName: node + linkType: hard + +"pino-pretty@npm:^13.0.0": + version: 13.0.0 + resolution: "pino-pretty@npm:13.0.0" + dependencies: + colorette: "npm:^2.0.7" + dateformat: "npm:^4.6.3" + fast-copy: "npm:^3.0.2" + fast-safe-stringify: "npm:^2.1.1" + help-me: "npm:^5.0.0" + joycon: "npm:^3.1.1" + minimist: "npm:^1.2.6" + on-exit-leak-free: "npm:^2.1.0" + pino-abstract-transport: "npm:^2.0.0" + pump: "npm:^3.0.0" + secure-json-parse: "npm:^2.4.0" + sonic-boom: "npm:^4.0.1" + strip-json-comments: "npm:^3.1.1" + bin: + pino-pretty: bin.js + checksum: 015dac25006c1b9820b9e01fccb8a392a019e12b30e6bfc3f3f61ecca8dbabcd000a8f3f64410b620b7f5d08579ba85e6ef137f7fbeaad70d46397a97a5f75ea + languageName: node + linkType: hard + +"pino-std-serializers@npm:^7.0.0": + version: 7.0.0 + resolution: "pino-std-serializers@npm:7.0.0" + checksum: 73e694d542e8de94445a03a98396cf383306de41fd75ecc07085d57ed7a57896198508a0dec6eefad8d701044af21eb27253ccc352586a03cf0d4a0bd25b4133 + languageName: node + linkType: hard + +"pino@npm:^9.5.0": + version: 9.5.0 + resolution: "pino@npm:9.5.0" + dependencies: + atomic-sleep: "npm:^1.0.0" + fast-redact: "npm:^3.1.1" + on-exit-leak-free: "npm:^2.1.0" + pino-abstract-transport: "npm:^2.0.0" + pino-std-serializers: "npm:^7.0.0" + process-warning: "npm:^4.0.0" + quick-format-unescaped: "npm:^4.0.3" + real-require: "npm:^0.2.0" + safe-stable-stringify: "npm:^2.3.1" + sonic-boom: "npm:^4.0.1" + thread-stream: "npm:^3.0.0" + bin: + pino: bin.js + checksum: b06590c5f4da43df59905af1aac344432b43154c4c1569ebea168e7ae7fd0a4181ccabb769a6568cf3e781e1d1b9df13d65b3603e25ebb05539bcb02ea04215e + languageName: node + linkType: hard + "pirates@npm:^4.0.1, pirates@npm:^4.0.4": version: 4.0.6 resolution: "pirates@npm:4.0.6" @@ -11443,6 +11564,13 @@ __metadata: languageName: node linkType: hard +"process-warning@npm:^4.0.0": + version: 4.0.0 + resolution: "process-warning@npm:4.0.0" + checksum: 5312a72b69d37a1b82ad03f3dfa0090dab3804a8fd995d06c28e3c002852bd82f5584217d9f4a3f197892bb2afc22d57e2c662c7e906b5abb48c0380c7b0880d + languageName: node + linkType: hard + "promise-retry@npm:^2.0.1": version: 2.0.1 resolution: "promise-retry@npm:2.0.1" @@ -11480,6 +11608,16 @@ __metadata: languageName: node linkType: hard +"pump@npm:^3.0.0": + version: 3.0.2 + resolution: "pump@npm:3.0.2" + dependencies: + end-of-stream: "npm:^1.1.0" + once: "npm:^1.3.1" + checksum: 5ad655cb2a7738b4bcf6406b24ad0970d680649d996b55ad20d1be8e0c02394034e4c45ff7cd105d87f1e9b96a0e3d06fd28e11fae8875da26e7f7a8e2c9726f + languageName: node + linkType: hard + "punycode@npm:^2.1.0": version: 2.3.1 resolution: "punycode@npm:2.3.1" @@ -11519,6 +11657,13 @@ __metadata: languageName: node linkType: hard +"quick-format-unescaped@npm:^4.0.3": + version: 4.0.4 + resolution: "quick-format-unescaped@npm:4.0.4" + checksum: fe5acc6f775b172ca5b4373df26f7e4fd347975578199e7d74b2ae4077f0af05baa27d231de1e80e8f72d88275ccc6028568a7a8c9ee5e7368ace0e18eff93a4 + languageName: node + linkType: hard + "range-parser@npm:~1.2.1": version: 1.2.1 resolution: "range-parser@npm:1.2.1" @@ -11685,6 +11830,13 @@ __metadata: languageName: node linkType: hard +"real-require@npm:^0.2.0": + version: 0.2.0 + resolution: "real-require@npm:0.2.0" + checksum: 23eea5623642f0477412ef8b91acd3969015a1501ed34992ada0e3af521d3c865bb2fe4cdbfec5fe4b505f6d1ef6a03e5c3652520837a8c3b53decff7e74b6a0 + languageName: node + linkType: hard + "redis@npm:*": version: 4.7.0 resolution: "redis@npm:4.7.0" @@ -12000,6 +12152,13 @@ __metadata: languageName: node linkType: hard +"secure-json-parse@npm:^2.4.0": + version: 2.7.0 + resolution: "secure-json-parse@npm:2.7.0" + checksum: f57eb6a44a38a3eeaf3548228585d769d788f59007454214fab9ed7f01fbf2e0f1929111da6db28cf0bcc1a2e89db5219a59e83eeaec3a54e413a0197ce879e4 + languageName: node + linkType: hard + "semver@npm:^6.3.0, semver@npm:^6.3.1": version: 6.3.1 resolution: "semver@npm:6.3.1" @@ -12275,6 +12434,15 @@ __metadata: languageName: node linkType: hard +"sonic-boom@npm:^4.0.1": + version: 4.2.0 + resolution: "sonic-boom@npm:4.2.0" + dependencies: + atomic-sleep: "npm:^1.0.0" + checksum: ae897e6c2cd6d3cb7cdcf608bc182393b19c61c9413a85ce33ffd25891485589f39bece0db1de24381d0a38fc03d08c9862ded0c60f184f1b852f51f97af9684 + languageName: node + linkType: hard + "sonner@npm:1.5.0": version: 1.5.0 resolution: "sonner@npm:1.5.0" @@ -12319,7 +12487,7 @@ __metadata: languageName: node linkType: hard -"split2@npm:^4.1.0": +"split2@npm:^4.0.0, split2@npm:^4.1.0": version: 4.2.0 resolution: "split2@npm:4.2.0" checksum: b292beb8ce9215f8c642bb68be6249c5a4c7f332fc8ecadae7be5cbdf1ea95addc95f0459ef2e7ad9d45fd1064698a097e4eb211c83e772b49bc0ee423e91534 @@ -12737,6 +12905,15 @@ __metadata: languageName: node linkType: hard +"thread-stream@npm:^3.0.0": + version: 3.1.0 + resolution: "thread-stream@npm:3.1.0" + dependencies: + real-require: "npm:^0.2.0" + checksum: c36118379940b77a6ef3e6f4d5dd31e97b8210c3f7b9a54eb8fe6358ab173f6d0acfaf69b9c3db024b948c0c5fd2a7df93e2e49151af02076b35ada3205ec9a6 + languageName: node + linkType: hard + "tiny-invariant@npm:^1.3.3": version: 1.3.3 resolution: "tiny-invariant@npm:1.3.3"