From e3b31b6bbe19ef1b0aacbad7630962d01544e6a5 Mon Sep 17 00:00:00 2001 From: Cat McGee Date: Thu, 30 Nov 2023 15:30:38 +0600 Subject: [PATCH 01/18] initial script --- .../preprocess/generate_aztecnr_reference.js | 208 ++++++++++++++++++ 1 file changed, 208 insertions(+) create mode 100644 docs/src/preprocess/generate_aztecnr_reference.js diff --git a/docs/src/preprocess/generate_aztecnr_reference.js b/docs/src/preprocess/generate_aztecnr_reference.js new file mode 100644 index 00000000000..9dc0b6b48a0 --- /dev/null +++ b/docs/src/preprocess/generate_aztecnr_reference.js @@ -0,0 +1,208 @@ +const fs = require('fs'); +const path = require('path'); + +// const filePath = '../../../yarn-project/aztec-nr/address-note/src/address_note.nr'; +// const filePath = '../../../yarn-project/aztec-nr/authwit/src/account.nr'; +// const filePath = '../../../yarn-project/aztec-nr/authwit/src/auth.nr'; +// const filePath = '../../../yarn-project/aztec-nr/aztec/src/abi.nr'; +// const filePath = '../../../yarn-project/aztec-nr/aztec/src/log.nr'; +// const filePath = '../../../yarn-project/aztec-nr/aztec/src/utils.nr'; +const filePath = '../../../yarn-project/aztec-nr/field-note/src/field_note.nr'; + +const content = fs.readFileSync(filePath, 'utf8'); + +function parseParameters(paramString) { + return paramString.split(',').map(param => { + param = param.trim().replace(/[\[:;,.]$/g, '').replace(/^[\[:;,.]/g, ''); // Clean up start and end + let [paramName, type] = param.split(':').map(p => p.trim()); + return { name: paramName, type }; + }); +} + +function parseStruct(content) { + const structRegex = /struct (\w+)\s*{([\s\S]*?)}/g; + let match; + const structs = []; + + while ((match = structRegex.exec(content)) !== null) { + const structName = match[1]; + const fields = match[2].trim().split('\n').map(fieldLine => { + fieldLine = fieldLine.trim().replace(/,$/, ''); + let [name, type] = fieldLine.split(/:\s*/); + return { name, type }; + }); + + let descriptionLines = []; + let commentIndex = match.index; + while (commentIndex >= 0) { + const precedingText = content.substring(0, commentIndex); + const commentMatch = precedingText.match(/\/\/\s*(.*)\n\s*$/); + + if (commentMatch && !commentMatch[1].includes('docs:start:') && !commentMatch[1].includes('docs:end:')) { + descriptionLines.unshift(commentMatch[1]); + commentIndex = commentMatch.index - 1; + } else { + break; + } + } + + let description = descriptionLines.join(' '); + + structs.push({ structName, fields, description }); + } + + return structs; +} + +const structs = parseStruct(content); + +function parseFunctions(content) { + const functions = []; + const implRegex = /impl\s+(\w+)\s*{/g; // Capture the name of the struct associated with the impl block + let implMatch; + + while ((implMatch = implRegex.exec(content)) !== null) { + const structName = implMatch[1]; // Capture the struct name + let braceDepth = 1; + let currentPos = implMatch.index + implMatch[0].length; + + // Find the end of the impl block by matching braces + while (braceDepth > 0 && currentPos < content.length) { + if (content[currentPos] === '{') { + braceDepth++; + } else if (content[currentPos] === '}') { + braceDepth--; + } + currentPos++; + } + + // Extract the content of the impl block + const implBlockContent = content.substring(implMatch.index, currentPos); + const methodRegex = /(?:pub )?fn (\w+)\((.*?)\)(?: -> (.*?))? {/g; + let methodMatch; + + // Process each method in the impl block + while ((methodMatch = methodRegex.exec(implBlockContent)) !== null) { + const name = methodMatch[1]; + const params = parseParameters(methodMatch[2]); + const returnType = (methodMatch[3] || '').replace(/[\[:;,.]$/g, '').replace(/^[\[:;,.]/g, ''); + + // Extracting the comment as description + let description = ''; + let commentIndex = methodMatch.index; + while (commentIndex >= 0) { + const commentMatch = implBlockContent.substring(0, commentIndex).match(/\/\/\s*(.*)\n\s*$/); + if (commentMatch && !commentMatch[1].includes('docs:start:') && !commentMatch[1].includes('docs:end:')) { + description = commentMatch[1] + (description ? ' ' + description : ''); + commentIndex = commentMatch.index - 1; + } else { + break; + } + } + + functions.push({ structName, name, params, returnType, description, isMethod: true }); + + } + } + + // Process standalone functions + const standaloneFunctionRegex = /(?:pub\s+)?fn\s+(\w+)(?:<.*?>)?\s*\((.*?)\)\s*(?:->\s*(.*?))?\s*{/g; + let standaloneFunctionMatch; + while ((standaloneFunctionMatch = standaloneFunctionRegex.exec(content)) !== null) { + const name = standaloneFunctionMatch[1]; + + // Check if this function has already been processed as a method + if (!functions.some(f => f.name === name)) { + const params = parseParameters(standaloneFunctionMatch[2]); + const returnType = (standaloneFunctionMatch[3] || '').replace(/[\[:;,.]$/g, '').replace(/^[\[:;,.]/g, ''); + + // Extract the comment as description TODO multiline comments + let description = ''; + const descriptionMatch = content.substring(0, standaloneFunctionMatch.index).match(/\/\/\s*(.*)\n\s*$/); + if (descriptionMatch) { + const precedingText = content.substring(0, descriptionMatch.index); + if (!precedingText.includes('docs:start:') && !precedingText.includes('docs:end:')) { + description = descriptionMatch[1]; + } + } + + functions.push({ name, params, returnType, description, isMethod: false }); + } + } + + return functions; +} + + +const functions = parseFunctions(content); + +function generateMarkdown(structInfo, functions) { + let markdown = ''; + + structs.forEach(structInfo => { + if (structInfo) { + markdown += `# ${structInfo.structName} Struct\n\n`; + + if (structInfo.description) { + markdown += `${structInfo.description}\n\n`; + } + + markdown += `## Fields\n`; + markdown += `| Field | Type |\n| --- | --- |\n`; + structInfo.fields.forEach(field => { + const cleanType = field.type.replace(/[\[:;,]$/g, '').replace(/^[\[:;,]/g, ''); + const fieldName = field.name.replace(/[:;]/g, ''); + markdown += `| ${fieldName} | ${cleanType} |\n`; + }); + + // Generate markdown for methods of this struct + const methods = functions.filter(f => f.isMethod && f.structName === structInfo.structName); + if (methods.length > 0) { + markdown += `\n## Methods\n\n`; + methods.forEach(func => { + markdown += `### ${func.name}\n\n`; + if (func.description) markdown += `${func.description}\n\n`; + markdown += `#### Parameters\n`; + markdown += `| Name | Type |\n| --- | --- |\n`; + func.params.forEach(({ name, type }) => { + markdown += `| ${name} | ${type} |\n`; + }); + if (func.returnType) { + markdown += `\n#### Returns\n`; + markdown += `| Type |\n| --- |\n`; + markdown += `| ${func.returnType} |\n`; + } + markdown += '\n'; + }); + } + } + }); + + // Generate markdown for standalone functions + const standaloneFunctions = functions.filter(f => !f.isMethod); + if (standaloneFunctions.length > 0) { + markdown += `\n## Standalone Functions\n\n`; + standaloneFunctions.forEach(func => { + markdown += `### ${func.name}\n\n`; + if (func.description) markdown += `${func.description}\n\n`; + markdown += `#### Parameters\n`; + markdown += `| Name | Type |\n| --- | --- |\n`; + func.params.forEach(({ name, type }) => { + markdown += `| ${name} | ${type} |\n`; + }); + if (func.returnType) { + markdown += `\n#### Returns\n`; + markdown += `| Type |\n| --- |\n`; + markdown += `| ${func.returnType} |\n`; + } + markdown += '\n'; + }); + } + + return markdown; +} + +const markdown = generateMarkdown(structs, functions); + +const outputPath = 'address-note.md'; +fs.writeFileSync(outputPath, markdown); From 0c42ed3d1b842d1257e62915c2a20a9d334b3cdf Mon Sep 17 00:00:00 2001 From: Cat McGee Date: Tue, 5 Dec 2023 16:52:01 +0600 Subject: [PATCH 02/18] multiple line comment descriptions --- .../preprocess/generate_aztecnr_reference.js | 38 ++++++++----------- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/docs/src/preprocess/generate_aztecnr_reference.js b/docs/src/preprocess/generate_aztecnr_reference.js index 9dc0b6b48a0..f8521e4bd2e 100644 --- a/docs/src/preprocess/generate_aztecnr_reference.js +++ b/docs/src/preprocess/generate_aztecnr_reference.js @@ -33,40 +33,41 @@ function parseStruct(content) { }); let descriptionLines = []; - let commentIndex = match.index; - while (commentIndex >= 0) { - const precedingText = content.substring(0, commentIndex); - const commentMatch = precedingText.match(/\/\/\s*(.*)\n\s*$/); - - if (commentMatch && !commentMatch[1].includes('docs:start:') && !commentMatch[1].includes('docs:end:')) { - descriptionLines.unshift(commentMatch[1]); - commentIndex = commentMatch.index - 1; - } else { + let lineIndex = content.lastIndexOf('\n', match.index - 1); + while (lineIndex >= 0) { + let endOfPreviousLine = content.lastIndexOf('\n', lineIndex - 1); + let line = content.substring(endOfPreviousLine + 1, lineIndex).trim(); + + if (line.startsWith('//') && !line.includes('docs:start:') && !line.includes('docs:end:')) { + descriptionLines.unshift(line.replace('//', '').trim()); + } else if (!line.startsWith('//')) { break; } + + lineIndex = endOfPreviousLine; } let description = descriptionLines.join(' '); - structs.push({ structName, fields, description }); } return structs; } + + const structs = parseStruct(content); function parseFunctions(content) { const functions = []; - const implRegex = /impl\s+(\w+)\s*{/g; // Capture the name of the struct associated with the impl block + const implRegex = /impl\s+(\w+)\s*{/g; let implMatch; while ((implMatch = implRegex.exec(content)) !== null) { - const structName = implMatch[1]; // Capture the struct name + const structName = implMatch[1]; let braceDepth = 1; let currentPos = implMatch.index + implMatch[0].length; - // Find the end of the impl block by matching braces while (braceDepth > 0 && currentPos < content.length) { if (content[currentPos] === '{') { braceDepth++; @@ -76,18 +77,15 @@ function parseFunctions(content) { currentPos++; } - // Extract the content of the impl block const implBlockContent = content.substring(implMatch.index, currentPos); const methodRegex = /(?:pub )?fn (\w+)\((.*?)\)(?: -> (.*?))? {/g; let methodMatch; - // Process each method in the impl block while ((methodMatch = methodRegex.exec(implBlockContent)) !== null) { const name = methodMatch[1]; const params = parseParameters(methodMatch[2]); const returnType = (methodMatch[3] || '').replace(/[\[:;,.]$/g, '').replace(/^[\[:;,.]/g, ''); - // Extracting the comment as description let description = ''; let commentIndex = methodMatch.index; while (commentIndex >= 0) { @@ -98,25 +96,21 @@ function parseFunctions(content) { } else { break; } - } + } functions.push({ structName, name, params, returnType, description, isMethod: true }); - } } - // Process standalone functions const standaloneFunctionRegex = /(?:pub\s+)?fn\s+(\w+)(?:<.*?>)?\s*\((.*?)\)\s*(?:->\s*(.*?))?\s*{/g; let standaloneFunctionMatch; while ((standaloneFunctionMatch = standaloneFunctionRegex.exec(content)) !== null) { const name = standaloneFunctionMatch[1]; - // Check if this function has already been processed as a method - if (!functions.some(f => f.name === name)) { + if (!functions.some(f => f.name === name && f.isMethod)) { const params = parseParameters(standaloneFunctionMatch[2]); const returnType = (standaloneFunctionMatch[3] || '').replace(/[\[:;,.]$/g, '').replace(/^[\[:;,.]/g, ''); - // Extract the comment as description TODO multiline comments let description = ''; const descriptionMatch = content.substring(0, standaloneFunctionMatch.index).match(/\/\/\s*(.*)\n\s*$/); if (descriptionMatch) { From 44df32989ef7dae4050354f4d2308b58a9543377 Mon Sep 17 00:00:00 2001 From: Cat McGee Date: Mon, 15 Jan 2024 20:23:09 +0900 Subject: [PATCH 03/18] reference --- .../syntax/aztecnr-reference/address_note.md | 113 ++++++++++++++++++ .../aztecnr-reference/authwit/account.md | 79 ++++++++++++ .../syntax/aztecnr-reference/authwit/auth.md | 3 + .../aztecnr-reference/authwit/auth_witness.md | 55 +++++++++ .../aztecnr-reference/authwit/entrypoint.md | 69 +++++++++++ .../syntax/aztecnr-reference/aztec/abi.md | 0 .../syntax/aztecnr-reference/aztec/address.md | 0 .../syntax/aztecnr-reference/aztec/context.md | 0 .../syntax/aztecnr-reference/aztec/hash.md | 0 .../aztec/history/contract_inclusion.md | 22 ++++ .../aztec/history/note_inclusion.md | 30 +++++ .../aztec/history/note_validity.md | 20 ++++ .../aztec/history/nullifier_non_inclusion.md | 30 +++++ .../aztec/history/nulllifer_inclusion.md | 0 .../aztec/history/public_value_inclusion.md | 0 .../syntax/aztecnr-reference/aztec/log.md | 0 .../aztecnr-reference/aztec/messaging.md | 0 .../syntax/aztecnr-reference/aztec/note.md | 0 .../syntax/aztecnr-reference/aztec/oracle.md | 0 .../aztecnr-reference/aztec/selector.md | 0 .../aztecnr-reference/aztec/state_vars.md | 0 .../syntax/aztecnr-reference/aztec/types.md | 0 .../aztecnr-reference/easy_private_state.md | 0 .../syntax/aztecnr-reference/field_note.md | 0 .../syntax/aztecnr-reference/safe_math.md | 0 .../aztecnr-reference/slow_updates_tree.md | 0 .../value_note/balance_utils.md | 0 .../aztecnr-reference/value_note/filter.md | 0 .../value_note/value_note.md | 0 docs/sidebars.js | 53 +++++++- 30 files changed, 473 insertions(+), 1 deletion(-) create mode 100644 docs/docs/dev_docs/contracts/syntax/aztecnr-reference/address_note.md create mode 100644 docs/docs/dev_docs/contracts/syntax/aztecnr-reference/authwit/account.md create mode 100644 docs/docs/dev_docs/contracts/syntax/aztecnr-reference/authwit/auth.md create mode 100644 docs/docs/dev_docs/contracts/syntax/aztecnr-reference/authwit/auth_witness.md create mode 100644 docs/docs/dev_docs/contracts/syntax/aztecnr-reference/authwit/entrypoint.md create mode 100644 docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/abi.md create mode 100644 docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/address.md create mode 100644 docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/context.md create mode 100644 docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/hash.md create mode 100644 docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/history/contract_inclusion.md create mode 100644 docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/history/note_inclusion.md create mode 100644 docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/history/note_validity.md create mode 100644 docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/history/nullifier_non_inclusion.md create mode 100644 docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/history/nulllifer_inclusion.md create mode 100644 docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/history/public_value_inclusion.md create mode 100644 docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/log.md create mode 100644 docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/messaging.md create mode 100644 docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/note.md create mode 100644 docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/oracle.md create mode 100644 docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/selector.md create mode 100644 docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/state_vars.md create mode 100644 docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/types.md create mode 100644 docs/docs/dev_docs/contracts/syntax/aztecnr-reference/easy_private_state.md create mode 100644 docs/docs/dev_docs/contracts/syntax/aztecnr-reference/field_note.md create mode 100644 docs/docs/dev_docs/contracts/syntax/aztecnr-reference/safe_math.md create mode 100644 docs/docs/dev_docs/contracts/syntax/aztecnr-reference/slow_updates_tree.md create mode 100644 docs/docs/dev_docs/contracts/syntax/aztecnr-reference/value_note/balance_utils.md create mode 100644 docs/docs/dev_docs/contracts/syntax/aztecnr-reference/value_note/filter.md create mode 100644 docs/docs/dev_docs/contracts/syntax/aztecnr-reference/value_note/value_note.md diff --git a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/address_note.md b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/address_note.md new file mode 100644 index 00000000000..c43439aef1a --- /dev/null +++ b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/address_note.md @@ -0,0 +1,113 @@ +--- +title: Address Note +--- + +Stores an address along with its associated details. + +## Struct Fields +| Field Name | Type | Description | +|------------|----------------|-----------------------| +| address | AztecAddress | The Aztec address | +| owner | AztecAddress | Owner of the address | +| randomness | Field | Randomness value | +| header | NoteHeader | Note header | + +## Methods + +### new +Creates a new `AddressNote` instance. +#### Arguments +| Argument Name | Type | Description | +|---------------|---------------|-----------------------| +| address | AztecAddress | The Aztec address | +| owner | AztecAddress | Owner of the address | + +### serialize +Serializes the `AddressNote` into an array of Fields. +#### Returns +| Return Name | Type | +|-------------|--------------------| +| | [Field; ADDRESS_NOTE_LEN] | + +### deserialize +Deserializes an array of Fields into an `AddressNote`. +#### Arguments +| Argument Name | Type | Description | +|---------------|--------------------|-----------------------| +| serialized_note | [Field; ADDRESS_NOTE_LEN] | Serialized note | + +### compute_note_hash +Computes a hash for the `AddressNote`. +#### Returns +| Return Name | Type | +|-------------|--------------------| +| | Field | + +### compute_nullifier +Computes a nullifier for the `AddressNote`. +#### Returns +| Return Name | Type | +|-------------|--------------------| +| | Field | + +### set_header +Sets the header of the `AddressNote`. +#### Arguments +| Argument Name | Type | Description | +|---------------|---------------|-------------------| +| header | NoteHeader | New note header | + +### broadcast +Broadcasts the note as an encrypted log on L1. +#### Arguments +| Argument Name | Type | Description | +|---------------|-------------------|---------------------------| +| context | &mut PrivateContext | Context for the operation | +| slot | Field | Slot for broadcasting | + +## Global Functions + +### deserialize +#### Arguments +| Argument Name | Type | Description | +|---------------|--------------------|-----------------------| +| serialized_note | [Field; ADDRESS_NOTE_LEN] | Serialized note | + +### serialize +#### Arguments +| Argument Name | Type | Description | +|---------------|--------------|---------------| +| note | AddressNote | Note to serialize | + +### compute_note_hash +#### Arguments +| Argument Name | Type | Description | +|---------------|--------------|---------------| +| note | AddressNote | Note to compute hash for | + +### compute_nullifier +#### Arguments +| Argument Name | Type | Description | +|---------------|--------------|---------------| +| note | AddressNote | Note to compute nullifier for | + +### get_header +#### Arguments +| Argument Name | Type | Description | +|---------------|--------------|---------------| +| note | AddressNote | Note to get header from | + +### set_header +#### Arguments +| Argument Name | Type | Description | +|---------------|--------------|---------------| +| note | &mut AddressNote | Note to set header for | +| header | NoteHeader | New note header | + +### broadcast +#### Arguments +| Argument Name | Type | Description | +|---------------|-------------------|---------------------------| +| context | &mut PrivateContext | Context for the operation | +| slot | Field | Slot for broadcasting | +| note | AddressNote | Note to broadcast | diff --git a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/authwit/account.md b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/authwit/account.md new file mode 100644 index 00000000000..44dec69b673 --- /dev/null +++ b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/authwit/account.md @@ -0,0 +1,79 @@ +--- +title: Account +--- + +# AccountActions +Manages account actions handling both private and public contexts. + +## Struct Fields +| Field Name | Type | Description | +|--------------------------|---------------------------------------------------------|-----------------------------------| +| context | Context | General context for actions | +| is_valid_impl | fn(&mut PrivateContext, Field) -> bool | Function to validate actions | +| approved_action | Map> | Map of approved actions | + +## Methods + +### init +Initializes an `AccountActions` instance. +#### Arguments +| Argument Name | Type | Description | +|-----------------------------|-------------------------------------------------------|-----------------------------------| +| context | Context | General context for actions | +| approved_action_storage_slot| Field | Storage slot for approved actions | +| is_valid_impl | fn(&mut PrivateContext, Field) -> bool | Function to validate actions | + +### private +Initializes an `AccountActions` instance in a private context. +#### Arguments +| Argument Name | Type | Description | +|-----------------------------|-------------------------------------------------------|-----------------------------------| +| context | &mut PrivateContext | Private context for the action | +| approved_action_storage_slot| Field | Storage slot for approved actions | +| is_valid_impl | fn(&mut PrivateContext, Field) -> bool | Function to validate actions | + +### public +Initializes an `AccountActions` instance in a public context. +#### Arguments +| Argument Name | Type | Description | +|-----------------------------|-------------------------------------------------------|-----------------------------------| +| context | &mut PublicContext | Public context for the action | +| approved_action_storage_slot| Field | Storage slot for approved actions | +| is_valid_impl | fn(&mut PrivateContext, Field) -> bool | Function to validate actions | + +### entrypoint +Executes the entrypoint for an action. +#### Arguments +| Argument Name | Type | Description | +|-----------------------------|-------------------------------------------------------|-----------------------------------| +| payload | EntrypointPayload | Payload for the action | + +### is_valid +Checks if an action is valid in a private context. +#### Arguments +| Argument Name | Type | Description | +|-----------------------------|-------------------------------------------------------|-----------------------------------| +| message_hash | Field | Hash of the message to validate | +#### Returns +| Return Name | Type | +|-------------|--------------------| +| | Field | + +### is_valid_public +Checks if an action is valid in a public context. +#### Arguments +| Argument Name | Type | Description | +|-----------------------------|-------------------------------------------------------|-----------------------------------| +| message_hash | Field | Hash of the message to validate | +#### Returns +| Return Name | Type | +|-------------|--------------------| +| | Field | + +### internal_set_is_valid_storage +Sets the validity of an action in the storage. +#### Arguments +| Argument Name | Type | Description | +|-----------------------------|-------------------------------------------------------|-----------------------------------| +| message_hash | Field | Hash of the message to validate | +| value | bool | Value to set for validity | diff --git a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/authwit/auth.md b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/authwit/auth.md new file mode 100644 index 00000000000..2044acc18f5 --- /dev/null +++ b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/authwit/auth.md @@ -0,0 +1,3 @@ +--- +title: Auth +--- diff --git a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/authwit/auth_witness.md b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/authwit/auth_witness.md new file mode 100644 index 00000000000..d4a925dcd80 --- /dev/null +++ b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/authwit/auth_witness.md @@ -0,0 +1,55 @@ +--- +title: Auth Witness +--- + +# assert_valid_authwit +Asserts that `on_behalf_of` has authorized `message_hash` with a valid authentication witness in a private context. +## Arguments +| Argument Name | Type | Description | +|----------------|-------------------|------------------------------------------| +| context | &mut PrivateContext | Context for executing the assertion | +| on_behalf_of | AztecAddress | Address on behalf of which to assert | +| message_hash | Field | Hash of the message to authorize | + +# assert_current_call_valid_authwit +Asserts that `on_behalf_of` has authorized the current call with a valid authentication witness in a private context. +## Arguments +| Argument Name | Type | Description | +|----------------|-------------------|------------------------------------------| +| context | &mut PrivateContext | Context for executing the assertion | +| on_behalf_of | AztecAddress | Address on behalf of which to assert | + +# assert_valid_authwit_public +Asserts that `on_behalf_of` has authorized `message_hash` with a valid authentication witness in a public context. +## Arguments +| Argument Name | Type | Description | +|----------------|------------------|------------------------------------------| +| context | &mut PublicContext | Context for executing the assertion | +| on_behalf_of | AztecAddress | Address on behalf of which to assert | +| message_hash | Field | Hash of the message to authorize | + +# assert_current_call_valid_authwit_public +Asserts that `on_behalf_of` has authorized the current call with a valid authentication witness in a public context. +## Arguments +| Argument Name | Type | Description | +|----------------|------------------|------------------------------------------| +| context | &mut PublicContext | Context for executing the assertion | +| on_behalf_of | AztecAddress | Address on behalf of which to assert | + +# compute_authwit_message_hash +Computes the message hash to be used by an authentication witness. +## Type Parameters +| Type Parameter | Description | +|----------------|-----------------------------------------| +| N | The length of the array in arguments | +## Arguments +| Argument Name | Type | Description | +|----------------|-------------------|------------------------------------------| +| caller | AztecAddress | Address of the caller | +| target | AztecAddress | Target address | +| selector | FunctionSelector | Selector for the function | +| args | [Field; N] | Arguments for the function | +## Returns +| Return Name | Type | +|----------------|-------------------| +| | Field | diff --git a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/authwit/entrypoint.md b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/authwit/entrypoint.md new file mode 100644 index 00000000000..000a624419e --- /dev/null +++ b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/authwit/entrypoint.md @@ -0,0 +1,69 @@ +--- +title: Entrypoint +--- + +# FunctionCall +Represents a function call. + +## Struct Fields +| Field Name | Type | Description | +|--------------------|-------------------|-------------------------| +| args_hash | Field | Hash of the arguments | +| function_selector | FunctionSelector | Selector for the function | +| target_address | AztecAddress | Address of the target | +| is_public | bool | Whether the call is public | + +## Methods + +### serialize +Serializes the `FunctionCall` into an array of Fields. +#### Returns +| Return Name | Type | +|-------------|------------------------------| +| | [Field; FUNCTION_CALL_SIZE] | + +### to_be_bytes +Converts the `FunctionCall` into a byte array. +#### Returns +| Return Name | Type | +|-------------|------------------------------------| +| | [u8; FUNCTION_CALL_SIZE_IN_BYTES] | + +# EntrypointPayload +Encapsulates function calls for the entrypoint. + +## Struct Fields +| Field Name | Type | Description | +|-----------------|--------------------------------|-----------------------------| +| function_calls | [FunctionCall; ACCOUNT_MAX_CALLS] | Array of function calls | +| nonce | Field | Nonce for the payload | + +## Methods + +### hash +Computes a hash of the `EntrypointPayload`. +#### Returns +| Return Name | Type | +|-------------|--------------| +| | Field | + +### serialize +Serializes the `EntrypointPayload` into an array of Fields. +#### Returns +| Return Name | Type | +|-------------|----------------------------------| +| | [Field; ENTRYPOINT_PAYLOAD_SIZE] | + +### to_be_bytes +Converts the `EntrypointPayload` into a byte array. +#### Returns +| Return Name | Type | +|-------------|-----------------------------------------| +| | [u8; ENTRYPOINT_PAYLOAD_SIZE_IN_BYTES] | + +### execute_calls +Executes all private and public calls in the payload. +#### Arguments +| Argument Name | Type | Description | +|----------------|---------------------|-----------------------------| +| context | &mut PrivateContext | Context for executing calls | diff --git a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/abi.md b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/abi.md new file mode 100644 index 00000000000..e69de29bb2d diff --git a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/address.md b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/address.md new file mode 100644 index 00000000000..e69de29bb2d diff --git a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/context.md b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/context.md new file mode 100644 index 00000000000..e69de29bb2d diff --git a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/hash.md b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/hash.md new file mode 100644 index 00000000000..e69de29bb2d diff --git a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/history/contract_inclusion.md b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/history/contract_inclusion.md new file mode 100644 index 00000000000..b5ffcbcf238 --- /dev/null +++ b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/history/contract_inclusion.md @@ -0,0 +1,22 @@ +--- +title: Contract inclusion +--- + +# prove_contract_inclusion +Proves that a contract exists at a specified block number and returns its address. It can be used to approximate a factory pattern, verifying that a contract at a given address matches expected constructor arguments. + +## Arguments +| Argument Name | Type | Description | +|-------------------------|----------------|---------------------------------------------------| +| deployer_public_key | Point | Public key of the deployer | +| contract_address_salt | Field | Salt used for the contract address | +| function_tree_root | Field | Root of the function tree | +| constructor_hash | Field | Hash of the constructor | +| portal_contract_address | EthAddress | Ethereum address of the portal contract | +| block_number | u32 | Block number to prove the contract's existence | +| context | PrivateContext | Context for executing the proof | + +## Returns +| Return Name | Type | +|------------------|--------------| +| | AztecAddress | diff --git a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/history/note_inclusion.md b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/history/note_inclusion.md new file mode 100644 index 00000000000..5e03d3a5ef0 --- /dev/null +++ b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/history/note_inclusion.md @@ -0,0 +1,30 @@ +--- +title: Note inclusion +--- + +# prove_note_commitment_inclusion +Proves the inclusion of a note commitment in a specific block. Validates that the given note commitment is part of the note hash tree at a specified block number. + +## Arguments +| Argument Name | Type | Description | +|------------------|----------------|------------------------------------------------------| +| note_commitment | Field | The note commitment to be proven | +| block_number | u32 | Block number at which the note's existence is proved | +| context | PrivateContext | Context for executing the proof | + +# prove_note_inclusion +Proves the inclusion of a note in a specific block by computing its unique siloed note hash and then proving its commitment inclusion. This function uses a provided note interface to handle specific note types. + +## Type Parameters +| Type Parameter | Description | +|----------------|--------------------------------------------------| +| Note | The type of note being proven | +| N | The length of the array in the note interface | + +## Arguments +| Argument Name | Type | Description | +|------------------|--------------------------------|------------------------------------------------------| +| note_interface | NoteInterface | Interface for handling note-related operations | +| note_with_header | Note | The note whose inclusion is to be proven | +| block_number | u32 | Block number at which the note's existence is proved | +| context | PrivateContext | Context for executing the proof | diff --git a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/history/note_validity.md b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/history/note_validity.md new file mode 100644 index 00000000000..33fbab4d3a0 --- /dev/null +++ b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/history/note_validity.md @@ -0,0 +1,20 @@ +--- +title: Note validity +--- + +# prove_note_validity +Proves the validity of a note at a specified block number. It ensures that the note exists at that block number and has not been nullified. + +## Type Parameters +| Type Parameter | Description | +|----------------|--------------------------------------------------| +| Note | The type of note being proven | +| N | The length of the array in the note interface | + +## Arguments +| Argument Name | Type | Description | +|------------------|--------------------------------|------------------------------------------------------| +| note_interface | NoteInterface | Interface for handling note-related operations | +| note_with_header | Note | The note whose validity is to be proven | +| block_number | u32 | Block number at which the note's validity is proved | +| context | PrivateContext | Context for executing the proof | diff --git a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/history/nullifier_non_inclusion.md b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/history/nullifier_non_inclusion.md new file mode 100644 index 00000000000..9a06068c889 --- /dev/null +++ b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/history/nullifier_non_inclusion.md @@ -0,0 +1,30 @@ +--- +title: Nullifier non-inclusion +--- + +# prove_nullifier_non_inclusion +Proves that a nullifier does not exist at a specified block number. This function ensures that the nullifier is not part of the nullifier tree at that block. + +## Arguments +| Argument Name | Type | Description | +|---------------|----------------|--------------------------------------------------| +| nullifier | Field | The nullifier to be proven non-existent | +| block_number | u32 | Block number at which to prove non-existence | +| context | PrivateContext | Context for executing the proof | + +# prove_note_not_nullified +Proves that a note was not nullified at a specified block number by computing its nullifier and then proving the nullifier's non-inclusion. + +## Type Parameters +| Type Parameter | Description | +|----------------|--------------------------------------------------| +| Note | The type of note being proven | +| N | The length of the array in the note interface | + +## Arguments +| Argument Name | Type | Description | +|------------------|-------------------------|----------------------------------------------------| +| note_interface | NoteInterface | Interface for handling note-related operations | +| note_with_header | Note | The note whose non-nullification is to be proven | +| block_number | u32 | Block number at which the note's non-nullification is proved | +| context | PrivateContext | Context for executing the proof | diff --git a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/history/nulllifer_inclusion.md b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/history/nulllifer_inclusion.md new file mode 100644 index 00000000000..e69de29bb2d diff --git a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/history/public_value_inclusion.md b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/history/public_value_inclusion.md new file mode 100644 index 00000000000..e69de29bb2d diff --git a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/log.md b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/log.md new file mode 100644 index 00000000000..e69de29bb2d diff --git a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/messaging.md b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/messaging.md new file mode 100644 index 00000000000..e69de29bb2d diff --git a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/note.md b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/note.md new file mode 100644 index 00000000000..e69de29bb2d diff --git a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/oracle.md b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/oracle.md new file mode 100644 index 00000000000..e69de29bb2d diff --git a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/selector.md b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/selector.md new file mode 100644 index 00000000000..e69de29bb2d diff --git a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/state_vars.md b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/state_vars.md new file mode 100644 index 00000000000..e69de29bb2d diff --git a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/types.md b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/types.md new file mode 100644 index 00000000000..e69de29bb2d diff --git a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/easy_private_state.md b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/easy_private_state.md new file mode 100644 index 00000000000..e69de29bb2d diff --git a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/field_note.md b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/field_note.md new file mode 100644 index 00000000000..e69de29bb2d diff --git a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/safe_math.md b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/safe_math.md new file mode 100644 index 00000000000..e69de29bb2d diff --git a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/slow_updates_tree.md b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/slow_updates_tree.md new file mode 100644 index 00000000000..e69de29bb2d diff --git a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/value_note/balance_utils.md b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/value_note/balance_utils.md new file mode 100644 index 00000000000..e69de29bb2d diff --git a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/value_note/filter.md b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/value_note/filter.md new file mode 100644 index 00000000000..e69de29bb2d diff --git a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/value_note/value_note.md b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/value_note/value_note.md new file mode 100644 index 00000000000..e69de29bb2d diff --git a/docs/sidebars.js b/docs/sidebars.js index 4eb6dbdcac7..daa60282182 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -375,6 +375,7 @@ const sidebars = { }, ], }, + // { // label: "Security Considerations", // type: "category", @@ -449,9 +450,59 @@ const sidebars = { "dev_docs/limitations/main", { - label: "API Reference", + label: "Reference", type: "category", items: [ + { + label: "Aztec.nr Reference", + type: "category", + + items: [ + "dev_docs/contracts/syntax/aztecnr-reference/address_note", + { + label: "Authwit", + type: "category", + items: [ + "dev_docs/contracts/syntax/aztecnr-reference/authwit/account", + "dev_docs/contracts/syntax/aztecnr-reference/authwit/auth_witness", + "dev_docs/contracts/syntax/aztecnr-reference/authwit/auth", + "dev_docs/contracts/syntax/aztecnr-reference/authwit/entrypoint", + ], + }, + { + label: "Aztec", + type: "category", + items: [ + "dev_docs/contracts/syntax/aztecnr-reference/aztec/abi", + "dev_docs/contracts/syntax/aztecnr-reference/aztec/address", + "dev_docs/contracts/syntax/aztecnr-reference/aztec/context", + "dev_docs/contracts/syntax/aztecnr-reference/aztec/hash", + "dev_docs/contracts/syntax/aztecnr-reference/aztec/log", + "dev_docs/contracts/syntax/aztecnr-reference/aztec/messaging", + "dev_docs/contracts/syntax/aztecnr-reference/aztec/note", + "dev_docs/contracts/syntax/aztecnr-reference/aztec/oracle", + "dev_docs/contracts/syntax/aztecnr-reference/aztec/selector", + "dev_docs/contracts/syntax/aztecnr-reference/aztec/state_vars", + "dev_docs/contracts/syntax/aztecnr-reference/aztec/types", + ], + }, + "dev_docs/contracts/syntax/aztecnr-reference/easy_private_state", + "dev_docs/contracts/syntax/aztecnr-reference/field_note", + "dev_docs/contracts/syntax/aztecnr-reference/safe_math", + "dev_docs/contracts/syntax/aztecnr-reference/slow_updates_tree", + { + label: "Value Note", + type: "category", + items: [ + "dev_docs/contracts/syntax/aztecnr-reference/value_note/balance_utils", + "dev_docs/contracts/syntax/aztecnr-reference/value_note/filter", + "dev_docs/contracts/syntax/aztecnr-reference/value_note/value_note", + ], + }, + + + ], + }, { label: "Private Execution Environment (PXE)", type: "doc", From 5a745d5304c888df9ed7a4494093959a68cbb223 Mon Sep 17 00:00:00 2001 From: Cat McGee Date: Tue, 6 Feb 2024 18:29:34 +0900 Subject: [PATCH 04/18] update script --- .../syntax/aztecnr-reference/address_note.md | 113 ------------------ .../aztecnr-reference/authwit/account.md | 79 ------------ .../syntax/aztecnr-reference/authwit/auth.md | 3 - .../aztecnr-reference/authwit/auth_witness.md | 55 --------- .../aztecnr-reference/authwit/entrypoint.md | 69 ----------- .../syntax/aztecnr-reference/aztec/abi.md | 0 .../syntax/aztecnr-reference/aztec/address.md | 0 .../syntax/aztecnr-reference/aztec/context.md | 0 .../syntax/aztecnr-reference/aztec/hash.md | 0 .../aztec/history/contract_inclusion.md | 22 ---- .../aztec/history/note_inclusion.md | 30 ----- .../aztec/history/note_validity.md | 20 ---- .../aztec/history/nullifier_non_inclusion.md | 30 ----- .../aztec/history/nulllifer_inclusion.md | 0 .../aztec/history/public_value_inclusion.md | 0 .../syntax/aztecnr-reference/aztec/log.md | 0 .../aztecnr-reference/aztec/messaging.md | 0 .../syntax/aztecnr-reference/aztec/note.md | 0 .../syntax/aztecnr-reference/aztec/oracle.md | 0 .../aztecnr-reference/aztec/selector.md | 0 .../aztecnr-reference/aztec/state_vars.md | 0 .../syntax/aztecnr-reference/aztec/types.md | 0 .../aztecnr-reference/easy_private_state.md | 0 .../syntax/aztecnr-reference/field_note.md | 0 .../syntax/aztecnr-reference/safe_math.md | 0 .../aztecnr-reference/slow_updates_tree.md | 0 .../value_note/balance_utils.md | 0 .../aztecnr-reference/value_note/filter.md | 0 .../value_note/value_note.md | 0 docs/scripts/build.sh | 3 + docs/sidebars.js | 57 ++------- .../preprocess/generate_aztecnr_reference.js | 102 +++++++++++----- 32 files changed, 86 insertions(+), 497 deletions(-) delete mode 100644 docs/docs/dev_docs/contracts/syntax/aztecnr-reference/address_note.md delete mode 100644 docs/docs/dev_docs/contracts/syntax/aztecnr-reference/authwit/account.md delete mode 100644 docs/docs/dev_docs/contracts/syntax/aztecnr-reference/authwit/auth.md delete mode 100644 docs/docs/dev_docs/contracts/syntax/aztecnr-reference/authwit/auth_witness.md delete mode 100644 docs/docs/dev_docs/contracts/syntax/aztecnr-reference/authwit/entrypoint.md delete mode 100644 docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/abi.md delete mode 100644 docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/address.md delete mode 100644 docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/context.md delete mode 100644 docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/hash.md delete mode 100644 docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/history/contract_inclusion.md delete mode 100644 docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/history/note_inclusion.md delete mode 100644 docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/history/note_validity.md delete mode 100644 docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/history/nullifier_non_inclusion.md delete mode 100644 docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/history/nulllifer_inclusion.md delete mode 100644 docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/history/public_value_inclusion.md delete mode 100644 docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/log.md delete mode 100644 docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/messaging.md delete mode 100644 docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/note.md delete mode 100644 docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/oracle.md delete mode 100644 docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/selector.md delete mode 100644 docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/state_vars.md delete mode 100644 docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/types.md delete mode 100644 docs/docs/dev_docs/contracts/syntax/aztecnr-reference/easy_private_state.md delete mode 100644 docs/docs/dev_docs/contracts/syntax/aztecnr-reference/field_note.md delete mode 100644 docs/docs/dev_docs/contracts/syntax/aztecnr-reference/safe_math.md delete mode 100644 docs/docs/dev_docs/contracts/syntax/aztecnr-reference/slow_updates_tree.md delete mode 100644 docs/docs/dev_docs/contracts/syntax/aztecnr-reference/value_note/balance_utils.md delete mode 100644 docs/docs/dev_docs/contracts/syntax/aztecnr-reference/value_note/filter.md delete mode 100644 docs/docs/dev_docs/contracts/syntax/aztecnr-reference/value_note/value_note.md diff --git a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/address_note.md b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/address_note.md deleted file mode 100644 index c43439aef1a..00000000000 --- a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/address_note.md +++ /dev/null @@ -1,113 +0,0 @@ ---- -title: Address Note ---- - -Stores an address along with its associated details. - -## Struct Fields -| Field Name | Type | Description | -|------------|----------------|-----------------------| -| address | AztecAddress | The Aztec address | -| owner | AztecAddress | Owner of the address | -| randomness | Field | Randomness value | -| header | NoteHeader | Note header | - -## Methods - -### new -Creates a new `AddressNote` instance. -#### Arguments -| Argument Name | Type | Description | -|---------------|---------------|-----------------------| -| address | AztecAddress | The Aztec address | -| owner | AztecAddress | Owner of the address | - -### serialize -Serializes the `AddressNote` into an array of Fields. -#### Returns -| Return Name | Type | -|-------------|--------------------| -| | [Field; ADDRESS_NOTE_LEN] | - -### deserialize -Deserializes an array of Fields into an `AddressNote`. -#### Arguments -| Argument Name | Type | Description | -|---------------|--------------------|-----------------------| -| serialized_note | [Field; ADDRESS_NOTE_LEN] | Serialized note | - -### compute_note_hash -Computes a hash for the `AddressNote`. -#### Returns -| Return Name | Type | -|-------------|--------------------| -| | Field | - -### compute_nullifier -Computes a nullifier for the `AddressNote`. -#### Returns -| Return Name | Type | -|-------------|--------------------| -| | Field | - -### set_header -Sets the header of the `AddressNote`. -#### Arguments -| Argument Name | Type | Description | -|---------------|---------------|-------------------| -| header | NoteHeader | New note header | - -### broadcast -Broadcasts the note as an encrypted log on L1. -#### Arguments -| Argument Name | Type | Description | -|---------------|-------------------|---------------------------| -| context | &mut PrivateContext | Context for the operation | -| slot | Field | Slot for broadcasting | - -## Global Functions - -### deserialize -#### Arguments -| Argument Name | Type | Description | -|---------------|--------------------|-----------------------| -| serialized_note | [Field; ADDRESS_NOTE_LEN] | Serialized note | - -### serialize -#### Arguments -| Argument Name | Type | Description | -|---------------|--------------|---------------| -| note | AddressNote | Note to serialize | - -### compute_note_hash -#### Arguments -| Argument Name | Type | Description | -|---------------|--------------|---------------| -| note | AddressNote | Note to compute hash for | - -### compute_nullifier -#### Arguments -| Argument Name | Type | Description | -|---------------|--------------|---------------| -| note | AddressNote | Note to compute nullifier for | - -### get_header -#### Arguments -| Argument Name | Type | Description | -|---------------|--------------|---------------| -| note | AddressNote | Note to get header from | - -### set_header -#### Arguments -| Argument Name | Type | Description | -|---------------|--------------|---------------| -| note | &mut AddressNote | Note to set header for | -| header | NoteHeader | New note header | - -### broadcast -#### Arguments -| Argument Name | Type | Description | -|---------------|-------------------|---------------------------| -| context | &mut PrivateContext | Context for the operation | -| slot | Field | Slot for broadcasting | -| note | AddressNote | Note to broadcast | diff --git a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/authwit/account.md b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/authwit/account.md deleted file mode 100644 index 44dec69b673..00000000000 --- a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/authwit/account.md +++ /dev/null @@ -1,79 +0,0 @@ ---- -title: Account ---- - -# AccountActions -Manages account actions handling both private and public contexts. - -## Struct Fields -| Field Name | Type | Description | -|--------------------------|---------------------------------------------------------|-----------------------------------| -| context | Context | General context for actions | -| is_valid_impl | fn(&mut PrivateContext, Field) -> bool | Function to validate actions | -| approved_action | Map> | Map of approved actions | - -## Methods - -### init -Initializes an `AccountActions` instance. -#### Arguments -| Argument Name | Type | Description | -|-----------------------------|-------------------------------------------------------|-----------------------------------| -| context | Context | General context for actions | -| approved_action_storage_slot| Field | Storage slot for approved actions | -| is_valid_impl | fn(&mut PrivateContext, Field) -> bool | Function to validate actions | - -### private -Initializes an `AccountActions` instance in a private context. -#### Arguments -| Argument Name | Type | Description | -|-----------------------------|-------------------------------------------------------|-----------------------------------| -| context | &mut PrivateContext | Private context for the action | -| approved_action_storage_slot| Field | Storage slot for approved actions | -| is_valid_impl | fn(&mut PrivateContext, Field) -> bool | Function to validate actions | - -### public -Initializes an `AccountActions` instance in a public context. -#### Arguments -| Argument Name | Type | Description | -|-----------------------------|-------------------------------------------------------|-----------------------------------| -| context | &mut PublicContext | Public context for the action | -| approved_action_storage_slot| Field | Storage slot for approved actions | -| is_valid_impl | fn(&mut PrivateContext, Field) -> bool | Function to validate actions | - -### entrypoint -Executes the entrypoint for an action. -#### Arguments -| Argument Name | Type | Description | -|-----------------------------|-------------------------------------------------------|-----------------------------------| -| payload | EntrypointPayload | Payload for the action | - -### is_valid -Checks if an action is valid in a private context. -#### Arguments -| Argument Name | Type | Description | -|-----------------------------|-------------------------------------------------------|-----------------------------------| -| message_hash | Field | Hash of the message to validate | -#### Returns -| Return Name | Type | -|-------------|--------------------| -| | Field | - -### is_valid_public -Checks if an action is valid in a public context. -#### Arguments -| Argument Name | Type | Description | -|-----------------------------|-------------------------------------------------------|-----------------------------------| -| message_hash | Field | Hash of the message to validate | -#### Returns -| Return Name | Type | -|-------------|--------------------| -| | Field | - -### internal_set_is_valid_storage -Sets the validity of an action in the storage. -#### Arguments -| Argument Name | Type | Description | -|-----------------------------|-------------------------------------------------------|-----------------------------------| -| message_hash | Field | Hash of the message to validate | -| value | bool | Value to set for validity | diff --git a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/authwit/auth.md b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/authwit/auth.md deleted file mode 100644 index 2044acc18f5..00000000000 --- a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/authwit/auth.md +++ /dev/null @@ -1,3 +0,0 @@ ---- -title: Auth ---- diff --git a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/authwit/auth_witness.md b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/authwit/auth_witness.md deleted file mode 100644 index d4a925dcd80..00000000000 --- a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/authwit/auth_witness.md +++ /dev/null @@ -1,55 +0,0 @@ ---- -title: Auth Witness ---- - -# assert_valid_authwit -Asserts that `on_behalf_of` has authorized `message_hash` with a valid authentication witness in a private context. -## Arguments -| Argument Name | Type | Description | -|----------------|-------------------|------------------------------------------| -| context | &mut PrivateContext | Context for executing the assertion | -| on_behalf_of | AztecAddress | Address on behalf of which to assert | -| message_hash | Field | Hash of the message to authorize | - -# assert_current_call_valid_authwit -Asserts that `on_behalf_of` has authorized the current call with a valid authentication witness in a private context. -## Arguments -| Argument Name | Type | Description | -|----------------|-------------------|------------------------------------------| -| context | &mut PrivateContext | Context for executing the assertion | -| on_behalf_of | AztecAddress | Address on behalf of which to assert | - -# assert_valid_authwit_public -Asserts that `on_behalf_of` has authorized `message_hash` with a valid authentication witness in a public context. -## Arguments -| Argument Name | Type | Description | -|----------------|------------------|------------------------------------------| -| context | &mut PublicContext | Context for executing the assertion | -| on_behalf_of | AztecAddress | Address on behalf of which to assert | -| message_hash | Field | Hash of the message to authorize | - -# assert_current_call_valid_authwit_public -Asserts that `on_behalf_of` has authorized the current call with a valid authentication witness in a public context. -## Arguments -| Argument Name | Type | Description | -|----------------|------------------|------------------------------------------| -| context | &mut PublicContext | Context for executing the assertion | -| on_behalf_of | AztecAddress | Address on behalf of which to assert | - -# compute_authwit_message_hash -Computes the message hash to be used by an authentication witness. -## Type Parameters -| Type Parameter | Description | -|----------------|-----------------------------------------| -| N | The length of the array in arguments | -## Arguments -| Argument Name | Type | Description | -|----------------|-------------------|------------------------------------------| -| caller | AztecAddress | Address of the caller | -| target | AztecAddress | Target address | -| selector | FunctionSelector | Selector for the function | -| args | [Field; N] | Arguments for the function | -## Returns -| Return Name | Type | -|----------------|-------------------| -| | Field | diff --git a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/authwit/entrypoint.md b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/authwit/entrypoint.md deleted file mode 100644 index 000a624419e..00000000000 --- a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/authwit/entrypoint.md +++ /dev/null @@ -1,69 +0,0 @@ ---- -title: Entrypoint ---- - -# FunctionCall -Represents a function call. - -## Struct Fields -| Field Name | Type | Description | -|--------------------|-------------------|-------------------------| -| args_hash | Field | Hash of the arguments | -| function_selector | FunctionSelector | Selector for the function | -| target_address | AztecAddress | Address of the target | -| is_public | bool | Whether the call is public | - -## Methods - -### serialize -Serializes the `FunctionCall` into an array of Fields. -#### Returns -| Return Name | Type | -|-------------|------------------------------| -| | [Field; FUNCTION_CALL_SIZE] | - -### to_be_bytes -Converts the `FunctionCall` into a byte array. -#### Returns -| Return Name | Type | -|-------------|------------------------------------| -| | [u8; FUNCTION_CALL_SIZE_IN_BYTES] | - -# EntrypointPayload -Encapsulates function calls for the entrypoint. - -## Struct Fields -| Field Name | Type | Description | -|-----------------|--------------------------------|-----------------------------| -| function_calls | [FunctionCall; ACCOUNT_MAX_CALLS] | Array of function calls | -| nonce | Field | Nonce for the payload | - -## Methods - -### hash -Computes a hash of the `EntrypointPayload`. -#### Returns -| Return Name | Type | -|-------------|--------------| -| | Field | - -### serialize -Serializes the `EntrypointPayload` into an array of Fields. -#### Returns -| Return Name | Type | -|-------------|----------------------------------| -| | [Field; ENTRYPOINT_PAYLOAD_SIZE] | - -### to_be_bytes -Converts the `EntrypointPayload` into a byte array. -#### Returns -| Return Name | Type | -|-------------|-----------------------------------------| -| | [u8; ENTRYPOINT_PAYLOAD_SIZE_IN_BYTES] | - -### execute_calls -Executes all private and public calls in the payload. -#### Arguments -| Argument Name | Type | Description | -|----------------|---------------------|-----------------------------| -| context | &mut PrivateContext | Context for executing calls | diff --git a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/abi.md b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/abi.md deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/address.md b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/address.md deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/context.md b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/context.md deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/hash.md b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/hash.md deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/history/contract_inclusion.md b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/history/contract_inclusion.md deleted file mode 100644 index b5ffcbcf238..00000000000 --- a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/history/contract_inclusion.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: Contract inclusion ---- - -# prove_contract_inclusion -Proves that a contract exists at a specified block number and returns its address. It can be used to approximate a factory pattern, verifying that a contract at a given address matches expected constructor arguments. - -## Arguments -| Argument Name | Type | Description | -|-------------------------|----------------|---------------------------------------------------| -| deployer_public_key | Point | Public key of the deployer | -| contract_address_salt | Field | Salt used for the contract address | -| function_tree_root | Field | Root of the function tree | -| constructor_hash | Field | Hash of the constructor | -| portal_contract_address | EthAddress | Ethereum address of the portal contract | -| block_number | u32 | Block number to prove the contract's existence | -| context | PrivateContext | Context for executing the proof | - -## Returns -| Return Name | Type | -|------------------|--------------| -| | AztecAddress | diff --git a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/history/note_inclusion.md b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/history/note_inclusion.md deleted file mode 100644 index 5e03d3a5ef0..00000000000 --- a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/history/note_inclusion.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: Note inclusion ---- - -# prove_note_commitment_inclusion -Proves the inclusion of a note commitment in a specific block. Validates that the given note commitment is part of the note hash tree at a specified block number. - -## Arguments -| Argument Name | Type | Description | -|------------------|----------------|------------------------------------------------------| -| note_commitment | Field | The note commitment to be proven | -| block_number | u32 | Block number at which the note's existence is proved | -| context | PrivateContext | Context for executing the proof | - -# prove_note_inclusion -Proves the inclusion of a note in a specific block by computing its unique siloed note hash and then proving its commitment inclusion. This function uses a provided note interface to handle specific note types. - -## Type Parameters -| Type Parameter | Description | -|----------------|--------------------------------------------------| -| Note | The type of note being proven | -| N | The length of the array in the note interface | - -## Arguments -| Argument Name | Type | Description | -|------------------|--------------------------------|------------------------------------------------------| -| note_interface | NoteInterface | Interface for handling note-related operations | -| note_with_header | Note | The note whose inclusion is to be proven | -| block_number | u32 | Block number at which the note's existence is proved | -| context | PrivateContext | Context for executing the proof | diff --git a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/history/note_validity.md b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/history/note_validity.md deleted file mode 100644 index 33fbab4d3a0..00000000000 --- a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/history/note_validity.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -title: Note validity ---- - -# prove_note_validity -Proves the validity of a note at a specified block number. It ensures that the note exists at that block number and has not been nullified. - -## Type Parameters -| Type Parameter | Description | -|----------------|--------------------------------------------------| -| Note | The type of note being proven | -| N | The length of the array in the note interface | - -## Arguments -| Argument Name | Type | Description | -|------------------|--------------------------------|------------------------------------------------------| -| note_interface | NoteInterface | Interface for handling note-related operations | -| note_with_header | Note | The note whose validity is to be proven | -| block_number | u32 | Block number at which the note's validity is proved | -| context | PrivateContext | Context for executing the proof | diff --git a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/history/nullifier_non_inclusion.md b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/history/nullifier_non_inclusion.md deleted file mode 100644 index 9a06068c889..00000000000 --- a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/history/nullifier_non_inclusion.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: Nullifier non-inclusion ---- - -# prove_nullifier_non_inclusion -Proves that a nullifier does not exist at a specified block number. This function ensures that the nullifier is not part of the nullifier tree at that block. - -## Arguments -| Argument Name | Type | Description | -|---------------|----------------|--------------------------------------------------| -| nullifier | Field | The nullifier to be proven non-existent | -| block_number | u32 | Block number at which to prove non-existence | -| context | PrivateContext | Context for executing the proof | - -# prove_note_not_nullified -Proves that a note was not nullified at a specified block number by computing its nullifier and then proving the nullifier's non-inclusion. - -## Type Parameters -| Type Parameter | Description | -|----------------|--------------------------------------------------| -| Note | The type of note being proven | -| N | The length of the array in the note interface | - -## Arguments -| Argument Name | Type | Description | -|------------------|-------------------------|----------------------------------------------------| -| note_interface | NoteInterface | Interface for handling note-related operations | -| note_with_header | Note | The note whose non-nullification is to be proven | -| block_number | u32 | Block number at which the note's non-nullification is proved | -| context | PrivateContext | Context for executing the proof | diff --git a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/history/nulllifer_inclusion.md b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/history/nulllifer_inclusion.md deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/history/public_value_inclusion.md b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/history/public_value_inclusion.md deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/log.md b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/log.md deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/messaging.md b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/messaging.md deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/note.md b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/note.md deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/oracle.md b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/oracle.md deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/selector.md b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/selector.md deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/state_vars.md b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/state_vars.md deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/types.md b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/aztec/types.md deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/easy_private_state.md b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/easy_private_state.md deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/field_note.md b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/field_note.md deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/safe_math.md b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/safe_math.md deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/slow_updates_tree.md b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/slow_updates_tree.md deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/value_note/balance_utils.md b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/value_note/balance_utils.md deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/value_note/filter.md b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/value_note/filter.md deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/value_note/value_note.md b/docs/docs/dev_docs/contracts/syntax/aztecnr-reference/value_note/value_note.md deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/docs/scripts/build.sh b/docs/scripts/build.sh index eb63a05887d..7520e4eb198 100755 --- a/docs/scripts/build.sh +++ b/docs/scripts/build.sh @@ -34,6 +34,9 @@ if [ -n "$NETLIFY" ]; then # Build the required projects for typedoc build_package "pxe" build_package "aztec.js" "yarn build:ts" + # Generate Aztec.nr reference docs + echo "Generating Aztec.nr reference docs..." + node ../src/preprocess/generate_aztecnr_reference.js # Back to docs site cd docs diff --git a/docs/sidebars.js b/docs/sidebars.js index 709115e6e75..b4903973cf0 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -11,6 +11,12 @@ // @ts-check +const fs = require('fs'); +const path = require('path'); + +// Assuming docsStructure.json is in the root of your Docusaurus project +const docsStructurePath = path.join(__dirname, 'docsStructure.json'); +const docsStructure = JSON.parse(fs.readFileSync(docsStructurePath, 'utf8')); /** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */ const sidebars = { docsSidebar: [ @@ -444,54 +450,9 @@ const sidebars = { type: "category", items: [ { - label: "Aztec.nr Reference", - type: "category", - - items: [ - "dev_docs/contracts/syntax/aztecnr-reference/address_note", - { - label: "Authwit", - type: "category", - items: [ - "dev_docs/contracts/syntax/aztecnr-reference/authwit/account", - "dev_docs/contracts/syntax/aztecnr-reference/authwit/auth_witness", - "dev_docs/contracts/syntax/aztecnr-reference/authwit/auth", - "dev_docs/contracts/syntax/aztecnr-reference/authwit/entrypoint", - ], - }, - { - label: "Aztec", - type: "category", - items: [ - "dev_docs/contracts/syntax/aztecnr-reference/aztec/abi", - "dev_docs/contracts/syntax/aztecnr-reference/aztec/address", - "dev_docs/contracts/syntax/aztecnr-reference/aztec/context", - "dev_docs/contracts/syntax/aztecnr-reference/aztec/hash", - "dev_docs/contracts/syntax/aztecnr-reference/aztec/log", - "dev_docs/contracts/syntax/aztecnr-reference/aztec/messaging", - "dev_docs/contracts/syntax/aztecnr-reference/aztec/note", - "dev_docs/contracts/syntax/aztecnr-reference/aztec/oracle", - "dev_docs/contracts/syntax/aztecnr-reference/aztec/selector", - "dev_docs/contracts/syntax/aztecnr-reference/aztec/state_vars", - "dev_docs/contracts/syntax/aztecnr-reference/aztec/types", - ], - }, - "dev_docs/contracts/syntax/aztecnr-reference/easy_private_state", - "dev_docs/contracts/syntax/aztecnr-reference/field_note", - "dev_docs/contracts/syntax/aztecnr-reference/safe_math", - "dev_docs/contracts/syntax/aztecnr-reference/slow_updates_tree", - { - label: "Value Note", - type: "category", - items: [ - "dev_docs/contracts/syntax/aztecnr-reference/value_note/balance_utils", - "dev_docs/contracts/syntax/aztecnr-reference/value_note/filter", - "dev_docs/contracts/syntax/aztecnr-reference/value_note/value_note", - ], - }, - - - ], + label: "Aztec.nr Reference", + type: "category", + items: docsStructure.AztecNR.map(docPath => ({type: 'doc', id: docPath})), }, { label: "Private Execution Environment (PXE)", diff --git a/docs/src/preprocess/generate_aztecnr_reference.js b/docs/src/preprocess/generate_aztecnr_reference.js index f8521e4bd2e..9e6eb495d19 100644 --- a/docs/src/preprocess/generate_aztecnr_reference.js +++ b/docs/src/preprocess/generate_aztecnr_reference.js @@ -1,15 +1,19 @@ const fs = require('fs'); const path = require('path'); -// const filePath = '../../../yarn-project/aztec-nr/address-note/src/address_note.nr'; -// const filePath = '../../../yarn-project/aztec-nr/authwit/src/account.nr'; -// const filePath = '../../../yarn-project/aztec-nr/authwit/src/auth.nr'; -// const filePath = '../../../yarn-project/aztec-nr/aztec/src/abi.nr'; -// const filePath = '../../../yarn-project/aztec-nr/aztec/src/log.nr'; -// const filePath = '../../../yarn-project/aztec-nr/aztec/src/utils.nr'; -const filePath = '../../../yarn-project/aztec-nr/field-note/src/field_note.nr'; - -const content = fs.readFileSync(filePath, 'utf8'); +function listNrFiles(dir, fileList = []) { + const files = fs.readdirSync(dir); + files.forEach(file => { + const filePath = path.join(dir, file); + const stat = fs.statSync(filePath); + if (stat.isDirectory()) { + listNrFiles(filePath, fileList); + } else if (filePath.endsWith('.nr')) { + fileList.push(filePath); + } + }); + return fileList; +} function parseParameters(paramString) { return paramString.split(',').map(param => { @@ -28,9 +32,12 @@ function parseStruct(content) { const structName = match[1]; const fields = match[2].trim().split('\n').map(fieldLine => { fieldLine = fieldLine.trim().replace(/,$/, ''); - let [name, type] = fieldLine.split(/:\s*/); - return { name, type }; - }); + // Skip lines that are comments or do not contain a colon (indicating they are not field definitions) + if (!fieldLine.startsWith('//') && fieldLine.includes(':')) { + let [name, type] = fieldLine.split(/:\s*/); + return { name, type }; + } + }).filter(field => field !== undefined); // Filter out undefined entries resulting from comments or invalid lines let descriptionLines = []; let lineIndex = content.lastIndexOf('\n', match.index - 1); @@ -54,10 +61,6 @@ function parseStruct(content) { return structs; } - - -const structs = parseStruct(content); - function parseFunctions(content) { const functions = []; const implRegex = /impl\s+(\w+)\s*{/g; @@ -127,10 +130,7 @@ function parseFunctions(content) { return functions; } - -const functions = parseFunctions(content); - -function generateMarkdown(structInfo, functions) { +function generateMarkdown(structs, functions) { let markdown = ''; structs.forEach(structInfo => { @@ -144,9 +144,12 @@ function generateMarkdown(structInfo, functions) { markdown += `## Fields\n`; markdown += `| Field | Type |\n| --- | --- |\n`; structInfo.fields.forEach(field => { - const cleanType = field.type.replace(/[\[:;,]$/g, '').replace(/^[\[:;,]/g, ''); - const fieldName = field.name.replace(/[:;]/g, ''); - markdown += `| ${fieldName} | ${cleanType} |\n`; + // Check if field and field.type are defined + if (field && field.type) { + const cleanType = field.type.replace(/[\[:;,]$/g, '').replace(/^[\[:;,]/g, ''); + const fieldName = field.name.replace(/[:;]/g, ''); + markdown += `| ${fieldName} | ${cleanType} |\n`; + } }); // Generate markdown for methods of this struct @@ -159,7 +162,10 @@ function generateMarkdown(structInfo, functions) { markdown += `#### Parameters\n`; markdown += `| Name | Type |\n| --- | --- |\n`; func.params.forEach(({ name, type }) => { - markdown += `| ${name} | ${type} |\n`; + // Ensure param name and type are defined + if (name && type) { + markdown += `| ${name} | ${type} |\n`; + } }); if (func.returnType) { markdown += `\n#### Returns\n`; @@ -182,7 +188,10 @@ function generateMarkdown(structInfo, functions) { markdown += `#### Parameters\n`; markdown += `| Name | Type |\n| --- | --- |\n`; func.params.forEach(({ name, type }) => { - markdown += `| ${name} | ${type} |\n`; + // Ensure param name and type are defined + if (name && type) { + markdown += `| ${name} | ${type} |\n`; + } }); if (func.returnType) { markdown += `\n#### Returns\n`; @@ -196,7 +205,44 @@ function generateMarkdown(structInfo, functions) { return markdown; } -const markdown = generateMarkdown(structs, functions); +function processFiles(baseDir, outputBaseDir) { + const nrFiles = listNrFiles(baseDir); + let docPaths = []; // Array to hold the relative paths of the documentation files + + nrFiles.forEach(filePath => { + if (path.basename(filePath) === 'lib.nr') { + console.log(`Skipping documentation generation for ${filePath}`); + return; // Skip this file and continue to the next one + } + + const content = fs.readFileSync(filePath, 'utf8'); + const structs = parseStruct(content); + const functions = parseFunctions(content); + const markdown = generateMarkdown(structs, functions); + + const relativePath = path.relative(baseDir, filePath); + const adjustedPath = relativePath.replace('/src', '').replace(/\.nr$/, '.md'); // Adjust the path and remove .nr extension + const outputFilePath = path.join(outputBaseDir, adjustedPath); + + fs.mkdirSync(path.dirname(outputFilePath), { recursive: true }); + fs.writeFileSync(outputFilePath, markdown); + console.log(`Generated documentation for ${filePath}`); + + // Add the adjusted path to the docPaths array, converting it to a format suitable for Docusaurus + const docPathForDocusaurus = adjustedPath.replace(/\\/g, '/').replace('.md', ''); // Ensure paths are in URL format and remove .md + docPaths.push(docPathForDocusaurus); + }); + + // Write the documentation structure to AztecnrReferenceAutogenStructure.json + const docsStructure = { + AztecNR: docPaths + }; + const outputPath = path.join(outputBaseDir, 'AztecnrReferenceAutogenStructure.json'); + fs.writeFileSync(outputPath, JSON.stringify(docsStructure, null, 2)); + console.log(`Documentation structure written to ${outputPath}`); +} + +const baseDir = path.resolve(__dirname, '../../../yarn-project/aztec-nr'); +const outputBaseDir = path.resolve(__dirname, '../../docs/developers/contracts/references/aztec-nr'); -const outputPath = 'address-note.md'; -fs.writeFileSync(outputPath, markdown); +processFiles(baseDir, outputBaseDir); From 9cb59e9c7b7573844204f32ca190658559e46f0e Mon Sep 17 00:00:00 2001 From: Cat McGee Date: Tue, 6 Feb 2024 19:19:35 +0900 Subject: [PATCH 05/18] kinda working --- docs/sidebars.js | 33 ++++++- .../preprocess/generate_aztecnr_reference.js | 92 +++++++++++-------- 2 files changed, 81 insertions(+), 44 deletions(-) diff --git a/docs/sidebars.js b/docs/sidebars.js index b4903973cf0..e5d78fd4576 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -13,10 +13,35 @@ const fs = require('fs'); const path = require('path'); - -// Assuming docsStructure.json is in the root of your Docusaurus project -const docsStructurePath = path.join(__dirname, 'docsStructure.json'); +// Load the structured documentation paths +const docsStructurePath = path.join(__dirname, '/src/preprocess/AztecnrReferenceAutogenStructure.json'); const docsStructure = JSON.parse(fs.readFileSync(docsStructurePath, 'utf8')); + +// Function to recursively build sidebar items from the structured documentation +function buildSidebarItemsFromStructure(structure, basePath = '') { + const items = []; + for (const key in structure) { + if (key === '_docs') { + // Base case: add the docs + structure[key].forEach(doc => { + items.push(`${basePath}/${doc}`); + }); + } else { + // Recursive case: process a subdirectory + const subItems = buildSidebarItemsFromStructure(structure[key], `${basePath}/${key}`); + items.push({ + type: 'category', + label: key.charAt(0).toUpperCase() + key.slice(1), // Capitalize the label + items: subItems, + }); + } + } + return items; +} + +// Build sidebar for AztecNR documentation +const aztecNRSidebar = buildSidebarItemsFromStructure(docsStructure.AztecNR, 'developers/contracts/references/aztec-nr'); + /** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */ const sidebars = { docsSidebar: [ @@ -452,7 +477,7 @@ const sidebars = { { label: "Aztec.nr Reference", type: "category", - items: docsStructure.AztecNR.map(docPath => ({type: 'doc', id: docPath})), + items: aztecNRSidebar, }, { label: "Private Execution Environment (PXE)", diff --git a/docs/src/preprocess/generate_aztecnr_reference.js b/docs/src/preprocess/generate_aztecnr_reference.js index 9e6eb495d19..97591cde6b7 100644 --- a/docs/src/preprocess/generate_aztecnr_reference.js +++ b/docs/src/preprocess/generate_aztecnr_reference.js @@ -8,18 +8,27 @@ function listNrFiles(dir, fileList = []) { const stat = fs.statSync(filePath); if (stat.isDirectory()) { listNrFiles(filePath, fileList); - } else if (filePath.endsWith('.nr')) { + } else if (filePath.endsWith('.nr') && !file.endsWith('lib.nr')) { fileList.push(filePath); } }); return fileList; } +function escapeHtml(unsafeText) { + if (!unsafeText) { + // Return an empty string or some default value if unsafeText is undefined or null + return ''; + } + return unsafeText.replace(//g, ">"); +} + + function parseParameters(paramString) { return paramString.split(',').map(param => { param = param.trim().replace(/[\[:;,.]$/g, '').replace(/^[\[:;,.]/g, ''); // Clean up start and end let [paramName, type] = param.split(':').map(p => p.trim()); - return { name: paramName, type }; + return { name: paramName, type: escapeHtml(type) }; }); } @@ -135,42 +144,43 @@ function generateMarkdown(structs, functions) { structs.forEach(structInfo => { if (structInfo) { - markdown += `# ${structInfo.structName} Struct\n\n`; + markdown += `# ${escapeHtml(structInfo.structName)} Struct\n\n`; if (structInfo.description) { - markdown += `${structInfo.description}\n\n`; + markdown += `${escapeHtml(structInfo.description)}\n\n`; } markdown += `## Fields\n`; markdown += `| Field | Type |\n| --- | --- |\n`; structInfo.fields.forEach(field => { - // Check if field and field.type are defined if (field && field.type) { - const cleanType = field.type.replace(/[\[:;,]$/g, '').replace(/^[\[:;,]/g, ''); - const fieldName = field.name.replace(/[:;]/g, ''); + const cleanType = escapeHtml(field.type.replace(/[\[:;,]$/g, '').replace(/^[\[:;,]/g, '')); + const fieldName = escapeHtml(field.name.replace(/[:;]/g, '')); markdown += `| ${fieldName} | ${cleanType} |\n`; } }); + markdown += '\n'; + // Generate markdown for methods of this struct - const methods = functions.filter(f => f.isMethod && f.structName === structInfo.structName); + const methods = functions.filter(f => f.isMethod && f.structName === escapeHtml(structInfo.structName)); if (methods.length > 0) { - markdown += `\n## Methods\n\n`; + markdown += `## Methods\n\n`; methods.forEach(func => { - markdown += `### ${func.name}\n\n`; - if (func.description) markdown += `${func.description}\n\n`; + markdown += `### ${escapeHtml(func.name)}\n\n`; + if (func.description) { + markdown += `${escapeHtml(func.description)}\n\n`; + } markdown += `#### Parameters\n`; markdown += `| Name | Type |\n| --- | --- |\n`; func.params.forEach(({ name, type }) => { - // Ensure param name and type are defined - if (name && type) { - markdown += `| ${name} | ${type} |\n`; - } + markdown += `| ${escapeHtml(name)} | ${escapeHtml(type)} |\n`; }); + if (func.returnType) { markdown += `\n#### Returns\n`; markdown += `| Type |\n| --- |\n`; - markdown += `| ${func.returnType} |\n`; + markdown += `| ${escapeHtml(func.returnType)} |\n`; } markdown += '\n'; }); @@ -181,22 +191,21 @@ function generateMarkdown(structs, functions) { // Generate markdown for standalone functions const standaloneFunctions = functions.filter(f => !f.isMethod); if (standaloneFunctions.length > 0) { - markdown += `\n## Standalone Functions\n\n`; + markdown += `## Standalone Functions\n\n`; standaloneFunctions.forEach(func => { - markdown += `### ${func.name}\n\n`; - if (func.description) markdown += `${func.description}\n\n`; + markdown += `### ${escapeHtml(func.name)}\n\n`; + if (func.description) { + markdown += `${escapeHtml(func.description)}\n\n`; + } markdown += `#### Parameters\n`; markdown += `| Name | Type |\n| --- | --- |\n`; func.params.forEach(({ name, type }) => { - // Ensure param name and type are defined - if (name && type) { - markdown += `| ${name} | ${type} |\n`; - } + markdown += `| ${escapeHtml(name)} | ${escapeHtml(type)} |\n`; }); if (func.returnType) { markdown += `\n#### Returns\n`; markdown += `| Type |\n| --- |\n`; - markdown += `| ${func.returnType} |\n`; + markdown += `| ${escapeHtml(func.returnType)} |\n`; } markdown += '\n'; }); @@ -205,40 +214,42 @@ function generateMarkdown(structs, functions) { return markdown; } + function processFiles(baseDir, outputBaseDir) { const nrFiles = listNrFiles(baseDir); - let docPaths = []; // Array to hold the relative paths of the documentation files + let docStructure = {}; // To hold structured documentation paths nrFiles.forEach(filePath => { - if (path.basename(filePath) === 'lib.nr') { - console.log(`Skipping documentation generation for ${filePath}`); - return; // Skip this file and continue to the next one - } - const content = fs.readFileSync(filePath, 'utf8'); const structs = parseStruct(content); const functions = parseFunctions(content); const markdown = generateMarkdown(structs, functions); const relativePath = path.relative(baseDir, filePath); - const adjustedPath = relativePath.replace('/src', '').replace(/\.nr$/, '.md'); // Adjust the path and remove .nr extension + const adjustedPath = relativePath.replace('/src', '').replace(/\.nr$/, '.md'); const outputFilePath = path.join(outputBaseDir, adjustedPath); fs.mkdirSync(path.dirname(outputFilePath), { recursive: true }); fs.writeFileSync(outputFilePath, markdown); console.log(`Generated documentation for ${filePath}`); - // Add the adjusted path to the docPaths array, converting it to a format suitable for Docusaurus - const docPathForDocusaurus = adjustedPath.replace(/\\/g, '/').replace('.md', ''); // Ensure paths are in URL format and remove .md - docPaths.push(docPathForDocusaurus); + // Adjusted to populate docStructure for JSON + const docPathForJson = adjustedPath.replace(/\\/g, '/').replace('.md', ''); + const parts = docPathForJson.split('/'); + let current = docStructure; + + for (let i = 0; i < parts.length - 1; i++) { + current[parts[i]] = current[parts[i]] || {}; + current = current[parts[i]]; + } + + current._docs = current._docs || []; + current._docs.push(parts[parts.length - 1]); }); - // Write the documentation structure to AztecnrReferenceAutogenStructure.json - const docsStructure = { - AztecNR: docPaths - }; - const outputPath = path.join(outputBaseDir, 'AztecnrReferenceAutogenStructure.json'); - fs.writeFileSync(outputPath, JSON.stringify(docsStructure, null, 2)); + // Write structured documentation paths to JSON + const outputPath = path.join(__dirname, 'AztecnrReferenceAutogenStructure.json'); + fs.writeFileSync(outputPath, JSON.stringify({ AztecNR: docStructure }, null, 2)); console.log(`Documentation structure written to ${outputPath}`); } @@ -246,3 +257,4 @@ const baseDir = path.resolve(__dirname, '../../../yarn-project/aztec-nr'); const outputBaseDir = path.resolve(__dirname, '../../docs/developers/contracts/references/aztec-nr'); processFiles(baseDir, outputBaseDir); + From 6462e8010a2b3fc52cf863367d37f4cea8feffb6 Mon Sep 17 00:00:00 2001 From: Cat McGee Date: Fri, 9 Feb 2024 17:42:42 +0900 Subject: [PATCH 06/18] sidebar merge conflicts --- docs/sidebars.js | 275 ++++++++++++++++++++++++++++++++--------------- 1 file changed, 186 insertions(+), 89 deletions(-) diff --git a/docs/sidebars.js b/docs/sidebars.js index e5d78fd4576..48efb366754 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -53,7 +53,7 @@ const sidebars = { // ABOUT AZTEC { - type: "html", + type: "html", className: "sidebar-title", value: "LEARN", defaultStyle: true, @@ -285,93 +285,199 @@ const sidebars = { type: "category", link: { type: "doc", - id: "developers/cli/main", + id: "developers/sandbox/main", }, items: [ - "developers/cli/cli-commands", - "developers/cli/sandbox-reference", - "developers/cli/run_more_than_one_pxe_sandbox", + { + label: "Guides", + type: "category", + items: [ + "developers/sandbox/guides/blank_box", + "developers/sandbox/guides/run_more_than_one_pxe_sandbox", + "developers/wallets/creating_schnorr_accounts", + ], + }, + { + label: "References", + type: "category", + items: [ + "developers/sandbox/references/cli-commands", + "developers/sandbox/references/sandbox-reference", + "developers/sandbox/references/cheat_codes", + { + label: "PXE Reference", + type: "doc", + id: "apis/pxe/interfaces/PXE", + }, + ], + + }, + ], }, { - label: "Aztec.nr Contracts", + label: "Smart Contracts", type: "category", link: { type: "doc", id: "developers/contracts/main", }, items: [ - "developers/contracts/workflow", "developers/contracts/setup", - "developers/contracts/layout", { - label: "Syntax", + label: "Writing Contracts", type: "category", - link: { - type: "doc", - id: "developers/contracts/syntax/main", - }, items: [ + "developers/contracts/writing_contracts/layout", + "developers/contracts/writing_contracts/example_contract", + { + label: "Functions and Constructors", + type: "category", + link: { + type: "doc", + id: "developers/contracts/writing_contracts/functions/main", + }, + items: [ + "developers/contracts/writing_contracts/functions/context", + "developers/contracts/writing_contracts/functions/public_private_unconstrained", + "developers/contracts/writing_contracts/functions/visibility", + "developers/contracts/writing_contracts/functions/call_functions", + "developers/contracts/writing_contracts/functions/write_constructor", + "developers/contracts/writing_contracts/functions/inner_workings", + ], + }, { label: "Storage", type: "category", link: { type: "doc", - id: "developers/contracts/syntax/storage/main", + id: "developers/contracts/writing_contracts/storage/main", }, items: [ - "developers/contracts/syntax/storage/private_state", - "developers/contracts/syntax/storage/public_state", - "developers/contracts/syntax/storage/storage_slots", + "developers/contracts/writing_contracts/storage/define_storage", + "developers/contracts/writing_contracts/storage/storage_slots", + ], + }, + { + label: "Accounts and Account Contracts", + type: "category", + items: [ + "developers/contracts/writing_contracts/accounts/write_accounts_contract", + ], }, - "developers/contracts/syntax/events", { - label: "Functions", + label: "Events", + type: "category", + items: [ + "developers/contracts/writing_contracts/events/emit_event", + ], + }, + { + label: "Oracles", type: "category", link: { type: "doc", - id: "developers/contracts/syntax/functions/main", + id: "developers/contracts/writing_contracts/oracles/main", }, items: [ - "developers/contracts/syntax/functions/public_private_unconstrained", - "developers/contracts/syntax/functions/visibility", - "developers/contracts/syntax/functions/constructor", - "developers/contracts/syntax/functions/calling_functions", - "developers/contracts/syntax/functions/oracles", - "developers/contracts/syntax/functions/inner_workings", + "developers/contracts/writing_contracts/oracles/inbuilt_oracles", + "developers/contracts/writing_contracts/oracles/pop_capsule", ], }, - "developers/contracts/syntax/oracles", { - label: "Proving Historical Blockchain Data", + label: "Portals", type: "category", + link: { + type: "doc", + id: "developers/contracts/writing_contracts/portals/portals", + }, items: [ - "developers/contracts/syntax/historical_access/how_to_prove_history", - "developers/contracts/syntax/historical_access/history_lib_reference", + "developers/contracts/writing_contracts/portals/deploy_with_portal", + "developers/contracts/writing_contracts/portals/communicate_with_portal", ], }, - "developers/contracts/syntax/slow_updates_tree", - - "developers/contracts/syntax/context", - "developers/contracts/syntax/globals", + { + label: "Historical Data", + type: "category", + items: [ + { + label: "Historical Blockchain Data (Archive Tree)", + type: "category", + link: { + type: "doc", + id: "developers/contracts/writing_contracts/historical_data/slow_updates_tree/main", + }, + items: [ + "developers/contracts/writing_contracts/historical_data/archive_tree/how_to_prove_history", + ], + }, + ], + }, + { + label: "Access public data from private state (Slow Updates Tree)", + type: "category", + link: { + type: "doc", + id: "developers/contracts/writing_contracts/historical_data/slow_updates_tree/main", + }, + items: [ + "developers/contracts/writing_contracts/historical_data/slow_updates_tree/implement_slow_updates", + ], + }, + ], }, - "developers/contracts/compiling", - "developers/contracts/deploying", - "developers/contracts/artifacts", { - label: "Portals", + label: "Compiling Contracts", + type: "category", + items: [ + "developers/contracts/compiling_contracts/how_to_compile_contract", + "developers/contracts/compiling_contracts/artifacts", + ], + }, + { + label: "Deploying Contracts", + type: "category", + items: [ + "developers/contracts/deploying_contracts/how_to_deploy_contract", + ], + }, + "developers/contracts/testing_contracts/main", + { + label: "References", type: "category", - link: { - type: "doc", - id: "developers/contracts/portals/main", - }, items: [ - "developers/contracts/portals/data_structures", - "developers/contracts/portals/registry", - "developers/contracts/portals/inbox", - "developers/contracts/portals/outbox", + "developers/contracts/references/globals", + { + label: "Storage Reference", + type: "category", + link: { + type: "doc", + id: "developers/contracts/references/storage/main", + }, + items: [ + "developers/contracts/references/storage/private_state", + "developers/contracts/references/storage/public_state" + ], + }, + { + label: "Portals Reference", + type: "category", + items: [ + "developers/contracts/references/portals/data_structures", + "developers/contracts/references/portals/inbox", + "developers/contracts/references/portals/outbox", + "developers/contracts/references/portals/registry", + ], + }, + { + label: "Aztec.nr Reference", + type: "category", + items: aztecNRSidebar, + }, + "developers/contracts/references/history_lib_reference", + "developers/contracts/references/slow_updates_tree", ], }, { @@ -397,7 +503,6 @@ const sidebars = { }, ], }, - // { // label: "Security Considerations", // type: "category", @@ -418,8 +523,39 @@ const sidebars = { { label: "Aztec.js", - type: "doc", - id: "developers/aztecjs/main", + type: "category", + link: { + type: "doc", + id: "developers/aztecjs/main", + }, + items: [ + { + label: "Guides", + type: "category", + items: [ + "developers/aztecjs/guides/create_account", + "developers/aztecjs/guides/deploy_contract", + "developers/aztecjs/guides/send_transaction", + "developers/aztecjs/guides/call_view_function", + ], + }, + { + label: "References", + type: "category", + items: [ + { + label: "Aztec.js", + type: "category", + items: [{ dirName: "apis/aztec-js", type: "autogenerated" }], + }, + { + label: "Accounts", + type: "category", + items: [{ dirName: "apis/accounts", type: "autogenerated" }], + }, + ], + }, + ], }, { label: "Debugging", @@ -438,16 +574,6 @@ const sidebars = { type: "doc", id: "developers/updating", }, - - { - label: "Testing", - type: "category", - link: { - type: "doc", - id: "developers/testing/main", - }, - items: ["developers/testing/cheat_codes"], - }, { label: "Wallets", type: "category", @@ -457,8 +583,6 @@ const sidebars = { }, items: [ "developers/wallets/architecture", - "developers/wallets/writing_an_account_contract", - "developers/wallets/creating_schnorr_accounts", ], }, @@ -470,33 +594,6 @@ const sidebars = { "developers/privacy/main", "developers/limitations/main", - { - label: "Reference", - type: "category", - items: [ - { - label: "Aztec.nr Reference", - type: "category", - items: aztecNRSidebar, - }, - { - label: "Private Execution Environment (PXE)", - type: "doc", - id: "apis/pxe/interfaces/PXE", - }, - { - label: "Aztec.js", - type: "category", - items: [{ dirName: "apis/aztec-js", type: "autogenerated" }], - }, - { - label: "Accounts", - type: "category", - items: [{ dirName: "apis/accounts", type: "autogenerated" }], - }, - ], - }, - { type: "html", value: '', @@ -535,4 +632,4 @@ const sidebars = { ], }; -module.exports = sidebars; +module.exports = sidebars; \ No newline at end of file From e4935e70c294d1cd534e730ec4105c09c02a2a76 Mon Sep 17 00:00:00 2001 From: Cat McGee Date: Fri, 9 Feb 2024 20:21:30 +0900 Subject: [PATCH 07/18] transcript.hpp --- barretenberg/cpp/src/barretenberg/transcript/transcript.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/barretenberg/cpp/src/barretenberg/transcript/transcript.hpp b/barretenberg/cpp/src/barretenberg/transcript/transcript.hpp index d5d7347229d..655641144b3 100644 --- a/barretenberg/cpp/src/barretenberg/transcript/transcript.hpp +++ b/barretenberg/cpp/src/barretenberg/transcript/transcript.hpp @@ -16,9 +16,9 @@ namespace bb { template -concept Loggable = - (std::same_as || std::same_as || std::same_as || - std::same_as || std::same_as); +concept Loggable = (std::same_as || std::same_as || + std::same_as || std::same_as || + std::same_as); // class TranscriptManifest; class TranscriptManifest { From 5f88400d14174238e67cca7ab02a121da74ffa87 Mon Sep 17 00:00:00 2001 From: Cat McGee Date: Fri, 9 Feb 2024 21:42:53 +0900 Subject: [PATCH 08/18] script --- docs/.gitignore | 4 ++ docs/package.json | 2 +- docs/scripts/build.sh | 6 +-- .../preprocess/generate_aztecnr_reference.js | 49 +++++++++++++------ 4 files changed, 41 insertions(+), 20 deletions(-) diff --git a/docs/.gitignore b/docs/.gitignore index 462844ee8bd..34958269cc2 100644 --- a/docs/.gitignore +++ b/docs/.gitignore @@ -21,3 +21,7 @@ npm-debug.log* yarn-debug.log* yarn-error.log* + +/docs/developers/contracts/references/aztec-nr + +/src/preprocess/AztecnrReferenceAutogenStructure.json \ No newline at end of file diff --git a/docs/package.json b/docs/package.json index d226d8bae82..a354b03963a 100644 --- a/docs/package.json +++ b/docs/package.json @@ -4,7 +4,7 @@ "private": true, "scripts": { "docusaurus": "docusaurus", - "start": "yarn preprocess && yarn typedoc && docusaurus start --host 0.0.0.0", + "start": "yarn preprocess && yarn typedoc && node src/preprocess/generate_aztecnr_reference.js && docusaurus start --host 0.0.0.0", "start:dev": "concurrently \"yarn preprocess:dev\" \"yarn typedoc:dev\" \"sleep 2 && docusaurus start --host 0.0.0.0\"", "start:dev:local": "concurrently \"yarn preprocess:dev\" \"yarn typedoc:dev\" \"sleep 2 && docusaurus start\"", "build": "./scripts/build.sh", diff --git a/docs/scripts/build.sh b/docs/scripts/build.sh index 7520e4eb198..0755b2f3515 100755 --- a/docs/scripts/build.sh +++ b/docs/scripts/build.sh @@ -34,9 +34,6 @@ if [ -n "$NETLIFY" ]; then # Build the required projects for typedoc build_package "pxe" build_package "aztec.js" "yarn build:ts" - # Generate Aztec.nr reference docs - echo "Generating Aztec.nr reference docs..." - node ../src/preprocess/generate_aztecnr_reference.js # Back to docs site cd docs @@ -48,4 +45,7 @@ fi # Now build the docsite echo Building docsite... +echo "Generating Aztec.nr reference docs..." +node ./src/preprocess/generate_aztecnr_reference.js +echo "Generated Aztec.nr reference docs" yarn preprocess && yarn typedoc && yarn docusaurus build diff --git a/docs/src/preprocess/generate_aztecnr_reference.js b/docs/src/preprocess/generate_aztecnr_reference.js index 97591cde6b7..109236e0aa5 100644 --- a/docs/src/preprocess/generate_aztecnr_reference.js +++ b/docs/src/preprocess/generate_aztecnr_reference.js @@ -25,6 +25,10 @@ function escapeHtml(unsafeText) { function parseParameters(paramString) { + if (!paramString.trim()) { + return []; + } + return paramString.split(',').map(param => { param = param.trim().replace(/[\[:;,.]$/g, '').replace(/^[\[:;,.]/g, ''); // Clean up start and end let [paramName, type] = param.split(':').map(p => p.trim()); @@ -32,6 +36,7 @@ function parseParameters(paramString) { }); } + function parseStruct(content) { const structRegex = /struct (\w+)\s*{([\s\S]*?)}/g; let match; @@ -144,7 +149,7 @@ function generateMarkdown(structs, functions) { structs.forEach(structInfo => { if (structInfo) { - markdown += `# ${escapeHtml(structInfo.structName)} Struct\n\n`; + markdown += `# ${escapeHtml(structInfo.structName)}\n\n`; if (structInfo.description) { markdown += `${escapeHtml(structInfo.description)}\n\n`; @@ -159,7 +164,6 @@ function generateMarkdown(structs, functions) { markdown += `| ${fieldName} | ${cleanType} |\n`; } }); - markdown += '\n'; // Generate markdown for methods of this struct @@ -171,12 +175,17 @@ function generateMarkdown(structs, functions) { if (func.description) { markdown += `${escapeHtml(func.description)}\n\n`; } - markdown += `#### Parameters\n`; - markdown += `| Name | Type |\n| --- | --- |\n`; - func.params.forEach(({ name, type }) => { - markdown += `| ${escapeHtml(name)} | ${escapeHtml(type)} |\n`; - }); - + + if (func.params.length > 0) { + markdown += `#### Parameters\n`; + markdown += `| Name | Type |\n| --- | --- |\n`; + func.params.forEach(({ name, type }) => { + markdown += `| ${escapeHtml(name)} | ${escapeHtml(type)} |\n`; + }); + } else { + markdown += `#### Parameters\nTakes no parameters.\n\n`; + } + if (func.returnType) { markdown += `\n#### Returns\n`; markdown += `| Type |\n| --- |\n`; @@ -185,6 +194,7 @@ function generateMarkdown(structs, functions) { markdown += '\n'; }); } + } }); @@ -197,11 +207,15 @@ function generateMarkdown(structs, functions) { if (func.description) { markdown += `${escapeHtml(func.description)}\n\n`; } - markdown += `#### Parameters\n`; - markdown += `| Name | Type |\n| --- | --- |\n`; - func.params.forEach(({ name, type }) => { - markdown += `| ${escapeHtml(name)} | ${escapeHtml(type)} |\n`; - }); + if (func.params.length > 0) { + markdown += `#### Parameters\n`; + markdown += `| Name | Type |\n| --- | --- |\n`; + func.params.forEach(({ name, type }) => { + markdown += `| ${escapeHtml(name)} | ${escapeHtml(type)} |\n`; + }); + } else { + markdown += `#### Parameters\nTakes no parameters.\n\n`; + } if (func.returnType) { markdown += `\n#### Returns\n`; markdown += `| Type |\n| --- |\n`; @@ -214,15 +228,20 @@ function generateMarkdown(structs, functions) { return markdown; } - function processFiles(baseDir, outputBaseDir) { const nrFiles = listNrFiles(baseDir); let docStructure = {}; // To hold structured documentation paths nrFiles.forEach(filePath => { + const content = fs.readFileSync(filePath, 'utf8'); const structs = parseStruct(content); const functions = parseFunctions(content); + + if (structs.length === 0 && functions.length === 0) { + return; + } + const markdown = generateMarkdown(structs, functions); const relativePath = path.relative(baseDir, filePath); @@ -231,7 +250,6 @@ function processFiles(baseDir, outputBaseDir) { fs.mkdirSync(path.dirname(outputFilePath), { recursive: true }); fs.writeFileSync(outputFilePath, markdown); - console.log(`Generated documentation for ${filePath}`); // Adjusted to populate docStructure for JSON const docPathForJson = adjustedPath.replace(/\\/g, '/').replace('.md', ''); @@ -250,7 +268,6 @@ function processFiles(baseDir, outputBaseDir) { // Write structured documentation paths to JSON const outputPath = path.join(__dirname, 'AztecnrReferenceAutogenStructure.json'); fs.writeFileSync(outputPath, JSON.stringify({ AztecNR: docStructure }, null, 2)); - console.log(`Documentation structure written to ${outputPath}`); } const baseDir = path.resolve(__dirname, '../../../yarn-project/aztec-nr'); From 8efe5adcc77ed685729bb5897b31eb9641877750 Mon Sep 17 00:00:00 2001 From: Cat McGee Date: Mon, 12 Feb 2024 15:06:41 +0900 Subject: [PATCH 09/18] fix yarn start:dev:local --- docs/package.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/package.json b/docs/package.json index a354b03963a..67a53d63e89 100644 --- a/docs/package.json +++ b/docs/package.json @@ -4,16 +4,16 @@ "private": true, "scripts": { "docusaurus": "docusaurus", - "start": "yarn preprocess && yarn typedoc && node src/preprocess/generate_aztecnr_reference.js && docusaurus start --host 0.0.0.0", - "start:dev": "concurrently \"yarn preprocess:dev\" \"yarn typedoc:dev\" \"sleep 2 && docusaurus start --host 0.0.0.0\"", - "start:dev:local": "concurrently \"yarn preprocess:dev\" \"yarn typedoc:dev\" \"sleep 2 && docusaurus start\"", + "start": "yarn preprocess && yarn typedoc && docusaurus start --host 0.0.0.0", + "start:dev": "yarn start", + "start:dev:local": "yarn preprocess && yarn typedoc && docusaurus start", "build": "./scripts/build.sh", "swizzle": "docusaurus swizzle", "deploy": "docusaurus deploy", - "clear": "rm -rf 'processed-docs' 'processed-docs-cache' docs/apis && docusaurus clear", + "clear": "rm -rf 'processed-docs' 'processed-docs-cache' docs/apis && docusaurus clear && rm 'src/preprocess/AztecnrReferenceAutogenStructure.json' && rm -rf 'docs/developers/references/aztec-nr'", "serve": "docusaurus serve", - "preprocess": "yarn node -r dotenv/config ./src/preprocess/index.js", - "preprocess:dev": "nodemon --config nodemon.json ./src/preprocess/index.js", + "preprocess": "yarn node -r dotenv/config ./src/preprocess/index.js && node src/preprocess/generate_aztecnr_reference.js", + "preprocess:dev": "nodemon --config nodemon.json ./src/preprocess/index.js && nodemon --config nodemon.json src/preprocess/generate_aztecnr_reference.js ", "typedoc": "rm -rf docs/apis && docusaurus generate-typedoc && cp -a docs/apis processed-docs/", "typedoc:dev": "nodemon -w ../yarn-project -e '*.js,*.ts,*.nr,*.md' --exec \"rm -rf docs/apis && yarn docusaurus generate-typedoc && cp -a docs/apis processed-docs/\"", "write-translations": "docusaurus write-translations", From 6160d9b32da447d105e7748e79b4964050878d96 Mon Sep 17 00:00:00 2001 From: Cat McGee Date: Mon, 12 Feb 2024 15:17:25 +0900 Subject: [PATCH 10/18] add code block in functions --- .../preprocess/generate_aztecnr_reference.js | 50 ++++++++++++------- 1 file changed, 31 insertions(+), 19 deletions(-) diff --git a/docs/src/preprocess/generate_aztecnr_reference.js b/docs/src/preprocess/generate_aztecnr_reference.js index 109236e0aa5..f838d842bf3 100644 --- a/docs/src/preprocess/generate_aztecnr_reference.js +++ b/docs/src/preprocess/generate_aztecnr_reference.js @@ -155,46 +155,50 @@ function generateMarkdown(structs, functions) { markdown += `${escapeHtml(structInfo.description)}\n\n`; } - markdown += `## Fields\n`; - markdown += `| Field | Type |\n| --- | --- |\n`; - structInfo.fields.forEach(field => { - if (field && field.type) { + if (structInfo.fields.length > 0) { + markdown += `## Fields\n`; + markdown += `| Field | Type |\n| --- | --- |\n`; + structInfo.fields.forEach(field => { const cleanType = escapeHtml(field.type.replace(/[\[:;,]$/g, '').replace(/^[\[:;,]/g, '')); const fieldName = escapeHtml(field.name.replace(/[:;]/g, '')); markdown += `| ${fieldName} | ${cleanType} |\n`; - } - }); - markdown += '\n'; + }); + markdown += '\n'; + } - // Generate markdown for methods of this struct + // Filter methods for this struct const methods = functions.filter(f => f.isMethod && f.structName === escapeHtml(structInfo.structName)); if (methods.length > 0) { markdown += `## Methods\n\n`; methods.forEach(func => { markdown += `### ${escapeHtml(func.name)}\n\n`; + + // Insert usage code block + const usageParams = func.params.map(param => param.name).join(', '); + markdown += "```rust\n" + `${func.structName}::${func.name}(${usageParams});` + "\n```\n\n"; + if (func.description) { markdown += `${escapeHtml(func.description)}\n\n`; } - + if (func.params.length > 0) { markdown += `#### Parameters\n`; markdown += `| Name | Type |\n| --- | --- |\n`; func.params.forEach(({ name, type }) => { markdown += `| ${escapeHtml(name)} | ${escapeHtml(type)} |\n`; }); + markdown += '\n'; } else { - markdown += `#### Parameters\nTakes no parameters.\n\n`; + markdown += 'Takes no parameters.\n\n'; } - + if (func.returnType) { - markdown += `\n#### Returns\n`; + markdown += `#### Returns\n`; markdown += `| Type |\n| --- |\n`; - markdown += `| ${escapeHtml(func.returnType)} |\n`; + markdown += `| ${escapeHtml(func.returnType)} |\n\n`; } - markdown += '\n'; }); } - } }); @@ -204,30 +208,38 @@ function generateMarkdown(structs, functions) { markdown += `## Standalone Functions\n\n`; standaloneFunctions.forEach(func => { markdown += `### ${escapeHtml(func.name)}\n\n`; + + // Insert usage code block + const usageParams = func.params.map(param => param.name).join(', '); + markdown += "```rust\n" + `${func.name}(${usageParams});` + "\n```\n\n"; + if (func.description) { markdown += `${escapeHtml(func.description)}\n\n`; } + if (func.params.length > 0) { markdown += `#### Parameters\n`; markdown += `| Name | Type |\n| --- | --- |\n`; func.params.forEach(({ name, type }) => { markdown += `| ${escapeHtml(name)} | ${escapeHtml(type)} |\n`; }); + markdown += '\n'; } else { - markdown += `#### Parameters\nTakes no parameters.\n\n`; + markdown += 'Takes no parameters.\n\n'; } + if (func.returnType) { - markdown += `\n#### Returns\n`; + markdown += `#### Returns\n`; markdown += `| Type |\n| --- |\n`; - markdown += `| ${escapeHtml(func.returnType)} |\n`; + markdown += `| ${escapeHtml(func.returnType)} |\n\n`; } - markdown += '\n'; }); } return markdown; } + function processFiles(baseDir, outputBaseDir) { const nrFiles = listNrFiles(baseDir); let docStructure = {}; // To hold structured documentation paths From 92e6418a8103503c69ce44f39dce965e8b16be65 Mon Sep 17 00:00:00 2001 From: Cat McGee Date: Mon, 12 Feb 2024 16:03:52 +0900 Subject: [PATCH 11/18] added some comments --- docs/src/preprocess/generate_aztecnr_reference.js | 13 +++++++++---- yarn-project/aztec-nr/aztec/src/avm/context.nr | 3 ++- .../src/context/globals/private_global_variables.nr | 1 + .../easy-private-state/src/easy_private_state.nr | 2 +- yarn-project/aztec-nr/safe-math/src/safe_u120.nr | 1 + 5 files changed, 14 insertions(+), 6 deletions(-) diff --git a/docs/src/preprocess/generate_aztecnr_reference.js b/docs/src/preprocess/generate_aztecnr_reference.js index f838d842bf3..7cebda01507 100644 --- a/docs/src/preprocess/generate_aztecnr_reference.js +++ b/docs/src/preprocess/generate_aztecnr_reference.js @@ -173,14 +173,18 @@ function generateMarkdown(structs, functions) { methods.forEach(func => { markdown += `### ${escapeHtml(func.name)}\n\n`; - // Insert usage code block - const usageParams = func.params.map(param => param.name).join(', '); - markdown += "```rust\n" + `${func.structName}::${func.name}(${usageParams});` + "\n```\n\n"; - + + // Description taken from a comment above the function decalaration + // If the comment is docs:, looks at the comment above if (func.description) { markdown += `${escapeHtml(func.description)}\n\n`; } + // Codeblock for example usage + const usageParams = func.params.map(param => param.name).join(', '); + markdown += "```rust\n" + `${func.structName}::${func.name}(${usageParams});` + "\n```\n\n"; + + // Parameters if (func.params.length > 0) { markdown += `#### Parameters\n`; markdown += `| Name | Type |\n| --- | --- |\n`; @@ -192,6 +196,7 @@ function generateMarkdown(structs, functions) { markdown += 'Takes no parameters.\n\n'; } + // Returns if (func.returnType) { markdown += `#### Returns\n`; markdown += `| Type |\n| --- |\n`; diff --git a/yarn-project/aztec-nr/aztec/src/avm/context.nr b/yarn-project/aztec-nr/aztec/src/avm/context.nr index 4e6d3f56f21..baa34a5084f 100644 --- a/yarn-project/aztec-nr/aztec/src/avm/context.nr +++ b/yarn-project/aztec-nr/aztec/src/avm/context.nr @@ -5,9 +5,10 @@ use dep::protocol_types::address::{ // Getters that will be converted by the transpiler into their // own opcodes +// No new function as this struct is entirely static getters + struct AvmContext {} -// No new function as this struct is entirely static getters impl AvmContext { #[oracle(address)] pub fn address() -> AztecAddress {} diff --git a/yarn-project/aztec-nr/aztec/src/context/globals/private_global_variables.nr b/yarn-project/aztec-nr/aztec/src/context/globals/private_global_variables.nr index 012db96d33c..038273862fb 100644 --- a/yarn-project/aztec-nr/aztec/src/context/globals/private_global_variables.nr +++ b/yarn-project/aztec-nr/aztec/src/context/globals/private_global_variables.nr @@ -9,6 +9,7 @@ struct PrivateGlobalVariables { } // docs:end:private-global-variables +// Note: public global vars are equal to the private ones impl Serialize for PrivateGlobalVariables { fn serialize(self) -> [Field; PRIVATE_GLOBAL_VARIABLES_LENGTH] { [self.chain_id, self.version] diff --git a/yarn-project/aztec-nr/easy-private-state/src/easy_private_state.nr b/yarn-project/aztec-nr/easy-private-state/src/easy_private_state.nr index d6b6fbf650f..d02862dcd08 100644 --- a/yarn-project/aztec-nr/easy-private-state/src/easy_private_state.nr +++ b/yarn-project/aztec-nr/easy-private-state/src/easy_private_state.nr @@ -15,7 +15,7 @@ struct EasyPrivateUint { storage_slot: Field, } -impl EasyPrivateUint { +// Holds a note that can act similarly to an int. pub fn new( context: Context, storage_slot: Field, diff --git a/yarn-project/aztec-nr/safe-math/src/safe_u120.nr b/yarn-project/aztec-nr/safe-math/src/safe_u120.nr index 4ef341bf839..f614b282668 100644 --- a/yarn-project/aztec-nr/safe-math/src/safe_u120.nr +++ b/yarn-project/aztec-nr/safe-math/src/safe_u120.nr @@ -29,6 +29,7 @@ impl Deserialize for SafeU120 { } } +// Holds an integer in public storage impl SafeU120 { pub fn min() -> Self { Self { From 579a0424450f4882f514b48d0c8564262b40be37 Mon Sep 17 00:00:00 2001 From: Cat McGee Date: Thu, 15 Feb 2024 20:32:49 +0900 Subject: [PATCH 12/18] woops --- .../aztec-nr/easy-private-state/src/easy_private_state.nr | 1 + 1 file changed, 1 insertion(+) diff --git a/noir-projects/aztec-nr/easy-private-state/src/easy_private_state.nr b/noir-projects/aztec-nr/easy-private-state/src/easy_private_state.nr index d02862dcd08..06664d9ccb7 100644 --- a/noir-projects/aztec-nr/easy-private-state/src/easy_private_state.nr +++ b/noir-projects/aztec-nr/easy-private-state/src/easy_private_state.nr @@ -16,6 +16,7 @@ struct EasyPrivateUint { } // Holds a note that can act similarly to an int. +impl EasyPrivateUint { pub fn new( context: Context, storage_slot: Field, From 2cd491c555f68dbc9a945770578f5a836d04f882 Mon Sep 17 00:00:00 2001 From: Cat McGee Date: Thu, 15 Feb 2024 20:54:14 +0900 Subject: [PATCH 13/18] update paths for ci --- docs/src/preprocess/generate_aztecnr_reference.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/src/preprocess/generate_aztecnr_reference.js b/docs/src/preprocess/generate_aztecnr_reference.js index 7cebda01507..80f582e9720 100644 --- a/docs/src/preprocess/generate_aztecnr_reference.js +++ b/docs/src/preprocess/generate_aztecnr_reference.js @@ -287,8 +287,14 @@ function processFiles(baseDir, outputBaseDir) { fs.writeFileSync(outputPath, JSON.stringify({ AztecNR: docStructure }, null, 2)); } + const baseDir = path.resolve(__dirname, '../../../yarn-project/aztec-nr'); -const outputBaseDir = path.resolve(__dirname, '../../docs/developers/contracts/references/aztec-nr'); +const outputBaseDir = path.resolve(__dirname, './developers/contracts/references/aztec-nr'); + +if (process.env.CI === 'true') { + baseDir = path.resolve(__dirname, '../yarn-project/aztec-nr'); + outputBaseDir = path.resolve(__dirname, '../../docs/developers/contracts/references/aztec-nr'); +} processFiles(baseDir, outputBaseDir); From 36de06a764ab50a35709aeaf4ec7044e6b92a642 Mon Sep 17 00:00:00 2001 From: Cat McGee Date: Thu, 15 Feb 2024 20:54:45 +0900 Subject: [PATCH 14/18] const -> let --- docs/src/preprocess/generate_aztecnr_reference.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/src/preprocess/generate_aztecnr_reference.js b/docs/src/preprocess/generate_aztecnr_reference.js index 80f582e9720..93169b81408 100644 --- a/docs/src/preprocess/generate_aztecnr_reference.js +++ b/docs/src/preprocess/generate_aztecnr_reference.js @@ -288,8 +288,8 @@ function processFiles(baseDir, outputBaseDir) { } -const baseDir = path.resolve(__dirname, '../../../yarn-project/aztec-nr'); -const outputBaseDir = path.resolve(__dirname, './developers/contracts/references/aztec-nr'); +let baseDir = path.resolve(__dirname, '../../../yarn-project/aztec-nr'); +let outputBaseDir = path.resolve(__dirname, './developers/contracts/references/aztec-nr'); if (process.env.CI === 'true') { baseDir = path.resolve(__dirname, '../yarn-project/aztec-nr'); From 5eccc4111a8d159a6ac85b6a60a500e4d1af8a31 Mon Sep 17 00:00:00 2001 From: Cat McGee Date: Fri, 16 Feb 2024 18:53:57 +0900 Subject: [PATCH 15/18] update paths --- docs/src/preprocess/generate_aztecnr_reference.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/src/preprocess/generate_aztecnr_reference.js b/docs/src/preprocess/generate_aztecnr_reference.js index 93169b81408..56b6bfebea2 100644 --- a/docs/src/preprocess/generate_aztecnr_reference.js +++ b/docs/src/preprocess/generate_aztecnr_reference.js @@ -288,11 +288,11 @@ function processFiles(baseDir, outputBaseDir) { } -let baseDir = path.resolve(__dirname, '../../../yarn-project/aztec-nr'); +let baseDir = path.resolve(__dirname, '../../../noir-projects/aztec-nr'); let outputBaseDir = path.resolve(__dirname, './developers/contracts/references/aztec-nr'); if (process.env.CI === 'true') { - baseDir = path.resolve(__dirname, '../yarn-project/aztec-nr'); + baseDir = path.resolve(__dirname, '../noir-projects/aztec-nr'); outputBaseDir = path.resolve(__dirname, '../../docs/developers/contracts/references/aztec-nr'); } From a7dcd867c8f5e098d74237513caedc37369a781e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pedro=20Sousa?= Date: Thu, 22 Feb 2024 15:47:29 +0000 Subject: [PATCH 16/18] chore(docs): fix --- .../references/storage/private_state.md | 6 +- .../writing_contracts/functions/context.md | 2 +- docs/sidebars.js | 87 ++--- .../aztec-nr/address-note/address_note.md | 168 +++++++++ .../references/aztec-nr/authwit/account.md | 71 ++++ .../references/aztec-nr/authwit/auth.md | 39 ++ .../aztec-nr/authwit/auth_witness.md | 34 ++ .../aztec-nr/authwit/entrypoint/app.md | 76 ++++ .../aztec-nr/authwit/entrypoint/fee.md | 72 ++++ .../authwit/entrypoint/function_call.md | 46 +++ .../references/aztec-nr/aztec/avm/context.md | 173 +++++++++ .../references/aztec-nr/aztec/avm/hash.md | 50 +++ .../references/aztec-nr/aztec/context.md | 55 +++ .../references/aztec-nr/aztec/context/avm.md | 229 ++++++++++++ .../globals/private_global_variables.md | 26 ++ .../context/inputs/private_context_inputs.md | 12 + .../context/inputs/public_context_inputs.md | 11 + .../aztec-nr/aztec/context/private_context.md | 309 ++++++++++++++++ .../aztec-nr/aztec/context/public_context.md | 294 +++++++++++++++ .../references/aztec-nr/aztec/hash.md | 18 + .../references/aztec-nr/aztec/hasher.md | 64 ++++ .../aztec/history/nullifier_inclusion.md | 26 ++ .../aztec/history/nullifier_non_inclusion.md | 39 ++ .../references/aztec-nr/aztec/log.md | 28 ++ .../aztec/messaging/l1_to_l2_message.md | 61 ++++ .../messaging/l1_to_l2_message_getter_data.md | 24 ++ .../aztec-nr/aztec/note/note_getter.md | 31 ++ .../aztec/note/note_getter_options.md | 174 +++++++++ .../aztec-nr/aztec/note/note_header.md | 45 +++ .../aztec/note/note_viewer_options.md | 103 ++++++ .../references/aztec-nr/aztec/note/utils.md | 116 ++++++ .../aztec-nr/aztec/oracle/arguments.md | 34 ++ .../aztec-nr/aztec/oracle/context.md | 34 ++ .../aztec/oracle/create_commitment.md | 29 ++ .../aztec-nr/aztec/oracle/debug_log.md | 143 ++++++++ .../aztec/oracle/get_l1_to_l2_message.md | 34 ++ .../get_nullifier_membership_witness.md | 63 ++++ .../aztec/oracle/get_public_data_witness.md | 28 ++ .../aztec-nr/aztec/oracle/get_public_key.md | 50 +++ .../aztec-nr/aztec/oracle/get_sibling_path.md | 20 ++ .../aztec-nr/aztec/oracle/header.md | 51 +++ .../references/aztec-nr/aztec/oracle/notes.md | 68 ++++ .../aztec-nr/aztec/oracle/nullifier_key.md | 75 ++++ .../references/aztec-nr/aztec/oracle/rand.md | 28 ++ .../aztec-nr/aztec/oracle/storage.md | 80 +++++ .../aztec/state_vars/immutable_singleton.md | 83 +++++ .../aztec-nr/aztec/state_vars/map.md | 19 + .../aztec-nr/aztec/state_vars/public_state.md | 18 + .../aztec-nr/aztec/state_vars/set.md | 44 +++ .../aztec-nr/aztec/state_vars/singleton.md | 84 +++++ .../aztec/state_vars/stable_public_state.md | 34 ++ .../aztec-nr/aztec/state_vars/storage.md | 18 + .../compressed-string/compressed_string.md | 98 +++++ .../field_compressed_string.md | 110 ++++++ .../easy-private-state/easy_private_uint.md | 41 +++ .../aztec-nr/field-note/field_note.md | 165 +++++++++ .../aztec-nr/safe-math/safe_u120.md | 339 ++++++++++++++++++ .../aztec-nr/slow-updates-tree/leaf.md | 45 +++ .../aztec-nr/slow-updates-tree/slow_map.md | 161 +++++++++ .../slow-updates-tree/slow_update_proof.md | 50 +++ .../aztec-nr/value-note/balance_utils.md | 35 ++ .../references/aztec-nr/value-note/utils.md | 90 +++++ .../aztec-nr/value-note/value_note.md | 166 +++++++++ 63 files changed, 4781 insertions(+), 45 deletions(-) create mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/address-note/address_note.md create mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/authwit/account.md create mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/authwit/auth.md create mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/authwit/auth_witness.md create mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/authwit/entrypoint/app.md create mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/authwit/entrypoint/fee.md create mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/authwit/entrypoint/function_call.md create mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/avm/context.md create mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/avm/hash.md create mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/context.md create mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/context/avm.md create mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/context/globals/private_global_variables.md create mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/context/inputs/private_context_inputs.md create mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/context/inputs/public_context_inputs.md create mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/context/private_context.md create mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/context/public_context.md create mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/hash.md create mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/hasher.md create mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/history/nullifier_inclusion.md create mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/history/nullifier_non_inclusion.md create mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/log.md create mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/messaging/l1_to_l2_message.md create mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/messaging/l1_to_l2_message_getter_data.md create mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/note/note_getter.md create mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/note/note_getter_options.md create mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/note/note_header.md create mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/note/note_viewer_options.md create mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/note/utils.md create mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/arguments.md create mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/context.md create mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/create_commitment.md create mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/debug_log.md create mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/get_l1_to_l2_message.md create mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/get_nullifier_membership_witness.md create mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/get_public_data_witness.md create mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/get_public_key.md create mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/get_sibling_path.md create mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/header.md create mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/notes.md create mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/nullifier_key.md create mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/rand.md create mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/storage.md create mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/state_vars/immutable_singleton.md create mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/state_vars/map.md create mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/state_vars/public_state.md create mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/state_vars/set.md create mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/state_vars/singleton.md create mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/state_vars/stable_public_state.md create mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/state_vars/storage.md create mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/compressed-string/compressed_string.md create mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/compressed-string/field_compressed_string.md create mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/easy-private-state/easy_private_uint.md create mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/field-note/field_note.md create mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/safe-math/safe_u120.md create mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/slow-updates-tree/leaf.md create mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/slow-updates-tree/slow_map.md create mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/slow-updates-tree/slow_update_proof.md create mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/value-note/balance_utils.md create mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/value-note/utils.md create mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/value-note/value_note.md diff --git a/docs/docs/developers/contracts/references/storage/private_state.md b/docs/docs/developers/contracts/references/storage/private_state.md index 4b8d6addec1..61d3046a67c 100644 --- a/docs/docs/developers/contracts/references/storage/private_state.md +++ b/docs/docs/developers/contracts/references/storage/private_state.md @@ -202,7 +202,7 @@ Allows us to modify the storage by inserting a note into the set. A hash of the note will be generated, and inserted into the note hash tree, allowing us to later use in contract interactions. Recall that the content of the note should be shared with the owner to allow them to use it, as mentioned this can be done via an [encrypted log](../../writing_contracts/events/emit_event.md#encrypted-events), or offchain via web2, or completely offline. -#include_code insert /noir-projects/aztec-nr/easy-private-state/src/easy_private_state.nr rust +#include_code insert /noir-projects/aztec-nr/easy-private-state/src/easy_private_uint.nr rust ### `insert_from_public` @@ -220,7 +220,7 @@ Nullifiers are emitted when reading values to make sure that they are up to date An example of how to use this operation is visible in the `easy_private_state`: -#include_code remove /noir-projects/aztec-nr/easy-private-state/src/easy_private_state.nr rust +#include_code remove /noir-projects/aztec-nr/easy-private-state/src/easy_private_uint.nr rust ### `get_notes` @@ -232,7 +232,7 @@ Because of this limit, we should always consider using the second argument `Note An example of such options is using the [filter_notes_min_sum](https://github.com/AztecProtocol/aztec-packages/blob/#include_aztec_version/noir-projects/aztec-nr/value-note/src/filter.nr) to get "enough" notes to cover a given value. Essentially, this function will return just enough notes to cover the amount specified such that we don't need to read all our notes. For users with a lot of notes, this becomes increasingly important. -#include_code get_notes /noir-projects/aztec-nr/easy-private-state/src/easy_private_state.nr rust +#include_code get_notes /noir-projects/aztec-nr/easy-private-state/src/easy_private_uint.nr rust ### `view_notes` diff --git a/docs/docs/developers/contracts/writing_contracts/functions/context.md b/docs/docs/developers/contracts/writing_contracts/functions/context.md index e80d34e4ec2..99b692ffe25 100644 --- a/docs/docs/developers/contracts/writing_contracts/functions/context.md +++ b/docs/docs/developers/contracts/writing_contracts/functions/context.md @@ -81,7 +81,7 @@ In the public context this header is set by sequencer (sequencer executes public Just like with the `is_contract_deployment` flag mentioned earlier. This data will only be set to true when the current transaction is one in which a contract is being deployed. -#include_code contract-deployment-data /noir-projects/noir-protocol-circuits/src/crates/types/src/contrakt/deployment_data.nr rust +#include_code contract-deployment-data /noir-projects/noir-protocol-circuits/src/crates/types/src/contrakt/contract_deployment_data.nr rust ### Private Global Variables diff --git a/docs/sidebars.js b/docs/sidebars.js index 90ae6dcad42..9fe832ff0d3 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -11,37 +11,47 @@ // @ts-check -const fs = require('fs'); -const path = require('path'); +const fs = require("fs"); +const path = require("path"); // Load the structured documentation paths -const docsStructurePath = path.join(__dirname, '/src/preprocess/AztecnrReferenceAutogenStructure.json'); -const docsStructure = JSON.parse(fs.readFileSync(docsStructurePath, 'utf8')); +const docsStructurePath = path.join( + __dirname, + "/src/preprocess/AztecnrReferenceAutogenStructure.json" +); +const docsStructure = JSON.parse(fs.readFileSync(docsStructurePath, "utf8")); // Function to recursively build sidebar items from the structured documentation -function buildSidebarItemsFromStructure(structure, basePath = '') { - const items = []; - for (const key in structure) { - if (key === '_docs') { - // Base case: add the docs - structure[key].forEach(doc => { - items.push(`${basePath}/${doc}`); - }); - } else { - // Recursive case: process a subdirectory - const subItems = buildSidebarItemsFromStructure(structure[key], `${basePath}/${key}`); - items.push({ - type: 'category', - label: key.charAt(0).toUpperCase() + key.slice(1), // Capitalize the label - items: subItems, - }); - } +function buildSidebarItemsFromStructure(structure, basePath = "") { + const items = []; + for (const key in structure) { + if (key === "_docs") { + // Base case: add the docs + structure[key].forEach((doc) => { + items.push(`${basePath}/${doc}`); + }); + } else { + // Recursive case: process a subdirectory + const subItems = buildSidebarItemsFromStructure( + structure[key], + `${basePath}/${key}` + ); + items.push({ + type: "category", + label: key.charAt(0).toUpperCase() + key.slice(1), // Capitalize the label + items: subItems, + }); } - return items; + } + return items; } // Build sidebar for AztecNR documentation -const aztecNRSidebar = buildSidebarItemsFromStructure(docsStructure.AztecNR, 'developers/contracts/references/aztec-nr'); +const aztecNRSidebar = buildSidebarItemsFromStructure( + docsStructure.AztecNR, + "developers/contracts/references/aztec-nr" +); +console.log(aztecNRSidebar); /** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */ const sidebars = { docsSidebar: [ @@ -53,7 +63,7 @@ const sidebars = { // ABOUT AZTEC { - type: "html", + type: "html", className: "sidebar-title", value: "LEARN", defaultStyle: true, @@ -309,9 +319,7 @@ const sidebars = { id: "apis/pxe/interfaces/PXE", }, ], - }, - ], }, { @@ -362,7 +370,6 @@ const sidebars = { type: "category", items: [ "developers/contracts/writing_contracts/accounts/write_accounts_contract", - ], }, { @@ -414,7 +421,8 @@ const sidebars = { ], }, { - label: "Access public data from private state (Slow Updates Tree)", + label: + "Access public data from private state (Slow Updates Tree)", type: "category", link: { type: "doc", @@ -424,7 +432,6 @@ const sidebars = { "developers/contracts/writing_contracts/historical_data/slow_updates_tree/implement_slow_updates", ], }, - ], }, { @@ -433,16 +440,16 @@ const sidebars = { items: [ "developers/contracts/compiling_contracts/how_to_compile_contract", "developers/contracts/compiling_contracts/artifacts", - ], + ], }, { label: "Deploying Contracts", type: "category", items: [ "developers/contracts/deploying_contracts/how_to_deploy_contract", - ], + ], }, - "developers/contracts/testing_contracts/main", + "developers/contracts/testing_contracts/main", { label: "References", type: "category", @@ -457,7 +464,7 @@ const sidebars = { }, items: [ "developers/contracts/references/storage/private_state", - "developers/contracts/references/storage/public_state" + "developers/contracts/references/storage/public_state", ], }, { @@ -538,7 +545,7 @@ const sidebars = { "developers/aztecjs/guides/call_view_function", ], }, - { + { label: "References", type: "category", items: [ @@ -552,9 +559,9 @@ const sidebars = { type: "category", items: [{ dirName: "apis/accounts", type: "autogenerated" }], }, - ], - }, - ], + ], + }, + ], }, { label: "Debugging", @@ -580,9 +587,7 @@ const sidebars = { type: "doc", id: "developers/wallets/main", }, - items: [ - "developers/wallets/architecture", - ], + items: ["developers/wallets/architecture"], }, /* { @@ -631,4 +636,4 @@ const sidebars = { ], }; -module.exports = sidebars; \ No newline at end of file +module.exports = sidebars; diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/address-note/address_note.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/address-note/address_note.md new file mode 100644 index 00000000000..dd7236d3ada --- /dev/null +++ b/docs/src/preprocess/developers/contracts/references/aztec-nr/address-note/address_note.md @@ -0,0 +1,168 @@ +# AddressNote + +Stores an address + +## Fields +| Field | Type | +| --- | --- | +| address | AztecAddress | +| owner | AztecAddress | +| randomness | Field | +| header | NoteHeader | + +## Methods + +### new + +```rust +AddressNote::new(address, owner); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| address | AztecAddress | +| owner | AztecAddress | + +#### Returns +| Type | +| --- | +| Self | + +## Standalone Functions + +### serialize_content + +```rust +serialize_content(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| Field; ADDRESS_NOTE_LEN] | + +### deserialize_content + +```rust +deserialize_content(serialized_note); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| serialized_note | [Field; ADDRESS_NOTE_LEN] | + +#### Returns +| Type | +| --- | +| Self | + +### compute_note_content_hash + +```rust +compute_note_content_hash(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| Field | + +### compute_nullifier + +```rust +compute_nullifier(self, context); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| context | &mut PrivateContext | + +#### Returns +| Type | +| --- | +| Field | + +### compute_nullifier_without_context + +```rust +compute_nullifier_without_context(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| Field | + +### set_header + +```rust +set_header(&mut self, header); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| header | NoteHeader | + +### get_header + +```rust +get_header(note); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| note | Self | + +#### Returns +| Type | +| --- | +| NoteHeader | + +### broadcast + +```rust +broadcast(self, context, slot); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| context | &mut PrivateContext | +| slot | Field | + +### get_note_type_id + +```rust +get_note_type_id(); +``` + +Takes no parameters. + +#### Returns +| Type | +| --- | +| Field | + diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/authwit/account.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/authwit/account.md new file mode 100644 index 00000000000..ba147147d3f --- /dev/null +++ b/docs/src/preprocess/developers/contracts/references/aztec-nr/authwit/account.md @@ -0,0 +1,71 @@ +# AccountActions + +## Fields +| Field | Type | +| --- | --- | +| context | Context | +| is_valid_impl | fn(&mut PrivateContext, Field) -> bool | +| approved_action | Map<Field, PublicState<bool>> | + +## Methods + +### entrypoint + +```rust +AccountActions::entrypoint(self, app_payload, fee_payload); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| app_payload | AppPayload | +| fee_payload | FeePayload | + +### is_valid + +```rust +AccountActions::is_valid(self, message_hash); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| message_hash | Field | + +#### Returns +| Type | +| --- | +| Field | + +### is_valid_public + +```rust +AccountActions::is_valid_public(self, message_hash); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| message_hash | Field | + +#### Returns +| Type | +| --- | +| Field | + +### internal_set_is_valid_storage + +```rust +AccountActions::internal_set_is_valid_storage(self, message_hash, value); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| message_hash | Field | +| value | bool | + diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/authwit/auth.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/authwit/auth.md new file mode 100644 index 00000000000..fbb36a220da --- /dev/null +++ b/docs/src/preprocess/developers/contracts/references/aztec-nr/authwit/auth.md @@ -0,0 +1,39 @@ +## Standalone Functions + +### assert_current_call_valid_authwit + +```rust +assert_current_call_valid_authwit(context, on_behalf_of); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| context | &mut PrivateContext | +| on_behalf_of | AztecAddress | + +### assert_valid_authwit_public + +```rust +assert_valid_authwit_public(context, on_behalf_of, message_hash); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| context | &mut PublicContext | +| on_behalf_of | AztecAddress | +| message_hash | Field | + +### assert_current_call_valid_authwit_public + +```rust +assert_current_call_valid_authwit_public(context, on_behalf_of); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| context | &mut PublicContext | +| on_behalf_of | AztecAddress | + diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/authwit/auth_witness.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/authwit/auth_witness.md new file mode 100644 index 00000000000..78b55d0b66d --- /dev/null +++ b/docs/src/preprocess/developers/contracts/references/aztec-nr/authwit/auth_witness.md @@ -0,0 +1,34 @@ +## Standalone Functions + +### get_auth_witness_oracle + +```rust +get_auth_witness_oracle(_message_hash); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| _message_hash | Field | + +#### Returns +| Type | +| --- | +| Field; N] | + +### get_auth_witness + +```rust +get_auth_witness(message_hash); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| message_hash | Field | + +#### Returns +| Type | +| --- | +| Field; N] | + diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/authwit/entrypoint/app.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/authwit/entrypoint/app.md new file mode 100644 index 00000000000..7dcaa5379d4 --- /dev/null +++ b/docs/src/preprocess/developers/contracts/references/aztec-nr/authwit/entrypoint/app.md @@ -0,0 +1,76 @@ +# AppPayload + +Note: If you change the following struct you have to update default_entrypoint.ts + +## Fields +| Field | Type | +| --- | --- | +| function_calls | FunctionCall; ACCOUNT_MAX_CALLS] | +| nonce | Field | + +## Methods + +### to_be_bytes + +Serializes the payload as an array of bytes. Useful for hashing with sha256. + +```rust +AppPayload::to_be_bytes(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| u8; APP_PAYLOAD_SIZE_IN_BYTES] | + +### execute_calls + +```rust +AppPayload::execute_calls(self, context); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| context | &mut PrivateContext | + +## Standalone Functions + +### serialize + +```rust +serialize(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| Field; APP_PAYLOAD_SIZE] | + +### hash + +```rust +hash(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| Field | + diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/authwit/entrypoint/fee.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/authwit/entrypoint/fee.md new file mode 100644 index 00000000000..51a07cb1722 --- /dev/null +++ b/docs/src/preprocess/developers/contracts/references/aztec-nr/authwit/entrypoint/fee.md @@ -0,0 +1,72 @@ +# FeePayload + +## Fields +| Field | Type | +| --- | --- | +| function_calls | FunctionCall; MAX_FEE_FUNCTION_CALLS] | +| nonce | Field | + +## Methods + +### to_be_bytes + +```rust +FeePayload::to_be_bytes(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| u8; FEE_PAYLOAD_SIZE_IN_BYTES] | + +### execute_calls + +```rust +FeePayload::execute_calls(self, context); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| context | &mut PrivateContext | + +## Standalone Functions + +### serialize + +```rust +serialize(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| Field; FEE_PAYLOAD_SIZE] | + +### hash + +```rust +hash(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| Field | + diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/authwit/entrypoint/function_call.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/authwit/entrypoint/function_call.md new file mode 100644 index 00000000000..2def72c8262 --- /dev/null +++ b/docs/src/preprocess/developers/contracts/references/aztec-nr/authwit/entrypoint/function_call.md @@ -0,0 +1,46 @@ +# FunctionCall + +## Fields +| Field | Type | +| --- | --- | +| args_hash | Field | +| function_selector | FunctionSelector | +| target_address | AztecAddress | +| is_public | bool | + +## Methods + +### to_be_bytes + +```rust +FunctionCall::to_be_bytes(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| u8; FUNCTION_CALL_SIZE_IN_BYTES] | + +## Standalone Functions + +### serialize + +```rust +serialize(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| Field; FUNCTION_CALL_SIZE] | + diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/avm/context.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/avm/context.md new file mode 100644 index 00000000000..9513e9083b9 --- /dev/null +++ b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/avm/context.md @@ -0,0 +1,173 @@ +# AvmContext + +## Methods + +### address + +```rust +AvmContext::address(); +``` + +Takes no parameters. + +#### Returns +| Type | +| --- | +| AztecAddress | + +### storage_address + +```rust +AvmContext::storage_address(); +``` + +Takes no parameters. + +#### Returns +| Type | +| --- | +| AztecAddress | + +### origin + +```rust +AvmContext::origin(); +``` + +Takes no parameters. + +#### Returns +| Type | +| --- | +| AztecAddress | + +### sender + +```rust +AvmContext::sender(); +``` + +Takes no parameters. + +#### Returns +| Type | +| --- | +| AztecAddress | + +### portal + +```rust +AvmContext::portal(); +``` + +Takes no parameters. + +#### Returns +| Type | +| --- | +| EthAddress | + +### fee_per_l1_gas + +```rust +AvmContext::fee_per_l1_gas(); +``` + +Takes no parameters. + +#### Returns +| Type | +| --- | +| Field | + +### fee_per_l2_gas + +```rust +AvmContext::fee_per_l2_gas(); +``` + +Takes no parameters. + +#### Returns +| Type | +| --- | +| Field | + +### fee_per_da_gas + +```rust +AvmContext::fee_per_da_gas(); +``` + +Takes no parameters. + +#### Returns +| Type | +| --- | +| Field | + +### chain_id + +```rust +AvmContext::chain_id(); +``` + +Takes no parameters. + +#### Returns +| Type | +| --- | +| Field | + +### version + +```rust +AvmContext::version(); +``` + +Takes no parameters. + +#### Returns +| Type | +| --- | +| Field | + +### block_number + +```rust +AvmContext::block_number(); +``` + +Takes no parameters. + +#### Returns +| Type | +| --- | +| Field | + +### timestamp + +```rust +AvmContext::timestamp(); +``` + +Takes no parameters. + +#### Returns +| Type | +| --- | +| Field | + +### contract_call_depth + +```rust +AvmContext::contract_call_depth(); +``` + +Takes no parameters. + +#### Returns +| Type | +| --- | +| Field | + diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/avm/hash.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/avm/hash.md new file mode 100644 index 00000000000..ad40c675723 --- /dev/null +++ b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/avm/hash.md @@ -0,0 +1,50 @@ +## Standalone Functions + +### keccak256 + +```rust +keccak256(input); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| input | [Field; N] | + +#### Returns +| Type | +| --- | +| Field; 2] | + +### poseidon + +```rust +poseidon(input); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| input | [Field; N] | + +#### Returns +| Type | +| --- | +| Field | + +### sha256 + +```rust +sha256(input); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| input | [Field; N] | + +#### Returns +| Type | +| --- | +| Field; 2] | + diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/context.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/context.md new file mode 100644 index 00000000000..bcd14ad3c20 --- /dev/null +++ b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/context.md @@ -0,0 +1,55 @@ +# Context + +## Fields +| Field | Type | +| --- | --- | +| private | Option<&mut PrivateContext> | +| public | Option<&mut PublicContext> | + +## Methods + +### private + +```rust +Context::private(context); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| context | &mut PrivateContext | + +#### Returns +| Type | +| --- | +| Context | + +### public + +```rust +Context::public(context); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| context | &mut PublicContext | + +#### Returns +| Type | +| --- | +| Context | + +### none + +```rust +Context::none(); +``` + +Takes no parameters. + +#### Returns +| Type | +| --- | +| Context | + diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/context/avm.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/context/avm.md new file mode 100644 index 00000000000..5de339db53d --- /dev/null +++ b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/context/avm.md @@ -0,0 +1,229 @@ +# AVMContext + +Getters that will be converted by the transpiler into their own opcodes + +## Methods + +### new + +Empty new function enables retaining context.<value> syntax + +```rust +AVMContext::new(); +``` + +Takes no parameters. + +#### Returns +| Type | +| --- | +| Self | + +### address + +```rust +AVMContext::address(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| AztecAddress | + +### storage_address + +```rust +AVMContext::storage_address(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| AztecAddress | + +### origin + +```rust +AVMContext::origin(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| AztecAddress | + +### sender + +```rust +AVMContext::sender(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| AztecAddress | + +### portal + +```rust +AVMContext::portal(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| EthAddress | + +### fee_per_l1_gas + +```rust +AVMContext::fee_per_l1_gas(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| Field | + +### fee_per_l2_gas + +```rust +AVMContext::fee_per_l2_gas(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| Field | + +### fee_per_da_gas + +```rust +AVMContext::fee_per_da_gas(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| Field | + +### chain_id + +```rust +AVMContext::chain_id(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| Field | + +### version + +```rust +AVMContext::version(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| Field | + +### block_number + +```rust +AVMContext::block_number(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| Field | + +### timestamp + +```rust +AVMContext::timestamp(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| Field | + +### contract_call_depth + +```rust +AVMContext::contract_call_depth(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| Field | + diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/context/globals/private_global_variables.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/context/globals/private_global_variables.md new file mode 100644 index 00000000000..32536339ffe --- /dev/null +++ b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/context/globals/private_global_variables.md @@ -0,0 +1,26 @@ +# PrivateGlobalVariables + +## Fields +| Field | Type | +| --- | --- | +| chain_id | Field | +| version | Field | + +## Standalone Functions + +### serialize + +```rust +serialize(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| Field; PRIVATE_GLOBAL_VARIABLES_LENGTH] | + diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/context/inputs/private_context_inputs.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/context/inputs/private_context_inputs.md new file mode 100644 index 00000000000..4286078f99c --- /dev/null +++ b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/context/inputs/private_context_inputs.md @@ -0,0 +1,12 @@ +# PrivateContextInputs + +PrivateContextInputs are expected to be provided to each private function + +## Fields +| Field | Type | +| --- | --- | +| call_context | CallContext | +| historical_header | Header | +| contract_deployment_data | ContractDeploymentData | +| private_global_variables | PrivateGlobalVariables | + diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/context/inputs/public_context_inputs.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/context/inputs/public_context_inputs.md new file mode 100644 index 00000000000..2c3fce13fb8 --- /dev/null +++ b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/context/inputs/public_context_inputs.md @@ -0,0 +1,11 @@ +# PublicContextInputs + +PublicContextInputs are expected to be provided to each public function + +## Fields +| Field | Type | +| --- | --- | +| call_context | CallContext | +| historical_header | Header | +| public_global_variables | PublicGlobalVariables | + diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/context/private_context.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/context/private_context.md new file mode 100644 index 00000000000..057ee2c983c --- /dev/null +++ b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/context/private_context.md @@ -0,0 +1,309 @@ +# PrivateContext + +When finished, one can call .finish() to convert back to the abi + +## Fields +| Field | Type | +| --- | --- | +| inputs | PrivateContextInputs | +| side_effect_counter | u32 | +| min_revertible_side_effect_counter | u32 | +| args_hash | Field | +| return_values | BoundedVec<Field, RETURN_VALUES_LENGTH> | +| read_requests | BoundedVec<SideEffect, MAX_READ_REQUESTS_PER_CALL> | +| nullifier_key_validation_requests | BoundedVec<NullifierKeyValidationRequest, MAX_NULLIFIER_KEY_VALIDATION_REQUESTS_PER_CALL> | +| new_commitments | BoundedVec<SideEffect, MAX_NEW_COMMITMENTS_PER_CALL> | +| new_nullifiers | BoundedVec<SideEffectLinkedToNoteHash, MAX_NEW_NULLIFIERS_PER_CALL> | +| private_call_stack_hashes | BoundedVec<Field, MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL> | +| public_call_stack_hashes | BoundedVec<Field, MAX_PUBLIC_CALL_STACK_LENGTH_PER_CALL> | +| new_l2_to_l1_msgs | BoundedVec<L2ToL1Message, MAX_NEW_L2_TO_L1_MSGS_PER_CALL> | +| historical_header | Header | +| nullifier_key | Option<NullifierKeyPair> | + +## Methods + +### new + +```rust +PrivateContext::new(inputs, args_hash); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| inputs | PrivateContextInputs | +| args_hash | Field | + +#### Returns +| Type | +| --- | +| PrivateContext | + +### msg_sender + +```rust +PrivateContext::msg_sender(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| AztecAddress | + +### this_address + +```rust +PrivateContext::this_address(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| AztecAddress | + +### this_portal_address + +```rust +PrivateContext::this_portal_address(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| EthAddress | + +### chain_id + +```rust +PrivateContext::chain_id(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| Field | + +### version + +```rust +PrivateContext::version(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| Field | + +### selector + +```rust +PrivateContext::selector(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| FunctionSelector | + +### get_header + +Returns the header of a block whose state is used during private execution (not the block the transaction is included in). + +```rust +PrivateContext::get_header(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| Header | + +### get_header_at + +Returns the header of an arbitrary block whose block number is less than or equal to the block number of historical header. + +```rust +PrivateContext::get_header_at(self, block_number); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| block_number | u32 | + +#### Returns +| Type | +| --- | +| Header | + +### finish + +```rust +PrivateContext::finish(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| PrivateCircuitPublicInputs | + +### capture_min_revertible_side_effect_counter + +```rust +PrivateContext::capture_min_revertible_side_effect_counter(&mut self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | + +### push_read_request + +```rust +PrivateContext::push_read_request(&mut self, read_request); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| read_request | Field | + +### push_new_note_hash + +```rust +PrivateContext::push_new_note_hash(&mut self, note_hash); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| note_hash | Field | + +### push_new_nullifier + +```rust +PrivateContext::push_new_nullifier(&mut self, nullifier, nullified_commitment); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| nullifier | Field | +| nullified_commitment | Field | + +### request_nullifier_secret_key + +```rust +PrivateContext::request_nullifier_secret_key(&mut self, account); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| account | AztecAddress | + +#### Returns +| Type | +| --- | +| GrumpkinPrivateKey | + +### message_portal + +```rust +PrivateContext::message_portal(&mut self, recipient, content); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| recipient | EthAddress | +| content | Field | + +### consume_l1_to_l2_message + +```rust +PrivateContext::consume_l1_to_l2_message(&mut self, msg_key, content, secret, sender); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| msg_key | Field | +| content | Field | +| secret | Field | +| sender | EthAddress | + +## Standalone Functions + +### accumulate_encrypted_logs + +```rust +accumulate_encrypted_logs(&mut self, log); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| log | [Field; N] | + +### accumulate_unencrypted_logs + +```rust +accumulate_unencrypted_logs(&mut self, log); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| log | T | + diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/context/public_context.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/context/public_context.md new file mode 100644 index 00000000000..f0ef34060a2 --- /dev/null +++ b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/context/public_context.md @@ -0,0 +1,294 @@ +# PublicContext + +## Fields +| Field | Type | +| --- | --- | +| inputs | PublicContextInputs | +| side_effect_counter | u32 | +| args_hash | Field | +| return_values | BoundedVec<Field, RETURN_VALUES_LENGTH> | +| contract_storage_update_requests | BoundedVec<StorageUpdateRequest, MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_CALL> | +| contract_storage_reads | BoundedVec<StorageRead, MAX_PUBLIC_DATA_READS_PER_CALL> | +| public_call_stack_hashes | BoundedVec<Field, MAX_PUBLIC_CALL_STACK_LENGTH_PER_CALL> | +| new_commitments | BoundedVec<SideEffect, MAX_NEW_COMMITMENTS_PER_CALL> | +| new_nullifiers | BoundedVec<SideEffectLinkedToNoteHash, MAX_NEW_NULLIFIERS_PER_CALL> | +| new_l2_to_l1_msgs | BoundedVec<L2ToL1Message, MAX_NEW_L2_TO_L1_MSGS_PER_CALL> | +| unencrypted_logs_hash | BoundedVec<Field, NUM_FIELDS_PER_SHA256> | +| unencrypted_logs_preimages_length | Field | +| historical_header | Header | +| prover_address | AztecAddress | + +## Methods + +### new + +```rust +PublicContext::new(inputs, args_hash); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| inputs | PublicContextInputs | +| args_hash | Field | + +#### Returns +| Type | +| --- | +| PublicContext | + +### msg_sender + +```rust +PublicContext::msg_sender(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| AztecAddress | + +### this_address + +```rust +PublicContext::this_address(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| AztecAddress | + +### this_portal_address + +```rust +PublicContext::this_portal_address(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| EthAddress | + +### chain_id + +```rust +PublicContext::chain_id(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| Field | + +### version + +```rust +PublicContext::version(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| Field | + +### selector + +```rust +PublicContext::selector(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| FunctionSelector | + +### block_number + +```rust +PublicContext::block_number(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| Field | + +### timestamp + +```rust +PublicContext::timestamp(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| Field | + +### coinbase + +```rust +PublicContext::coinbase(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| EthAddress | + +### fee_recipient + +```rust +PublicContext::fee_recipient(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| AztecAddress | + +### finish + +```rust +PublicContext::finish(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| PublicCircuitPublicInputs | + +### push_new_note_hash + +```rust +PublicContext::push_new_note_hash(&mut self, note_hash); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| note_hash | Field | + +### push_new_nullifier + +```rust +PublicContext::push_new_nullifier(&mut self, nullifier, _nullified_commitment); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| nullifier | Field | +| _nullified_commitment | Field | + +### message_portal + +```rust +PublicContext::message_portal(&mut self, recipient, content); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| recipient | EthAddress | +| content | Field | + +### consume_l1_to_l2_message + +```rust +PublicContext::consume_l1_to_l2_message(&mut self, msg_key, content, secret, sender); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| msg_key | Field | +| content | Field | +| secret | Field | +| sender | EthAddress | + +## Standalone Functions + +### accumulate_encrypted_logs + +```rust +accumulate_encrypted_logs(&mut self, log); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| log | [Field; N] | + +### accumulate_unencrypted_logs + +```rust +accumulate_unencrypted_logs(&mut self, log); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| log | T | + diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/hash.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/hash.md new file mode 100644 index 00000000000..b780b0b625b --- /dev/null +++ b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/hash.md @@ -0,0 +1,18 @@ +## Standalone Functions + +### compute_secret_hash + +```rust +compute_secret_hash(secret); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| secret | Field | + +#### Returns +| Type | +| --- | +| Field | + diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/hasher.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/hasher.md new file mode 100644 index 00000000000..8b0c22e0e7e --- /dev/null +++ b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/hasher.md @@ -0,0 +1,64 @@ +# Hasher + +## Fields +| Field | Type | +| --- | --- | +| fields | Field] | + +## Methods + +### new + +```rust +Hasher::new(); +``` + +Takes no parameters. + +#### Returns +| Type | +| --- | +| Self | + +### add + +```rust +Hasher::add(&mut self, field); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| field | Field | + +## Standalone Functions + +### hash + +```rust +hash(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| Field | + +### add_multiple + +```rust +add_multiple(&mut self, fields); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| fields | [Field; N] | + diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/history/nullifier_inclusion.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/history/nullifier_inclusion.md new file mode 100644 index 00000000000..829311b108b --- /dev/null +++ b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/history/nullifier_inclusion.md @@ -0,0 +1,26 @@ +## Standalone Functions + +### _nullifier_inclusion + +```rust +_nullifier_inclusion(nullifier, header); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| nullifier | Field | +| header | Header | + +### prove_nullifier_inclusion + +```rust +prove_nullifier_inclusion(nullifier, context); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| nullifier | Field | +| context | PrivateContext | + diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/history/nullifier_non_inclusion.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/history/nullifier_non_inclusion.md new file mode 100644 index 00000000000..fcdf75dee76 --- /dev/null +++ b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/history/nullifier_non_inclusion.md @@ -0,0 +1,39 @@ +## Standalone Functions + +### _nullifier_non_inclusion + +```rust +_nullifier_non_inclusion(nullifier, header); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| nullifier | Field | +| header | Header | + +### prove_nullifier_not_included + +```rust +prove_nullifier_not_included(nullifier, context); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| nullifier | Field | +| context | PrivateContext | + +### prove_nullifier_not_included_at + +```rust +prove_nullifier_not_included_at(nullifier, block_number, context); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| nullifier | Field | +| block_number | u32 | +| context | PrivateContext | + diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/log.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/log.md new file mode 100644 index 00000000000..aa4fe82bed9 --- /dev/null +++ b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/log.md @@ -0,0 +1,28 @@ +## Standalone Functions + +### emit_unencrypted_log + +```rust +emit_unencrypted_log(context, log); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| context | &mut PublicContext | +| log | T | + +### emit_unencrypted_log_from_private + +```rust +emit_unencrypted_log_from_private(context, log); +``` + +If we decide to keep this function around would make sense to wait for traits and then merge it with emit_unencrypted_log. + +#### Parameters +| Name | Type | +| --- | --- | +| context | &mut PrivateContext | +| log | T | + diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/messaging/l1_to_l2_message.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/messaging/l1_to_l2_message.md new file mode 100644 index 00000000000..0ad0daad6b5 --- /dev/null +++ b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/messaging/l1_to_l2_message.md @@ -0,0 +1,61 @@ +# L1ToL2Message + +## Fields +| Field | Type | +| --- | --- | +| sender | EthAddress | +| chainId | Field | +| recipient | AztecAddress | +| version | Field | +| content | Field | +| secret | Field | +| secret_hash | Field | +| deadline | u32 | +| fee | u64 | +| tree_index | Field | + +## Methods + +### validate_message_secret + +```rust +L1ToL2Message::validate_message_secret(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | Self | + +### hash + +```rust +L1ToL2Message::hash(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | Self | + +#### Returns +| Type | +| --- | +| Field | + +### compute_nullifier + +```rust +L1ToL2Message::compute_nullifier(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | Self | + +#### Returns +| Type | +| --- | +| Field | + diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/messaging/l1_to_l2_message_getter_data.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/messaging/l1_to_l2_message_getter_data.md new file mode 100644 index 00000000000..4df828b6298 --- /dev/null +++ b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/messaging/l1_to_l2_message_getter_data.md @@ -0,0 +1,24 @@ +# L1ToL2MessageGetterData + +## Fields +| Field | Type | +| --- | --- | +| message | L1ToL2Message | +| sibling_path | Field; L1_TO_L2_MSG_TREE_HEIGHT] | +| leaf_index | Field | + +## Standalone Functions + +### l1_to_l2_message_getter_len + +```rust +l1_to_l2_message_getter_len(); +``` + +Takes no parameters. + +#### Returns +| Type | +| --- | +| Field | + diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/note/note_getter.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/note/note_getter.md new file mode 100644 index 00000000000..0dd21bbb6e5 --- /dev/null +++ b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/note/note_getter.md @@ -0,0 +1,31 @@ +## Standalone Functions + +### check_note_fields + +```rust +check_note_fields(fields, selects, N>); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| fields | [Field; N] | +| selects | BoundedVec<Option<Select> | +| N> | | + +### get_note_internal + +```rust +get_note_internal(storage_slot); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| storage_slot | Field | + +#### Returns +| Type | +| --- | +| Note where Note: NoteInterface<N> | + diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/note/note_getter_options.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/note/note_getter_options.md new file mode 100644 index 00000000000..f01b40883dc --- /dev/null +++ b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/note/note_getter_options.md @@ -0,0 +1,174 @@ +# ComparatorEnum + +## Fields +| Field | Type | +| --- | --- | +| EQ | u3 | +| NEQ | u3 | +| LT | u3 | +| LTE | u3 | +| GT | u3 | +| GTE | u3 | + +# Select + +## Fields +| Field | Type | +| --- | --- | +| field_index | u8 | +| value | Field | +| comparator | u3 | + +## Methods + +### new + +```rust +Select::new(field_index, value, comparator); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| field_index | u8 | +| value | Field | +| comparator | u3 | + +#### Returns +| Type | +| --- | +| Self | + +# SortOrderEnum + +## Fields +| Field | Type | +| --- | --- | +| DESC | u2 | +| ASC | u2 | + +# Sort + +## Fields +| Field | Type | +| --- | --- | +| field_index | u8 | +| order | u2 | + +## Methods + +### new + +```rust +Sort::new(field_index, order); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| field_index | u8 | +| order | u2 | + +#### Returns +| Type | +| --- | +| Self | + +# NoteStatusEnum + +## Fields +| Field | Type | +| --- | --- | +| ACTIVE | u2 | +| ACTIVE_OR_NULLIFIED | u2 | + +## Standalone Functions + +### select + +```rust +select(&mut self, field_index, value, comparator); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| field_index | u8 | +| value | Field | +| comparator | Option<u3> | + +#### Returns +| Type | +| --- | +| Self | + +### sort + +```rust +sort(&mut self, field_index, order); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| field_index | u8 | +| order | u2 | + +#### Returns +| Type | +| --- | +| Self | + +### set_limit + +```rust +set_limit(&mut self, limit); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| limit | u32 | + +#### Returns +| Type | +| --- | +| Self | + +### set_offset + +```rust +set_offset(&mut self, offset); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| offset | u32 | + +#### Returns +| Type | +| --- | +| Self | + +### set_status + +```rust +set_status(&mut self, status); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| status | u2 | + +#### Returns +| Type | +| --- | +| Self | + diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/note/note_header.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/note/note_header.md new file mode 100644 index 00000000000..7d5934ed679 --- /dev/null +++ b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/note/note_header.md @@ -0,0 +1,45 @@ +# NoteHeader + +## Fields +| Field | Type | +| --- | --- | +| contract_address | AztecAddress | +| nonce | Field | +| storage_slot | Field | +| is_transient | bool | + +## Methods + +### new + +```rust +NoteHeader::new(contract_address, nonce, storage_slot); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| contract_address | AztecAddress | +| nonce | Field | +| storage_slot | Field | + +#### Returns +| Type | +| --- | +| Self | + +## Standalone Functions + +### empty + +```rust +empty(); +``` + +Takes no parameters. + +#### Returns +| Type | +| --- | +| Self | + diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/note/note_viewer_options.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/note/note_viewer_options.md new file mode 100644 index 00000000000..94f3ad864b0 --- /dev/null +++ b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/note/note_viewer_options.md @@ -0,0 +1,103 @@ +## Standalone Functions + +### new + +```rust +new(); +``` + +Takes no parameters. + +#### Returns +| Type | +| --- | +| NoteViewerOptions<Note, N> where Note: NoteInterface<N> | + +### select + +```rust +select(&mut self, field_index, value, comparator); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| field_index | u8 | +| value | Field | +| comparator | Option<u3> | + +#### Returns +| Type | +| --- | +| Self | + +### sort + +```rust +sort(&mut self, field_index, order); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| field_index | u8 | +| order | u2 | + +#### Returns +| Type | +| --- | +| Self | + +### set_limit + +```rust +set_limit(&mut self, limit); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| limit | u32 | + +#### Returns +| Type | +| --- | +| Self | + +### set_offset + +```rust +set_offset(&mut self, offset); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| offset | u32 | + +#### Returns +| Type | +| --- | +| Self | + +### set_status + +```rust +set_status(&mut self, status); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| status | u2 | + +#### Returns +| Type | +| --- | +| Self | + diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/note/utils.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/note/utils.md new file mode 100644 index 00000000000..bf4e18caa94 --- /dev/null +++ b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/note/utils.md @@ -0,0 +1,116 @@ +## Standalone Functions + +### compute_siloed_hash + +```rust +compute_siloed_hash(contract_address, inner_note_hash); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| contract_address | AztecAddress | +| inner_note_hash | Field | + +#### Returns +| Type | +| --- | +| Field | + +### compute_unique_hash + +```rust +compute_unique_hash(nonce, siloed_note_hash); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| nonce | Field | +| siloed_note_hash | Field | + +#### Returns +| Type | +| --- | +| Field | + +### compute_inner_note_hash + +```rust +compute_inner_note_hash(note); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| note | Note | + +#### Returns +| Type | +| --- | +| Field where Note: NoteInterface<N> | + +### compute_siloed_note_hash + +```rust +compute_siloed_note_hash(note_with_header); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| note_with_header | Note | + +#### Returns +| Type | +| --- | +| Field where Note: NoteInterface<N> | + +### compute_unique_siloed_note_hash + +```rust +compute_unique_siloed_note_hash(note_with_header); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| note_with_header | Note | + +#### Returns +| Type | +| --- | +| Field where Note: NoteInterface<N> | + +### compute_note_hash_for_insertion + +```rust +compute_note_hash_for_insertion(note); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| note | Note | + +#### Returns +| Type | +| --- | +| Field where Note: NoteInterface<N> | + +### compute_note_hash_for_consumption + +```rust +compute_note_hash_for_consumption(note); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| note | Note | + +#### Returns +| Type | +| --- | +| Field where Note: NoteInterface<N> | + diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/arguments.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/arguments.md new file mode 100644 index 00000000000..b68446fd403 --- /dev/null +++ b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/arguments.md @@ -0,0 +1,34 @@ +## Standalone Functions + +### pack_arguments_oracle + +```rust +pack_arguments_oracle(_args); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| _args | [Field; N] | + +#### Returns +| Type | +| --- | +| Field | + +### pack_arguments + +```rust +pack_arguments(args); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| args | [Field; N] | + +#### Returns +| Type | +| --- | +| Field | + diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/context.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/context.md new file mode 100644 index 00000000000..352ce1613f9 --- /dev/null +++ b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/context.md @@ -0,0 +1,34 @@ +## Standalone Functions + +### _get_portal_address + +```rust +_get_portal_address(_contract_address); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| _contract_address | AztecAddress | + +#### Returns +| Type | +| --- | +| EthAddress | + +### get_portal_address + +```rust +get_portal_address(contract_address); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| contract_address | AztecAddress | + +#### Returns +| Type | +| --- | +| EthAddress | + diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/create_commitment.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/create_commitment.md new file mode 100644 index 00000000000..cdadf1c75cf --- /dev/null +++ b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/create_commitment.md @@ -0,0 +1,29 @@ +## Standalone Functions + +### create_commitment_oracle + +```rust +create_commitment_oracle(_commitment); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| _commitment | Field | + +#### Returns +| Type | +| --- | +| Field | + +### create_commitment + +```rust +create_commitment(commitment); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| commitment | Field | + diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/debug_log.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/debug_log.md new file mode 100644 index 00000000000..bceb43f266e --- /dev/null +++ b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/debug_log.md @@ -0,0 +1,143 @@ +## Standalone Functions + +### debug_log_oracle + +```rust +debug_log_oracle(_msg, _num_args); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| _msg | T | +| _num_args | Field | + +#### Returns +| Type | +| --- | +| Field | + +### debug_log_format_oracle + +```rust +debug_log_format_oracle(_msg, _args, _num_args); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| _msg | T | +| _args | [Field; N] | +| _num_args | Field | + +#### Returns +| Type | +| --- | +| Field | + +### debug_log_field_oracle + +```rust +debug_log_field_oracle(_field); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| _field | Field | + +#### Returns +| Type | +| --- | +| Field | + +### debug_log_array_oracle + +```rust +debug_log_array_oracle(_arbitrary_array); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| _arbitrary_array | [T; N] | + +#### Returns +| Type | +| --- | +| Field | + +### debug_log_array_with_prefix_oracle + +```rust +debug_log_array_with_prefix_oracle(_prefix, _arbitrary_array); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| _prefix | S | +| _arbitrary_array | [T; N] | + +#### Returns +| Type | +| --- | +| Field | + +### debug_log + +```rust +debug_log(msg); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| msg | T | + +### debug_log_format + +```rust +debug_log_format(msg, args); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| msg | T | +| args | [Field; N] | + +### debug_log_field + +```rust +debug_log_field(field); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| field | Field | + +### debug_log_array + +```rust +debug_log_array(arbitrary_array); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| arbitrary_array | [T; N] | + +### debug_log_array_with_prefix + +```rust +debug_log_array_with_prefix(prefix, arbitrary_array); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| prefix | S | +| arbitrary_array | [T; N] | + diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/get_l1_to_l2_message.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/get_l1_to_l2_message.md new file mode 100644 index 00000000000..41023a34cd1 --- /dev/null +++ b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/get_l1_to_l2_message.md @@ -0,0 +1,34 @@ +## Standalone Functions + +### get_l1_to_l2_msg_oracle + +```rust +get_l1_to_l2_msg_oracle(_msg_key); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| _msg_key | Field | + +#### Returns +| Type | +| --- | +| Field; L1_TO_L2_MESSAGE_ORACLE_CALL_LENGTH] | + +### get_l1_to_l2_message_call + +```rust +get_l1_to_l2_message_call(msg_key); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| msg_key | Field | + +#### Returns +| Type | +| --- | +| Field; L1_TO_L2_MESSAGE_ORACLE_CALL_LENGTH] | + diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/get_nullifier_membership_witness.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/get_nullifier_membership_witness.md new file mode 100644 index 00000000000..a948a733d5e --- /dev/null +++ b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/get_nullifier_membership_witness.md @@ -0,0 +1,63 @@ +# NullifierMembershipWitness + +## Fields +| Field | Type | +| --- | --- | +| index | Field | +| leaf_preimage | NullifierLeafPreimage | +| path | Field; NULLIFIER_TREE_HEIGHT] | + +## Methods + +### deserialize + +```rust +NullifierMembershipWitness::deserialize(fields); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| fields | [Field; NULLIFIER_MEMBERSHIP_WITNESS] | + +#### Returns +| Type | +| --- | +| Self | + +## Standalone Functions + +### get_low_nullifier_membership_witness + +```rust +get_low_nullifier_membership_witness(block_number, nullifier); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| block_number | u32 | +| nullifier | Field | + +#### Returns +| Type | +| --- | +| NullifierMembershipWitness | + +### get_nullifier_membership_witness + +```rust +get_nullifier_membership_witness(block_number, nullifier); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| block_number | u32 | +| nullifier | Field | + +#### Returns +| Type | +| --- | +| NullifierMembershipWitness | + diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/get_public_data_witness.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/get_public_data_witness.md new file mode 100644 index 00000000000..97228bfa0d2 --- /dev/null +++ b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/get_public_data_witness.md @@ -0,0 +1,28 @@ +# PublicDataWitness + +## Fields +| Field | Type | +| --- | --- | +| index | Field | +| leaf_preimage | PublicDataTreeLeafPreimage | +| path | Field; PUBLIC_DATA_TREE_HEIGHT] | + +## Standalone Functions + +### get_public_data_witness + +```rust +get_public_data_witness(block_number, leaf_slot); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| block_number | u32 | +| leaf_slot | Field | + +#### Returns +| Type | +| --- | +| PublicDataWitness | + diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/get_public_key.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/get_public_key.md new file mode 100644 index 00000000000..9772fd74880 --- /dev/null +++ b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/get_public_key.md @@ -0,0 +1,50 @@ +## Standalone Functions + +### get_public_key_and_partial_address_oracle + +```rust +get_public_key_and_partial_address_oracle(_address); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| _address | AztecAddress | + +#### Returns +| Type | +| --- | +| Field; 3] | + +### get_public_key_and_partial_address_internal + +```rust +get_public_key_and_partial_address_internal(address); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| address | AztecAddress | + +#### Returns +| Type | +| --- | +| Field; 3] | + +### get_public_key + +```rust +get_public_key(address); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| address | AztecAddress | + +#### Returns +| Type | +| --- | +| GrumpkinPoint | + diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/get_sibling_path.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/get_sibling_path.md new file mode 100644 index 00000000000..de7165f340b --- /dev/null +++ b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/get_sibling_path.md @@ -0,0 +1,20 @@ +## Standalone Functions + +### get_sibling_path_oracle + +```rust +get_sibling_path_oracle(_block_number, _tree_id, _leaf_index); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| _block_number | u32 | +| _tree_id | Field | +| _leaf_index | Field | + +#### Returns +| Type | +| --- | +| Field; N] | + diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/header.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/header.md new file mode 100644 index 00000000000..f8313c66b46 --- /dev/null +++ b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/header.md @@ -0,0 +1,51 @@ +## Standalone Functions + +### get_header_at_oracle + +```rust +get_header_at_oracle(_block_number); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| _block_number | u32 | + +#### Returns +| Type | +| --- | +| Field; HEADER_LENGTH] | + +### get_header_at_internal + +```rust +get_header_at_internal(block_number); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| block_number | u32 | + +#### Returns +| Type | +| --- | +| Header | + +### get_header_at + +```rust +get_header_at(block_number, context); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| block_number | u32 | +| context | PrivateContext | + +#### Returns +| Type | +| --- | +| Header | + diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/notes.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/notes.md new file mode 100644 index 00000000000..1780e81a34f --- /dev/null +++ b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/notes.md @@ -0,0 +1,68 @@ +## Standalone Functions + +### notify_nullified_note_oracle + +```rust +notify_nullified_note_oracle(_nullifier, _inner_note_hash); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| _nullifier | Field | +| _inner_note_hash | Field | + +#### Returns +| Type | +| --- | +| Field | + +### notify_nullified_note + +```rust +notify_nullified_note(nullifier, inner_note_hash); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| nullifier | Field | +| inner_note_hash | Field | + +#### Returns +| Type | +| --- | +| Field | + +### check_nullifier_exists_oracle + +```rust +check_nullifier_exists_oracle(_inner_nullifier); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| _inner_nullifier | Field | + +#### Returns +| Type | +| --- | +| Field | + +### check_nullifier_exists + +```rust +check_nullifier_exists(inner_nullifier); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| inner_nullifier | Field | + +#### Returns +| Type | +| --- | +| bool | + diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/nullifier_key.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/nullifier_key.md new file mode 100644 index 00000000000..eb6d7e243a1 --- /dev/null +++ b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/nullifier_key.md @@ -0,0 +1,75 @@ +# NullifierKeyPair + +## Fields +| Field | Type | +| --- | --- | +| account | AztecAddress | +| public_key | GrumpkinPoint | +| secret_key | GrumpkinPrivateKey | + +## Standalone Functions + +### get_nullifier_key_pair_oracle + +```rust +get_nullifier_key_pair_oracle(_account); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| _account | AztecAddress | + +#### Returns +| Type | +| --- | +| Field; 4] | + +### get_nullifier_key_pair_internal + +```rust +get_nullifier_key_pair_internal(account); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| account | AztecAddress | + +#### Returns +| Type | +| --- | +| NullifierKeyPair | + +### get_nullifier_key_pair + +```rust +get_nullifier_key_pair(account); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| account | AztecAddress | + +#### Returns +| Type | +| --- | +| NullifierKeyPair | + +### get_nullifier_secret_key + +```rust +get_nullifier_secret_key(account); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| account | AztecAddress | + +#### Returns +| Type | +| --- | +| GrumpkinPrivateKey | + diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/rand.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/rand.md new file mode 100644 index 00000000000..9723fa36646 --- /dev/null +++ b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/rand.md @@ -0,0 +1,28 @@ +## Standalone Functions + +### rand_oracle + +```rust +rand_oracle(); +``` + +Takes no parameters. + +#### Returns +| Type | +| --- | +| Field | + +### rand + +```rust +rand(); +``` + +Takes no parameters. + +#### Returns +| Type | +| --- | +| Field | + diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/storage.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/storage.md new file mode 100644 index 00000000000..9e1209ad8f9 --- /dev/null +++ b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/storage.md @@ -0,0 +1,80 @@ +## Standalone Functions + +### storage_read_oracle + +```rust +storage_read_oracle(_storage_slot, _number_of_elements); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| _storage_slot | Field | +| _number_of_elements | Field | + +#### Returns +| Type | +| --- | +| Field; N] | + +### storage_read_oracle_wrapper + +```rust +storage_read_oracle_wrapper(_storage_slot); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| _storage_slot | Field | + +#### Returns +| Type | +| --- | +| Field; N] | + +### storage_read + +```rust +storage_read(storage_slot); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| storage_slot | Field | + +#### Returns +| Type | +| --- | +| Field; N] | + +### storage_write_oracle + +```rust +storage_write_oracle(_storage_slot, _values); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| _storage_slot | Field | +| _values | [Field; N] | + +#### Returns +| Type | +| --- | +| Field; N] | + +### storage_write + +```rust +storage_write(storage_slot, fields); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| storage_slot | Field | +| fields | [Field; N] | + diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/state_vars/immutable_singleton.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/state_vars/immutable_singleton.md new file mode 100644 index 00000000000..651d4b43597 --- /dev/null +++ b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/state_vars/immutable_singleton.md @@ -0,0 +1,83 @@ +## Standalone Functions + +### new + +```rust +new(context, storage_slot); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| context | Context | +| storage_slot | Field | + +#### Returns +| Type | +| --- | +| Self | + +### compute_initialization_nullifier + +```rust +compute_initialization_nullifier(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| Field | + +### is_initialized + +```rust +is_initialized(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| bool | + +### get_note + +```rust +get_note(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| Note where Note: NoteInterface<N> | + +### view_note + +```rust +view_note(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| Note where Note: NoteInterface<N> | + diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/state_vars/map.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/state_vars/map.md new file mode 100644 index 00000000000..b85b82aae78 --- /dev/null +++ b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/state_vars/map.md @@ -0,0 +1,19 @@ +## Standalone Functions + +### at + +```rust +at(self, key); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| key | K | + +#### Returns +| Type | +| --- | +| V where K: ToField | + diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/state_vars/public_state.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/state_vars/public_state.md new file mode 100644 index 00000000000..bf0f62394d1 --- /dev/null +++ b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/state_vars/public_state.md @@ -0,0 +1,18 @@ +## Standalone Functions + +### read + +```rust +read(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| T where T: Deserialize<T_SERIALIZED_LEN> | + diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/state_vars/set.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/state_vars/set.md new file mode 100644 index 00000000000..fecaccb1efc --- /dev/null +++ b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/state_vars/set.md @@ -0,0 +1,44 @@ +## Standalone Functions + +### new + +```rust +new(context, storage_slot); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| context | Context | +| storage_slot | Field | + +#### Returns +| Type | +| --- | +| Self | + +### assert_contains_and_remove + +```rust +assert_contains_and_remove(_self, _note, _nonce); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| _self | Self | +| _note | &mut Note | +| _nonce | Field | + +### assert_contains_and_remove_publicly_created + +```rust +assert_contains_and_remove_publicly_created(_self, _note); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| _self | Self | +| _note | &mut Note | + diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/state_vars/singleton.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/state_vars/singleton.md new file mode 100644 index 00000000000..0675e1598b7 --- /dev/null +++ b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/state_vars/singleton.md @@ -0,0 +1,84 @@ +## Standalone Functions + +### new + +```rust +new(context, storage_slot); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| context | Context | +| storage_slot | Field | + +#### Returns +| Type | +| --- | +| Self | + +### compute_initialization_nullifier + +```rust +compute_initialization_nullifier(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| Field | + +### is_initialized + +```rust +is_initialized(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| bool | + +### get_note + +```rust +get_note(self, broadcast); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| broadcast | bool | + +#### Returns +| Type | +| --- | +| Note where Note: NoteInterface<N> | + +### view_note + +```rust +view_note(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| Note where Note: NoteInterface<N> | + diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/state_vars/stable_public_state.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/state_vars/stable_public_state.md new file mode 100644 index 00000000000..7560e0e016a --- /dev/null +++ b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/state_vars/stable_public_state.md @@ -0,0 +1,34 @@ +## Standalone Functions + +### read_public + +```rust +read_public(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| T where T: Deserialize<T_SERIALIZED_LEN> | + +### read_private + +```rust +read_private(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| T where T: Deserialize<T_SERIALIZED_LEN> | + diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/state_vars/storage.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/state_vars/storage.md new file mode 100644 index 00000000000..48223ad3833 --- /dev/null +++ b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/state_vars/storage.md @@ -0,0 +1,18 @@ +## Standalone Functions + +### get_storage_slot + +```rust +get_storage_slot(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| Field | + diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/compressed-string/compressed_string.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/compressed-string/compressed_string.md new file mode 100644 index 00000000000..6dad0f79510 --- /dev/null +++ b/docs/src/preprocess/developers/contracts/references/aztec-nr/compressed-string/compressed_string.md @@ -0,0 +1,98 @@ +## Standalone Functions + +### from_string + +```rust +from_string(input_string); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| input_string | str<M> | + +#### Returns +| Type | +| --- | +| Self | + +### to_bytes + +```rust +to_bytes(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| u8; M] | + +### serialize + +```rust +serialize(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| Field; N] | + +### deserialize + +```rust +deserialize(input); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| input | [Field; N] | + +#### Returns +| Type | +| --- | +| Self | + +### test_short_string + +```rust +test_short_string(); +``` + +Takes no parameters. + +### test_long_string + +```rust +test_long_string(); +``` + +Takes no parameters. + +### test_long_string_work_with_too_many_fields + +```rust +test_long_string_work_with_too_many_fields(); +``` + +Takes no parameters. + +### test_long_string_fail_with_too_few_fields + +```rust +test_long_string_fail_with_too_few_fields(); +``` + +Takes no parameters. + diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/compressed-string/field_compressed_string.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/compressed-string/field_compressed_string.md new file mode 100644 index 00000000000..7dd9c420f36 --- /dev/null +++ b/docs/src/preprocess/developers/contracts/references/aztec-nr/compressed-string/field_compressed_string.md @@ -0,0 +1,110 @@ +# FieldCompressedString + +A Fixedsize Compressed String. Essentially a special version of Compressed String for practical use. + +## Fields +| Field | Type | +| --- | --- | +| value | Field | + +## Methods + +### is_eq + +```rust +FieldCompressedString::is_eq(self, other); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| other | FieldCompressedString | + +#### Returns +| Type | +| --- | +| bool | + +### from_field + +```rust +FieldCompressedString::from_field(input_field); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| input_field | Field | + +#### Returns +| Type | +| --- | +| Self | + +### from_string + +```rust +FieldCompressedString::from_string(input_string); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| input_string | str<31> | + +#### Returns +| Type | +| --- | +| Self | + +### to_bytes + +```rust +FieldCompressedString::to_bytes(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| u8; 31] | + +## Standalone Functions + +### serialize + +```rust +serialize(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| Field; 1] | + +### deserialize + +```rust +deserialize(input); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| input | [Field; 1] | + +#### Returns +| Type | +| --- | +| Self | + diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/easy-private-state/easy_private_uint.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/easy-private-state/easy_private_uint.md new file mode 100644 index 00000000000..1155a64f0b0 --- /dev/null +++ b/docs/src/preprocess/developers/contracts/references/aztec-nr/easy-private-state/easy_private_uint.md @@ -0,0 +1,41 @@ +# EasyPrivateUint + +## Fields +| Field | Type | +| --- | --- | +| context | Context | +| set | Set<ValueNote> | +| storage_slot | Field | + +## Methods + +### add + +Very similar to `value_note::utils::increment`. + +```rust +EasyPrivateUint::add(self, addend, owner); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| addend | u120 | +| owner | AztecAddress | + +### sub + +Very similar to `value_note::utils::decrement`. + +```rust +EasyPrivateUint::sub(self, subtrahend, owner); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| subtrahend | u120 | +| owner | AztecAddress | + diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/field-note/field_note.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/field-note/field_note.md new file mode 100644 index 00000000000..15420ecfc62 --- /dev/null +++ b/docs/src/preprocess/developers/contracts/references/aztec-nr/field-note/field_note.md @@ -0,0 +1,165 @@ +# FieldNote + +A note which stores a field and is expected to be passed around using the `addNote` function. WARNING: This Note is not private as it does not contain randomness and hence it can be easy to perform serialized_note attack on it. + +## Fields +| Field | Type | +| --- | --- | +| value | Field | +| header | NoteHeader | + +## Methods + +### new + +```rust +FieldNote::new(value); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| value | Field | + +#### Returns +| Type | +| --- | +| Self | + +## Standalone Functions + +### serialize_content + +```rust +serialize_content(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| Field; FIELD_NOTE_LEN] | + +### deserialize_content + +```rust +deserialize_content(serialized_note); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| serialized_note | [Field; FIELD_NOTE_LEN] | + +#### Returns +| Type | +| --- | +| Self | + +### compute_note_content_hash + +```rust +compute_note_content_hash(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| Field | + +### compute_nullifier + +```rust +compute_nullifier(self, _context); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| _context | &mut PrivateContext | + +#### Returns +| Type | +| --- | +| Field | + +### compute_nullifier_without_context + +```rust +compute_nullifier_without_context(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| Field | + +### set_header + +```rust +set_header(&mut self, header); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| header | NoteHeader | + +### get_header + +```rust +get_header(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| NoteHeader | + +### broadcast + +```rust +broadcast(self, context, slot); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| context | &mut PrivateContext | +| slot | Field | + +### get_note_type_id + +```rust +get_note_type_id(); +``` + +Takes no parameters. + +#### Returns +| Type | +| --- | +| Field | + diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/safe-math/safe_u120.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/safe-math/safe_u120.md new file mode 100644 index 00000000000..43610fc2b8c --- /dev/null +++ b/docs/src/preprocess/developers/contracts/references/aztec-nr/safe-math/safe_u120.md @@ -0,0 +1,339 @@ +# SafeU120 + +## Fields +| Field | Type | +| --- | --- | +| value | u120 | + +## Methods + +### min + +```rust +SafeU120::min(); +``` + +Takes no parameters. + +#### Returns +| Type | +| --- | +| Self | + +### max + +```rust +SafeU120::max(); +``` + +Takes no parameters. + +#### Returns +| Type | +| --- | +| Self | + +### lt + +```rust +SafeU120::lt(self, other); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | Self | +| other | Self | + +#### Returns +| Type | +| --- | +| bool | + +### le + +```rust +SafeU120::le(self, other); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | Self | +| other | Self | + +#### Returns +| Type | +| --- | +| bool | + +### gt + +```rust +SafeU120::gt(self, other); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | Self | +| other | Self | + +#### Returns +| Type | +| --- | +| bool | + +### ge + +```rust +SafeU120::ge(self, other); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | Self | +| other | Self | + +#### Returns +| Type | +| --- | +| bool | + +## Standalone Functions + +### serialize + +```rust +serialize(value); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| value | SafeU120 | + +#### Returns +| Type | +| --- | +| Field; SAFE_U120_SERIALIZED_LEN] | + +### deserialize + +```rust +deserialize(fields); +``` + +This is safe when reading from storage IF only correct safeu120 was written to storage + +#### Parameters +| Name | Type | +| --- | --- | +| fields | [Field; SAFE_U120_SERIALIZED_LEN] | + +#### Returns +| Type | +| --- | +| SafeU120 | + +### test_init + +```rust +test_init(); +``` + +Takes no parameters. + +### test_init_max + +```rust +test_init_max(); +``` + +Takes no parameters. + +### test_init_min + +```rust +test_init_min(); +``` + +Takes no parameters. + +### test_is_zero + +```rust +test_is_zero(); +``` + +Takes no parameters. + +### test_eq + +```rust +test_eq(); +``` + +Takes no parameters. + +### test_lt + +```rust +test_lt(); +``` + +Takes no parameters. + +### test_le + +```rust +test_le(); +``` + +Takes no parameters. + +### test_gt + +```rust +test_gt(); +``` + +Takes no parameters. + +### test_ge + +```rust +test_ge(); +``` + +Takes no parameters. + +### test_init_too_large + +```rust +test_init_too_large(); +``` + +Takes no parameters. + +### test_add + +```rust +test_add(); +``` + +Takes no parameters. + +### test_add_overflow + +```rust +test_add_overflow(); +``` + +Takes no parameters. + +### test_sub + +```rust +test_sub(); +``` + +Takes no parameters. + +### test_sub_underflow + +```rust +test_sub_underflow(); +``` + +Takes no parameters. + +### test_mul + +```rust +test_mul(); +``` + +Takes no parameters. + +### test_mul_overflow + +```rust +test_mul_overflow(); +``` + +Takes no parameters. + +### test_div + +```rust +test_div(); +``` + +Takes no parameters. + +### test_div_by_zero + +```rust +test_div_by_zero(); +``` + +Takes no parameters. + +### test_mul_div + +```rust +test_mul_div(); +``` + +Takes no parameters. + +### test_mul_div_zero_divisor + +```rust +test_mul_div_zero_divisor(); +``` + +Takes no parameters. + +### test_mul_div_ghost_overflow + +```rust +test_mul_div_ghost_overflow(); +``` + +Takes no parameters. + +### test_mul_div_up_rounding + +```rust +test_mul_div_up_rounding(); +``` + +Takes no parameters. + +### test_mul_div_up_non_rounding + +```rust +test_mul_div_up_non_rounding(); +``` + +Takes no parameters. + +### test_mul_div_up_ghost_overflow + +```rust +test_mul_div_up_ghost_overflow(); +``` + +Takes no parameters. + +### test_mul_div_up_zero_divisor + +```rust +test_mul_div_up_zero_divisor(); +``` + +Takes no parameters. + diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/slow-updates-tree/leaf.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/slow-updates-tree/leaf.md new file mode 100644 index 00000000000..8af2b59b7a2 --- /dev/null +++ b/docs/src/preprocess/developers/contracts/references/aztec-nr/slow-updates-tree/leaf.md @@ -0,0 +1,45 @@ +# Leaf + +A leaf in the tree. + +## Fields +| Field | Type | +| --- | --- | +| next_change | Field | +| before | Field | +| after | Field | + +## Standalone Functions + +### serialize + +```rust +serialize(leaf); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| leaf | Leaf | + +#### Returns +| Type | +| --- | +| Field; 3] | + +### deserialize + +```rust +deserialize(serialized); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| serialized | [Field; 3] | + +#### Returns +| Type | +| --- | +| Leaf | + diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/slow-updates-tree/slow_map.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/slow-updates-tree/slow_map.md new file mode 100644 index 00000000000..3b96ffc3fc2 --- /dev/null +++ b/docs/src/preprocess/developers/contracts/references/aztec-nr/slow-updates-tree/slow_map.md @@ -0,0 +1,161 @@ +## Standalone Functions + +### compute_next_change + +```rust +compute_next_change(time); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| time | Field | + +#### Returns +| Type | +| --- | +| Field | + +### read_root + +```rust +read_root(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | Self | + +#### Returns +| Type | +| --- | +| Leaf | + +### initialize + +```rust +initialize(self, initial_root); +``` + +Beware that the initial root could include much state that is not shown by the public storage! + +#### Parameters +| Name | Type | +| --- | --- | +| self | Self | +| initial_root | Field | + +### current_root + +```rust +current_root(self); +``` + +Reads the "CURRENT" value of the root + +#### Parameters +| Name | Type | +| --- | --- | +| self | Self | + +#### Returns +| Type | +| --- | +| Field | + +### read_leaf_at + +```rust +read_leaf_at(self, key); +``` + +docs:start:read_leaf_at + +#### Parameters +| Name | Type | +| --- | --- | +| self | Self | +| key | Field | + +#### Returns +| Type | +| --- | +| Leaf | + +### read_at + +```rust +read_at(self, key); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | Self | +| key | Field | + +#### Returns +| Type | +| --- | +| Field | + +### update_at + +```rust +update_at(self, p, M>); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | Self | +| p | SlowUpdateProof<N | +| M> | | + +### update_unsafe_at + +```rust +update_unsafe_at(self, index, leaf_value, new_root); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | Self | +| index | Field | +| leaf_value | Field | +| new_root | Field | + +### update_unsafe + +```rust +update_unsafe(self, index, leaf, root); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | Self | +| index | Field | +| leaf | Leaf | +| root | Leaf | + +### compute_merkle_root + +```rust +compute_merkle_root(leaf, index, hash_path); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| leaf | Field | +| index | Field | +| hash_path | [Field; N] | + +#### Returns +| Type | +| --- | +| Field | + diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/slow-updates-tree/slow_update_proof.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/slow-updates-tree/slow_update_proof.md new file mode 100644 index 00000000000..471387269ba --- /dev/null +++ b/docs/src/preprocess/developers/contracts/references/aztec-nr/slow-updates-tree/slow_update_proof.md @@ -0,0 +1,50 @@ +## Standalone Functions + +### deserialize_slow_update_proof + +```rust +deserialize_slow_update_proof(serialized); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| serialized | [Field; M] | + +#### Returns +| Type | +| --- | +| SlowUpdateProof<N, M> | + +### serialize + +```rust +serialize(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | Self | + +#### Returns +| Type | +| --- | +| Field; M] | + +### deserialize + +```rust +deserialize(serialized); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| serialized | [Field; M] | + +#### Returns +| Type | +| --- | +| Self | + diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/value-note/balance_utils.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/value-note/balance_utils.md new file mode 100644 index 00000000000..36b49162ef8 --- /dev/null +++ b/docs/src/preprocess/developers/contracts/references/aztec-nr/value-note/balance_utils.md @@ -0,0 +1,35 @@ +## Standalone Functions + +### get_balance + +```rust +get_balance(set); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| set | Set<ValueNote> | + +#### Returns +| Type | +| --- | +| Field | + +### get_balance_with_offset + +```rust +get_balance_with_offset(set, offset); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| set | Set<ValueNote> | +| offset | u32 | + +#### Returns +| Type | +| --- | +| Field | + diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/value-note/utils.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/value-note/utils.md new file mode 100644 index 00000000000..d08786b9574 --- /dev/null +++ b/docs/src/preprocess/developers/contracts/references/aztec-nr/value-note/utils.md @@ -0,0 +1,90 @@ +## Standalone Functions + +### create_note_getter_options_for_decreasing_balance + +```rust +create_note_getter_options_for_decreasing_balance(amount); +``` + +Pick the fewest notes whose sum is equal to or greater than `amount`. + +#### Parameters +| Name | Type | +| --- | --- | +| amount | Field | + +#### Returns +| Type | +| --- | +| NoteGetterOptions<ValueNote, VALUE_NOTE_LEN, Field> | + +### increment + +```rust +increment(balance, amount, recipient); +``` + +Inserts it to the recipient's set of notes. + +#### Parameters +| Name | Type | +| --- | --- | +| balance | Set<ValueNote> | +| amount | Field | +| recipient | AztecAddress | + +### decrement + +```rust +decrement(balance, amount, owner); +``` + +Fail if the sum of the selected notes is less than the amount. + +#### Parameters +| Name | Type | +| --- | --- | +| balance | Set<ValueNote> | +| amount | Field | +| owner | AztecAddress | + +### decrement_by_at_most + +```rust +decrement_by_at_most(balance, max_amount, owner); +``` + +// It returns the decremented amount, which should be less than or equal to max_amount. + +#### Parameters +| Name | Type | +| --- | --- | +| balance | Set<ValueNote> | +| max_amount | Field | +| owner | AztecAddress | + +#### Returns +| Type | +| --- | +| Field | + +### destroy_note + +```rust +destroy_note(balance, owner, note); +``` + +Returns the value of the destroyed note. + +#### Parameters +| Name | Type | +| --- | --- | +| balance | Set<ValueNote> | +| owner | AztecAddress | +| note | ValueNote | + +#### Returns +| Type | +| --- | +| Field | + diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/value-note/value_note.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/value-note/value_note.md new file mode 100644 index 00000000000..4e7d916aa38 --- /dev/null +++ b/docs/src/preprocess/developers/contracts/references/aztec-nr/value-note/value_note.md @@ -0,0 +1,166 @@ +# ValueNote + +## Fields +| Field | Type | +| --- | --- | +| value | Field | +| owner | AztecAddress | +| randomness | Field | +| header | NoteHeader | + +## Methods + +### new + +```rust +ValueNote::new(value, owner); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| value | Field | +| owner | AztecAddress | + +#### Returns +| Type | +| --- | +| Self | + +## Standalone Functions + +### serialize_content + +```rust +serialize_content(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| Field; VALUE_NOTE_LEN] | + +### deserialize_content + +```rust +deserialize_content(serialized_note); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| serialized_note | [Field; VALUE_NOTE_LEN] | + +#### Returns +| Type | +| --- | +| Self | + +### compute_note_content_hash + +```rust +compute_note_content_hash(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| Field | + +### compute_nullifier + +```rust +compute_nullifier(self, context); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| context | &mut PrivateContext | + +#### Returns +| Type | +| --- | +| Field | + +### compute_nullifier_without_context + +```rust +compute_nullifier_without_context(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| Field | + +### set_header + +```rust +set_header(&mut self, header); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| header | NoteHeader | + +### get_header + +```rust +get_header(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +#### Returns +| Type | +| --- | +| NoteHeader | + +### broadcast + +```rust +broadcast(self, context, slot); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| context | &mut PrivateContext | +| slot | Field | + +### get_note_type_id + +```rust +get_note_type_id(); +``` + +Takes no parameters. + +#### Returns +| Type | +| --- | +| Field | + From f87af4a6203227fb066a831223fbe61b0128657c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pedro=20Sousa?= Date: Thu, 22 Feb 2024 15:52:10 +0000 Subject: [PATCH 17/18] fix? --- docs/.gitignore | 5 +- .../aztec-nr/address-note/address_note.md | 168 --------- .../references/aztec-nr/authwit/account.md | 71 ---- .../references/aztec-nr/authwit/auth.md | 39 -- .../aztec-nr/authwit/auth_witness.md | 34 -- .../aztec-nr/authwit/entrypoint/app.md | 76 ---- .../aztec-nr/authwit/entrypoint/fee.md | 72 ---- .../authwit/entrypoint/function_call.md | 46 --- .../references/aztec-nr/aztec/avm/context.md | 173 --------- .../references/aztec-nr/aztec/avm/hash.md | 50 --- .../references/aztec-nr/aztec/context.md | 55 --- .../references/aztec-nr/aztec/context/avm.md | 229 ------------ .../globals/private_global_variables.md | 26 -- .../context/inputs/private_context_inputs.md | 12 - .../context/inputs/public_context_inputs.md | 11 - .../aztec-nr/aztec/context/private_context.md | 309 ---------------- .../aztec-nr/aztec/context/public_context.md | 294 --------------- .../references/aztec-nr/aztec/hash.md | 18 - .../references/aztec-nr/aztec/hasher.md | 64 ---- .../aztec/history/nullifier_inclusion.md | 26 -- .../aztec/history/nullifier_non_inclusion.md | 39 -- .../references/aztec-nr/aztec/log.md | 28 -- .../aztec/messaging/l1_to_l2_message.md | 61 ---- .../messaging/l1_to_l2_message_getter_data.md | 24 -- .../aztec-nr/aztec/note/note_getter.md | 31 -- .../aztec/note/note_getter_options.md | 174 --------- .../aztec-nr/aztec/note/note_header.md | 45 --- .../aztec/note/note_viewer_options.md | 103 ------ .../references/aztec-nr/aztec/note/utils.md | 116 ------ .../aztec-nr/aztec/oracle/arguments.md | 34 -- .../aztec-nr/aztec/oracle/context.md | 34 -- .../aztec/oracle/create_commitment.md | 29 -- .../aztec-nr/aztec/oracle/debug_log.md | 143 -------- .../aztec/oracle/get_l1_to_l2_message.md | 34 -- .../get_nullifier_membership_witness.md | 63 ---- .../aztec/oracle/get_public_data_witness.md | 28 -- .../aztec-nr/aztec/oracle/get_public_key.md | 50 --- .../aztec-nr/aztec/oracle/get_sibling_path.md | 20 -- .../aztec-nr/aztec/oracle/header.md | 51 --- .../references/aztec-nr/aztec/oracle/notes.md | 68 ---- .../aztec-nr/aztec/oracle/nullifier_key.md | 75 ---- .../references/aztec-nr/aztec/oracle/rand.md | 28 -- .../aztec-nr/aztec/oracle/storage.md | 80 ----- .../aztec/state_vars/immutable_singleton.md | 83 ----- .../aztec-nr/aztec/state_vars/map.md | 19 - .../aztec-nr/aztec/state_vars/public_state.md | 18 - .../aztec-nr/aztec/state_vars/set.md | 44 --- .../aztec-nr/aztec/state_vars/singleton.md | 84 ----- .../aztec/state_vars/stable_public_state.md | 34 -- .../aztec-nr/aztec/state_vars/storage.md | 18 - .../compressed-string/compressed_string.md | 98 ----- .../field_compressed_string.md | 110 ------ .../easy-private-state/easy_private_uint.md | 41 --- .../aztec-nr/field-note/field_note.md | 165 --------- .../aztec-nr/safe-math/safe_u120.md | 339 ------------------ .../aztec-nr/slow-updates-tree/leaf.md | 45 --- .../aztec-nr/slow-updates-tree/slow_map.md | 161 --------- .../slow-updates-tree/slow_update_proof.md | 50 --- .../aztec-nr/value-note/balance_utils.md | 35 -- .../references/aztec-nr/value-note/utils.md | 90 ----- .../aztec-nr/value-note/value_note.md | 166 --------- 61 files changed, 3 insertions(+), 4733 deletions(-) delete mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/address-note/address_note.md delete mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/authwit/account.md delete mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/authwit/auth.md delete mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/authwit/auth_witness.md delete mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/authwit/entrypoint/app.md delete mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/authwit/entrypoint/fee.md delete mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/authwit/entrypoint/function_call.md delete mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/avm/context.md delete mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/avm/hash.md delete mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/context.md delete mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/context/avm.md delete mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/context/globals/private_global_variables.md delete mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/context/inputs/private_context_inputs.md delete mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/context/inputs/public_context_inputs.md delete mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/context/private_context.md delete mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/context/public_context.md delete mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/hash.md delete mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/hasher.md delete mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/history/nullifier_inclusion.md delete mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/history/nullifier_non_inclusion.md delete mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/log.md delete mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/messaging/l1_to_l2_message.md delete mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/messaging/l1_to_l2_message_getter_data.md delete mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/note/note_getter.md delete mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/note/note_getter_options.md delete mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/note/note_header.md delete mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/note/note_viewer_options.md delete mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/note/utils.md delete mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/arguments.md delete mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/context.md delete mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/create_commitment.md delete mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/debug_log.md delete mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/get_l1_to_l2_message.md delete mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/get_nullifier_membership_witness.md delete mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/get_public_data_witness.md delete mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/get_public_key.md delete mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/get_sibling_path.md delete mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/header.md delete mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/notes.md delete mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/nullifier_key.md delete mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/rand.md delete mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/storage.md delete mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/state_vars/immutable_singleton.md delete mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/state_vars/map.md delete mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/state_vars/public_state.md delete mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/state_vars/set.md delete mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/state_vars/singleton.md delete mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/state_vars/stable_public_state.md delete mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/state_vars/storage.md delete mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/compressed-string/compressed_string.md delete mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/compressed-string/field_compressed_string.md delete mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/easy-private-state/easy_private_uint.md delete mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/field-note/field_note.md delete mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/safe-math/safe_u120.md delete mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/slow-updates-tree/leaf.md delete mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/slow-updates-tree/slow_map.md delete mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/slow-updates-tree/slow_update_proof.md delete mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/value-note/balance_utils.md delete mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/value-note/utils.md delete mode 100644 docs/src/preprocess/developers/contracts/references/aztec-nr/value-note/value_note.md diff --git a/docs/.gitignore b/docs/.gitignore index 34958269cc2..858ab1e91b4 100644 --- a/docs/.gitignore +++ b/docs/.gitignore @@ -22,6 +22,7 @@ npm-debug.log* yarn-debug.log* yarn-error.log* -/docs/developers/contracts/references/aztec-nr +docs/developers/contracts/references/aztec-nr +src/preprocess/developers -/src/preprocess/AztecnrReferenceAutogenStructure.json \ No newline at end of file +/src/preprocess/AztecnrReferenceAutogenStructure.json diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/address-note/address_note.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/address-note/address_note.md deleted file mode 100644 index dd7236d3ada..00000000000 --- a/docs/src/preprocess/developers/contracts/references/aztec-nr/address-note/address_note.md +++ /dev/null @@ -1,168 +0,0 @@ -# AddressNote - -Stores an address - -## Fields -| Field | Type | -| --- | --- | -| address | AztecAddress | -| owner | AztecAddress | -| randomness | Field | -| header | NoteHeader | - -## Methods - -### new - -```rust -AddressNote::new(address, owner); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| address | AztecAddress | -| owner | AztecAddress | - -#### Returns -| Type | -| --- | -| Self | - -## Standalone Functions - -### serialize_content - -```rust -serialize_content(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| Field; ADDRESS_NOTE_LEN] | - -### deserialize_content - -```rust -deserialize_content(serialized_note); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| serialized_note | [Field; ADDRESS_NOTE_LEN] | - -#### Returns -| Type | -| --- | -| Self | - -### compute_note_content_hash - -```rust -compute_note_content_hash(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| Field | - -### compute_nullifier - -```rust -compute_nullifier(self, context); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| context | &mut PrivateContext | - -#### Returns -| Type | -| --- | -| Field | - -### compute_nullifier_without_context - -```rust -compute_nullifier_without_context(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| Field | - -### set_header - -```rust -set_header(&mut self, header); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| header | NoteHeader | - -### get_header - -```rust -get_header(note); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| note | Self | - -#### Returns -| Type | -| --- | -| NoteHeader | - -### broadcast - -```rust -broadcast(self, context, slot); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| context | &mut PrivateContext | -| slot | Field | - -### get_note_type_id - -```rust -get_note_type_id(); -``` - -Takes no parameters. - -#### Returns -| Type | -| --- | -| Field | - diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/authwit/account.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/authwit/account.md deleted file mode 100644 index ba147147d3f..00000000000 --- a/docs/src/preprocess/developers/contracts/references/aztec-nr/authwit/account.md +++ /dev/null @@ -1,71 +0,0 @@ -# AccountActions - -## Fields -| Field | Type | -| --- | --- | -| context | Context | -| is_valid_impl | fn(&mut PrivateContext, Field) -> bool | -| approved_action | Map<Field, PublicState<bool>> | - -## Methods - -### entrypoint - -```rust -AccountActions::entrypoint(self, app_payload, fee_payload); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| app_payload | AppPayload | -| fee_payload | FeePayload | - -### is_valid - -```rust -AccountActions::is_valid(self, message_hash); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| message_hash | Field | - -#### Returns -| Type | -| --- | -| Field | - -### is_valid_public - -```rust -AccountActions::is_valid_public(self, message_hash); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| message_hash | Field | - -#### Returns -| Type | -| --- | -| Field | - -### internal_set_is_valid_storage - -```rust -AccountActions::internal_set_is_valid_storage(self, message_hash, value); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| message_hash | Field | -| value | bool | - diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/authwit/auth.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/authwit/auth.md deleted file mode 100644 index fbb36a220da..00000000000 --- a/docs/src/preprocess/developers/contracts/references/aztec-nr/authwit/auth.md +++ /dev/null @@ -1,39 +0,0 @@ -## Standalone Functions - -### assert_current_call_valid_authwit - -```rust -assert_current_call_valid_authwit(context, on_behalf_of); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| context | &mut PrivateContext | -| on_behalf_of | AztecAddress | - -### assert_valid_authwit_public - -```rust -assert_valid_authwit_public(context, on_behalf_of, message_hash); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| context | &mut PublicContext | -| on_behalf_of | AztecAddress | -| message_hash | Field | - -### assert_current_call_valid_authwit_public - -```rust -assert_current_call_valid_authwit_public(context, on_behalf_of); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| context | &mut PublicContext | -| on_behalf_of | AztecAddress | - diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/authwit/auth_witness.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/authwit/auth_witness.md deleted file mode 100644 index 78b55d0b66d..00000000000 --- a/docs/src/preprocess/developers/contracts/references/aztec-nr/authwit/auth_witness.md +++ /dev/null @@ -1,34 +0,0 @@ -## Standalone Functions - -### get_auth_witness_oracle - -```rust -get_auth_witness_oracle(_message_hash); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| _message_hash | Field | - -#### Returns -| Type | -| --- | -| Field; N] | - -### get_auth_witness - -```rust -get_auth_witness(message_hash); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| message_hash | Field | - -#### Returns -| Type | -| --- | -| Field; N] | - diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/authwit/entrypoint/app.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/authwit/entrypoint/app.md deleted file mode 100644 index 7dcaa5379d4..00000000000 --- a/docs/src/preprocess/developers/contracts/references/aztec-nr/authwit/entrypoint/app.md +++ /dev/null @@ -1,76 +0,0 @@ -# AppPayload - -Note: If you change the following struct you have to update default_entrypoint.ts - -## Fields -| Field | Type | -| --- | --- | -| function_calls | FunctionCall; ACCOUNT_MAX_CALLS] | -| nonce | Field | - -## Methods - -### to_be_bytes - -Serializes the payload as an array of bytes. Useful for hashing with sha256. - -```rust -AppPayload::to_be_bytes(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| u8; APP_PAYLOAD_SIZE_IN_BYTES] | - -### execute_calls - -```rust -AppPayload::execute_calls(self, context); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| context | &mut PrivateContext | - -## Standalone Functions - -### serialize - -```rust -serialize(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| Field; APP_PAYLOAD_SIZE] | - -### hash - -```rust -hash(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| Field | - diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/authwit/entrypoint/fee.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/authwit/entrypoint/fee.md deleted file mode 100644 index 51a07cb1722..00000000000 --- a/docs/src/preprocess/developers/contracts/references/aztec-nr/authwit/entrypoint/fee.md +++ /dev/null @@ -1,72 +0,0 @@ -# FeePayload - -## Fields -| Field | Type | -| --- | --- | -| function_calls | FunctionCall; MAX_FEE_FUNCTION_CALLS] | -| nonce | Field | - -## Methods - -### to_be_bytes - -```rust -FeePayload::to_be_bytes(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| u8; FEE_PAYLOAD_SIZE_IN_BYTES] | - -### execute_calls - -```rust -FeePayload::execute_calls(self, context); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| context | &mut PrivateContext | - -## Standalone Functions - -### serialize - -```rust -serialize(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| Field; FEE_PAYLOAD_SIZE] | - -### hash - -```rust -hash(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| Field | - diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/authwit/entrypoint/function_call.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/authwit/entrypoint/function_call.md deleted file mode 100644 index 2def72c8262..00000000000 --- a/docs/src/preprocess/developers/contracts/references/aztec-nr/authwit/entrypoint/function_call.md +++ /dev/null @@ -1,46 +0,0 @@ -# FunctionCall - -## Fields -| Field | Type | -| --- | --- | -| args_hash | Field | -| function_selector | FunctionSelector | -| target_address | AztecAddress | -| is_public | bool | - -## Methods - -### to_be_bytes - -```rust -FunctionCall::to_be_bytes(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| u8; FUNCTION_CALL_SIZE_IN_BYTES] | - -## Standalone Functions - -### serialize - -```rust -serialize(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| Field; FUNCTION_CALL_SIZE] | - diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/avm/context.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/avm/context.md deleted file mode 100644 index 9513e9083b9..00000000000 --- a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/avm/context.md +++ /dev/null @@ -1,173 +0,0 @@ -# AvmContext - -## Methods - -### address - -```rust -AvmContext::address(); -``` - -Takes no parameters. - -#### Returns -| Type | -| --- | -| AztecAddress | - -### storage_address - -```rust -AvmContext::storage_address(); -``` - -Takes no parameters. - -#### Returns -| Type | -| --- | -| AztecAddress | - -### origin - -```rust -AvmContext::origin(); -``` - -Takes no parameters. - -#### Returns -| Type | -| --- | -| AztecAddress | - -### sender - -```rust -AvmContext::sender(); -``` - -Takes no parameters. - -#### Returns -| Type | -| --- | -| AztecAddress | - -### portal - -```rust -AvmContext::portal(); -``` - -Takes no parameters. - -#### Returns -| Type | -| --- | -| EthAddress | - -### fee_per_l1_gas - -```rust -AvmContext::fee_per_l1_gas(); -``` - -Takes no parameters. - -#### Returns -| Type | -| --- | -| Field | - -### fee_per_l2_gas - -```rust -AvmContext::fee_per_l2_gas(); -``` - -Takes no parameters. - -#### Returns -| Type | -| --- | -| Field | - -### fee_per_da_gas - -```rust -AvmContext::fee_per_da_gas(); -``` - -Takes no parameters. - -#### Returns -| Type | -| --- | -| Field | - -### chain_id - -```rust -AvmContext::chain_id(); -``` - -Takes no parameters. - -#### Returns -| Type | -| --- | -| Field | - -### version - -```rust -AvmContext::version(); -``` - -Takes no parameters. - -#### Returns -| Type | -| --- | -| Field | - -### block_number - -```rust -AvmContext::block_number(); -``` - -Takes no parameters. - -#### Returns -| Type | -| --- | -| Field | - -### timestamp - -```rust -AvmContext::timestamp(); -``` - -Takes no parameters. - -#### Returns -| Type | -| --- | -| Field | - -### contract_call_depth - -```rust -AvmContext::contract_call_depth(); -``` - -Takes no parameters. - -#### Returns -| Type | -| --- | -| Field | - diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/avm/hash.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/avm/hash.md deleted file mode 100644 index ad40c675723..00000000000 --- a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/avm/hash.md +++ /dev/null @@ -1,50 +0,0 @@ -## Standalone Functions - -### keccak256 - -```rust -keccak256(input); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| input | [Field; N] | - -#### Returns -| Type | -| --- | -| Field; 2] | - -### poseidon - -```rust -poseidon(input); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| input | [Field; N] | - -#### Returns -| Type | -| --- | -| Field | - -### sha256 - -```rust -sha256(input); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| input | [Field; N] | - -#### Returns -| Type | -| --- | -| Field; 2] | - diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/context.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/context.md deleted file mode 100644 index bcd14ad3c20..00000000000 --- a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/context.md +++ /dev/null @@ -1,55 +0,0 @@ -# Context - -## Fields -| Field | Type | -| --- | --- | -| private | Option<&mut PrivateContext> | -| public | Option<&mut PublicContext> | - -## Methods - -### private - -```rust -Context::private(context); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| context | &mut PrivateContext | - -#### Returns -| Type | -| --- | -| Context | - -### public - -```rust -Context::public(context); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| context | &mut PublicContext | - -#### Returns -| Type | -| --- | -| Context | - -### none - -```rust -Context::none(); -``` - -Takes no parameters. - -#### Returns -| Type | -| --- | -| Context | - diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/context/avm.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/context/avm.md deleted file mode 100644 index 5de339db53d..00000000000 --- a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/context/avm.md +++ /dev/null @@ -1,229 +0,0 @@ -# AVMContext - -Getters that will be converted by the transpiler into their own opcodes - -## Methods - -### new - -Empty new function enables retaining context.<value> syntax - -```rust -AVMContext::new(); -``` - -Takes no parameters. - -#### Returns -| Type | -| --- | -| Self | - -### address - -```rust -AVMContext::address(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| AztecAddress | - -### storage_address - -```rust -AVMContext::storage_address(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| AztecAddress | - -### origin - -```rust -AVMContext::origin(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| AztecAddress | - -### sender - -```rust -AVMContext::sender(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| AztecAddress | - -### portal - -```rust -AVMContext::portal(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| EthAddress | - -### fee_per_l1_gas - -```rust -AVMContext::fee_per_l1_gas(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| Field | - -### fee_per_l2_gas - -```rust -AVMContext::fee_per_l2_gas(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| Field | - -### fee_per_da_gas - -```rust -AVMContext::fee_per_da_gas(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| Field | - -### chain_id - -```rust -AVMContext::chain_id(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| Field | - -### version - -```rust -AVMContext::version(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| Field | - -### block_number - -```rust -AVMContext::block_number(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| Field | - -### timestamp - -```rust -AVMContext::timestamp(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| Field | - -### contract_call_depth - -```rust -AVMContext::contract_call_depth(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| Field | - diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/context/globals/private_global_variables.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/context/globals/private_global_variables.md deleted file mode 100644 index 32536339ffe..00000000000 --- a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/context/globals/private_global_variables.md +++ /dev/null @@ -1,26 +0,0 @@ -# PrivateGlobalVariables - -## Fields -| Field | Type | -| --- | --- | -| chain_id | Field | -| version | Field | - -## Standalone Functions - -### serialize - -```rust -serialize(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| Field; PRIVATE_GLOBAL_VARIABLES_LENGTH] | - diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/context/inputs/private_context_inputs.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/context/inputs/private_context_inputs.md deleted file mode 100644 index 4286078f99c..00000000000 --- a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/context/inputs/private_context_inputs.md +++ /dev/null @@ -1,12 +0,0 @@ -# PrivateContextInputs - -PrivateContextInputs are expected to be provided to each private function - -## Fields -| Field | Type | -| --- | --- | -| call_context | CallContext | -| historical_header | Header | -| contract_deployment_data | ContractDeploymentData | -| private_global_variables | PrivateGlobalVariables | - diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/context/inputs/public_context_inputs.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/context/inputs/public_context_inputs.md deleted file mode 100644 index 2c3fce13fb8..00000000000 --- a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/context/inputs/public_context_inputs.md +++ /dev/null @@ -1,11 +0,0 @@ -# PublicContextInputs - -PublicContextInputs are expected to be provided to each public function - -## Fields -| Field | Type | -| --- | --- | -| call_context | CallContext | -| historical_header | Header | -| public_global_variables | PublicGlobalVariables | - diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/context/private_context.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/context/private_context.md deleted file mode 100644 index 057ee2c983c..00000000000 --- a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/context/private_context.md +++ /dev/null @@ -1,309 +0,0 @@ -# PrivateContext - -When finished, one can call .finish() to convert back to the abi - -## Fields -| Field | Type | -| --- | --- | -| inputs | PrivateContextInputs | -| side_effect_counter | u32 | -| min_revertible_side_effect_counter | u32 | -| args_hash | Field | -| return_values | BoundedVec<Field, RETURN_VALUES_LENGTH> | -| read_requests | BoundedVec<SideEffect, MAX_READ_REQUESTS_PER_CALL> | -| nullifier_key_validation_requests | BoundedVec<NullifierKeyValidationRequest, MAX_NULLIFIER_KEY_VALIDATION_REQUESTS_PER_CALL> | -| new_commitments | BoundedVec<SideEffect, MAX_NEW_COMMITMENTS_PER_CALL> | -| new_nullifiers | BoundedVec<SideEffectLinkedToNoteHash, MAX_NEW_NULLIFIERS_PER_CALL> | -| private_call_stack_hashes | BoundedVec<Field, MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL> | -| public_call_stack_hashes | BoundedVec<Field, MAX_PUBLIC_CALL_STACK_LENGTH_PER_CALL> | -| new_l2_to_l1_msgs | BoundedVec<L2ToL1Message, MAX_NEW_L2_TO_L1_MSGS_PER_CALL> | -| historical_header | Header | -| nullifier_key | Option<NullifierKeyPair> | - -## Methods - -### new - -```rust -PrivateContext::new(inputs, args_hash); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| inputs | PrivateContextInputs | -| args_hash | Field | - -#### Returns -| Type | -| --- | -| PrivateContext | - -### msg_sender - -```rust -PrivateContext::msg_sender(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| AztecAddress | - -### this_address - -```rust -PrivateContext::this_address(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| AztecAddress | - -### this_portal_address - -```rust -PrivateContext::this_portal_address(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| EthAddress | - -### chain_id - -```rust -PrivateContext::chain_id(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| Field | - -### version - -```rust -PrivateContext::version(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| Field | - -### selector - -```rust -PrivateContext::selector(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| FunctionSelector | - -### get_header - -Returns the header of a block whose state is used during private execution (not the block the transaction is included in). - -```rust -PrivateContext::get_header(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| Header | - -### get_header_at - -Returns the header of an arbitrary block whose block number is less than or equal to the block number of historical header. - -```rust -PrivateContext::get_header_at(self, block_number); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| block_number | u32 | - -#### Returns -| Type | -| --- | -| Header | - -### finish - -```rust -PrivateContext::finish(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| PrivateCircuitPublicInputs | - -### capture_min_revertible_side_effect_counter - -```rust -PrivateContext::capture_min_revertible_side_effect_counter(&mut self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | - -### push_read_request - -```rust -PrivateContext::push_read_request(&mut self, read_request); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| read_request | Field | - -### push_new_note_hash - -```rust -PrivateContext::push_new_note_hash(&mut self, note_hash); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| note_hash | Field | - -### push_new_nullifier - -```rust -PrivateContext::push_new_nullifier(&mut self, nullifier, nullified_commitment); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| nullifier | Field | -| nullified_commitment | Field | - -### request_nullifier_secret_key - -```rust -PrivateContext::request_nullifier_secret_key(&mut self, account); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| account | AztecAddress | - -#### Returns -| Type | -| --- | -| GrumpkinPrivateKey | - -### message_portal - -```rust -PrivateContext::message_portal(&mut self, recipient, content); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| recipient | EthAddress | -| content | Field | - -### consume_l1_to_l2_message - -```rust -PrivateContext::consume_l1_to_l2_message(&mut self, msg_key, content, secret, sender); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| msg_key | Field | -| content | Field | -| secret | Field | -| sender | EthAddress | - -## Standalone Functions - -### accumulate_encrypted_logs - -```rust -accumulate_encrypted_logs(&mut self, log); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| log | [Field; N] | - -### accumulate_unencrypted_logs - -```rust -accumulate_unencrypted_logs(&mut self, log); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| log | T | - diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/context/public_context.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/context/public_context.md deleted file mode 100644 index f0ef34060a2..00000000000 --- a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/context/public_context.md +++ /dev/null @@ -1,294 +0,0 @@ -# PublicContext - -## Fields -| Field | Type | -| --- | --- | -| inputs | PublicContextInputs | -| side_effect_counter | u32 | -| args_hash | Field | -| return_values | BoundedVec<Field, RETURN_VALUES_LENGTH> | -| contract_storage_update_requests | BoundedVec<StorageUpdateRequest, MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_CALL> | -| contract_storage_reads | BoundedVec<StorageRead, MAX_PUBLIC_DATA_READS_PER_CALL> | -| public_call_stack_hashes | BoundedVec<Field, MAX_PUBLIC_CALL_STACK_LENGTH_PER_CALL> | -| new_commitments | BoundedVec<SideEffect, MAX_NEW_COMMITMENTS_PER_CALL> | -| new_nullifiers | BoundedVec<SideEffectLinkedToNoteHash, MAX_NEW_NULLIFIERS_PER_CALL> | -| new_l2_to_l1_msgs | BoundedVec<L2ToL1Message, MAX_NEW_L2_TO_L1_MSGS_PER_CALL> | -| unencrypted_logs_hash | BoundedVec<Field, NUM_FIELDS_PER_SHA256> | -| unencrypted_logs_preimages_length | Field | -| historical_header | Header | -| prover_address | AztecAddress | - -## Methods - -### new - -```rust -PublicContext::new(inputs, args_hash); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| inputs | PublicContextInputs | -| args_hash | Field | - -#### Returns -| Type | -| --- | -| PublicContext | - -### msg_sender - -```rust -PublicContext::msg_sender(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| AztecAddress | - -### this_address - -```rust -PublicContext::this_address(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| AztecAddress | - -### this_portal_address - -```rust -PublicContext::this_portal_address(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| EthAddress | - -### chain_id - -```rust -PublicContext::chain_id(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| Field | - -### version - -```rust -PublicContext::version(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| Field | - -### selector - -```rust -PublicContext::selector(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| FunctionSelector | - -### block_number - -```rust -PublicContext::block_number(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| Field | - -### timestamp - -```rust -PublicContext::timestamp(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| Field | - -### coinbase - -```rust -PublicContext::coinbase(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| EthAddress | - -### fee_recipient - -```rust -PublicContext::fee_recipient(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| AztecAddress | - -### finish - -```rust -PublicContext::finish(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| PublicCircuitPublicInputs | - -### push_new_note_hash - -```rust -PublicContext::push_new_note_hash(&mut self, note_hash); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| note_hash | Field | - -### push_new_nullifier - -```rust -PublicContext::push_new_nullifier(&mut self, nullifier, _nullified_commitment); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| nullifier | Field | -| _nullified_commitment | Field | - -### message_portal - -```rust -PublicContext::message_portal(&mut self, recipient, content); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| recipient | EthAddress | -| content | Field | - -### consume_l1_to_l2_message - -```rust -PublicContext::consume_l1_to_l2_message(&mut self, msg_key, content, secret, sender); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| msg_key | Field | -| content | Field | -| secret | Field | -| sender | EthAddress | - -## Standalone Functions - -### accumulate_encrypted_logs - -```rust -accumulate_encrypted_logs(&mut self, log); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| log | [Field; N] | - -### accumulate_unencrypted_logs - -```rust -accumulate_unencrypted_logs(&mut self, log); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| log | T | - diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/hash.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/hash.md deleted file mode 100644 index b780b0b625b..00000000000 --- a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/hash.md +++ /dev/null @@ -1,18 +0,0 @@ -## Standalone Functions - -### compute_secret_hash - -```rust -compute_secret_hash(secret); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| secret | Field | - -#### Returns -| Type | -| --- | -| Field | - diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/hasher.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/hasher.md deleted file mode 100644 index 8b0c22e0e7e..00000000000 --- a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/hasher.md +++ /dev/null @@ -1,64 +0,0 @@ -# Hasher - -## Fields -| Field | Type | -| --- | --- | -| fields | Field] | - -## Methods - -### new - -```rust -Hasher::new(); -``` - -Takes no parameters. - -#### Returns -| Type | -| --- | -| Self | - -### add - -```rust -Hasher::add(&mut self, field); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| field | Field | - -## Standalone Functions - -### hash - -```rust -hash(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| Field | - -### add_multiple - -```rust -add_multiple(&mut self, fields); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| fields | [Field; N] | - diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/history/nullifier_inclusion.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/history/nullifier_inclusion.md deleted file mode 100644 index 829311b108b..00000000000 --- a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/history/nullifier_inclusion.md +++ /dev/null @@ -1,26 +0,0 @@ -## Standalone Functions - -### _nullifier_inclusion - -```rust -_nullifier_inclusion(nullifier, header); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| nullifier | Field | -| header | Header | - -### prove_nullifier_inclusion - -```rust -prove_nullifier_inclusion(nullifier, context); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| nullifier | Field | -| context | PrivateContext | - diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/history/nullifier_non_inclusion.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/history/nullifier_non_inclusion.md deleted file mode 100644 index fcdf75dee76..00000000000 --- a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/history/nullifier_non_inclusion.md +++ /dev/null @@ -1,39 +0,0 @@ -## Standalone Functions - -### _nullifier_non_inclusion - -```rust -_nullifier_non_inclusion(nullifier, header); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| nullifier | Field | -| header | Header | - -### prove_nullifier_not_included - -```rust -prove_nullifier_not_included(nullifier, context); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| nullifier | Field | -| context | PrivateContext | - -### prove_nullifier_not_included_at - -```rust -prove_nullifier_not_included_at(nullifier, block_number, context); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| nullifier | Field | -| block_number | u32 | -| context | PrivateContext | - diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/log.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/log.md deleted file mode 100644 index aa4fe82bed9..00000000000 --- a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/log.md +++ /dev/null @@ -1,28 +0,0 @@ -## Standalone Functions - -### emit_unencrypted_log - -```rust -emit_unencrypted_log(context, log); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| context | &mut PublicContext | -| log | T | - -### emit_unencrypted_log_from_private - -```rust -emit_unencrypted_log_from_private(context, log); -``` - -If we decide to keep this function around would make sense to wait for traits and then merge it with emit_unencrypted_log. - -#### Parameters -| Name | Type | -| --- | --- | -| context | &mut PrivateContext | -| log | T | - diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/messaging/l1_to_l2_message.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/messaging/l1_to_l2_message.md deleted file mode 100644 index 0ad0daad6b5..00000000000 --- a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/messaging/l1_to_l2_message.md +++ /dev/null @@ -1,61 +0,0 @@ -# L1ToL2Message - -## Fields -| Field | Type | -| --- | --- | -| sender | EthAddress | -| chainId | Field | -| recipient | AztecAddress | -| version | Field | -| content | Field | -| secret | Field | -| secret_hash | Field | -| deadline | u32 | -| fee | u64 | -| tree_index | Field | - -## Methods - -### validate_message_secret - -```rust -L1ToL2Message::validate_message_secret(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | Self | - -### hash - -```rust -L1ToL2Message::hash(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | Self | - -#### Returns -| Type | -| --- | -| Field | - -### compute_nullifier - -```rust -L1ToL2Message::compute_nullifier(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | Self | - -#### Returns -| Type | -| --- | -| Field | - diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/messaging/l1_to_l2_message_getter_data.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/messaging/l1_to_l2_message_getter_data.md deleted file mode 100644 index 4df828b6298..00000000000 --- a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/messaging/l1_to_l2_message_getter_data.md +++ /dev/null @@ -1,24 +0,0 @@ -# L1ToL2MessageGetterData - -## Fields -| Field | Type | -| --- | --- | -| message | L1ToL2Message | -| sibling_path | Field; L1_TO_L2_MSG_TREE_HEIGHT] | -| leaf_index | Field | - -## Standalone Functions - -### l1_to_l2_message_getter_len - -```rust -l1_to_l2_message_getter_len(); -``` - -Takes no parameters. - -#### Returns -| Type | -| --- | -| Field | - diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/note/note_getter.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/note/note_getter.md deleted file mode 100644 index 0dd21bbb6e5..00000000000 --- a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/note/note_getter.md +++ /dev/null @@ -1,31 +0,0 @@ -## Standalone Functions - -### check_note_fields - -```rust -check_note_fields(fields, selects, N>); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| fields | [Field; N] | -| selects | BoundedVec<Option<Select> | -| N> | | - -### get_note_internal - -```rust -get_note_internal(storage_slot); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| storage_slot | Field | - -#### Returns -| Type | -| --- | -| Note where Note: NoteInterface<N> | - diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/note/note_getter_options.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/note/note_getter_options.md deleted file mode 100644 index f01b40883dc..00000000000 --- a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/note/note_getter_options.md +++ /dev/null @@ -1,174 +0,0 @@ -# ComparatorEnum - -## Fields -| Field | Type | -| --- | --- | -| EQ | u3 | -| NEQ | u3 | -| LT | u3 | -| LTE | u3 | -| GT | u3 | -| GTE | u3 | - -# Select - -## Fields -| Field | Type | -| --- | --- | -| field_index | u8 | -| value | Field | -| comparator | u3 | - -## Methods - -### new - -```rust -Select::new(field_index, value, comparator); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| field_index | u8 | -| value | Field | -| comparator | u3 | - -#### Returns -| Type | -| --- | -| Self | - -# SortOrderEnum - -## Fields -| Field | Type | -| --- | --- | -| DESC | u2 | -| ASC | u2 | - -# Sort - -## Fields -| Field | Type | -| --- | --- | -| field_index | u8 | -| order | u2 | - -## Methods - -### new - -```rust -Sort::new(field_index, order); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| field_index | u8 | -| order | u2 | - -#### Returns -| Type | -| --- | -| Self | - -# NoteStatusEnum - -## Fields -| Field | Type | -| --- | --- | -| ACTIVE | u2 | -| ACTIVE_OR_NULLIFIED | u2 | - -## Standalone Functions - -### select - -```rust -select(&mut self, field_index, value, comparator); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| field_index | u8 | -| value | Field | -| comparator | Option<u3> | - -#### Returns -| Type | -| --- | -| Self | - -### sort - -```rust -sort(&mut self, field_index, order); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| field_index | u8 | -| order | u2 | - -#### Returns -| Type | -| --- | -| Self | - -### set_limit - -```rust -set_limit(&mut self, limit); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| limit | u32 | - -#### Returns -| Type | -| --- | -| Self | - -### set_offset - -```rust -set_offset(&mut self, offset); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| offset | u32 | - -#### Returns -| Type | -| --- | -| Self | - -### set_status - -```rust -set_status(&mut self, status); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| status | u2 | - -#### Returns -| Type | -| --- | -| Self | - diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/note/note_header.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/note/note_header.md deleted file mode 100644 index 7d5934ed679..00000000000 --- a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/note/note_header.md +++ /dev/null @@ -1,45 +0,0 @@ -# NoteHeader - -## Fields -| Field | Type | -| --- | --- | -| contract_address | AztecAddress | -| nonce | Field | -| storage_slot | Field | -| is_transient | bool | - -## Methods - -### new - -```rust -NoteHeader::new(contract_address, nonce, storage_slot); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| contract_address | AztecAddress | -| nonce | Field | -| storage_slot | Field | - -#### Returns -| Type | -| --- | -| Self | - -## Standalone Functions - -### empty - -```rust -empty(); -``` - -Takes no parameters. - -#### Returns -| Type | -| --- | -| Self | - diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/note/note_viewer_options.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/note/note_viewer_options.md deleted file mode 100644 index 94f3ad864b0..00000000000 --- a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/note/note_viewer_options.md +++ /dev/null @@ -1,103 +0,0 @@ -## Standalone Functions - -### new - -```rust -new(); -``` - -Takes no parameters. - -#### Returns -| Type | -| --- | -| NoteViewerOptions<Note, N> where Note: NoteInterface<N> | - -### select - -```rust -select(&mut self, field_index, value, comparator); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| field_index | u8 | -| value | Field | -| comparator | Option<u3> | - -#### Returns -| Type | -| --- | -| Self | - -### sort - -```rust -sort(&mut self, field_index, order); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| field_index | u8 | -| order | u2 | - -#### Returns -| Type | -| --- | -| Self | - -### set_limit - -```rust -set_limit(&mut self, limit); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| limit | u32 | - -#### Returns -| Type | -| --- | -| Self | - -### set_offset - -```rust -set_offset(&mut self, offset); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| offset | u32 | - -#### Returns -| Type | -| --- | -| Self | - -### set_status - -```rust -set_status(&mut self, status); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| status | u2 | - -#### Returns -| Type | -| --- | -| Self | - diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/note/utils.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/note/utils.md deleted file mode 100644 index bf4e18caa94..00000000000 --- a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/note/utils.md +++ /dev/null @@ -1,116 +0,0 @@ -## Standalone Functions - -### compute_siloed_hash - -```rust -compute_siloed_hash(contract_address, inner_note_hash); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| contract_address | AztecAddress | -| inner_note_hash | Field | - -#### Returns -| Type | -| --- | -| Field | - -### compute_unique_hash - -```rust -compute_unique_hash(nonce, siloed_note_hash); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| nonce | Field | -| siloed_note_hash | Field | - -#### Returns -| Type | -| --- | -| Field | - -### compute_inner_note_hash - -```rust -compute_inner_note_hash(note); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| note | Note | - -#### Returns -| Type | -| --- | -| Field where Note: NoteInterface<N> | - -### compute_siloed_note_hash - -```rust -compute_siloed_note_hash(note_with_header); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| note_with_header | Note | - -#### Returns -| Type | -| --- | -| Field where Note: NoteInterface<N> | - -### compute_unique_siloed_note_hash - -```rust -compute_unique_siloed_note_hash(note_with_header); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| note_with_header | Note | - -#### Returns -| Type | -| --- | -| Field where Note: NoteInterface<N> | - -### compute_note_hash_for_insertion - -```rust -compute_note_hash_for_insertion(note); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| note | Note | - -#### Returns -| Type | -| --- | -| Field where Note: NoteInterface<N> | - -### compute_note_hash_for_consumption - -```rust -compute_note_hash_for_consumption(note); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| note | Note | - -#### Returns -| Type | -| --- | -| Field where Note: NoteInterface<N> | - diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/arguments.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/arguments.md deleted file mode 100644 index b68446fd403..00000000000 --- a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/arguments.md +++ /dev/null @@ -1,34 +0,0 @@ -## Standalone Functions - -### pack_arguments_oracle - -```rust -pack_arguments_oracle(_args); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| _args | [Field; N] | - -#### Returns -| Type | -| --- | -| Field | - -### pack_arguments - -```rust -pack_arguments(args); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| args | [Field; N] | - -#### Returns -| Type | -| --- | -| Field | - diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/context.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/context.md deleted file mode 100644 index 352ce1613f9..00000000000 --- a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/context.md +++ /dev/null @@ -1,34 +0,0 @@ -## Standalone Functions - -### _get_portal_address - -```rust -_get_portal_address(_contract_address); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| _contract_address | AztecAddress | - -#### Returns -| Type | -| --- | -| EthAddress | - -### get_portal_address - -```rust -get_portal_address(contract_address); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| contract_address | AztecAddress | - -#### Returns -| Type | -| --- | -| EthAddress | - diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/create_commitment.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/create_commitment.md deleted file mode 100644 index cdadf1c75cf..00000000000 --- a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/create_commitment.md +++ /dev/null @@ -1,29 +0,0 @@ -## Standalone Functions - -### create_commitment_oracle - -```rust -create_commitment_oracle(_commitment); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| _commitment | Field | - -#### Returns -| Type | -| --- | -| Field | - -### create_commitment - -```rust -create_commitment(commitment); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| commitment | Field | - diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/debug_log.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/debug_log.md deleted file mode 100644 index bceb43f266e..00000000000 --- a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/debug_log.md +++ /dev/null @@ -1,143 +0,0 @@ -## Standalone Functions - -### debug_log_oracle - -```rust -debug_log_oracle(_msg, _num_args); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| _msg | T | -| _num_args | Field | - -#### Returns -| Type | -| --- | -| Field | - -### debug_log_format_oracle - -```rust -debug_log_format_oracle(_msg, _args, _num_args); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| _msg | T | -| _args | [Field; N] | -| _num_args | Field | - -#### Returns -| Type | -| --- | -| Field | - -### debug_log_field_oracle - -```rust -debug_log_field_oracle(_field); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| _field | Field | - -#### Returns -| Type | -| --- | -| Field | - -### debug_log_array_oracle - -```rust -debug_log_array_oracle(_arbitrary_array); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| _arbitrary_array | [T; N] | - -#### Returns -| Type | -| --- | -| Field | - -### debug_log_array_with_prefix_oracle - -```rust -debug_log_array_with_prefix_oracle(_prefix, _arbitrary_array); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| _prefix | S | -| _arbitrary_array | [T; N] | - -#### Returns -| Type | -| --- | -| Field | - -### debug_log - -```rust -debug_log(msg); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| msg | T | - -### debug_log_format - -```rust -debug_log_format(msg, args); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| msg | T | -| args | [Field; N] | - -### debug_log_field - -```rust -debug_log_field(field); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| field | Field | - -### debug_log_array - -```rust -debug_log_array(arbitrary_array); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| arbitrary_array | [T; N] | - -### debug_log_array_with_prefix - -```rust -debug_log_array_with_prefix(prefix, arbitrary_array); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| prefix | S | -| arbitrary_array | [T; N] | - diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/get_l1_to_l2_message.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/get_l1_to_l2_message.md deleted file mode 100644 index 41023a34cd1..00000000000 --- a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/get_l1_to_l2_message.md +++ /dev/null @@ -1,34 +0,0 @@ -## Standalone Functions - -### get_l1_to_l2_msg_oracle - -```rust -get_l1_to_l2_msg_oracle(_msg_key); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| _msg_key | Field | - -#### Returns -| Type | -| --- | -| Field; L1_TO_L2_MESSAGE_ORACLE_CALL_LENGTH] | - -### get_l1_to_l2_message_call - -```rust -get_l1_to_l2_message_call(msg_key); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| msg_key | Field | - -#### Returns -| Type | -| --- | -| Field; L1_TO_L2_MESSAGE_ORACLE_CALL_LENGTH] | - diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/get_nullifier_membership_witness.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/get_nullifier_membership_witness.md deleted file mode 100644 index a948a733d5e..00000000000 --- a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/get_nullifier_membership_witness.md +++ /dev/null @@ -1,63 +0,0 @@ -# NullifierMembershipWitness - -## Fields -| Field | Type | -| --- | --- | -| index | Field | -| leaf_preimage | NullifierLeafPreimage | -| path | Field; NULLIFIER_TREE_HEIGHT] | - -## Methods - -### deserialize - -```rust -NullifierMembershipWitness::deserialize(fields); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| fields | [Field; NULLIFIER_MEMBERSHIP_WITNESS] | - -#### Returns -| Type | -| --- | -| Self | - -## Standalone Functions - -### get_low_nullifier_membership_witness - -```rust -get_low_nullifier_membership_witness(block_number, nullifier); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| block_number | u32 | -| nullifier | Field | - -#### Returns -| Type | -| --- | -| NullifierMembershipWitness | - -### get_nullifier_membership_witness - -```rust -get_nullifier_membership_witness(block_number, nullifier); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| block_number | u32 | -| nullifier | Field | - -#### Returns -| Type | -| --- | -| NullifierMembershipWitness | - diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/get_public_data_witness.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/get_public_data_witness.md deleted file mode 100644 index 97228bfa0d2..00000000000 --- a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/get_public_data_witness.md +++ /dev/null @@ -1,28 +0,0 @@ -# PublicDataWitness - -## Fields -| Field | Type | -| --- | --- | -| index | Field | -| leaf_preimage | PublicDataTreeLeafPreimage | -| path | Field; PUBLIC_DATA_TREE_HEIGHT] | - -## Standalone Functions - -### get_public_data_witness - -```rust -get_public_data_witness(block_number, leaf_slot); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| block_number | u32 | -| leaf_slot | Field | - -#### Returns -| Type | -| --- | -| PublicDataWitness | - diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/get_public_key.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/get_public_key.md deleted file mode 100644 index 9772fd74880..00000000000 --- a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/get_public_key.md +++ /dev/null @@ -1,50 +0,0 @@ -## Standalone Functions - -### get_public_key_and_partial_address_oracle - -```rust -get_public_key_and_partial_address_oracle(_address); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| _address | AztecAddress | - -#### Returns -| Type | -| --- | -| Field; 3] | - -### get_public_key_and_partial_address_internal - -```rust -get_public_key_and_partial_address_internal(address); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| address | AztecAddress | - -#### Returns -| Type | -| --- | -| Field; 3] | - -### get_public_key - -```rust -get_public_key(address); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| address | AztecAddress | - -#### Returns -| Type | -| --- | -| GrumpkinPoint | - diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/get_sibling_path.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/get_sibling_path.md deleted file mode 100644 index de7165f340b..00000000000 --- a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/get_sibling_path.md +++ /dev/null @@ -1,20 +0,0 @@ -## Standalone Functions - -### get_sibling_path_oracle - -```rust -get_sibling_path_oracle(_block_number, _tree_id, _leaf_index); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| _block_number | u32 | -| _tree_id | Field | -| _leaf_index | Field | - -#### Returns -| Type | -| --- | -| Field; N] | - diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/header.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/header.md deleted file mode 100644 index f8313c66b46..00000000000 --- a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/header.md +++ /dev/null @@ -1,51 +0,0 @@ -## Standalone Functions - -### get_header_at_oracle - -```rust -get_header_at_oracle(_block_number); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| _block_number | u32 | - -#### Returns -| Type | -| --- | -| Field; HEADER_LENGTH] | - -### get_header_at_internal - -```rust -get_header_at_internal(block_number); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| block_number | u32 | - -#### Returns -| Type | -| --- | -| Header | - -### get_header_at - -```rust -get_header_at(block_number, context); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| block_number | u32 | -| context | PrivateContext | - -#### Returns -| Type | -| --- | -| Header | - diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/notes.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/notes.md deleted file mode 100644 index 1780e81a34f..00000000000 --- a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/notes.md +++ /dev/null @@ -1,68 +0,0 @@ -## Standalone Functions - -### notify_nullified_note_oracle - -```rust -notify_nullified_note_oracle(_nullifier, _inner_note_hash); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| _nullifier | Field | -| _inner_note_hash | Field | - -#### Returns -| Type | -| --- | -| Field | - -### notify_nullified_note - -```rust -notify_nullified_note(nullifier, inner_note_hash); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| nullifier | Field | -| inner_note_hash | Field | - -#### Returns -| Type | -| --- | -| Field | - -### check_nullifier_exists_oracle - -```rust -check_nullifier_exists_oracle(_inner_nullifier); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| _inner_nullifier | Field | - -#### Returns -| Type | -| --- | -| Field | - -### check_nullifier_exists - -```rust -check_nullifier_exists(inner_nullifier); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| inner_nullifier | Field | - -#### Returns -| Type | -| --- | -| bool | - diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/nullifier_key.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/nullifier_key.md deleted file mode 100644 index eb6d7e243a1..00000000000 --- a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/nullifier_key.md +++ /dev/null @@ -1,75 +0,0 @@ -# NullifierKeyPair - -## Fields -| Field | Type | -| --- | --- | -| account | AztecAddress | -| public_key | GrumpkinPoint | -| secret_key | GrumpkinPrivateKey | - -## Standalone Functions - -### get_nullifier_key_pair_oracle - -```rust -get_nullifier_key_pair_oracle(_account); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| _account | AztecAddress | - -#### Returns -| Type | -| --- | -| Field; 4] | - -### get_nullifier_key_pair_internal - -```rust -get_nullifier_key_pair_internal(account); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| account | AztecAddress | - -#### Returns -| Type | -| --- | -| NullifierKeyPair | - -### get_nullifier_key_pair - -```rust -get_nullifier_key_pair(account); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| account | AztecAddress | - -#### Returns -| Type | -| --- | -| NullifierKeyPair | - -### get_nullifier_secret_key - -```rust -get_nullifier_secret_key(account); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| account | AztecAddress | - -#### Returns -| Type | -| --- | -| GrumpkinPrivateKey | - diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/rand.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/rand.md deleted file mode 100644 index 9723fa36646..00000000000 --- a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/rand.md +++ /dev/null @@ -1,28 +0,0 @@ -## Standalone Functions - -### rand_oracle - -```rust -rand_oracle(); -``` - -Takes no parameters. - -#### Returns -| Type | -| --- | -| Field | - -### rand - -```rust -rand(); -``` - -Takes no parameters. - -#### Returns -| Type | -| --- | -| Field | - diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/storage.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/storage.md deleted file mode 100644 index 9e1209ad8f9..00000000000 --- a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/oracle/storage.md +++ /dev/null @@ -1,80 +0,0 @@ -## Standalone Functions - -### storage_read_oracle - -```rust -storage_read_oracle(_storage_slot, _number_of_elements); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| _storage_slot | Field | -| _number_of_elements | Field | - -#### Returns -| Type | -| --- | -| Field; N] | - -### storage_read_oracle_wrapper - -```rust -storage_read_oracle_wrapper(_storage_slot); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| _storage_slot | Field | - -#### Returns -| Type | -| --- | -| Field; N] | - -### storage_read - -```rust -storage_read(storage_slot); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| storage_slot | Field | - -#### Returns -| Type | -| --- | -| Field; N] | - -### storage_write_oracle - -```rust -storage_write_oracle(_storage_slot, _values); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| _storage_slot | Field | -| _values | [Field; N] | - -#### Returns -| Type | -| --- | -| Field; N] | - -### storage_write - -```rust -storage_write(storage_slot, fields); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| storage_slot | Field | -| fields | [Field; N] | - diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/state_vars/immutable_singleton.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/state_vars/immutable_singleton.md deleted file mode 100644 index 651d4b43597..00000000000 --- a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/state_vars/immutable_singleton.md +++ /dev/null @@ -1,83 +0,0 @@ -## Standalone Functions - -### new - -```rust -new(context, storage_slot); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| context | Context | -| storage_slot | Field | - -#### Returns -| Type | -| --- | -| Self | - -### compute_initialization_nullifier - -```rust -compute_initialization_nullifier(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| Field | - -### is_initialized - -```rust -is_initialized(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| bool | - -### get_note - -```rust -get_note(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| Note where Note: NoteInterface<N> | - -### view_note - -```rust -view_note(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| Note where Note: NoteInterface<N> | - diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/state_vars/map.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/state_vars/map.md deleted file mode 100644 index b85b82aae78..00000000000 --- a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/state_vars/map.md +++ /dev/null @@ -1,19 +0,0 @@ -## Standalone Functions - -### at - -```rust -at(self, key); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| key | K | - -#### Returns -| Type | -| --- | -| V where K: ToField | - diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/state_vars/public_state.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/state_vars/public_state.md deleted file mode 100644 index bf0f62394d1..00000000000 --- a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/state_vars/public_state.md +++ /dev/null @@ -1,18 +0,0 @@ -## Standalone Functions - -### read - -```rust -read(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| T where T: Deserialize<T_SERIALIZED_LEN> | - diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/state_vars/set.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/state_vars/set.md deleted file mode 100644 index fecaccb1efc..00000000000 --- a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/state_vars/set.md +++ /dev/null @@ -1,44 +0,0 @@ -## Standalone Functions - -### new - -```rust -new(context, storage_slot); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| context | Context | -| storage_slot | Field | - -#### Returns -| Type | -| --- | -| Self | - -### assert_contains_and_remove - -```rust -assert_contains_and_remove(_self, _note, _nonce); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| _self | Self | -| _note | &mut Note | -| _nonce | Field | - -### assert_contains_and_remove_publicly_created - -```rust -assert_contains_and_remove_publicly_created(_self, _note); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| _self | Self | -| _note | &mut Note | - diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/state_vars/singleton.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/state_vars/singleton.md deleted file mode 100644 index 0675e1598b7..00000000000 --- a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/state_vars/singleton.md +++ /dev/null @@ -1,84 +0,0 @@ -## Standalone Functions - -### new - -```rust -new(context, storage_slot); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| context | Context | -| storage_slot | Field | - -#### Returns -| Type | -| --- | -| Self | - -### compute_initialization_nullifier - -```rust -compute_initialization_nullifier(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| Field | - -### is_initialized - -```rust -is_initialized(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| bool | - -### get_note - -```rust -get_note(self, broadcast); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| broadcast | bool | - -#### Returns -| Type | -| --- | -| Note where Note: NoteInterface<N> | - -### view_note - -```rust -view_note(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| Note where Note: NoteInterface<N> | - diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/state_vars/stable_public_state.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/state_vars/stable_public_state.md deleted file mode 100644 index 7560e0e016a..00000000000 --- a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/state_vars/stable_public_state.md +++ /dev/null @@ -1,34 +0,0 @@ -## Standalone Functions - -### read_public - -```rust -read_public(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| T where T: Deserialize<T_SERIALIZED_LEN> | - -### read_private - -```rust -read_private(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| T where T: Deserialize<T_SERIALIZED_LEN> | - diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/state_vars/storage.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/state_vars/storage.md deleted file mode 100644 index 48223ad3833..00000000000 --- a/docs/src/preprocess/developers/contracts/references/aztec-nr/aztec/state_vars/storage.md +++ /dev/null @@ -1,18 +0,0 @@ -## Standalone Functions - -### get_storage_slot - -```rust -get_storage_slot(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| Field | - diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/compressed-string/compressed_string.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/compressed-string/compressed_string.md deleted file mode 100644 index 6dad0f79510..00000000000 --- a/docs/src/preprocess/developers/contracts/references/aztec-nr/compressed-string/compressed_string.md +++ /dev/null @@ -1,98 +0,0 @@ -## Standalone Functions - -### from_string - -```rust -from_string(input_string); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| input_string | str<M> | - -#### Returns -| Type | -| --- | -| Self | - -### to_bytes - -```rust -to_bytes(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| u8; M] | - -### serialize - -```rust -serialize(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| Field; N] | - -### deserialize - -```rust -deserialize(input); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| input | [Field; N] | - -#### Returns -| Type | -| --- | -| Self | - -### test_short_string - -```rust -test_short_string(); -``` - -Takes no parameters. - -### test_long_string - -```rust -test_long_string(); -``` - -Takes no parameters. - -### test_long_string_work_with_too_many_fields - -```rust -test_long_string_work_with_too_many_fields(); -``` - -Takes no parameters. - -### test_long_string_fail_with_too_few_fields - -```rust -test_long_string_fail_with_too_few_fields(); -``` - -Takes no parameters. - diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/compressed-string/field_compressed_string.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/compressed-string/field_compressed_string.md deleted file mode 100644 index 7dd9c420f36..00000000000 --- a/docs/src/preprocess/developers/contracts/references/aztec-nr/compressed-string/field_compressed_string.md +++ /dev/null @@ -1,110 +0,0 @@ -# FieldCompressedString - -A Fixedsize Compressed String. Essentially a special version of Compressed String for practical use. - -## Fields -| Field | Type | -| --- | --- | -| value | Field | - -## Methods - -### is_eq - -```rust -FieldCompressedString::is_eq(self, other); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| other | FieldCompressedString | - -#### Returns -| Type | -| --- | -| bool | - -### from_field - -```rust -FieldCompressedString::from_field(input_field); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| input_field | Field | - -#### Returns -| Type | -| --- | -| Self | - -### from_string - -```rust -FieldCompressedString::from_string(input_string); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| input_string | str<31> | - -#### Returns -| Type | -| --- | -| Self | - -### to_bytes - -```rust -FieldCompressedString::to_bytes(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| u8; 31] | - -## Standalone Functions - -### serialize - -```rust -serialize(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| Field; 1] | - -### deserialize - -```rust -deserialize(input); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| input | [Field; 1] | - -#### Returns -| Type | -| --- | -| Self | - diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/easy-private-state/easy_private_uint.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/easy-private-state/easy_private_uint.md deleted file mode 100644 index 1155a64f0b0..00000000000 --- a/docs/src/preprocess/developers/contracts/references/aztec-nr/easy-private-state/easy_private_uint.md +++ /dev/null @@ -1,41 +0,0 @@ -# EasyPrivateUint - -## Fields -| Field | Type | -| --- | --- | -| context | Context | -| set | Set<ValueNote> | -| storage_slot | Field | - -## Methods - -### add - -Very similar to `value_note::utils::increment`. - -```rust -EasyPrivateUint::add(self, addend, owner); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| addend | u120 | -| owner | AztecAddress | - -### sub - -Very similar to `value_note::utils::decrement`. - -```rust -EasyPrivateUint::sub(self, subtrahend, owner); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| subtrahend | u120 | -| owner | AztecAddress | - diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/field-note/field_note.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/field-note/field_note.md deleted file mode 100644 index 15420ecfc62..00000000000 --- a/docs/src/preprocess/developers/contracts/references/aztec-nr/field-note/field_note.md +++ /dev/null @@ -1,165 +0,0 @@ -# FieldNote - -A note which stores a field and is expected to be passed around using the `addNote` function. WARNING: This Note is not private as it does not contain randomness and hence it can be easy to perform serialized_note attack on it. - -## Fields -| Field | Type | -| --- | --- | -| value | Field | -| header | NoteHeader | - -## Methods - -### new - -```rust -FieldNote::new(value); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| value | Field | - -#### Returns -| Type | -| --- | -| Self | - -## Standalone Functions - -### serialize_content - -```rust -serialize_content(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| Field; FIELD_NOTE_LEN] | - -### deserialize_content - -```rust -deserialize_content(serialized_note); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| serialized_note | [Field; FIELD_NOTE_LEN] | - -#### Returns -| Type | -| --- | -| Self | - -### compute_note_content_hash - -```rust -compute_note_content_hash(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| Field | - -### compute_nullifier - -```rust -compute_nullifier(self, _context); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| _context | &mut PrivateContext | - -#### Returns -| Type | -| --- | -| Field | - -### compute_nullifier_without_context - -```rust -compute_nullifier_without_context(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| Field | - -### set_header - -```rust -set_header(&mut self, header); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| header | NoteHeader | - -### get_header - -```rust -get_header(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| NoteHeader | - -### broadcast - -```rust -broadcast(self, context, slot); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| context | &mut PrivateContext | -| slot | Field | - -### get_note_type_id - -```rust -get_note_type_id(); -``` - -Takes no parameters. - -#### Returns -| Type | -| --- | -| Field | - diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/safe-math/safe_u120.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/safe-math/safe_u120.md deleted file mode 100644 index 43610fc2b8c..00000000000 --- a/docs/src/preprocess/developers/contracts/references/aztec-nr/safe-math/safe_u120.md +++ /dev/null @@ -1,339 +0,0 @@ -# SafeU120 - -## Fields -| Field | Type | -| --- | --- | -| value | u120 | - -## Methods - -### min - -```rust -SafeU120::min(); -``` - -Takes no parameters. - -#### Returns -| Type | -| --- | -| Self | - -### max - -```rust -SafeU120::max(); -``` - -Takes no parameters. - -#### Returns -| Type | -| --- | -| Self | - -### lt - -```rust -SafeU120::lt(self, other); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | Self | -| other | Self | - -#### Returns -| Type | -| --- | -| bool | - -### le - -```rust -SafeU120::le(self, other); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | Self | -| other | Self | - -#### Returns -| Type | -| --- | -| bool | - -### gt - -```rust -SafeU120::gt(self, other); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | Self | -| other | Self | - -#### Returns -| Type | -| --- | -| bool | - -### ge - -```rust -SafeU120::ge(self, other); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | Self | -| other | Self | - -#### Returns -| Type | -| --- | -| bool | - -## Standalone Functions - -### serialize - -```rust -serialize(value); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| value | SafeU120 | - -#### Returns -| Type | -| --- | -| Field; SAFE_U120_SERIALIZED_LEN] | - -### deserialize - -```rust -deserialize(fields); -``` - -This is safe when reading from storage IF only correct safeu120 was written to storage - -#### Parameters -| Name | Type | -| --- | --- | -| fields | [Field; SAFE_U120_SERIALIZED_LEN] | - -#### Returns -| Type | -| --- | -| SafeU120 | - -### test_init - -```rust -test_init(); -``` - -Takes no parameters. - -### test_init_max - -```rust -test_init_max(); -``` - -Takes no parameters. - -### test_init_min - -```rust -test_init_min(); -``` - -Takes no parameters. - -### test_is_zero - -```rust -test_is_zero(); -``` - -Takes no parameters. - -### test_eq - -```rust -test_eq(); -``` - -Takes no parameters. - -### test_lt - -```rust -test_lt(); -``` - -Takes no parameters. - -### test_le - -```rust -test_le(); -``` - -Takes no parameters. - -### test_gt - -```rust -test_gt(); -``` - -Takes no parameters. - -### test_ge - -```rust -test_ge(); -``` - -Takes no parameters. - -### test_init_too_large - -```rust -test_init_too_large(); -``` - -Takes no parameters. - -### test_add - -```rust -test_add(); -``` - -Takes no parameters. - -### test_add_overflow - -```rust -test_add_overflow(); -``` - -Takes no parameters. - -### test_sub - -```rust -test_sub(); -``` - -Takes no parameters. - -### test_sub_underflow - -```rust -test_sub_underflow(); -``` - -Takes no parameters. - -### test_mul - -```rust -test_mul(); -``` - -Takes no parameters. - -### test_mul_overflow - -```rust -test_mul_overflow(); -``` - -Takes no parameters. - -### test_div - -```rust -test_div(); -``` - -Takes no parameters. - -### test_div_by_zero - -```rust -test_div_by_zero(); -``` - -Takes no parameters. - -### test_mul_div - -```rust -test_mul_div(); -``` - -Takes no parameters. - -### test_mul_div_zero_divisor - -```rust -test_mul_div_zero_divisor(); -``` - -Takes no parameters. - -### test_mul_div_ghost_overflow - -```rust -test_mul_div_ghost_overflow(); -``` - -Takes no parameters. - -### test_mul_div_up_rounding - -```rust -test_mul_div_up_rounding(); -``` - -Takes no parameters. - -### test_mul_div_up_non_rounding - -```rust -test_mul_div_up_non_rounding(); -``` - -Takes no parameters. - -### test_mul_div_up_ghost_overflow - -```rust -test_mul_div_up_ghost_overflow(); -``` - -Takes no parameters. - -### test_mul_div_up_zero_divisor - -```rust -test_mul_div_up_zero_divisor(); -``` - -Takes no parameters. - diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/slow-updates-tree/leaf.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/slow-updates-tree/leaf.md deleted file mode 100644 index 8af2b59b7a2..00000000000 --- a/docs/src/preprocess/developers/contracts/references/aztec-nr/slow-updates-tree/leaf.md +++ /dev/null @@ -1,45 +0,0 @@ -# Leaf - -A leaf in the tree. - -## Fields -| Field | Type | -| --- | --- | -| next_change | Field | -| before | Field | -| after | Field | - -## Standalone Functions - -### serialize - -```rust -serialize(leaf); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| leaf | Leaf | - -#### Returns -| Type | -| --- | -| Field; 3] | - -### deserialize - -```rust -deserialize(serialized); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| serialized | [Field; 3] | - -#### Returns -| Type | -| --- | -| Leaf | - diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/slow-updates-tree/slow_map.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/slow-updates-tree/slow_map.md deleted file mode 100644 index 3b96ffc3fc2..00000000000 --- a/docs/src/preprocess/developers/contracts/references/aztec-nr/slow-updates-tree/slow_map.md +++ /dev/null @@ -1,161 +0,0 @@ -## Standalone Functions - -### compute_next_change - -```rust -compute_next_change(time); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| time | Field | - -#### Returns -| Type | -| --- | -| Field | - -### read_root - -```rust -read_root(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | Self | - -#### Returns -| Type | -| --- | -| Leaf | - -### initialize - -```rust -initialize(self, initial_root); -``` - -Beware that the initial root could include much state that is not shown by the public storage! - -#### Parameters -| Name | Type | -| --- | --- | -| self | Self | -| initial_root | Field | - -### current_root - -```rust -current_root(self); -``` - -Reads the "CURRENT" value of the root - -#### Parameters -| Name | Type | -| --- | --- | -| self | Self | - -#### Returns -| Type | -| --- | -| Field | - -### read_leaf_at - -```rust -read_leaf_at(self, key); -``` - -docs:start:read_leaf_at - -#### Parameters -| Name | Type | -| --- | --- | -| self | Self | -| key | Field | - -#### Returns -| Type | -| --- | -| Leaf | - -### read_at - -```rust -read_at(self, key); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | Self | -| key | Field | - -#### Returns -| Type | -| --- | -| Field | - -### update_at - -```rust -update_at(self, p, M>); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | Self | -| p | SlowUpdateProof<N | -| M> | | - -### update_unsafe_at - -```rust -update_unsafe_at(self, index, leaf_value, new_root); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | Self | -| index | Field | -| leaf_value | Field | -| new_root | Field | - -### update_unsafe - -```rust -update_unsafe(self, index, leaf, root); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | Self | -| index | Field | -| leaf | Leaf | -| root | Leaf | - -### compute_merkle_root - -```rust -compute_merkle_root(leaf, index, hash_path); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| leaf | Field | -| index | Field | -| hash_path | [Field; N] | - -#### Returns -| Type | -| --- | -| Field | - diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/slow-updates-tree/slow_update_proof.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/slow-updates-tree/slow_update_proof.md deleted file mode 100644 index 471387269ba..00000000000 --- a/docs/src/preprocess/developers/contracts/references/aztec-nr/slow-updates-tree/slow_update_proof.md +++ /dev/null @@ -1,50 +0,0 @@ -## Standalone Functions - -### deserialize_slow_update_proof - -```rust -deserialize_slow_update_proof(serialized); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| serialized | [Field; M] | - -#### Returns -| Type | -| --- | -| SlowUpdateProof<N, M> | - -### serialize - -```rust -serialize(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | Self | - -#### Returns -| Type | -| --- | -| Field; M] | - -### deserialize - -```rust -deserialize(serialized); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| serialized | [Field; M] | - -#### Returns -| Type | -| --- | -| Self | - diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/value-note/balance_utils.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/value-note/balance_utils.md deleted file mode 100644 index 36b49162ef8..00000000000 --- a/docs/src/preprocess/developers/contracts/references/aztec-nr/value-note/balance_utils.md +++ /dev/null @@ -1,35 +0,0 @@ -## Standalone Functions - -### get_balance - -```rust -get_balance(set); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| set | Set<ValueNote> | - -#### Returns -| Type | -| --- | -| Field | - -### get_balance_with_offset - -```rust -get_balance_with_offset(set, offset); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| set | Set<ValueNote> | -| offset | u32 | - -#### Returns -| Type | -| --- | -| Field | - diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/value-note/utils.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/value-note/utils.md deleted file mode 100644 index d08786b9574..00000000000 --- a/docs/src/preprocess/developers/contracts/references/aztec-nr/value-note/utils.md +++ /dev/null @@ -1,90 +0,0 @@ -## Standalone Functions - -### create_note_getter_options_for_decreasing_balance - -```rust -create_note_getter_options_for_decreasing_balance(amount); -``` - -Pick the fewest notes whose sum is equal to or greater than `amount`. - -#### Parameters -| Name | Type | -| --- | --- | -| amount | Field | - -#### Returns -| Type | -| --- | -| NoteGetterOptions<ValueNote, VALUE_NOTE_LEN, Field> | - -### increment - -```rust -increment(balance, amount, recipient); -``` - -Inserts it to the recipient's set of notes. - -#### Parameters -| Name | Type | -| --- | --- | -| balance | Set<ValueNote> | -| amount | Field | -| recipient | AztecAddress | - -### decrement - -```rust -decrement(balance, amount, owner); -``` - -Fail if the sum of the selected notes is less than the amount. - -#### Parameters -| Name | Type | -| --- | --- | -| balance | Set<ValueNote> | -| amount | Field | -| owner | AztecAddress | - -### decrement_by_at_most - -```rust -decrement_by_at_most(balance, max_amount, owner); -``` - -// It returns the decremented amount, which should be less than or equal to max_amount. - -#### Parameters -| Name | Type | -| --- | --- | -| balance | Set<ValueNote> | -| max_amount | Field | -| owner | AztecAddress | - -#### Returns -| Type | -| --- | -| Field | - -### destroy_note - -```rust -destroy_note(balance, owner, note); -``` - -Returns the value of the destroyed note. - -#### Parameters -| Name | Type | -| --- | --- | -| balance | Set<ValueNote> | -| owner | AztecAddress | -| note | ValueNote | - -#### Returns -| Type | -| --- | -| Field | - diff --git a/docs/src/preprocess/developers/contracts/references/aztec-nr/value-note/value_note.md b/docs/src/preprocess/developers/contracts/references/aztec-nr/value-note/value_note.md deleted file mode 100644 index 4e7d916aa38..00000000000 --- a/docs/src/preprocess/developers/contracts/references/aztec-nr/value-note/value_note.md +++ /dev/null @@ -1,166 +0,0 @@ -# ValueNote - -## Fields -| Field | Type | -| --- | --- | -| value | Field | -| owner | AztecAddress | -| randomness | Field | -| header | NoteHeader | - -## Methods - -### new - -```rust -ValueNote::new(value, owner); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| value | Field | -| owner | AztecAddress | - -#### Returns -| Type | -| --- | -| Self | - -## Standalone Functions - -### serialize_content - -```rust -serialize_content(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| Field; VALUE_NOTE_LEN] | - -### deserialize_content - -```rust -deserialize_content(serialized_note); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| serialized_note | [Field; VALUE_NOTE_LEN] | - -#### Returns -| Type | -| --- | -| Self | - -### compute_note_content_hash - -```rust -compute_note_content_hash(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| Field | - -### compute_nullifier - -```rust -compute_nullifier(self, context); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| context | &mut PrivateContext | - -#### Returns -| Type | -| --- | -| Field | - -### compute_nullifier_without_context - -```rust -compute_nullifier_without_context(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| Field | - -### set_header - -```rust -set_header(&mut self, header); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| header | NoteHeader | - -### get_header - -```rust -get_header(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -#### Returns -| Type | -| --- | -| NoteHeader | - -### broadcast - -```rust -broadcast(self, context, slot); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| context | &mut PrivateContext | -| slot | Field | - -### get_note_type_id - -```rust -get_note_type_id(); -``` - -Takes no parameters. - -#### Returns -| Type | -| --- | -| Field | - From b708225510845ca74e43c711f4b44bfe970d2939 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pedro=20Sousa?= Date: Thu, 22 Feb 2024 16:41:18 +0000 Subject: [PATCH 18/18] fix? --- docs/src/preprocess/generate_aztecnr_reference.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/src/preprocess/generate_aztecnr_reference.js b/docs/src/preprocess/generate_aztecnr_reference.js index 56b6bfebea2..0d06932453c 100644 --- a/docs/src/preprocess/generate_aztecnr_reference.js +++ b/docs/src/preprocess/generate_aztecnr_reference.js @@ -289,12 +289,12 @@ function processFiles(baseDir, outputBaseDir) { let baseDir = path.resolve(__dirname, '../../../noir-projects/aztec-nr'); -let outputBaseDir = path.resolve(__dirname, './developers/contracts/references/aztec-nr'); +let outputBaseDir = path.resolve(__dirname, '../../docs/developers/contracts/references/aztec-nr'); -if (process.env.CI === 'true') { - baseDir = path.resolve(__dirname, '../noir-projects/aztec-nr'); - outputBaseDir = path.resolve(__dirname, '../../docs/developers/contracts/references/aztec-nr'); -} +// if (process.env.CI === 'true') { +// baseDir = path.resolve(__dirname, '../noir-projects/aztec-nr'); +// outputBaseDir = path.resolve(__dirname, '../../docs/developers/contracts/references/aztec-nr'); +// } processFiles(baseDir, outputBaseDir);