From b8c156534acbd2c8a4c6923106715d132089d13b Mon Sep 17 00:00:00 2001 From: Filip Harald Date: Fri, 13 Dec 2024 09:19:25 +0100 Subject: [PATCH] feat: 0.67.0 (#235) --- k8s/local/aztec-sandbox-node/deployment.yaml | 2 +- k8s/local/skaffold.only_aztec-listener.yaml | 15 + k8s/local/skaffold.only_event-cannon.yaml | 14 + k8s/local/skaffold.only_explorer-api.yaml | 16 + packages/backend-utils/package.json | 2 +- packages/message-registry/package.json | 2 +- services/aztec-listener/package.json | 4 +- services/ethereum-listener/package.json | 4 +- services/event-cannon/package.json | 8 +- .../scenarios/l1-l2-private-messaging.ts | 4 +- .../scenarios/l1-l2-public-messaging.ts | 4 +- .../SimpleLogging/Nargo.toml | 2 +- .../target/simple_logging-SimpleLogging.json | 780 +++++++++--------- .../simple_logging-SimpleLogging.json.bak | 2 +- services/explorer-api/package.json | 6 +- services/explorer-api/src/constants.ts | 2 +- .../pages/contract-instance-details/index.tsx | 8 +- services/explorer-ui/src/pages/dev.tsx | 2 +- yarn.lock | 196 ++--- 19 files changed, 561 insertions(+), 512 deletions(-) create mode 100644 k8s/local/skaffold.only_aztec-listener.yaml create mode 100644 k8s/local/skaffold.only_event-cannon.yaml create mode 100644 k8s/local/skaffold.only_explorer-api.yaml diff --git a/k8s/local/aztec-sandbox-node/deployment.yaml b/k8s/local/aztec-sandbox-node/deployment.yaml index 317f53e5..a232210c 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.66.0 + - image: aztecprotocol/aztec:0.67.0 name: aztec-sandbox-node resources: limits: diff --git a/k8s/local/skaffold.only_aztec-listener.yaml b/k8s/local/skaffold.only_aztec-listener.yaml new file mode 100644 index 00000000..0fe949a1 --- /dev/null +++ b/k8s/local/skaffold.only_aztec-listener.yaml @@ -0,0 +1,15 @@ +apiVersion: skaffold/v4beta6 +kind: Config +metadata: + name: chicmoz +requires: + - path: ./chicmoz-base-image.yaml + - path: ./aztec-listener/image.yaml +deploy: + kubectl: + flags: + apply: ["--force"] +manifests: + rawYaml: + - k8s/local/aztec-listener/deployment.yaml + #- k8s/local/aztec-listener/remote_aztec_deployment.yaml diff --git a/k8s/local/skaffold.only_event-cannon.yaml b/k8s/local/skaffold.only_event-cannon.yaml new file mode 100644 index 00000000..69bda782 --- /dev/null +++ b/k8s/local/skaffold.only_event-cannon.yaml @@ -0,0 +1,14 @@ +apiVersion: skaffold/v4beta6 +kind: Config +metadata: + name: chicmoz +requires: + - path: ./chicmoz-base-image.yaml + - path: ./event-cannon/image.yaml +deploy: + kubectl: + flags: + apply: ["--force"] +manifests: + rawYaml: + - k8s/local/event-cannon/deployment.yaml diff --git a/k8s/local/skaffold.only_explorer-api.yaml b/k8s/local/skaffold.only_explorer-api.yaml new file mode 100644 index 00000000..e5ff05ff --- /dev/null +++ b/k8s/local/skaffold.only_explorer-api.yaml @@ -0,0 +1,16 @@ +apiVersion: skaffold/v4beta6 +kind: Config +metadata: + name: chicmoz +requires: + - path: ./chicmoz-base-image.yaml + - path: ./explorer-api/image.yaml +deploy: + kubectl: + flags: + apply: ["--force"] +manifests: + rawYaml: + - k8s/local/explorer-api/ingress.yaml + - k8s/local/explorer-api/deployment.yaml + - k8s/local/explorer-api/service.yaml diff --git a/packages/backend-utils/package.json b/packages/backend-utils/package.json index 59f44929..32848401 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.66.0", + "@aztec/aztec.js": "0.67.0", "@chicmoz-pkg/types": "workspace:^" }, "devDependencies": { diff --git a/packages/message-registry/package.json b/packages/message-registry/package.json index f71d6926..c3d174aa 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.66.0", + "@aztec/aztec.js": "0.67.0", "@chicmoz-pkg/types": "workspace:^" }, "devDependencies": { diff --git a/services/aztec-listener/package.json b/services/aztec-listener/package.json index 349f6577..70e9dbc8 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.66.0", - "@aztec/circuits.js": "0.66.0", + "@aztec/aztec.js": "0.67.0", + "@aztec/circuits.js": "0.67.0", "@chicmoz-pkg/logger-server": "workspace:^", "@chicmoz-pkg/message-bus": "workspace:^", "@chicmoz-pkg/message-registry": "workspace:^", diff --git a/services/ethereum-listener/package.json b/services/ethereum-listener/package.json index 4a4c04c3..7bb1070e 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.66.0", - "@aztec/l1-artifacts": "0.66.0", + "@aztec/aztec.js": "0.67.0", + "@aztec/l1-artifacts": "0.67.0", "@chicmoz-pkg/logger-server": "workspace:^", "@chicmoz-pkg/message-bus": "workspace:^", "@chicmoz-pkg/message-registry": "workspace:^", diff --git a/services/event-cannon/package.json b/services/event-cannon/package.json index ed53d27c..9584f678 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.66.0", - "@aztec/aztec.js": "0.66.0", - "@aztec/l1-artifacts": "0.66.0", - "@aztec/noir-contracts.js": "0.66.0", + "@aztec/accounts": "0.67.0", + "@aztec/aztec.js": "0.67.0", + "@aztec/l1-artifacts": "0.67.0", + "@aztec/noir-contracts.js": "0.67.0", "@chicmoz-pkg/logger-server": "workspace:^" }, "devDependencies": { 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 7b229373..68475052 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 @@ -4,7 +4,7 @@ import { EthAddress, Fr, L1TokenPortalManager, - createDebugLogger, + createLogger, deployL1Contract, retryUntil, waitForPXE, @@ -156,7 +156,7 @@ export const run = async () => { l1ContractAddresses.outboxAddress, publicClient, walletClient, - createDebugLogger("TEST") + createLogger("L1TokenPortalManager-private") ); const l1TokenManager = l1TokenPortalManager.getTokenManager(); const ownerAddress = wallet.getAddress(); 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 c604e523..c0523963 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 @@ -4,7 +4,7 @@ import { EthAddress, Fr, L1TokenPortalManager, - createDebugLogger, + createLogger, deployL1Contract, retryUntil, waitForPXE, @@ -159,7 +159,7 @@ export const run = async () => { l1ContractAddresses.outboxAddress, publicClient, walletClient, - createDebugLogger("TEST") + createLogger("L1TokenPortalManager-public") ); const l1TokenManager = l1TokenPortalManager.getTokenManager(); const ownerAddress = wallet.getAddress(); diff --git a/services/event-cannon/src/contract-projects/SimpleLogging/Nargo.toml b/services/event-cannon/src/contract-projects/SimpleLogging/Nargo.toml index cd8018f4..addf43f9 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.66.0", directory = "noir-projects/aztec-nr/aztec" } +aztec = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "aztec-packages-v0.67.0", directory = "noir-projects/aztec-nr/aztec" } 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 fcb18b65..a5a0eec1 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,227 +1,8 @@ { "transpiled": true, - "noir_version": "1.0.0-beta.0+a46035ba69b0a659897fe25271c346e005925a6c-x8664", + "noir_version": "1.0.0-beta.0+b3f4ad661c8c6f88544d714fd5b7b6f58a8ce4ad-x8664", "name": "SimpleLogging", "functions": [ - { - "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": "JgACBAEnAAABBIBDJgAABAMmAgEEACYCAgQAHxgAAgABgEMkAAAAOicCAAEEgEMmAgIEADoNAAEAAiQAAANKHgIAAwA1OAADAAQABQAmAgYBASYCBwAAJgIIAQAjAgAFAAAAdiIAAABpLAwIASwMBwIiAAAAgywMBgEsDAQCIgAAAIMjAgABAAAAlCYCCQQAOwkBCTU4AAMAAQAJAiMCAAkAAAC3IgAAAKosDAgELAwHBSIAAADELAwGBCwMAQUiAAAAxCMCAAQAAADVJgIBBAA7CQEBJgIBBAAmAgMEASwIAQQmAgkEAgAQAQkBJgMEBAEAKAQCCR88AAEAAwAJLA0ECQAoCQIJLA4JBAAoBAIKADgKAQssDQsJHAwJCgQcDAoEACwIAQkAAAECASYDCQQBACgJAgofPAADAAEACiwIAQMmAgoEBAAQAQoBJgM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jZb1y59Lg9fUJ2EPLBfXnmo3So38zymqGkAMYSzvAtzdezfRSk+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+igCAAMAkjkk1go4AQMFJgIDAQAmAgYABiYCBwQBJgIIAAAjAgAFAAABKSIAAALTLAgBBSYCCQQCABABCQEmAwUEAQAoBQIJHzwABwAHAAksDQUJACgJAgksDgkFLA0FCQAoCQIJLA4JBSwNBQkAKAkCCSwOCQUsCAEJAAABAgEsDgUJLAgBBQAAAQIBLA4EBSYCCwQMLAgADCwMCQ0sDAUOLAwGDwAQAAsAJAAACoAsBAAALAwNCiwIAQUAAAECASwOAwUsCAEJAAABAgEsDggJLAgBCwAAAQIBJgIMACYsDgwLJgIMBA0sCAANLAwFDiwMCQ8sDAsQABAADAAkAAAK2ywEAAAeAgAMAR4CAA0ACjgMDQ4jAgAOAAACHCQAAAsFJgIMAAEmAg0AGSYCEgQTLAgAEywMBRQsDAkVLAwLFiwMDBcsDA0YLAwKGQAQABIAJAAACxcsBAAALAwUDiwMFQ8sDBYQLAwXES4MABEAEgA4EgwRJgIWBBcsCAAXLAwFGCwMCRksDAsaLAwMGywMDRwsDAodABAAFgAkAAALFywEAAAsDBgSLAwZEywMGhQsDBsVLwwAEQAVACgCAgosDQoJJgILBAIAOAoLBToNAAUACSIAAALTKAIABQCv3CA7CjgBBQkmAgECcyYCBQJlJgIKAmwmAgsCYyYCDAJyJgINAm4mAg4CICYCDwJ0JgIQAm8jAgAJAAADGyIAAAYdLAgBESYCEgQCABABEgEmAxEEAQAoEQISHzwABwAHABIsDRESACgSAhIsDhIRLA0REgAoEgISLA4SESwNERIAKBICEiwOEhEsCAESAAABAgEsDhESLAgBEQAAAQIBLA4EESYCFAQVLAgAFSwMEhYsDBEXLAwGGAAQABQAJAAACoAsBAAALAwWEywIAQYAAAECASwOAwYsCAERAAABAgEsDggRLAgBEgAAAQIBJgIUAAssDhQSJgIUBBUsCAAVLAwGFiwMERcsDBIYABAAFAAkAAAK2ywEAAAmAgYCYiYCEQJpJgISAnUmAhQCZCYCFQJDJgIWAnAmAhcCYSwIARgmAhkEGQAQARkBJgMYBAEAKBgCGSwMGRosDhUaACgaAhosDhAaACgaAhosDhIaACgaAhosDg0aACgaAhosDg8aACgaAhosDgUaACgaAhosDgwaACgaAhosDg4aACgaAhosDhEaACgaAhosDg0aACgaAhosDgsaACgaAhosDgwaACgaAhosDgUaACgaAhosDhcaACgaAhosDgEaACgaAhosDgUaACgaAhosDhQaACgaAhosDg4aACgaAhosDhYaACgaAhosDhIaACgaAhosDgYaACgaAhosDgoaACgaAhosDhEaACgaAhosDgsaLA0YBgAoBgIGLA4GGCwIAQYmAhEEGQAQAREBJgMGBAEAKAYCESYCEgQYADgSERIsDBEUDDgUEhUWDBUVIwIAFQAABVYsDggUACgUAhQiAAAFNywIAQgAAAECASwOBggmAgYEGCwMBAkiAAAFc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bo2kvwvo7YuENJQpQW1caODgtp4Y1pDUQtqo31pqCZducmu3ORDbNKFTaW8EQGmkdqCElmjuAW1EQE0FLagNtpyWm5hiymVNUpaUBv36msobkDJxpkZDYVNqBZvSMxNqCZdkJpQTZ5PTZ7f6M2naeeColWrlI1oo6GoBbWxrKShSgtq4wVkDSUtKG7StZFifnm8IRv52hqKWlAbmcQXUXnjCJpyZfwE27iyn5dOhcpa2dZDBQqqSdfWpfaXUVvX1CuoeoFxScv8JsAKtXFJi4bCJpS0oDZCgIbiFhQ1eYOaPM9NurjJ89zk+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" - }, - "5019202896831570965": { - "error_kind": "string", - "string": "attempt to add with overflow" - } - }, - "parameters": [ - { - "name": "counter_id", - "type": { - "kind": "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ICK7EiICA4AoFBCQICEgjYUZAQBqJIMEVJI0SEtyEpJEiwVUkjZBDlyCHLjlSvKtzfA9iO3FWtdwfVa3o9vsCAJP25QIme6tfEO3PtWLkS052JedINbOZHI69cf1KQznJk5wUgi85vrwTfXkn+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": "inner", - "type": { - "kind": "field" - } - } - ], - "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/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, @@ -237,98 +18,9 @@ "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", + "debug_symbols": "nZJLCoMwFEX38sYOzM/fVqRI1CiBkEiMhSLuvVFsscVJMnlwwz13krNCL9plbKQezAxVvYIyHXfSaJ/WLYHWSqXk2FyfId0PQkd/nrje4+y4dVARnIDQPVQ09fQglYAqw9sjAYQD+ySwTwP7LKyPb/dLUmYnUVJMvgxi9IBYDJTFQHkMVERA5PbjS1qwD8RS+gttPj65lbxV4hRrWHR38cy9JvGn3GRNJ/rFil2+i3f+1ihPMPazfvoN", "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+HgIABQEeAgAGAAo4BQYHIwIABwAAALskAAABkCYCBQAdJgIGAAEmAgsEDCwIAAwsDAINLAwDDiwMBA8sDAYQLAwFESwMARIAEAALACQA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f3h8XVQjH/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+4nmX5CmKDbFdpMg6UGAcg5HCJ1L4vEi0JEa3lR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wXlaUIUKZP7JL2uYdRQUEGQKIiKmiqIipoqiIqaKoiKmiqIipoo6FBRUwVxlZ8qiJ6EKoiehCqoIFgU1CoKmuQKa6dLSbYURE9CFURPQhVET0IVRE9CFOx0PcmWguhJiH8N0emKki0F0ZNQBRUEiYKoqM8FDygokjMoqHszKChlExSRXxHBqrB9q1kSkv3EeRVexpv0VVx9iK8Oyc+pfTkkX1penK1F/MeMyYUgOSdIzQnSc4LMnCA7J8jNCfIzgiSbEzTniJBzjgg554iQc44IOeeIkHOOiPwMYxdPJ/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, @@ -687,7 +379,7 @@ } ], "kind": "struct", - "path": "aztec::protocol_types::header::Header" + "path": "aztec::protocol_types::block_header::BlockHeader" } }, { @@ -1786,7 +1478,7 @@ } ], "kind": "struct", - "path": "aztec::protocol_types::header::Header" + "path": "aztec::protocol_types::block_header::BlockHeader" } }, { @@ -1890,20 +1582,328 @@ "path": "aztec::protocol_types::transaction::tx_context::TxContext" } } - ], - "kind": "struct", - "path": "aztec::protocol_types::abis::private_circuit_public_inputs::PrivateCircuitPublicInputs" + ], + "kind": "struct", + "path": "aztec::protocol_types::abis::private_circuit_public_inputs::PrivateCircuitPublicInputs" + }, + "visibility": "databus" + } + }, + "bytecode": "H4sIAAAAAAAA/+XdBXRT99/H8dSA4rTI2PANt2ib4O7uDpWUMdzm0rm7O1Pm7sp8Y+6+sc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AydL6qr/wF", + "brillig_names": [ + "pack_arguments_oracle_wrapper", + "enqueue_public_function_call_internal" + ], + "verification_key": "AAAAAAAQAAAAAAAAAAAAFAAAAAAAAAAQAAAAAAAABAEBAAAAAAAAAAEAAAACAAAAAwAAAAQAAAAF\nAAAABgAAAAcAAAAIAAAACQAAAAoAAAALAAAADAAAAA0AAAAOAAAADwAAAAAAAAAAACrWUlel2L8n\nMoF1rWtrIankZjeJ5yCP+iB5BZ1KerToLuaVJMw72DocxR5gh2QusCbwCj5moGos+lytSde+Yt0A\nKXOoPcY5ue8SJK619N4osdVN8hzy0oK3dTXWz9/DgA0IYn0U8BgEwPurQ4TV4c4SIBYihw/onbU1\nQY2qpz76Ldwp2ZXvYUPts4V/l2Lcou+i7g/QbWX4bRVMLrDbi/sL4zpBBTq6ZS4ItZg5wExtpinT\nJNHZ9s3aHngs9jfRUQHajhdYRRWKvGJ6myXNpIZLnkz/rDizKuJwOHgZBzkbG2Z5BiIjs07jzu1l\n71xh4BvOy6ixnK3agUolyqJctWwreTivzDganjsDlOSzker0A1Hh9HY7Yz8M5sQesF8B0hlzbpCA\neKGN3ueHDohLWq36vA5Ih8/bKFvN1Ldi6m3YLfMSjYY/RD1nD9qKb2PSoAOoGw4ALUkL+aW1sB8W\n8lkfnwFQbud8VBllM6JlIXUM02CAnbm6MpyQ7PfdA878uCqHEK2Ho8Be1crPjUEI0RcDAhlQKym3\nfWCHWE9j4fULFkcUI7/Z7Gm2oKkCJbDBGMqfNvl0/qkF4/N+keqIqvUWWiX/avdRPmDepfltSNSn\ndK3DZKvNdou9DyG4cdDlCBOoMHJ+/6dKOrar+7Xt7phapNmSHDvbsAns7Y3c135nB+VkEVDo5KrF\nLablTOZWJhxKmeUkNV0kCkajkdkaoa4D5ekOobonOMF4+Xu52BhvMcOpR4qLRicktYzPkLM+BCXW\ntK3k5KYmr2nG96+KvtqVnesWzPD52R8OFQ3lfxngJqVhFdIr9PqFdktPx0H6QDoVaeqm6cNi44NQ\nemPo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hmQdcwsPJ4web7IZ2SqXP0COWI4OcUb5v/oPHfIC4+UrVDF3W4p6skHbML1mV/PJ8jIi0\nhSmJGb9xZEQJQtb2xa0J/Fb1ohItHtk1OGC6aKtbesQ2+IiZmkj3nvIS5kg/FAiDSZwiZljYO00M\nx7CMFdrOTiO/QbVeMJi9joLnSxweHyaMCUW96klPv8UuhYHBXANz2LKGv3JzAVcaVOFjbncBuS+S\nBCriVW4xz3LMOZDGt+dwweYuJQTOmG8hMk/5OTA4/+YoThdERaDrEaY+C3AHIgwsAvTsLBxfrakF\na4w3AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\nAAAAAAAAAAAAAijZgVPiaqE5xfmVoS1rgoNE5801i7AI+iWU9C4gWKTaCru9sEL+XedxRom0sZjL\n672Za6gt1ILAzZ+T26XJSPEPy7+dPPQCuqPu2l8Knkm1werJWyZMMC3IVObyLXMw3yg+39qJyUgF\nl/CzRC6XUt751Y/Ckgg2GUJh97Fj/vuvJ8qczwFCmSOmHYcsfCJMQmRoHJE2ov3nE3M173Fv7N4Z\nKxptOxTf5amtY5UdLXZt9e5ME1hEP1oUCGtRluE+Rg==" + }, + { + "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+igCAAMAkjkk1go4AQMFJgIDAQAmAgYABiYCBwQBJgIIAAAjAgAFAAABKSIAAALTLAgBBSYCCQQCABABCQEmAwUEAQAoBQIJHzwABwAHAAksDQUJACgJAgksDgkFLA0FCQAoCQIJLA4JBSwNBQkAKAkCCSwOCQUsCAEJAAABAgEsDgUJLAgBBQAAAQIBLA4EBSYCCwQMLAgADCwMCQ0sDAUOLAwGDwAQAAsAJAAACwwsBAAALAwNCiwIAQUAAAECASwOAwUsCAEJAAABAgEsDggJLAgBCwAAAQIBJgIMACosDgwLJgIMBA0sCAANLAwFDiwMCQ8sDAsQABAADAAkAAALZywEAAAeAgAMAR4CAA0ACjgMDQ4jAgAOAAACHCQAAAuRJgIMAAEmAg0AGSYCEgQTLAgAEywMBRQsDAkVLAwLFiwMDBcsDA0YLAwKGQAQABIAJAAAC6MsBAAALAwUDiwMFQ8sDBYQLAwXES4MABEAEgA4EgwRJgIWBBcsCAAXLAwFGCwMCRksDAsaLAwMGywMDRwsDAodABAAFgAkAAALoywEAAAsDBgSLAwZEywMGhQsDBsVLwwAEQAVACgCAgosDQoJJgILBAIAOAoLBToNAAUACSIAAALTKAIABQCv3CA7CjgBBQkmAgECcyYCBQJlJgIKAmwmAgsCYyYCDAJyJgINAm4mAg4CICYCDwJ0JgIQAm8jAgAJAAADGyIAAAYdLAgBESYCEgQCABABEgEmAxEEAQAoEQISHzwABwAHABIsDRESACgSAhIsDhIRLA0REgAoEgISLA4SESwNERIAKBICEiwOEhEsCAESAAABAgEsDhESLAgBEQAAAQIBLA4EESYCFAQVLAgAFSwMEhYsDBEXLAwGGAAQABQAJAAACwwsBAAALAwWEywIAQYAAAECASwOAwYsCAERAAABAgEsDggRLAgBEgAAAQIBJgIUAAssDhQSJgIUBBUsCAAVLAwGFiwMERcsDBIYABAAFAAkAAALZywEAAAmAgYCYiYCEQJpJgISAnUmAhQCZCYCFQJDJgIWAnAmAhcCYSwIARgmAhkEGQAQARkBJgMYBAEAKBgCGSwMGRosDhUaACgaAhosDhAaACgaAhosDhIaACgaAhosDg0aACgaAhosDg8aACgaAhosDgUaACgaAhosDgwaACgaAhosDg4aACgaAhosDhEaACgaAhosDg0aACgaAhosDgsaACgaAhosDgwaACgaAhosDgUaACgaAhosDhcaACgaAhosDgEaACgaAhosDgUaACgaAhosDhQaACgaAhosDg4aACgaAhosDhYaACgaAhosDhIaACgaAhosDgYaACgaAhosDgoaACgaAhosDhEaACgaAhosDgsaLA0YBgAoBgIGLA4GGCwIAQYmAhEEGQAQAREBJgMGBAEAKAYCESYCEgQYADgSERIsDBEUDDgUEhUWDBUVIwIAFQAABVYsDggUACgUAhQiAAAFNywIAQgAAAECASwOBggmAgYEGCwMBAkiAAAFcQw4CQYRIwIAEQAAB0ciAAAFgywNCAcmAhEEGAYoEQIIJgITBAMAOBETEiwIAQkAEAESASYDCQQBACgJAhIsDhESACgSAhIsDhESJgITBAMAOAkTEgAoBwITLQQAE4ADLQQAEoAELQQAEYAFJAAADVwAKAkCEiwNEhEmAhMEAgA4EhMHNg0ABwARHgIABgAAKAICESwNEQkmAhIEAgA4ERIHOg0ABwAJIgAABh0mAgICVSYCBgJrJgIHAncsCAEIJgIJBBEAEAE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Y4V49IN/jIdyHCMc1SqQVGVroXDvRJKalCSXyRLHAMXRIdzFNegFo7CSqhQhYo1qPyIWUTVeGPhCqkiqkoXuCpUqELVeD4hVqGqvOGrvOGrvLGQf1NAhfwiKk23c0HyGVSsQVGVLqrQFRav8ZkiNjihGWrpZp4CKt82IEzxECjOUAunjCVUla6FFlVCpRrUQosCuVx9luY+XGhRBdTCmDL8YUQFN2e48IJiCZVqUAsvKZZQ+RGWppQLIJIZamFMKaFqdIGjGtTC6FBCcQ0KfRUq1qAW+lcJlWpQoUpXqLKLqnxIVbq4qpYXIgDJNDpQSnMUVaFSDWohAhRQC33ZX0a9Yad3jpIKFC7MD0soqkKlGtRC6lEJVeUNxCpUlS5f5Xlf5Xlf5fmF0dxTmFAsc1SsQS2sYQuohcPXEoprUAsJnyWU1KBila7IFfMNTK4KFapQsQLl8ztXEsaJuZCbYfK7QymMDT4xzjFUgUlqTMinxxYwUrE6CVVrmrB0geg6ailzsoCq0uWrdPkqXaFKV6jSRVX1RVW6uMqupSyQAirVoJbu6CugqnpKPuKuxpiQj7dpeq192AL6EUMuVGCiHpPv+QVMhT3o1LGMUB9nyVfo8VGPCb4CU6GHKvTkc+oSj200yWwtQfld/gKmQk9+VbWOye/UFzAVelKFnvz85qp+chj9XIBdqMBU6Mmvh9Yx+dVQAaPvC+z18YCDq8CwHkNQganQwxX2cEXb4Yr6kYp2ECv8Fiv8VjHPZ20//Xf49d+3n+/fvnv48GVAPP7x74/vv95/+vj88+v//hr/8u7z/cPD/Z9v/vr86f2H3//+/OHNw6f3j3+7c8///CYgr8THgcvjICDOvxLww69vO6TDptGrYcH++PPRtAj+VQQaOAw8/g8=", + "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" + }, + "5019202896831570965": { + "error_kind": "string", + "string": "attempt to add with overflow" + } + }, + "parameters": [ + { + "name": "counter_id", + "type": { + "kind": "field" + }, + "visibility": "private" + } + ], + "return_type": null + }, + "bytecode": "JgACBAEnAAABBIBEJgAABAMmAgIEASYCAwQAHxgAAwACgEMtCIBDAAEkAAAAQCcCAAEEgEQmAgIEADoNAAEAAiQAAANzLAgBAwAAAQIBJgIEAQAsDgQDLAgBAwAAAQIBJgIEAAAsDgQDLAgBAwAAAQIBJgIFAAIsDgUDHgIAAwAeAgAFADI4AAMABQAGJgIDAQEjAgAGAAAAnyQAAAOcJgIDAmwmAgUCZCYCBgJjJgIHAnImAggCbiYCCQJDJgIKAmImAgsCcyYCDAJpJgINAmUmAg4CdSYCDwJwJgIQAmEmAhECICYCEgJ0JgITAm8sCAEUJgIVBBkAEAEVASYDFAQBACgUAhUsDBUWLA4JFgAoFgIWLA4TFgAoFgIWLA4OFgAoFgIWLA4IFgAoFgIWLA4SFgAoFgIWLA4NFgAoFgIWLA4HFgAoFgIWLA4RFgAoFgIWLA4MFgAoFgIWLA4IFgAoFgIWLA4GFgAoFgIWLA4HFgAoFgIWLA4NFgAoFgIWLA4QFgAoFgIWLA4LFgAoFgIWLA4NFgAoFgIWLA4FFgAoFgIWLA4RFgAoFgIWLA4PFgAoFgIWLA4OFgAoFgIWLA4KFgAoFgIWLA4DFgAoFgIWLA4MFgAoFgIWLA4GFiwNFAMAKAMCAywOAxQsCAEDJgIFBBkAEAEFASYDAwQBACgDAgUmAgYEGAA4BgUGLAwFBww4BwYIFgwICCMCAAgAAAIwLA4EBwAoBwIHIgAAAhEsCAEEAAABAgEsDgMEJgIDBAAmAgUEASYCBgQYLAwDAiIAAAJVDDgCBgEjAgABAAAC5CIAAAJnLA0EASYCBAQYBigEAgImAgcEAwA4BAcFLAgBAwAQAQUBJgMDBAEAKAMCBSwOBAUAKAUCBSwOBAUmAgcEAwA4AwcFACgBAgctBAAHgAMtBAAFgA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EAJASFphEwsVIDgcmAEBASXIyEgILhMEQEBwWUOCEgQEJBGjMxGjMxGnJDgJiSNFAmuImmUkeBmJI2QbQ4j25x6sABABUmjAgRXAiEgILgSIwICgisUEJAgICCNhBkBAWkkggRXkDRKSHATkkaKBFeRNEIOXYIcuuRI8a7O8QOI7cRZ1fJwVLWi2+8LAEw6lAuY7K1+UesCOzlGvuRkV3KOVDObyeE4GNevdCgneZKTQvAlx5d3oi/vRF/eIV/eIWfeKa7kHDlT/ZgccyXnSIH7p+QkXyMr+RpZ6ss76mtkqa95p1x4N8j7V2u1jFQ+y9GLL6EqezmZD+WMGazy/p3X/5eDStKaoHUPuHUPuHUPjhQZRySwxgSpdQ9S6x4otSbIjQlybE2gjQmsdQ+sdQ9K6ywqjcdBDtKaYITZNIU9gZ1YYEutHg/GtUB5ICeKLznmSg6xLzm+vHNk5yGigxxR/V7OqH9UyxI87aWzXPrgk3Uvx+RQTnElJ/nyjpIvOdmVnOzLO9mXdyz+nJzCh3IuXaz79gyfL/6C6YQcV96xIL7kFFdyfJWjjMiXnOxKDrMvOeZKjvjyjvjKneRrZCVf3lFf02AOfuRsa/PPdD2f3ixmr7cX75+Xt+8uM27+Ps4+3Wt8XK9uZ3fP61l/w/HtcmPfLQo8IZLazX68RiuTWMrv/orcrhkm0VLf7Dc1RKna5qqh6vgH", + "brillig_names": ["increase_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":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udJW78nN49NfdbnV3v356HSLGX75vHt5W283h4dvfL+E397vVer16vn3ZbR+eHt93T7fr7cP4uwU7/PNLOL8cuqTf43qN40MmloLZ8SHf/9YshXPDsw7P/A8=", + "brillig_names": ["get_counter_value"] + }, + { + "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//z6k9vo7AQECJSkBAAEFjTuHxGEpfmo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3w10UXBeGGpJMyeDS+qCRgZP5ncT6hm+pHxs5pFvrSf9UwnM34yuZ8VHdXi/eQnyEyBJqZqDoTVAZR6dp+Vg1LPpG8RFMCp3APtAij1fJ+hHJSKzjoqCKWeHefloFR03tEiKPb0OgMfBFrHM9Di9EaZ7tdgpFx5mQpzKDxjShqK5xlTMlB4VrR6WlMDre0MCoiKDosuSaWNlQgV4JmAclTqOT+jIJWKTk8pSIXpUlOOSj0nXBSkgjyXEHJUeNb7GSpMl5tyVFpciVBhuuCUo9LGSoSKbVVchArT1Ultpx1d2vuQCjYqESpM65U0FaYLlGkqwHQtTp12iirlQio81+IyVCp6fVtJKjxzUI4KzxyUoSJ55qAclRZtI1Tq+V5YUSptrESoMN0kmKPSMnOMSsvMESqaaWbWOFExNqTCdKykqRieK5QZKpZpDspQYVqvpKlU9JLEklTaWIlQqehVicU2lnZUsFGJUGk7s0MqnRuNSkilngPOrlP57SiDtDI4WtFbAjOOMtj+OzgaPwvE4mjAahFo4vWCx9GQN6GdeDbNaNxijYpH4ozmyuOb+tZwt9oBJJWmqKQgqUi2FMmWItlCki0k2dKk+6VJtgzJr2vn/mdUjqK6cgZQTkV6UuJz0WSMUfGjuT2Mpw55FWgwfvRuRmOXa+JPfkZD8Cf+HZRkLEOJBA3BTnx3f1qDkqAh2NEEOzo6sr0Zx6i3wc4eNEDQEOxYJGj8co0j2HEEO/HD1M/uT0yzvBbQQhE0BDvx8j+tiVfSGc3yZ0ErJGiWxwMdz8lpjRYEDcUOwR9DGDuGcH8sYRw4AjdH4Eao8/XS5/Sr+/T3/WFz/7B9fusU/R8/do/vm/3u+PH9n9fxLw+HzXa7ebl7Pewfn58+Ds932/1j/7eVOP74qRSuu6Kt70v/0cLamv5Dj9mJtZOdxc7qvw==", + "brillig_names": ["add_to_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": "inner", + "type": { + "kind": "field" + } + } + ], + "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": "databus" + "visibility": "public" } }, - "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+WG5PWYX7wB8rSBj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HVWkvXu6/sTT9vXjc/pJ/wBaRD7+r/9B+R/AAj765aYGwIA", - "debug_symbols": "7VbbisIwEP2XPPdhLplc/JVlkapVCqVK1YVF/PdNxLTqhpW17ILgS8kkZzJnzkyGHtSimu1X07pdrrdq8nZQzXpe7up1G6yDQj7tbTdlG83trux2aoLGQ6GqdhGWFuBYqGXdVGpi6Fh8A5NjdwaTMwMYyWfQLOjPaBZPd9AenD2jPQL2aKIcE7SOE20Hw91kcmAgk8Bg5RL8XijUL12yushLl6wu5qVLVhc7Whf2ls5gDeCGTNGfIrg/j+BHR0AGncDMfohgIVctoaS/Fw1XfDJ9g15SBcLayS1/gifnjzn+nqhvO5Cf6VuW1P6W3eVjydEXl4QxeEFG84kMjSfjE9hqtnfIoLP9Qw9rNqPV5GdPQP9zAp65v9sL8jWhYM26umnq1fTqzwriR2e7BcMIThciudsW0/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/hMo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7+X5vLqeuuhyM2bjzj2qmMuT3/k87mjeev5bXvJsXPXXe+/lfni6gP30vnAteJ4OP7k1yIkwtx7hGLn9Gjhr6uSae4bv1auVxv2n9w0VyUuMtzf8fiJ6z/r/Abx0btLXP+cb2vjs/74365f3tbvO6nDN9bH3T6A/vRhmkVHwAA", + "debug_symbols": "tdfRioQgFAbgd/HaC49aZq+yLIOVDYJYWC0s0buvDbO7w8zl8N8EJ06fIf7I2dngu+16CWmcFtZ+7CxOvVvDlEq1H5x1OcQYrpfH10ycD6tu/cvs0lkuq8sra5XkzKeBtVqUr8cQPWtrefCXRvPbaMxfYyWPT86sRsEVCq5RsEHBDQq2IJiEgMkEkyVMVjBZw+QKJtcw2cDkBibDMkiwDBIsgwTLIMEySLAMEiyD9F4Grbo3lm19oQ2ObnC0hdFS4GjC0RJHKxytcXSFo3FplLg0SlwaJSiNR6m+XA6ui/4+M41b6h9GqPV79k/T1Jyn3g9b9udc9T9SnYdYaa717RYvBZX/I2XKImWhHw==", + "brillig_names": ["compute_note_hash_and_optionally_a_nullifier"] + }, + { + "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": "JgACBAEnAAABBIBDJgAABAMmAgEEACYCAgQAHxgAAgABgEMkAAAAOicCAAEEgEMmAgIEADoNAAEAAiQAAAS9LAgBAwAAAQIBJgIEAQAsDgQDLAgBAwAAAQIBJgIFAAAsDgUDLAgBAwAAAQIBJgIGAAIsDgYDHgIAAwA1OAADAAYABwAmAggBASMCAAcAAACiIgAAAJUsDAQBLAw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+RWkXRmb4MF8jE8TLDu+UyMsNbBD48K1Dbd4aQc1KuROqdi2RzUkW6qEgXFeniIl1cpMsVfS9XpMsX5euds7tzUrFE6p0jrnNSRSVleEXOx3XM8JKSmA7tj7YnQ8NTlxmZMF5muORnZAryY9Xouozs+HqWqEAPhfEybAtkCvS4Aj1u0LOja300+t5CbRruxmVkCvQEHi8TVYHMeD2sVIEMZb7PkMz4WIA1FcgU6BneSPuxzPBO0IzM+LLANL4+YFYFMm68jNMFMgV6fEF+fIHv+ILvEwr8IBZwi+O5uYI4340tp3+ap3+vH3fXN/u7p0bi8OOv+9vn3cP9y+Pzfz/bX24ed/v97sfVz8eH27tvvx7vrvYPt4ffNurlz1dredsEiAdbDo+GeGtYHR4PmWnC7601odHaaP4f", + "brillig_names": ["constructor"] } ], "outputs": { @@ -1954,35 +1954,35 @@ { "name": "parameters", "type": { - "fields": [], + "fields": [ + { + "name": "counter_id", + "type": { + "kind": "field" + } + } + ], "kind": "struct", - "path": "SimpleLogging::constructor_parameters" + "path": "SimpleLogging::increase_counter_public_parameters" } } ], "kind": "struct", - "path": "SimpleLogging::constructor_abi" + "path": "SimpleLogging::increase_counter_public_abi" }, { "fields": [ { "name": "parameters", "type": { - "fields": [ - { - "name": "counter_id", - "type": { - "kind": "field" - } - } - ], + "fields": [], "kind": "struct", - "path": "SimpleLogging::increase_counter_private_parameters" + "path": "SimpleLogging::constructor_parameters" } } ], "kind": "struct", - "path": "SimpleLogging::increase_counter_private_abi" + "path": "SimpleLogging::constructor_abi" }, { "fields": [ @@ -1998,12 +1998,12 @@ } ], "kind": "struct", - "path": "SimpleLogging::add_to_counter_public_parameters" + "path": "SimpleLogging::increase_counter_private_parameters" } } ], "kind": "struct", - "path": "SimpleLogging::add_to_counter_public_abi" + "path": "SimpleLogging::increase_counter_private_abi" }, { "fields": [ @@ -2019,110 +2019,114 @@ } ], "kind": "struct", - "path": "SimpleLogging::increase_counter_public_parameters" + "path": "SimpleLogging::add_to_counter_public_parameters" } } ], "kind": "struct", - "path": "SimpleLogging::increase_counter_public_abi" + "path": "SimpleLogging::add_to_counter_public_abi" } ] } }, "file_map": { - "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", + "103": { + "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.67.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" }, - "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", + "116": { + "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.67.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" }, - "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" - }, "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" + "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.67.0/noir-projects/aztec-nr/aztec/src/context/private_context.nr", + "source": "use dep::protocol_types::debug_log::debug_log_format;\n\nuse 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 block_header::get_block_header_at,\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 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 block_header::BlockHeader,\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 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: BlockHeader,\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 // WARNING(https://github.com/AztecProtocol/aztec-packages/issues/10558): if you delete this debug_log_format line, some tests fail.\n debug_log_format(\n \"Context.note_hashes, after pushing new note hash: {0}\",\n self.note_hashes.storage().map(|nh: NoteHash| nh.value),\n );\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_block_header(self) -> BlockHeader {\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_block_header_at(self, block_number: u32) -> BlockHeader {\n get_block_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: BlockHeader::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" }, "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", + "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.67.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" + }, + "122": { + "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.67.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" }, - "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", + "128": { + "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.67.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" }, - "129": { - "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.66.0/noir-projects/aztec-nr/aztec/src/hash.nr", + "130": { + "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.67.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" }, - "143": { - "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.66.0/noir-projects/aztec-nr/aztec/src/oracle/arguments.nr", + "145": { + "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.67.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" }, - "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", + "146": { + "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.67.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" }, - "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" - }, "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" + "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.67.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" }, "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" + "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.67.0/noir-projects/aztec-nr/aztec/src/oracle/notes.nr", + "source": "use crate::{note::{note_header::NoteHeader, note_interface::NoteInterface}, utils::array};\n\nuse dep::protocol_types::{\n address::AztecAddress,\n indexed_tagging_secret::{INDEXED_TAGGING_SECRET_LENGTH, IndexedTaggingSecret},\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\n let nonce = fields[read_offset];\n let note_hash_counter = fields[read_offset + 1] as u32;\n let note_content = array::subarray(fields, read_offset + 2);\n\n let mut note = Note::deserialize_content(note_content);\n note.set_header(NoteHeader { contract_address, nonce, storage_slot, note_hash_counter });\n\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" }, "155": { - "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.66.0/noir-projects/aztec-nr/aztec/src/oracle/storage.nr", + "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.67.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" + }, + "156": { + "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.67.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" }, - "170": { - "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.66.0/noir-projects/aztec-nr/aztec/src/initializer.nr", + "171": { + "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.67.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" }, - "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" + "177": { + "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.67.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};\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\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" }, - "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", + "189": { + "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.67.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" }, - "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", + "207": { + "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.67.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" }, - "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", + "211": { + "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.67.0/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays.nr", + "source": "pub mod assert_array_appended;\npub mod assert_array_prepended;\npub mod assert_combined_array;\npub mod assert_combined_transformed_array;\npub mod assert_exposed_sorted_transformed_value_array;\npub mod assert_sorted_array;\npub mod assert_sorted_transformed_value_array;\npub mod assert_split_sorted_transformed_value_arrays;\npub mod assert_split_transformed_value_arrays;\npub mod get_sorted_result;\npub mod get_sorted_tuple;\npub mod sort_by;\npub mod sort_by_counter;\n\n// Re-exports.\npub use assert_array_appended::{\n assert_array_appended, assert_array_appended_and_scoped, assert_array_appended_reversed,\n assert_array_appended_scoped,\n};\npub use assert_array_prepended::assert_array_prepended;\npub use assert_combined_array::{assert_combined_array, combine_arrays};\npub use assert_combined_transformed_array::{\n assert_combined_transformed_array, combine_and_transform_arrays,\n};\npub use assert_exposed_sorted_transformed_value_array::{\n assert_exposed_sorted_transformed_value_array,\n get_order_hints::{get_order_hints_asc, get_order_hints_desc, OrderHint},\n};\npub use assert_sorted_array::assert_sorted_array;\npub use assert_sorted_transformed_value_array::{\n assert_sorted_transformed_value_array, assert_sorted_transformed_value_array_capped_size,\n};\npub use assert_split_sorted_transformed_value_arrays::{\n assert_split_sorted_transformed_value_arrays_asc,\n assert_split_sorted_transformed_value_arrays_desc,\n get_split_order_hints::{get_split_order_hints_asc, get_split_order_hints_desc, SplitOrderHints},\n};\npub use assert_split_transformed_value_arrays::assert_split_transformed_value_arrays;\npub use get_sorted_result::{get_sorted_result, SortedResult};\npub use sort_by_counter::{sort_by_counter_asc, sort_by_counter_desc};\n\nuse crate::traits::{Empty, is_empty};\n\npub fn subarray(\n src: [Field; SRC_LEN],\n offset: u32,\n) -> [Field; DST_LEN] {\n assert(offset + DST_LEN <= SRC_LEN, \"offset too large\");\n\n let mut dst: [Field; DST_LEN] = std::mem::zeroed();\n for i in 0..DST_LEN {\n dst[i] = src[i + offset];\n }\n\n dst\n}\n\n// Helper function to convert a validated array to BoundedVec.\n// Important: Only use it for validated arrays: validate_array(array) should be true.\npub unconstrained fn array_to_bounded_vec(array: [T; N]) -> BoundedVec\nwhere\n T: Empty + Eq,\n{\n let len = array_length(array);\n BoundedVec::from_parts_unchecked(array, len)\n}\n\npub unconstrained fn find_index_hint(\n array: [T; N],\n find: fn[Env](T) -> bool,\n) -> u32 {\n let mut index = N;\n for i in 0..N {\n if (index == N) & find(array[i]) {\n index = i;\n }\n }\n index\n}\n\n// Routine which validates that all zero values of an array form a contiguous region at the end, i.e.,\n// of the form: [*,*,*...,0,0,0,0] where any * is non-zero. Note that a full array of non-zero values is\n// valid.\npub fn validate_array(array: [T; N]) -> u32\nwhere\n T: Empty + Eq,\n{\n let mut seen_empty = false;\n let mut length = 0;\n for i in 0..N {\n if is_empty(array[i]) {\n seen_empty = true;\n } else {\n assert(seen_empty == false, \"invalid array\");\n length += 1;\n }\n }\n length\n}\n\n// Helper function to count the number of non-empty elements in a validated array.\n// Important: Only use it for validated arrays: validate_array(array) should be true.\npub fn array_length(array: [T; N]) -> u32\nwhere\n T: Empty + Eq,\n{\n let length = unsafe { find_index_hint(array, |elem: T| is_empty(elem)) };\n if length != 0 {\n assert(!is_empty(array[length - 1]));\n }\n if length != N {\n assert(is_empty(array[length]));\n }\n length\n}\n\npub fn array_concat(array1: [T; N], array2: [T; M]) -> [T; N + M] {\n let mut result = [array1[0]; N + M];\n for i in 1..N {\n result[i] = array1[i];\n }\n for i in 0..M {\n result[i + N] = array2[i];\n }\n result\n}\n\npub fn array_merge(array1: [T; N], array2: [T; N]) -> [T; N]\nwhere\n T: Empty + Eq,\n{\n let mut result: [T; N] = [T::empty(); N];\n let mut i = 0;\n for elem in array1 {\n if !is_empty(elem) {\n result[i] = elem;\n i += 1;\n }\n }\n for elem in array2 {\n if !is_empty(elem) {\n result[i] = elem;\n i += 1;\n }\n }\n result\n}\n\npub fn check_permutation(\n original_array: [T; N],\n permuted_array: [T; N],\n original_indexes: [u32; N],\n)\nwhere\n T: Eq + Empty,\n{\n let mut seen_value = [false; N];\n for i in 0..N {\n let index = original_indexes[i];\n let original_value = original_array[index];\n assert(permuted_array[i].eq(original_value), \"Invalid index\");\n assert(!seen_value[index], \"Duplicated index\");\n seen_value[index] = true;\n }\n}\n\n#[test]\nfn smoke_validate_array() {\n let valid_array: [Field; 0] = [];\n assert(validate_array(valid_array) == 0);\n\n let valid_array = [0];\n assert(validate_array(valid_array) == 0);\n\n let valid_array = [3];\n assert(validate_array(valid_array) == 1);\n\n let valid_array = [1, 2, 3];\n assert(validate_array(valid_array) == 3);\n\n let valid_array = [1, 2, 3, 0];\n assert(validate_array(valid_array) == 3);\n\n let valid_array = [1, 2, 3, 0, 0];\n assert(validate_array(valid_array) == 3);\n}\n\n#[test(should_fail_with = \"invalid array\")]\nfn smoke_validate_array_invalid_case0() {\n let invalid_array = [0, 1];\n let _ = validate_array(invalid_array);\n}\n\n#[test(should_fail_with = \"invalid array\")]\nfn smoke_validate_array_invalid_case1() {\n let invalid_array = [1, 0, 0, 1, 0];\n let _ = validate_array(invalid_array);\n}\n\n#[test(should_fail_with = \"invalid array\")]\nfn smoke_validate_array_invalid_case2() {\n let invalid_array = [0, 0, 0, 0, 1];\n let _ = validate_array(invalid_array);\n}\n\n#[test]\nfn test_empty_array_length() {\n assert_eq(array_length([0]), 0);\n assert_eq(array_length([0, 0, 0]), 0);\n}\n\n#[test]\nfn test_array_length() {\n assert_eq(array_length([123]), 1);\n assert_eq(array_length([123, 0, 0]), 1);\n assert_eq(array_length([123, 456]), 2);\n assert_eq(array_length([123, 456, 0]), 2);\n}\n\n#[test]\nfn test_array_length_invalid_arrays() {\n // Result can be misleading (but correct) for invalid arrays.\n assert_eq(array_length([0, 0, 123]), 0);\n assert_eq(array_length([0, 123, 0]), 0);\n assert_eq(array_length([0, 123, 456]), 0);\n assert_eq(array_length([123, 0, 456]), 1);\n}\n\n#[test]\nfn find_index_greater_than_min() {\n let values = [10, 20, 30, 40];\n let min = 22;\n let index = unsafe { find_index_hint(values, |v: Field| min.lt(v)) };\n assert_eq(index, 2);\n}\n\n#[test]\nfn find_index_not_found() {\n let values = [10, 20, 30, 40];\n let min = 100;\n let index = unsafe { find_index_hint(values, |v: Field| min.lt(v)) };\n assert_eq(index, 4);\n}\n\n#[test]\nfn test_array_concat() {\n let array0 = [1, 2, 3];\n let array1 = [4, 5];\n let concated = array_concat(array0, array1);\n assert_eq(concated, [1, 2, 3, 4, 5]);\n}\n\n#[test]\nfn check_permutation_basic_test() {\n let original_array = [1, 2, 3];\n let permuted_array = [3, 1, 2];\n let indexes = [2, 0, 1];\n check_permutation(original_array, permuted_array, indexes);\n}\n\n#[test(should_fail_with = \"Duplicated index\")]\nfn check_permutation_duplicated_index() {\n let original_array = [0, 1, 0];\n let permuted_array = [1, 0, 0];\n let indexes = [1, 0, 0];\n check_permutation(original_array, permuted_array, indexes);\n}\n\n#[test(should_fail_with = \"Invalid index\")]\nfn check_permutation_invalid_index() {\n let original_array = [0, 1, 2];\n let permuted_array = [1, 0, 0];\n let indexes = [1, 0, 2];\n check_permutation(original_array, permuted_array, indexes);\n}\n" + }, + "221": { + "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.67.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" }, - "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" + "223": { + "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.67.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::{arrays::array_concat, 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, siloed_note_hash: Field) -> Field {\n let inputs = [nonce, siloed_note_hash];\n poseidon2_hash_with_separator(inputs, GENERATOR_INDEX__UNIQUE_NOTE_HASH)\n}\n\npub fn compute_siloed_note_hash(app: AztecAddress, note_hash: Field) -> Field {\n poseidon2_hash_with_separator(\n [app.to_field(), note_hash],\n GENERATOR_INDEX__SILOED_NOTE_HASH,\n )\n}\n\n/// Computes unique note hashes from siloed note hashes\npub fn compute_unique_siloed_note_hash(\n siloed_note_hash: Field,\n tx_hash: Field,\n note_index_in_tx: u32,\n) -> Field {\n if siloed_note_hash == 0 {\n 0\n } else {\n let nonce = compute_note_hash_nonce(tx_hash, note_index_in_tx);\n compute_unique_note_hash(nonce, 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) -> Field {\n if note_hash.contract_address.is_zero() {\n 0\n } else {\n compute_siloed_note_hash(note_hash.contract_address, note_hash.value())\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 let inputs_with_separator = array_concat([separator.to_field()], inputs);\n poseidon2_hash(inputs_with_separator)\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 let mut fields = [0; (N + 30) / 31];\n let mut field_index = 0;\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 fields[field_index] = field_from_bytes(current_field, false);\n current_field = [0; 31];\n field_index += 1;\n }\n }\n if field_index != fields.len() {\n fields[field_index] = field_from_bytes(current_field, false);\n }\n poseidon2_hash(fields)\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" }, - "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", + "257": { + "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.67.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" }, "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 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", + "310": { + "path": "/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.67.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" }, - "50": { + "51": { "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" }, - "51": { + "52": { "path": "std/panic.nr", "source": "pub fn panic(message: fmtstr) -> U {\n assert(false, message);\n crate::mem::zeroed()\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 04232f6f..faf697ef 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":"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+n86mJ8cfpWff8AzgaOYVyhDfmM1nQEQ6X7Vlju4r9llGIQQdPMoR8HCU7zt01Bw6AkVHRDpet6XvFUkb5eCWbDfN6viVuRvhcTFK3zzNnqEWq1UFa7HfMqsxVCYWAdkTfxgfmXf5DJesuJjhB+nR0TidpQcnj59wwGhbP+QjBWRMk8PAqBTUy3Nf8SEs8M+YZcexTmwMlPZN0tVSdGkginxbkW+RjCnoR9vRjoO3qviOvnbNar+DglJscp30rWW8TqDEhbU2blcOWFQs9cjXqCgQud26gO0WtDdmmZla1Gbfvsc3o9GmmUnst4zfLO0aaMRHMBXs2oqvA4VXh+eiydhW7NyWrr7RxxvtaNi0HHawPX/nYbt9W8ZXoy2u4DER22i3Q/27pm2m7U3jWey3zOpY+IjnDvlTFBuCXVfxdaDwOAa7ip2uYudp0iUxeltzo6u0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UAORBrIaiDWQZkSgZkSMnKJLbCPkem/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/+bXv1tz73TV7hgtGO7tW3XPV51z6tSpqj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quhfjvGOdolJN97gITRLgqu5lxSLBAWmhe971AuBdMADeFQPA6t1Bdu5AjBtOINayynhletW2xSGKdwfRu4Pk3YF6d+BcGwLWjXKw7pSDdasc0nWqtFlHAIk9jYuncXPdsrVw2bppD9Zde7Bu24N13x6sG/dg3bkH69Y9WPfuwbp5D2ouUbdGWq2RztZIZ2ukszXS2Rpp151ocN2KBte9aHDdjAbX3Whw3Y5G1+1odN2ORtftaHTdjsbArtbF1Xp0tZ5craurdddcBddcBddcBddcBddcBddcBddcBddcBddcBddcBddcRddcRddcRddcRddcRddcRddcRddcRddcRddcRddcJddcJddcJddcJddcJddcJddcJddcJddcJddcJddcZddcZddcZddcZddcZddcZddcZddcZddcZddcZddcFddcFddcFddcFddcFddcFddcFddcFddcFddcFddcja65Gl1zNbrmanTN1eiaq9E1V6NrrkbXXI2uuRpdczW55mpyzdV0Za6SlGI10kpjTXPNk+Za+TdNI+K1MaGePjabXuS98KZBefOgvKVT3gRz4+lfcck7Dso7DcpbB+Wdx+StYVDeMCjvXvWyxrtXvazx7lUva7wH1UsdVC91UL3UQfVSB9XLPKhe5kH1Mnc7D1J53iHOS97d5mXkwjvRkvcvyct89v3065chFEI3TKAbJtgNE+qGCXfDRLphErthkrphot0w6WaOhW7mWOhmjoVu5ljoZo6FbuZY6GaOhW7mWPiZc6yEwkQra83MWBqzxCVvHZR3HpM3hkF5w6C8r1QS5vl7bOAYtxvf9ChOQucrUejasv56B+LdQfTuIHl3YL0HyXwRkvkmJEIrgKwAtgKstzOZr2cy389kvqDJekMTWa9oIusdTWS9pInYGmm2RpqtkWZrpNkaabZG2nrXEVkvOyIx325mjbRYIy3WSIs10mKNtFgjLdZIizXS0RrpaI10tEbaevMRWa8+omi+W88a6WiNdLRG+sriwzQ3TKdV4bTke7J8ZeHhlmVws4xulsnNMrtZFjfL0c1ycrOsbpbdclDdclDdclDdclDdclDdclDdclDdclDdclDdclDdcrDf4ojNIgPK3RYTplh4Ky95d1tMWOHNg/LutoimwrvbYs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iK0ZURoy4jQlhGhLSNCL4yIlAsoLyTgwvFMFZC2gHID6MKpRVSOPQOixRxx4SCiCohaQNwCkhZQbAGlFpC2gLIdpBcOQqmAoAWELaALI0K4gGJagLgFJC2g2AJKLSBtAeUG0IVPwSsgsK8j9MJHyhUQtYC4BbR+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/9VVVd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HYuHky+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/6zNkz4931pufONjz99cJ1HNqB6xr12YW2vM0qRazSkmfv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efCXRvPbaMxfY0XHJ2dWo+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/aVKFDdJnuJor5fUNuhd4BKykHLUMekhsC7wLhOsR3IhrA8wLn8DgNUIdgdgAcGGANPKpYwK3aMNbVw8AbqMZ4gnloQuwRoA6xEMt4t9grUAJrawPthx1+vUPHlxNH+WPE7mcSlDn1KODszLKLitHLrim6ZJ+7S4OIxCjgscWlxwHA5JLoTdBRjH4Y6iq8DuAYzj8D7Ato1DseG2cYh+uUOwDsCGBMP8vUswzF+xhaUlunMcfnp0eJIYGrwu9ui+peDhsIpJslRX6/eKCrDpfhiKQSuOfmDSzkH+AeF/4O45mSSoZleUczmdR8vxfDnfncfxZDEfEn20W9sD/6dJlIyXy+U4mU+We8sb578fj5/uTxeTvWh0ME32NvLXzjUNwJX3pGBhES7yLH2ZvTryb5n0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RFqB0R5uAojqUGEp3tAko3dEmoHRHm4DC1NHa6RYu7X0EhamjzUJpaEvcBaEwdbR5KDzNG55uC0WMrtE2tLfsglB4mrcCFJ7mrQCFp3krQOFp3gpQeJq3PJSGdtpdEApP81aAwvNyZAFKd7QJKKpDiaEwdbRaTVBMdJGpoX2HF4TC1NHmoTB1tHkoTB1tFkpDeyUvCIWpo81D6beMxreMKp6OtgBFdSgxFJ6OtgCFgXkb42Tgx8Y4GVisQ5zt7NRfiDM5n1aF41s9368f0ht5ehW68SbqJb3NZV6i6iW6XvLNgjv3CDB8t8FeXuQoIk8QfbeBWV4kKSKgiJAiUhSRpogoGWEpGWEpGWEpGeEoGeEoGZHenydbTtJb3XgZdgzyGEtsvcTVS3y1JL2NRF4iq4uWry/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//u3btZ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FMyOD/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/rdpmma3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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 +{"noir_version":"1.0.0-beta.0+b3f4ad661c8c6f88544d714fd5b7b6f58a8ce4ad-x8664","name":"SimpleLogging","functions":[{"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":"nZJLCoMwFEX38sYOzM/fVqRI1CiBkEiMhSLuvVFsscVJMnlwwz13krNCL9plbKQezAxVvYIyHXfSaJ/WLYHWSqXk2FyfId0PQkd/nrje4+y4dVARnIDQPVQ09fQglYAqw9sjAYQD+ySwTwP7LKyPb/dLUmYnUVJMvgxi9IBYDJTFQHkMVERA5PbjS1qwD8RS+gttPj65lbxV4hRrWHR38cy9JvGn3GRNJ/rFil2+i3f+1ihPMPazfvoN","brillig_names":["sync_notes"]},{"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::block_header::BlockHeader","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::block_header::BlockHeader","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/j31dNX1dXNVTN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P/8MaiYmvUnfYDrHEv8/PhtuE/pnm3Zp7SsKX6Zfo7L9NvHZfo7LtPfcRlb/u2BcuIfaacj2YO+vgnnZXr2tsXPc94hx012x53rcNkyoHSP958/DJ6UPoAPp/gfKV+u598f/MT/IbY7+Pqxz6PzFi6NLo2OWFo4Z1ZRv6XzipbMmj+vd8GcOYl39s4blHPJSrhc4vclu2N3fp2Z8HVWkvXu6/sTT9vXjc/pJ/wBaRD7+r/9B+R/AAj765aYGwIA","debug_symbols":"7ZbdisIwEIXfJde9yMzkb3yVZZGqVQqllVoXFvHdNylNq25YWcsuCN6UTvNN5uRMEnoSm2J13C3LetscxOLtJKpmnXdlU/voJID6b4d9Xofw0OVtJxZgWGaiqDf+1Up5zsS2rAqxMHjOvsHoyA0wOjPBQDJBkwYeaNKMd2jHVg+0Y8cjjUgJGqyjKNvJaW40KViiibC0+hJ+zwSoly9JX/TLl6Qv5uVL0hc72xclddSuJMO0UpR9BffnFXh2Bd8VFWGiyX+wkKCZNQw0s3FXehL7BsnFyREV0K1+lE+uH1L6GXHcdlL/LN+StgNsyV0cFkzJ1y4aY2CaGJTuxeB8MRxhq8jeEQMMKmr370bNdpOefQHqvxdgzXhSmNXN/eCjVVtWVblbXv1ZyfBQyd0CIOP5AEB3u8UUPZKkHknSjySZXyf5CAKbvon01A19cbXokOjDj7wt81VVBFfD6LFeR5N92H3u40hsw75t1sXm2BahIVMvgqskMyXDlR6EKJdpGrX1n5AydL6qr/wF","brillig_names":["pack_arguments_oracle_wrapper","enqueue_public_function_call_internal"]},{"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/+Vd24tkRxmvM92nZ6Znei47e8tGH0RBDBr6NrcHYWQTNeANJYhv9k73xIHN7DI7EaMg86QvPggR8hjwFkHwPYFoUBAiiogvvgkJ+He4Jzlf929+/Ts150xXza6xYOjuU3W+W3311VdffVWTuElJ8s86/XaizV7+2Z6tdALCap8h0sdEEVNv1z74XMx/z0F9LSDTi4Q3JPyddr+/KPgLSH9vMYcZUz4GMwL89nwO5/bpBD7zkpVW/ht1yN5ZePi3lD9bpHYx+jOivNsbgn7DlfH58+Qsn3Mgj1lp6GwfdLo7OzvIV1ZSD01GRz2SPAx+Iw78nvGVghxrgifD3xJyTwo+DRbXGa6mizt2fbwh/fZ9jdqzDIpgpRVhLYq6GH1a9/CN+FcFr3PEt4JV9/A9J/i+LDyxx2TqztqHj+ef2RjpEA2R5o1NG4eoew5wcamJNvYss6u/yV9qiXZWVgVP3H81wsnPfP1XI1gNAUuNW6MLx5O9a/0wT3j28t/t2UrXxzfabMO/nNOblcF3X/zq/f17w9HXRycvHR85Kmxi6/CcxZUWvFOD9lh8quoCiGe329vt9odbTJ+aSmsFdCSBaLHCU2lA2FuR1Wzshi6Ep31szqyPdt1ER17Nvytzk1C/LcbhvZsQPue0W2H4my7q9Dp2KxaJniJXIBvy1/Lv4yF/e3D37nBwMrh97/7LyAQLkj95ICeEzJ7NF/xWBgK/rwoa0gL6nJswjs98PpC1+7DhaYn3koJPw8PPGI+i2TcQL4rH56MuQV3AQbRvfCy76WJ1LcDNcl5xxbJZhTqcg7kon8j4zQzt5+cmcLkd09qEuhbVxeorjg3E0r0FwrMUAI/pF/b/Xv7Znql0B2tuWneXC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Ygq6ogrBzcLIKkBaQVofnJ8WkB+xUQJE8isRZmHLp51Uv3PT1eXIWqHRDukZoZxbRtnCZSv7Yksg6AGhDUgqgFxDUhqQFoDijWgVAOq6RFQ0yOgpkdATY+Amh4xf6vw0nCS568JzuOD5ZmmkGyGzE/wlyFgh6AdQtZBKyPbIWKHqB0S7ZBkh2QzZH6tIevQLXPMEwjYIWiHkB3CdojYIWqHlKI/A7FHn+zRn19XWIaAHYJ2iJ37bOc+27nPdu6znftsjz7boy/26Is9+mKPvthDKfZQij2UYgzlP6e//vv288Pbd48fvpwQT//418f3Xx8+fXz98+v//hz+5d3nh8fHhz/e/Pn50/sPv/31+cObx0/vn/7tLrz+59cI8T5SOqnyxI8Y6D4Cnf56LpgY0j3j859PUUpA9wnkpMNJj/8D","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/xyfHbewI4FbHreMrJtnBfKYZHyoy1Hrk6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NhVNj4VgsHA+FoykWDv0/HJ8umvXSe4dfr+GVY+FILJwSC0dj4cTajlKLheOhcGqKhUOxcGJV5RqrKtdYVbnGqso1VlWugaryvm/+mm+X85vV4u2w4f3z+vbD2cPd78fFP8cQH7eb28Xd83YxHEh8P4s41K+ceJaz9G9zGCBkPiP34U2n12aakZWhORSXnEsfW3uGnuMP","brillig_names":["increase_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+4nmX5CmKD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EqogehKiYK9rLzUUREVdFJTHCVGkTO6T9LqGUUNBBUGiICpqqiAqaqogKmqqICpqqiAqaqKgQ0VNFcRVfqogehKqIHoSqqCCYFFQqyhokiusnS4l2VIQPQlVED0JVRA9CVUQPQlRsNP1JFsKoich/jVEpytKthRET0IVVBAkCqKiPhXco6BIzqCg7s2goJRNUER+RQSrwvatZklI9h3nVXgab9JncfUhvjokP6f2+ZB8aXl2thbxLzMmF4LknCA1J0jPCTJzguycIDcnyM8IkmxO0JwjQs45IuScI0LOOSLknCNCzjki8jOMnT2d5Off8jzME+plEpKf7Od8iKwPUfUhuj7EVJ+0VP0JWNWfgFX9CVjXn4DzMx2cDxH1Ifm9b8Jh6a1PQlR9iK4PMfUhtj7E1Yf46hBT2vuZkPq9b+r3fv6vhs6HqPoQXR9S/9439e99U//eN/XvfVv/3rf1e9/W731bv/dt/d639Xvf1u9KW78rbf2udJW78nN49NfdbnV3v356HSLGX75vHt5W283h4dvfL+E397vVer16vn3ZbR+eHt93T7fr7cP4uwU7/PNLOL8cuqTf43qN40MmloLZ8SHf/9YshXPDsw7P/A8=","brillig_names":["get_counter_value"]},{"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/UjONkOgoSLVk9M1VT76rurnHJrEfJzV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iW914+W4Y5DHUGLLJa5c4osl8W0k0hJZXLR8eQH25QXYlxdgX16A448+pyW2XBKffTOmpbfBvTnxx49TEow/nJuWyHIJlEuwXKLKJbnZj0iKZx+FLZe4cokvlsQfZElLZLkEyiVYLlHlEl0uKZ99WT77snz2ZfnsQ/nsQ/lUQvlUQvlUQuFUfnWv/n04bh8ed5u3TtG/+bF/et8e9qeX7/+9ju88Hre73fbl/vV4eNo8fxw397vDU//eSpx+/EJUa9S6G8pwTlm5tqZ/0Z8tTqwddD12vf4P","brillig_names":["add_to_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+DvzYd0TJ9JtAGNRrKuNdV5obCmMrfdO61yr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9b9udc9T9SnYdYaa717RYvBZX/I2XKImWhHw==","brillig_names":["compute_note_hash_and_optionally_a_nullifier"]},{"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/9VazWskRRSvzkxPZibzFbO7ICiCKAjKMj3pmM1tJOvHgriHxYu3JtPDDmSTJRmF9TQnwYt/hSdBPHgVPHr34p/hQbzoxdRSL/3Lb173dDZdoz5oqrvfq/dV772qrurAZBC4tm5yIChCKrQWHrublnveAHzt4hq75+HNIGqR3Cr53xvGuy3Fvgr1f84/8KS/BeHvyf/DTcfncJHxR1tEbvPiapssJnzZLGPm0+adFXb+6e67INsArdYaoMN3G+SzOtGMK7JpQLqiLB92hIAbe7Qh9GhDo3obRpoNIqdzcQ3cffLFk4dPj04n6XuTyVl6fh6QXZr+GliebzDPD9P54enJ/Cw5mj84OZ8nJ0fp/fTp8emz9GyD5DToeZN8ZQiP7Spdxc9Nwo9dO7wZRCHp/JprrU2vuHuJG9Sd8wLrTAg8Xi/g0Szg0VB4hMTjTfIRzoNV1rqXgK8hWTZ27rr7oth5cDKbz5Lj2ZfJfHZ68lFy/pijiCOCVw2G8MaUj6KQeL7tWuvdt9y9jEIDePAobwIOR/luAY9mAY9A4RESj8i1LcVG36NcW5PsluK3KleI4ntcyQVkW9uP7FGZmQXlt43XbI4Ckif6sH8k72yG33b3lxl+mBwfT5J5cnj69BkawY7klhMzIGFoMD43VtDJfV/RoZWjnzGZ4fhOZAyU/m3itaXw0pwo9B2FfkuxR7OjU9CPg7em6I66ds2y3UFOKzL5ndjWNl4TKCrytTZu1w5YZCzvEa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vKsjv/p5NmdzFq5VpL3WtPPV5+hod7DtB3K+h8P2niN9+igq7jzbl05Z2yF0HbEJ71bCJPld22rTDf2gW1HplV2E7UZuuS6dtTjxpnYZ14zLim/G5PXQ01vbFw1h+5fZoulHNkP58x5v7po3LgAj7VwEiHF0FiDBp0yHOfWPMZUDE47sKEPFE7ktfQokxQdSUWQFQabmgMT62RxxP5KSJM4jXJq45wWtWynvEYZykicNlSROHJZMmDv9Wn7inRDz27pzYFLM+cVZpWZxVr8axL6Y4cczHpYkziAsTx3y8OnFrEjxrfY845uPSxDEflyaO+bg0cTx8kSVO2C5TnDg8pzRxeE5p4vCc0sQZxIWJw3NKE4fnlCYOzylNHJ5Tmjg8pzBxbKH5DcR9+laWjbFHHJ5Tmjg8pzRxeE5p4nBA1Ymb7tu1xoQecTggaeJwQNLE4YCkicMBCRPHjpjixOGApInDAUkThwOSJs4gLkwcnlOaODynNHF4zvrELSfirvdEAjuPihOH5xQmjj1NxYnDc0oTh+eUJg7PKU2cQVz024Vk4DmlicNzShOH55QmDgc0jfgeIjayrgERPqUCRFiP6RCHd4Hx3B7fW/U5ZXiLh8jtaaLrnWV4j4LjKVSeYspTeLCGjr79j/7y3v5MkhuT5MckhTFJcUTSX94jn0nSY5JoTJIZkzSmIvyYivBjKsKPqQg/piL8mIoYfoPu0eFk+H2xMb11P5p+ii1PceUpvjwllKfE4kErlg/AsXwAjuUDcCwfgIff3HQ8xZanDPe+a8sy+t6fWg+//OV4SihPiaUpZvj9EcdTdHkKlafken8gpbj3jbLlKa48xZenhPKU4mvfaFWeostTqDzFlKeU974u731d3vu6vPd1ee9TeVdSeVdSeVdSYVe+Np/+vXjYXlzurh+bjP0vn2+vnrZ3t28fn/67b39z+bDd7bY35/cPd1fXv54frs93d1f7323U24+fxtizxuE0Ug7VTmzPyKr9x33zTTMBMRSaszZn/h8=","brillig_names":["constructor"]}],"outputs":{"structs":{"functions":[{"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"}}]}}]},{"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"}}]}}]}]},"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"},"51":{"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"},"52":{"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"},"103":{"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.67.0/noir-projects/aztec-nr/aztec/src/state_vars/map.nr"},"116":{"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.67.0/noir-projects/aztec-nr/aztec/src/state_vars/public_mutable.nr"},"120":{"source":"use dep::protocol_types::debug_log::debug_log_format;\n\nuse 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 block_header::get_block_header_at,\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 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 block_header::BlockHeader,\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 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: BlockHeader,\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 // WARNING(https://github.com/AztecProtocol/aztec-packages/issues/10558): if you delete this debug_log_format line, some tests fail.\n debug_log_format(\n \"Context.note_hashes, after pushing new note hash: {0}\",\n self.note_hashes.storage().map(|nh: NoteHash| nh.value),\n );\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_block_header(self) -> BlockHeader {\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_block_header_at(self, block_number: u32) -> BlockHeader {\n get_block_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: BlockHeader::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.67.0/noir-projects/aztec-nr/aztec/src/context/private_context.nr"},"121":{"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.67.0/noir-projects/aztec-nr/aztec/src/context/call_interfaces.nr"},"122":{"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.67.0/noir-projects/aztec-nr/aztec/src/context/unconstrained_context.nr"},"128":{"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.67.0/noir-projects/aztec-nr/aztec/src/context/public_context.nr"},"130":{"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.67.0/noir-projects/aztec-nr/aztec/src/hash.nr"},"145":{"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.67.0/noir-projects/aztec-nr/aztec/src/oracle/arguments.nr"},"146":{"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.67.0/noir-projects/aztec-nr/aztec/src/oracle/get_contract_instance.nr"},"153":{"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.67.0/noir-projects/aztec-nr/aztec/src/oracle/execution.nr"},"154":{"source":"use crate::{note::{note_header::NoteHeader, note_interface::NoteInterface}, utils::array};\n\nuse dep::protocol_types::{\n address::AztecAddress,\n indexed_tagging_secret::{INDEXED_TAGGING_SECRET_LENGTH, IndexedTaggingSecret},\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\n let nonce = fields[read_offset];\n let note_hash_counter = fields[read_offset + 1] as u32;\n let note_content = array::subarray(fields, read_offset + 2);\n\n let mut note = Note::deserialize_content(note_content);\n note.set_header(NoteHeader { contract_address, nonce, storage_slot, note_hash_counter });\n\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.67.0/noir-projects/aztec-nr/aztec/src/oracle/notes.nr"},"155":{"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.67.0/noir-projects/aztec-nr/aztec/src/oracle/enqueue_public_function_call.nr"},"156":{"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.67.0/noir-projects/aztec-nr/aztec/src/oracle/storage.nr"},"171":{"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.67.0/noir-projects/aztec-nr/aztec/src/initializer.nr"},"177":{"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};\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\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.67.0/noir-projects/noir-protocol-circuits/crates/types/src/address/aztec_address.nr"},"189":{"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.67.0/noir-projects/noir-protocol-circuits/crates/types/src/type_serialization.nr"},"207":{"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.67.0/noir-projects/noir-protocol-circuits/crates/types/src/utils/reader.nr"},"211":{"source":"pub mod assert_array_appended;\npub mod assert_array_prepended;\npub mod assert_combined_array;\npub mod assert_combined_transformed_array;\npub mod assert_exposed_sorted_transformed_value_array;\npub mod assert_sorted_array;\npub mod assert_sorted_transformed_value_array;\npub mod assert_split_sorted_transformed_value_arrays;\npub mod assert_split_transformed_value_arrays;\npub mod get_sorted_result;\npub mod get_sorted_tuple;\npub mod sort_by;\npub mod sort_by_counter;\n\n// Re-exports.\npub use assert_array_appended::{\n assert_array_appended, assert_array_appended_and_scoped, assert_array_appended_reversed,\n assert_array_appended_scoped,\n};\npub use assert_array_prepended::assert_array_prepended;\npub use assert_combined_array::{assert_combined_array, combine_arrays};\npub use assert_combined_transformed_array::{\n assert_combined_transformed_array, combine_and_transform_arrays,\n};\npub use assert_exposed_sorted_transformed_value_array::{\n assert_exposed_sorted_transformed_value_array,\n get_order_hints::{get_order_hints_asc, get_order_hints_desc, OrderHint},\n};\npub use assert_sorted_array::assert_sorted_array;\npub use assert_sorted_transformed_value_array::{\n assert_sorted_transformed_value_array, assert_sorted_transformed_value_array_capped_size,\n};\npub use assert_split_sorted_transformed_value_arrays::{\n assert_split_sorted_transformed_value_arrays_asc,\n assert_split_sorted_transformed_value_arrays_desc,\n get_split_order_hints::{get_split_order_hints_asc, get_split_order_hints_desc, SplitOrderHints},\n};\npub use assert_split_transformed_value_arrays::assert_split_transformed_value_arrays;\npub use get_sorted_result::{get_sorted_result, SortedResult};\npub use sort_by_counter::{sort_by_counter_asc, sort_by_counter_desc};\n\nuse crate::traits::{Empty, is_empty};\n\npub fn subarray(\n src: [Field; SRC_LEN],\n offset: u32,\n) -> [Field; DST_LEN] {\n assert(offset + DST_LEN <= SRC_LEN, \"offset too large\");\n\n let mut dst: [Field; DST_LEN] = std::mem::zeroed();\n for i in 0..DST_LEN {\n dst[i] = src[i + offset];\n }\n\n dst\n}\n\n// Helper function to convert a validated array to BoundedVec.\n// Important: Only use it for validated arrays: validate_array(array) should be true.\npub unconstrained fn array_to_bounded_vec(array: [T; N]) -> BoundedVec\nwhere\n T: Empty + Eq,\n{\n let len = array_length(array);\n BoundedVec::from_parts_unchecked(array, len)\n}\n\npub unconstrained fn find_index_hint(\n array: [T; N],\n find: fn[Env](T) -> bool,\n) -> u32 {\n let mut index = N;\n for i in 0..N {\n if (index == N) & find(array[i]) {\n index = i;\n }\n }\n index\n}\n\n// Routine which validates that all zero values of an array form a contiguous region at the end, i.e.,\n// of the form: [*,*,*...,0,0,0,0] where any * is non-zero. Note that a full array of non-zero values is\n// valid.\npub fn validate_array(array: [T; N]) -> u32\nwhere\n T: Empty + Eq,\n{\n let mut seen_empty = false;\n let mut length = 0;\n for i in 0..N {\n if is_empty(array[i]) {\n seen_empty = true;\n } else {\n assert(seen_empty == false, \"invalid array\");\n length += 1;\n }\n }\n length\n}\n\n// Helper function to count the number of non-empty elements in a validated array.\n// Important: Only use it for validated arrays: validate_array(array) should be true.\npub fn array_length(array: [T; N]) -> u32\nwhere\n T: Empty + Eq,\n{\n let length = unsafe { find_index_hint(array, |elem: T| is_empty(elem)) };\n if length != 0 {\n assert(!is_empty(array[length - 1]));\n }\n if length != N {\n assert(is_empty(array[length]));\n }\n length\n}\n\npub fn array_concat(array1: [T; N], array2: [T; M]) -> [T; N + M] {\n let mut result = [array1[0]; N + M];\n for i in 1..N {\n result[i] = array1[i];\n }\n for i in 0..M {\n result[i + N] = array2[i];\n }\n result\n}\n\npub fn array_merge(array1: [T; N], array2: [T; N]) -> [T; N]\nwhere\n T: Empty + Eq,\n{\n let mut result: [T; N] = [T::empty(); N];\n let mut i = 0;\n for elem in array1 {\n if !is_empty(elem) {\n result[i] = elem;\n i += 1;\n }\n }\n for elem in array2 {\n if !is_empty(elem) {\n result[i] = elem;\n i += 1;\n }\n }\n result\n}\n\npub fn check_permutation(\n original_array: [T; N],\n permuted_array: [T; N],\n original_indexes: [u32; N],\n)\nwhere\n T: Eq + Empty,\n{\n let mut seen_value = [false; N];\n for i in 0..N {\n let index = original_indexes[i];\n let original_value = original_array[index];\n assert(permuted_array[i].eq(original_value), \"Invalid index\");\n assert(!seen_value[index], \"Duplicated index\");\n seen_value[index] = true;\n }\n}\n\n#[test]\nfn smoke_validate_array() {\n let valid_array: [Field; 0] = [];\n assert(validate_array(valid_array) == 0);\n\n let valid_array = [0];\n assert(validate_array(valid_array) == 0);\n\n let valid_array = [3];\n assert(validate_array(valid_array) == 1);\n\n let valid_array = [1, 2, 3];\n assert(validate_array(valid_array) == 3);\n\n let valid_array = [1, 2, 3, 0];\n assert(validate_array(valid_array) == 3);\n\n let valid_array = [1, 2, 3, 0, 0];\n assert(validate_array(valid_array) == 3);\n}\n\n#[test(should_fail_with = \"invalid array\")]\nfn smoke_validate_array_invalid_case0() {\n let invalid_array = [0, 1];\n let _ = validate_array(invalid_array);\n}\n\n#[test(should_fail_with = \"invalid array\")]\nfn smoke_validate_array_invalid_case1() {\n let invalid_array = [1, 0, 0, 1, 0];\n let _ = validate_array(invalid_array);\n}\n\n#[test(should_fail_with = \"invalid array\")]\nfn smoke_validate_array_invalid_case2() {\n let invalid_array = [0, 0, 0, 0, 1];\n let _ = validate_array(invalid_array);\n}\n\n#[test]\nfn test_empty_array_length() {\n assert_eq(array_length([0]), 0);\n assert_eq(array_length([0, 0, 0]), 0);\n}\n\n#[test]\nfn test_array_length() {\n assert_eq(array_length([123]), 1);\n assert_eq(array_length([123, 0, 0]), 1);\n assert_eq(array_length([123, 456]), 2);\n assert_eq(array_length([123, 456, 0]), 2);\n}\n\n#[test]\nfn test_array_length_invalid_arrays() {\n // Result can be misleading (but correct) for invalid arrays.\n assert_eq(array_length([0, 0, 123]), 0);\n assert_eq(array_length([0, 123, 0]), 0);\n assert_eq(array_length([0, 123, 456]), 0);\n assert_eq(array_length([123, 0, 456]), 1);\n}\n\n#[test]\nfn find_index_greater_than_min() {\n let values = [10, 20, 30, 40];\n let min = 22;\n let index = unsafe { find_index_hint(values, |v: Field| min.lt(v)) };\n assert_eq(index, 2);\n}\n\n#[test]\nfn find_index_not_found() {\n let values = [10, 20, 30, 40];\n let min = 100;\n let index = unsafe { find_index_hint(values, |v: Field| min.lt(v)) };\n assert_eq(index, 4);\n}\n\n#[test]\nfn test_array_concat() {\n let array0 = [1, 2, 3];\n let array1 = [4, 5];\n let concated = array_concat(array0, array1);\n assert_eq(concated, [1, 2, 3, 4, 5]);\n}\n\n#[test]\nfn check_permutation_basic_test() {\n let original_array = [1, 2, 3];\n let permuted_array = [3, 1, 2];\n let indexes = [2, 0, 1];\n check_permutation(original_array, permuted_array, indexes);\n}\n\n#[test(should_fail_with = \"Duplicated index\")]\nfn check_permutation_duplicated_index() {\n let original_array = [0, 1, 0];\n let permuted_array = [1, 0, 0];\n let indexes = [1, 0, 0];\n check_permutation(original_array, permuted_array, indexes);\n}\n\n#[test(should_fail_with = \"Invalid index\")]\nfn check_permutation_invalid_index() {\n let original_array = [0, 1, 2];\n let permuted_array = [1, 0, 0];\n let indexes = [1, 0, 2];\n check_permutation(original_array, permuted_array, indexes);\n}\n","path":"/home/filip/nargo/github.com/AztecProtocol/aztec-packages/aztec-packages-v0.67.0/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays.nr"},"221":{"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.67.0/noir-projects/noir-protocol-circuits/crates/types/src/traits.nr"},"223":{"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::{arrays::array_concat, 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, siloed_note_hash: Field) -> Field {\n let inputs = [nonce, siloed_note_hash];\n poseidon2_hash_with_separator(inputs, GENERATOR_INDEX__UNIQUE_NOTE_HASH)\n}\n\npub fn compute_siloed_note_hash(app: AztecAddress, note_hash: Field) -> Field {\n poseidon2_hash_with_separator(\n [app.to_field(), note_hash],\n GENERATOR_INDEX__SILOED_NOTE_HASH,\n )\n}\n\n/// Computes unique note hashes from siloed note hashes\npub fn compute_unique_siloed_note_hash(\n siloed_note_hash: Field,\n tx_hash: Field,\n note_index_in_tx: u32,\n) -> Field {\n if siloed_note_hash == 0 {\n 0\n } else {\n let nonce = compute_note_hash_nonce(tx_hash, note_index_in_tx);\n compute_unique_note_hash(nonce, 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) -> Field {\n if note_hash.contract_address.is_zero() {\n 0\n } else {\n compute_siloed_note_hash(note_hash.contract_address, note_hash.value())\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 let inputs_with_separator = array_concat([separator.to_field()], inputs);\n poseidon2_hash(inputs_with_separator)\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 let mut fields = [0; (N + 30) / 31];\n let mut field_index = 0;\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 fields[field_index] = field_from_bytes(current_field, false);\n current_field = [0; 31];\n field_index += 1;\n }\n }\n if field_index != fields.len() {\n fields[field_index] = field_from_bytes(current_field, false);\n }\n poseidon2_hash(fields)\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.67.0/noir-projects/noir-protocol-circuits/crates/types/src/hash.nr"},"257":{"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.67.0/noir-projects/noir-protocol-circuits/crates/types/src/abis/function_selector.nr"},"310":{"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.67.0/noir-projects/noir-protocol-circuits/crates/types/src/storage/map.nr"}}} \ No newline at end of file diff --git a/services/explorer-api/package.json b/services/explorer-api/package.json index 9666bf4b..88473f0c 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.66.0", - "@aztec/circuits.js": "0.66.0", - "@aztec/protocol-contracts": "0.66.0", + "@aztec/aztec.js": "0.67.0", + "@aztec/circuits.js": "0.67.0", + "@aztec/protocol-contracts": "0.67.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 f717d6db..9ee067b1 100644 --- a/services/explorer-api/src/constants.ts +++ b/services/explorer-api/src/constants.ts @@ -10,7 +10,7 @@ export const DEFAULT_VERIFIED_CONTRACT_ADDRESSES_DEV: ChicmozL2VerifiedContractA "0x0e5fe9a23c854f14262bb3b3e88dab8e33412d6db17baa199506f865ed746a0c", name: "Deployed by Sandbox", details: - "This contract was deployed by the sandbox environment. Hardcoded address is at least valid for 0.66.0", + "This contract was deployed by the sandbox environment. Hardcoded address is at least valid for 0.67.0", contact: "email: test@test.com, discord: test#1234, telegram: @test", uiUrl: "https://aztec.network", repoUrl: "https://github.com/AztecProtocol/aztec-packages", 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 d01f9df7..4ea2cdaf 100644 --- a/services/explorer-ui/src/pages/contract-instance-details/index.tsx +++ b/services/explorer-ui/src/pages/contract-instance-details/index.tsx @@ -6,6 +6,7 @@ import { KeyValueDisplay } from "~/components/info-display/key-value-display"; import { useContractInstance } from "~/hooks/"; import { getContractData, getVerifiedContractData } from "./util"; import { routes } from "~/routes/__root"; +import { CustomTooltip } from "~/components/custom-tooltip"; export const ContractInstanceDetails: FC = () => { const { address } = useParams({ @@ -48,10 +49,9 @@ export const ContractInstanceDetails: FC = () => { Verified contract data
- -
- Read more about verified contracts here. -
+ + +
diff --git a/services/explorer-ui/src/pages/dev.tsx b/services/explorer-ui/src/pages/dev.tsx index 142bc46c..3341039d 100644 --- a/services/explorer-ui/src/pages/dev.tsx +++ b/services/explorer-ui/src/pages/dev.tsx @@ -5,7 +5,7 @@ export const DevPage: FC = () => {

Dev Page

-

Aztec.js version : 0.66.0

+

Aztec.js version : 0.67.0

); diff --git a/yarn.lock b/yarn.lock index e84d2982..99cd5081 100644 --- a/yarn.lock +++ b/yarn.lock @@ -41,43 +41,43 @@ __metadata: languageName: node linkType: hard -"@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" +"@aztec/accounts@npm:0.67.0": + version: 0.67.0 + resolution: "@aztec/accounts@npm:0.67.0" + dependencies: + "@aztec/aztec.js": "npm:0.67.0" + "@aztec/circuit-types": "npm:0.67.0" + "@aztec/circuits.js": "npm:0.67.0" + "@aztec/entrypoints": "npm:0.67.0" + "@aztec/ethereum": "npm:0.67.0" + "@aztec/foundation": "npm:0.67.0" + "@aztec/types": "npm:0.67.0" tslib: "npm:^2.4.0" - checksum: edd31c634eacc8c769ef69bf46960deda25ca45460115a1b54bca3fd97d8d1a49e219356c542455d9a3cf00c9e738b9ea21e72435186450ea3e6c46f3c0fc9fc + checksum: 567626b913709373954571595d3c308cb903c459439011954b2c0a127329696afc44d00d359325569a04386912933f7dae581c384434bee74019c3298275652f languageName: node linkType: hard -"@aztec/aztec.js@npm:0.66.0": - version: 0.66.0 - resolution: "@aztec/aztec.js@npm:0.66.0" +"@aztec/aztec.js@npm:0.67.0": + version: 0.67.0 + resolution: "@aztec/aztec.js@npm:0.67.0" dependencies: - "@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" + "@aztec/circuit-types": "npm:0.67.0" + "@aztec/circuits.js": "npm:0.67.0" + "@aztec/ethereum": "npm:0.67.0" + "@aztec/foundation": "npm:0.67.0" + "@aztec/l1-artifacts": "npm:0.67.0" + "@aztec/protocol-contracts": "npm:0.67.0" + "@aztec/types": "npm:0.67.0" axios: "npm:^1.7.2" tslib: "npm:^2.4.0" viem: "npm:^2.7.15" - checksum: 60eb34b05a71d7f35b7031e51c6990f6fb2985369369e89f6a43ec8f0462852b3b324c7407cae7c24c804d1c7044bde9a2d2e56a6c6fc1c4a079fba996412205 + checksum: 7cfe7a6592752c3121f48b9aee59ce1334e77c717f9d0b068357d7174c634997b56078a7a1c6d544c1bdaf47f45e1a7668eefe4a8c38a2f2876137c308ba7b74 languageName: node linkType: hard -"@aztec/bb.js@npm:0.66.0": - version: 0.66.0 - resolution: "@aztec/bb.js@npm:0.66.0" +"@aztec/bb.js@npm:0.67.0": + version: 0.67.0 + resolution: "@aztec/bb.js@npm:0.67.0" dependencies: comlink: "npm:^4.4.1" commander: "npm:^10.0.1" @@ -87,78 +87,78 @@ __metadata: tslib: "npm:^2.4.0" bin: bb.js: dest/node/main.js - checksum: edafaf80355ac04778802e97c85be21cbdbe8309e55445b06587072d8aa780f3c56a100243a28f5158732eb7f78932849d2a7598e4af0af85ad9ac9d97337a8b + checksum: 1916e6fb208ca139458d5f85cb335d1bae015f3fa448ec506c7578e2a57e266b8765d6bf63c7843d11c3090d224b69565461294dfb06795fc49eaf51f5221c4d languageName: node linkType: hard -"@aztec/circuit-types@npm:0.66.0": - version: 0.66.0 - resolution: "@aztec/circuit-types@npm:0.66.0" +"@aztec/circuit-types@npm:0.67.0": + version: 0.67.0 + resolution: "@aztec/circuit-types@npm:0.67.0" dependencies: - "@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" + "@aztec/circuits.js": "npm:0.67.0" + "@aztec/ethereum": "npm:0.67.0" + "@aztec/foundation": "npm:0.67.0" + "@aztec/types": "npm:0.67.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: dda40b0641327d48c54c39bc5eab8a64e46c08d43ef0e37e2a17642d02dc54985f919a6a739dedc260118b68b30ef33bbf141d88983f58b9d38f1b107dfadcc9 + checksum: dc7f07ff20f50e00ba78e5af6418d3638aacfed7ff6a07599f751696412c8d7c379d22776e23def431e2706a563fd1f002eeb21b19e4c549cefae1f63b2b80ba languageName: node linkType: hard -"@aztec/circuits.js@npm:0.66.0": - version: 0.66.0 - resolution: "@aztec/circuits.js@npm:0.66.0" +"@aztec/circuits.js@npm:0.67.0": + version: 0.67.0 + resolution: "@aztec/circuits.js@npm:0.67.0" dependencies: - "@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" + "@aztec/bb.js": "npm:0.67.0" + "@aztec/ethereum": "npm:0.67.0" + "@aztec/foundation": "npm:0.67.0" + "@aztec/types": "npm:0.67.0" eslint: "npm:^8.35.0" tslib: "npm:^2.4.0" zod: "npm:^3.23.8" - checksum: 46b9eceb46110d49ed59a88d4a38da830f160b9f32ac09f8154d0e15175bc9775a6256acd1020a9becebb92761544c5b9dda177574d404208a8f849e162a2c3e + checksum: b50b5137134606f3380f378f321ac7fc6955a79738744487b510226bec6108f9ec2b489f8faaafeb67a70dcc1f9a55e47be49f6390d084cb6f373da4315cf9b5 languageName: node linkType: hard -"@aztec/entrypoints@npm:0.66.0": - version: 0.66.0 - resolution: "@aztec/entrypoints@npm:0.66.0" +"@aztec/entrypoints@npm:0.67.0": + version: 0.67.0 + resolution: "@aztec/entrypoints@npm:0.67.0" dependencies: - "@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" + "@aztec/aztec.js": "npm:0.67.0" + "@aztec/circuit-types": "npm:0.67.0" + "@aztec/circuits.js": "npm:0.67.0" + "@aztec/foundation": "npm:0.67.0" + "@aztec/protocol-contracts": "npm:0.67.0" tslib: "npm:^2.4.0" - checksum: 4e420f2e3881b22064b3139cd7ef08fb41d10938e15c40fb576d1e45c06cfad4254bbff0aa6f04786625ec75137b579b4ea074f8ba5a70074687cc16fed012ad + checksum: 07f1b64e56f924802ec421dfe6a2a5f317defa62d9ee9c90553ff5265b39746b2c19f65a0ba29d397ee675b7b0c9784fc8c90ada1e958a7fc1b5567aa0d17072 languageName: node linkType: hard -"@aztec/ethereum@npm:0.66.0": - version: 0.66.0 - resolution: "@aztec/ethereum@npm:0.66.0" +"@aztec/ethereum@npm:0.67.0": + version: 0.67.0 + resolution: "@aztec/ethereum@npm:0.67.0" dependencies: - "@aztec/foundation": "npm:0.66.0" - "@aztec/l1-artifacts": "npm:0.66.0" + "@aztec/foundation": "npm:0.67.0" + "@aztec/l1-artifacts": "npm:0.67.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: 7cc88fdcdc857e9b3fcfd28f86d98757beb5d8ce0c98b2a7d0e054abfa8751b18def54c8ef10dce9a250a889e9b38c1227cd7a8d75b706996885c3a0454e10f4 + checksum: eed58795c99a9c4bc55f917b92cd9a309a638a265646ee957f7e5f392b97925a0f17cf7de705022554dc57e156992389d12d86a27b746ce9711b18c41e596f54 languageName: node linkType: hard -"@aztec/foundation@npm:0.66.0": - version: 0.66.0 - resolution: "@aztec/foundation@npm:0.66.0" +"@aztec/foundation@npm:0.67.0": + version: 0.67.0 + resolution: "@aztec/foundation@npm:0.67.0" dependencies: - "@aztec/bb.js": "npm:0.66.0" + "@aztec/bb.js": "npm:0.67.0" "@koa/cors": "npm:^5.0.0" "@noble/curves": "npm:^1.2.0" bn.js: "npm:^5.2.1" @@ -181,50 +181,50 @@ __metadata: pino-pretty: "npm:^13.0.0" sha3: "npm:^2.1.4" zod: "npm:^3.23.8" - checksum: 40f674b536833d397f7960b6680e57ea58e9c58e09b40b96e537aafeaa194f9366a3241943971504a7f4f6451e4ddffc9c138f68ddb27d51a7819bbc7e159e90 + checksum: 9878a1b60317e5dc86d7bd5ccd5a5cd04fdc5f6d56c80a709a0c4b35e00a484d44c445455297be4c181b0648b2b2c7a4a890abcbab067ad9a595b60693c1a1e0 languageName: node linkType: hard -"@aztec/l1-artifacts@npm:0.66.0": - version: 0.66.0 - resolution: "@aztec/l1-artifacts@npm:0.66.0" +"@aztec/l1-artifacts@npm:0.67.0": + version: 0.67.0 + resolution: "@aztec/l1-artifacts@npm:0.67.0" dependencies: tslib: "npm:^2.4.0" - checksum: bed22a886eeb3f0d1f6c1d9cb22e4265b4cdbda57970bcbdc2cc7005ecc9c0ee557e1c392e29edafb728e2ea2b1eb85f1edbdd7cbb35312aabdbdbf43cdda17a + checksum: 4951546e507f8714fa9e0e7b22c947a654a806aea59e937eaf867096ad8ec271c7f7eccf0daaa1f783e212ee101b9e50553d08c96f06340c0360a04903e25f90 languageName: node linkType: hard -"@aztec/noir-contracts.js@npm:0.66.0": - version: 0.66.0 - resolution: "@aztec/noir-contracts.js@npm:0.66.0" +"@aztec/noir-contracts.js@npm:0.67.0": + version: 0.67.0 + resolution: "@aztec/noir-contracts.js@npm:0.67.0" dependencies: - "@aztec/aztec.js": "npm:0.66.0" + "@aztec/aztec.js": "npm:0.67.0" tslib: "npm:^2.4.0" - checksum: f90737fb41cf4c50bc223be0b69c1f5f0ce9c5652ba1bde1ba6729a56c7a590c66a99a7c51ac2c4020fe9201e7ad9b777812bf6e20cd97dd314f5ea0e311713a + checksum: 9724fd4a41e69629072a1743798d3f0c6c49050cfa8a45178603f4ec29e79480001a7402bee2bcaf3d87ea7b2df73c7f6571e88f9d3b9e872a234d2c5fe82bfa languageName: node linkType: hard -"@aztec/protocol-contracts@npm:0.66.0": - version: 0.66.0 - resolution: "@aztec/protocol-contracts@npm:0.66.0" +"@aztec/protocol-contracts@npm:0.67.0": + version: 0.67.0 + resolution: "@aztec/protocol-contracts@npm:0.67.0" dependencies: - "@aztec/circuits.js": "npm:0.66.0" - "@aztec/foundation": "npm:0.66.0" - "@aztec/types": "npm:0.66.0" + "@aztec/circuits.js": "npm:0.67.0" + "@aztec/foundation": "npm:0.67.0" + "@aztec/types": "npm:0.67.0" lodash.chunk: "npm:^4.2.0" lodash.omit: "npm:^4.5.0" tslib: "npm:^2.4.0" - checksum: c1e8f8e0ff4a1d9c2dae212a16ea4f39d88b8c7fac1a283da850afee48654b60d65d604f003c35033f2977581586a30066aef7f7d1371ac425d14987b551206e + checksum: 7fb25ee620f44ed732e8fc70fdeaaa8745117b6248770b693fb22d5fa702c526525addbba9d62f9bc2008b6a7eeb9ec6bbec7805b358803b4f44f88227928cc8 languageName: node linkType: hard -"@aztec/types@npm:0.66.0": - version: 0.66.0 - resolution: "@aztec/types@npm:0.66.0" +"@aztec/types@npm:0.67.0": + version: 0.67.0 + resolution: "@aztec/types@npm:0.67.0" dependencies: - "@aztec/ethereum": "npm:0.66.0" - "@aztec/foundation": "npm:0.66.0" - checksum: d2adad06a76d4c39bac6c924710ba990a81407d5112404e60a47bc6c8070b688862148d7ea322cff9bd4e3c0867b9afd0563f3aaa93dfe6056a14f3095b7bec3 + "@aztec/ethereum": "npm:0.67.0" + "@aztec/foundation": "npm:0.67.0" + checksum: 6a605689597267230f60caaf0b16feb7cb8eb5b1be1a334f092eba84c38d238d23fb67b97a9412891f78fca2f2280ed83ea85f061ca038ee41616a0687f5676a languageName: node linkType: hard @@ -772,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.66.0" + "@aztec/aztec.js": "npm:0.67.0" "@chicmoz-pkg/types": "workspace:^" "@typescript-eslint/eslint-plugin": "npm:6.11.0" "@typescript-eslint/parser": "npm:6.11.0" @@ -852,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.66.0" + "@aztec/aztec.js": "npm:0.67.0" "@chicmoz-pkg/types": "workspace:^" "@typescript-eslint/eslint-plugin": "npm:6.11.0" "@typescript-eslint/parser": "npm:6.11.0" @@ -928,8 +928,8 @@ __metadata: version: 0.0.0-use.local resolution: "@chicmoz/aztec-listener@workspace:services/aztec-listener" dependencies: - "@aztec/aztec.js": "npm:0.66.0" - "@aztec/circuits.js": "npm:0.66.0" + "@aztec/aztec.js": "npm:0.67.0" + "@aztec/circuits.js": "npm:0.67.0" "@chicmoz-pkg/logger-server": "workspace:^" "@chicmoz-pkg/message-bus": "workspace:^" "@chicmoz-pkg/message-registry": "workspace:^" @@ -979,8 +979,8 @@ __metadata: version: 0.0.0-use.local resolution: "@chicmoz/ethereum-listener@workspace:services/ethereum-listener" dependencies: - "@aztec/aztec.js": "npm:0.66.0" - "@aztec/l1-artifacts": "npm:0.66.0" + "@aztec/aztec.js": "npm:0.67.0" + "@aztec/l1-artifacts": "npm:0.67.0" "@chicmoz-pkg/logger-server": "workspace:^" "@chicmoz-pkg/message-bus": "workspace:^" "@chicmoz-pkg/message-registry": "workspace:^" @@ -1003,10 +1003,10 @@ __metadata: version: 0.0.0-use.local resolution: "@chicmoz/event-cannon@workspace:services/event-cannon" dependencies: - "@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" + "@aztec/accounts": "npm:0.67.0" + "@aztec/aztec.js": "npm:0.67.0" + "@aztec/l1-artifacts": "npm:0.67.0" + "@aztec/noir-contracts.js": "npm:0.67.0" "@chicmoz-pkg/logger-server": "workspace:^" "@types/node": "npm:20.5.0" "@typescript-eslint/eslint-plugin": "npm:6.11.0" @@ -1026,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.66.0" - "@aztec/circuits.js": "npm:0.66.0" - "@aztec/protocol-contracts": "npm:0.66.0" + "@aztec/aztec.js": "npm:0.67.0" + "@aztec/circuits.js": "npm:0.67.0" + "@aztec/protocol-contracts": "npm:0.67.0" "@chicmoz-pkg/backend-utils": "workspace:^" "@chicmoz-pkg/error-middleware": "workspace:^" "@chicmoz-pkg/logger-server": "workspace:^"