diff --git a/docs/docs/aztec/concepts/smart_contracts/communication/public_private_calls.md b/docs/docs/aztec/concepts/smart_contracts/communication/public_private_calls.md index 09f2449bec0..1dfd3c1a218 100644 --- a/docs/docs/aztec/concepts/smart_contracts/communication/public_private_calls.md +++ b/docs/docs/aztec/concepts/smart_contracts/communication/public_private_calls.md @@ -60,7 +60,7 @@ To summarize: - _Public_ functions altering public state (updatable storage) must be executed at the current "head" of the chain, which only the sequencer can ensure, so these must be executed separately to the _private_ functions. - _Private_ and _public_ functions within an Aztec transaction are therefore ordered such that first _private_ functions are executed, and then _public_. -A more comprehensive overview of the interplay between private and public functions and their ability to manipulate data is presented below. It is worth noting that all data reads performed by private functions are historical in nature, and that private functions are not capable of modifying public storage. Conversely, public functions have the capacity to manipulate private storage (e.g., inserting new note hashes, potentially as part of transferring funds from the public domain to the secret domain). +A more comprehensive overview of the interplay between private and public functions and their ability to manipulate data is presented below. It is worth noting that all data reads performed by private functions are historical in nature, and that private functions are not capable of modifying public storage. Conversely, public functions have the capacity to manipulate private storage (e.g., inserting new note hashes, potentially as part of transferring funds from the public domain to the private domain). diff --git a/docs/docs/reference/smart_contract_reference/index.md b/docs/docs/reference/smart_contract_reference/index.md index 38cf6204067..8c47f55d714 100644 --- a/docs/docs/reference/smart_contract_reference/index.md +++ b/docs/docs/reference/smart_contract_reference/index.md @@ -15,7 +15,7 @@ The structure of a contract artifact is as follows: "functions": [ { "name": "constructor", - "functionType": "secret", + "functionType": "private", "isInternal": false, "parameters": [], "returnTypes": [], @@ -24,7 +24,7 @@ The structure of a contract artifact is as follows: }, { "name": "on_card_played", - "functionType": "open", + "functionType": "public", "isInternal": true, "parameters": [ { @@ -75,8 +75,8 @@ A simple string that matches the name that the contract developer used for this #### `function.functionType` The function type can have one of the following values: -- Secret: The function is ran and proved locally by the clients, and its bytecode not published to the network. -- Open: The function is ran and proved by the sequencer, and its bytecode is published to the network. +- Private: The function is ran and proved locally by the clients, and its bytecode not published to the network. +- Public: The function is ran and proved by the sequencer, and its bytecode is published to the network. - Unconstrained: The function is ran locally by the clients to generate digested information useful for the user. It's not meant to be transacted against. #### `function.isInternal` diff --git a/noir-projects/noir-contracts/contracts/import_test_contract/src/main.nr b/noir-projects/noir-contracts/contracts/import_test_contract/src/main.nr index bd11a2ac560..d8dd2776a3a 100644 --- a/noir-projects/noir-contracts/contracts/import_test_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/import_test_contract/src/main.nr @@ -41,18 +41,18 @@ contract ImportTest { } // Calls the emit_nullifier_public on the Test contract at the target address - // Used for testing calling an open function + // Used for testing calling a public function // See yarn-project/end-to-end/src/e2e_nested_contract.test.ts #[aztec(private)] - fn call_open_fn(target: AztecAddress) { + fn call_public_fn(target: AztecAddress) { Test::at(target).emit_nullifier_public(1).enqueue(&mut context); } // Calls the emit_nullifier_public on the Test contract at the target address - // Used for testing calling an open function from another open function + // Used for testing calling a public function from another public function // See yarn-project/end-to-end/src/e2e_nested_contract.test.ts #[aztec(public)] - fn pub_call_open_fn(target: AztecAddress) { + fn pub_call_public_fn(target: AztecAddress) { Test::at(target).emit_nullifier_public(1).call(&mut context); } } diff --git a/yarn-project/aztec.js/src/contract/contract.test.ts b/yarn-project/aztec.js/src/contract/contract.test.ts index c7e7db96a48..56855fd9f98 100644 --- a/yarn-project/aztec.js/src/contract/contract.test.ts +++ b/yarn-project/aztec.js/src/contract/contract.test.ts @@ -43,7 +43,7 @@ describe('Contract Class', () => { { name: 'bar', isInitializer: false, - functionType: FunctionType.SECRET, + functionType: FunctionType.PRIVATE, isInternal: false, isStatic: false, debugSymbols: '', @@ -70,7 +70,7 @@ describe('Contract Class', () => { name: 'baz', isInitializer: false, isStatic: false, - functionType: FunctionType.OPEN, + functionType: FunctionType.PUBLIC, isInternal: false, parameters: [], returnTypes: [], diff --git a/yarn-project/aztec.js/src/contract/contract_function_interaction.ts b/yarn-project/aztec.js/src/contract/contract_function_interaction.ts index 6ebf682cdc1..dd8c84951fc 100644 --- a/yarn-project/aztec.js/src/contract/contract_function_interaction.ts +++ b/yarn-project/aztec.js/src/contract/contract_function_interaction.ts @@ -81,7 +81,7 @@ export class ContractFunctionInteraction extends BaseContractInteraction { const txRequest = await this.create(); // const from = - // this.functionDao.functionType == FunctionType.SECRET ? options.from ?? this.wallet.getAddress() : undefined; + // this.functionDao.functionType == FunctionType.PRIVATE ? options.from ?? this.wallet.getAddress() : undefined; const simulatedTx = await this.wallet.simulateTx(txRequest, true, options?.from); @@ -89,7 +89,7 @@ export class ContractFunctionInteraction extends BaseContractInteraction { // since we're interested in the first set of values AFTER the account entrypoint // For public functions we retrieve the first values directly from the public output. const rawReturnValues = - this.functionDao.functionType == FunctionType.SECRET + this.functionDao.functionType == FunctionType.PRIVATE ? simulatedTx.privateReturnValues?.nested?.[0].values : simulatedTx.publicOutput?.publicReturnValues?.values; diff --git a/yarn-project/aztec.js/src/entrypoint/default_multi_call_entrypoint.ts b/yarn-project/aztec.js/src/entrypoint/default_multi_call_entrypoint.ts index bf36456c1bb..8d5e7e6cd3f 100644 --- a/yarn-project/aztec.js/src/entrypoint/default_multi_call_entrypoint.ts +++ b/yarn-project/aztec.js/src/entrypoint/default_multi_call_entrypoint.ts @@ -37,7 +37,7 @@ export class DefaultMultiCallEntrypoint implements EntrypointInterface { return { name: 'entrypoint', isInitializer: false, - functionType: 'secret', + functionType: 'private', isInternal: false, isStatic: false, parameters: [ diff --git a/yarn-project/aztec.js/src/wallet/account_wallet.ts b/yarn-project/aztec.js/src/wallet/account_wallet.ts index a3361210f4d..93c4114a598 100644 --- a/yarn-project/aztec.js/src/wallet/account_wallet.ts +++ b/yarn-project/aztec.js/src/wallet/account_wallet.ts @@ -228,7 +228,7 @@ export class AccountWallet extends BaseWallet { return { name: 'approve_public_authwit', isInitializer: false, - functionType: FunctionType.OPEN, + functionType: FunctionType.PUBLIC, isInternal: true, isStatic: false, parameters: [ @@ -246,7 +246,7 @@ export class AccountWallet extends BaseWallet { return { name: 'cancel_authwit', isInitializer: false, - functionType: FunctionType.SECRET, + functionType: FunctionType.PRIVATE, isInternal: true, isStatic: false, parameters: [ diff --git a/yarn-project/builder/src/fixtures/test_contract/Nargo.toml b/yarn-project/builder/src/fixtures/test_contract/Nargo.toml deleted file mode 100644 index 44ea20e01ba..00000000000 --- a/yarn-project/builder/src/fixtures/test_contract/Nargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "test" -authors = [""] -compiler_version = ">=0.18.0" -type = "contract" - -[dependencies] -test = { path = "../test_lib" } diff --git a/yarn-project/builder/src/fixtures/test_contract/src/main.nr b/yarn-project/builder/src/fixtures/test_contract/src/main.nr deleted file mode 100644 index 95824d09f4b..00000000000 --- a/yarn-project/builder/src/fixtures/test_contract/src/main.nr +++ /dev/null @@ -1,11 +0,0 @@ -contract TestContract { - use dep::test::module::foo; - - fn constructor(param: Field, pub_param: pub Field) -> pub [Field; 2] { - [foo::bar(param), param + pub_param] - } - - open fn openFunction() -> pub Field { - 42 - } -} diff --git a/yarn-project/builder/src/fixtures/test_lib.zip b/yarn-project/builder/src/fixtures/test_lib.zip deleted file mode 100644 index e5004ee2ece..00000000000 Binary files a/yarn-project/builder/src/fixtures/test_lib.zip and /dev/null differ diff --git a/yarn-project/builder/src/fixtures/test_lib/Nargo.toml b/yarn-project/builder/src/fixtures/test_lib/Nargo.toml deleted file mode 100644 index fe1288f4a6e..00000000000 --- a/yarn-project/builder/src/fixtures/test_lib/Nargo.toml +++ /dev/null @@ -1,7 +0,0 @@ -[package] -name = "testlib" -authors = [""] -compiler_version = ">=0.18.0" -type = "lib" - -[dependencies] \ No newline at end of file diff --git a/yarn-project/builder/src/fixtures/test_lib/src/lib.nr b/yarn-project/builder/src/fixtures/test_lib/src/lib.nr deleted file mode 100644 index 144bcec0532..00000000000 --- a/yarn-project/builder/src/fixtures/test_lib/src/lib.nr +++ /dev/null @@ -1 +0,0 @@ -mod module; diff --git a/yarn-project/builder/src/fixtures/test_lib/src/module.nr b/yarn-project/builder/src/fixtures/test_lib/src/module.nr deleted file mode 100644 index f4ad3bff5c9..00000000000 --- a/yarn-project/builder/src/fixtures/test_lib/src/module.nr +++ /dev/null @@ -1 +0,0 @@ -mod foo; diff --git a/yarn-project/builder/src/fixtures/test_lib/src/module/foo.nr b/yarn-project/builder/src/fixtures/test_lib/src/module/foo.nr deleted file mode 100644 index 0376cd4cb87..00000000000 --- a/yarn-project/builder/src/fixtures/test_lib/src/module/foo.nr +++ /dev/null @@ -1,3 +0,0 @@ -pub fn bar(param: Field) -> Field { - dep::std::hash::pedersen_hash([param]) -} diff --git a/yarn-project/circuits.js/src/contract/artifact_hash.ts b/yarn-project/circuits.js/src/contract/artifact_hash.ts index f4e594854dc..c56af781335 100644 --- a/yarn-project/circuits.js/src/contract/artifact_hash.ts +++ b/yarn-project/circuits.js/src/contract/artifact_hash.ts @@ -52,7 +52,7 @@ export function computeArtifactHash( } export function computeArtifactHashPreimage(artifact: ContractArtifact) { - const privateFunctionRoot = computeArtifactFunctionTreeRoot(artifact, FunctionType.SECRET); + const privateFunctionRoot = computeArtifactFunctionTreeRoot(artifact, FunctionType.PRIVATE); const unconstrainedFunctionRoot = computeArtifactFunctionTreeRoot(artifact, FunctionType.UNCONSTRAINED); const metadataHash = computeArtifactMetadataHash(artifact); return { privateFunctionRoot, unconstrainedFunctionRoot, metadataHash }; diff --git a/yarn-project/circuits.js/src/contract/contract_address.test.ts b/yarn-project/circuits.js/src/contract/contract_address.test.ts index 4bb4b19a1fb..9f424a3d665 100644 --- a/yarn-project/circuits.js/src/contract/contract_address.test.ts +++ b/yarn-project/circuits.js/src/contract/contract_address.test.ts @@ -33,7 +33,7 @@ describe('ContractAddress', () => { it('computeInitializationHash', () => { const mockInitFn: FunctionAbi = { - functionType: FunctionType.SECRET, + functionType: FunctionType.PRIVATE, isInitializer: false, isInternal: false, isStatic: false, diff --git a/yarn-project/circuits.js/src/contract/contract_class.test.ts b/yarn-project/circuits.js/src/contract/contract_class.test.ts index 5e1fe283358..13540a34d3e 100644 --- a/yarn-project/circuits.js/src/contract/contract_class.test.ts +++ b/yarn-project/circuits.js/src/contract/contract_class.test.ts @@ -20,10 +20,10 @@ describe('ContractClass', () => { // Check function selectors match const publicFunctionSelectors = artifact.functions - .filter(fn => fn.functionType === FunctionType.OPEN) + .filter(fn => fn.functionType === FunctionType.PUBLIC) .map(fn => FunctionSelector.fromNameAndParameters(fn)); const privateFunctionSelectors = artifact.functions - .filter(fn => fn.functionType === FunctionType.SECRET) + .filter(fn => fn.functionType === FunctionType.PRIVATE) .map(fn => FunctionSelector.fromNameAndParameters(fn)); expect(new Set(contractClass.publicFunctions.map(fn => fn.selector))).toEqual(new Set(publicFunctionSelectors)); diff --git a/yarn-project/circuits.js/src/contract/contract_class.ts b/yarn-project/circuits.js/src/contract/contract_class.ts index b4834dc8673..4efe593ed7e 100644 --- a/yarn-project/circuits.js/src/contract/contract_class.ts +++ b/yarn-project/circuits.js/src/contract/contract_class.ts @@ -18,7 +18,7 @@ export function getContractClassFromArtifact( ): ContractClassWithId & ContractClassIdPreimage { const artifactHash = 'artifactHash' in artifact ? artifact.artifactHash : computeArtifactHash(artifact); const publicFunctions: ContractClass['publicFunctions'] = artifact.functions - .filter(f => f.functionType === FunctionType.OPEN) + .filter(f => f.functionType === FunctionType.PUBLIC) .map(f => ({ selector: FunctionSelector.fromNameAndParameters(f.name, f.parameters), bytecode: f.bytecode, @@ -28,7 +28,7 @@ export function getContractClassFromArtifact( const packedBytecode = packBytecode(publicFunctions); const privateFunctions: ContractClass['privateFunctions'] = artifact.functions - .filter(f => f.functionType === FunctionType.SECRET) + .filter(f => f.functionType === FunctionType.PRIVATE) .map(getContractClassPrivateFunctionFromArtifact) .sort(cmpFunctionArtifacts); diff --git a/yarn-project/circuits.js/src/contract/private_function_membership_proof.test.ts b/yarn-project/circuits.js/src/contract/private_function_membership_proof.test.ts index 6909cd68c30..958af440bf9 100644 --- a/yarn-project/circuits.js/src/contract/private_function_membership_proof.test.ts +++ b/yarn-project/circuits.js/src/contract/private_function_membership_proof.test.ts @@ -20,7 +20,7 @@ describe('private_function_membership_proof', () => { beforeAll(() => { artifact = getBenchmarkContractArtifact(); contractClass = getContractClassFromArtifact(artifact); - privateFunction = artifact.functions.findLast(fn => fn.functionType === FunctionType.SECRET)!; + privateFunction = artifact.functions.findLast(fn => fn.functionType === FunctionType.PRIVATE)!; vkHash = computeVerificationKeyHash(privateFunction.verificationKey!); selector = FunctionSelector.fromNameAndParameters(privateFunction); }); diff --git a/yarn-project/circuits.js/src/contract/private_function_membership_proof.ts b/yarn-project/circuits.js/src/contract/private_function_membership_proof.ts index 2857b463c24..d2c628bea65 100644 --- a/yarn-project/circuits.js/src/contract/private_function_membership_proof.ts +++ b/yarn-project/circuits.js/src/contract/private_function_membership_proof.ts @@ -32,7 +32,7 @@ export function createPrivateFunctionMembershipProof( // Locate private function definition and artifact const privateFunctions = artifact.functions - .filter(fn => fn.functionType === FunctionType.SECRET) + .filter(fn => fn.functionType === FunctionType.PRIVATE) .map(getContractClassPrivateFunctionFromArtifact); const privateFunction = privateFunctions.find(fn => fn.selector.equals(selector)); const privateFunctionArtifact = artifact.functions.find(fn => selector.equals(fn)); @@ -54,7 +54,7 @@ export function createPrivateFunctionMembershipProof( // And the "artifact tree" captures function bytecode and metadata, and is used by the pxe to check that its executing the code it's supposed to be executing, but it never goes into circuits. const functionMetadataHash = computeFunctionMetadataHash(privateFunctionArtifact); const functionArtifactHash = computeFunctionArtifactHash({ ...privateFunctionArtifact, functionMetadataHash }); - const artifactTree = computeArtifactFunctionTree(artifact, FunctionType.SECRET)!; + const artifactTree = computeArtifactFunctionTree(artifact, FunctionType.PRIVATE)!; const artifactTreeLeafIndex = artifactTree.getIndex(functionArtifactHash.toBuffer()); const artifactTreeSiblingPath = artifactTree.getSiblingPath(artifactTreeLeafIndex).map(Fr.fromBuffer); diff --git a/yarn-project/circuits.js/src/structs/function_data.ts b/yarn-project/circuits.js/src/structs/function_data.ts index d33a8b2ea8d..38fb1faa53d 100644 --- a/yarn-project/circuits.js/src/structs/function_data.ts +++ b/yarn-project/circuits.js/src/structs/function_data.ts @@ -20,7 +20,7 @@ export class FunctionData { static fromAbi(abi: FunctionAbi | ContractFunctionDao): FunctionData { return new FunctionData( FunctionSelector.fromNameAndParameters(abi.name, abi.parameters), - abi.functionType === FunctionType.SECRET, + abi.functionType === FunctionType.PRIVATE, abi.isStatic, ); } diff --git a/yarn-project/end-to-end/src/e2e_nested_contract/importer.test.ts b/yarn-project/end-to-end/src/e2e_nested_contract/importer.test.ts index f74f92dcde8..e11ce439df9 100644 --- a/yarn-project/end-to-end/src/e2e_nested_contract/importer.test.ts +++ b/yarn-project/end-to-end/src/e2e_nested_contract/importer.test.ts @@ -33,13 +33,13 @@ describe('e2e_nested_contract manual', () => { await importerContract.methods.call_no_args(testContract.address).send().wait(); }); - it('calls an open function', async () => { - logger.info(`Calling openfn on importer contract`); - await importerContract.methods.call_open_fn(testContract.address).send().wait(); + it('calls a public function', async () => { + logger.info(`Calling public_fn on importer contract`); + await importerContract.methods.call_public_fn(testContract.address).send().wait(); }); - it('calls an open function from an open function', async () => { - logger.info(`Calling pub openfn on importer contract`); - await importerContract.methods.pub_call_open_fn(testContract.address).send().wait(); + it('calls a public function from a public function', async () => { + logger.info(`Calling pub_public_fn on importer contract`); + await importerContract.methods.pub_call_public_fn(testContract.address).send().wait(); }); }); diff --git a/yarn-project/entrypoints/src/account_entrypoint.ts b/yarn-project/entrypoints/src/account_entrypoint.ts index 87e9a8f1023..a7a9450f36f 100644 --- a/yarn-project/entrypoints/src/account_entrypoint.ts +++ b/yarn-project/entrypoints/src/account_entrypoint.ts @@ -46,7 +46,7 @@ export class DefaultAccountEntrypoint implements EntrypointInterface { return { name: 'entrypoint', isInitializer: false, - functionType: 'secret', + functionType: 'private', isInternal: false, isStatic: false, parameters: [ diff --git a/yarn-project/entrypoints/src/dapp_entrypoint.ts b/yarn-project/entrypoints/src/dapp_entrypoint.ts index 2aca62739c7..5f7572da58e 100644 --- a/yarn-project/entrypoints/src/dapp_entrypoint.ts +++ b/yarn-project/entrypoints/src/dapp_entrypoint.ts @@ -59,7 +59,7 @@ export class DefaultDappEntrypoint implements EntrypointInterface { return { name: 'entrypoint', isInitializer: false, - functionType: 'secret', + functionType: 'private', isInternal: false, isStatic: false, parameters: [ diff --git a/yarn-project/foundation/src/abi/abi.test.ts b/yarn-project/foundation/src/abi/abi.test.ts index b7b1334e432..69e04c80d6d 100644 --- a/yarn-project/foundation/src/abi/abi.test.ts +++ b/yarn-project/foundation/src/abi/abi.test.ts @@ -46,8 +46,8 @@ describe('abi', () => { it('prefers functions based on type', () => { const contract = { functions: [ - { name: 'foo', isInitializer: true, functionType: FunctionType.OPEN }, - { name: 'bar', isInitializer: true, functionType: FunctionType.SECRET }, + { name: 'foo', isInitializer: true, functionType: FunctionType.PUBLIC }, + { name: 'bar', isInitializer: true, functionType: FunctionType.PRIVATE }, ], } as ContractArtifact; expect(getDefaultInitializer(contract)?.name).toEqual('bar'); diff --git a/yarn-project/foundation/src/abi/abi.ts b/yarn-project/foundation/src/abi/abi.ts index da33e70473b..200e7b0088c 100644 --- a/yarn-project/foundation/src/abi/abi.ts +++ b/yarn-project/foundation/src/abi/abi.ts @@ -144,8 +144,8 @@ export interface StructType extends BasicType<'struct'> { * Aztec.nr function types. */ export enum FunctionType { - SECRET = 'secret', - OPEN = 'open', + PRIVATE = 'private', + PUBLIC = 'public', UNCONSTRAINED = 'unconstrained', } @@ -404,7 +404,7 @@ export function getDefaultInitializer(contractArtifact: ContractArtifact): Funct ? initializers.find(f => f.name === 'constructor') ?? initializers.find(f => f.name === 'initializer') ?? initializers.find(f => f.parameters?.length === 0) ?? - initializers.find(f => f.functionType === FunctionType.SECRET) ?? + initializers.find(f => f.functionType === FunctionType.PRIVATE) ?? initializers[0] : initializers[0]; } diff --git a/yarn-project/foundation/src/abi/encoder.test.ts b/yarn-project/foundation/src/abi/encoder.test.ts index a38b963e9d0..82c2d569ac7 100644 --- a/yarn-project/foundation/src/abi/encoder.test.ts +++ b/yarn-project/foundation/src/abi/encoder.test.ts @@ -8,7 +8,7 @@ describe('abi/encoder', () => { it('serializes fields as fields', () => { const abi: FunctionAbi = { name: 'constructor', - functionType: FunctionType.SECRET, + functionType: FunctionType.PRIVATE, isInternal: false, isInitializer: true, isStatic: false, @@ -32,7 +32,7 @@ describe('abi/encoder', () => { const abi: FunctionAbi = { name: 'constructor', isInitializer: true, - functionType: FunctionType.SECRET, + functionType: FunctionType.PRIVATE, isInternal: false, isStatic: false, parameters: [ @@ -57,7 +57,7 @@ describe('abi/encoder', () => { const abi: FunctionAbi = { name: 'constructor', isInitializer: true, - functionType: FunctionType.SECRET, + functionType: FunctionType.PRIVATE, isInternal: false, isStatic: false, parameters: [ @@ -83,7 +83,7 @@ describe('abi/encoder', () => { const abi: FunctionAbi = { name: 'constructor', isInitializer: true, - functionType: FunctionType.SECRET, + functionType: FunctionType.PRIVATE, isInternal: false, isStatic: false, parameters: [ @@ -119,7 +119,7 @@ describe('abi/encoder', () => { const abi: FunctionAbi = { name: 'constructor', isInitializer: true, - functionType: FunctionType.SECRET, + functionType: FunctionType.PRIVATE, isInternal: false, isStatic: false, parameters: [ @@ -151,7 +151,7 @@ describe('abi/encoder', () => { const testFunctionAbi: FunctionAbi = { name: 'constructor', isInitializer: true, - functionType: FunctionType.SECRET, + functionType: FunctionType.PRIVATE, isInternal: false, isStatic: false, parameters: [ @@ -174,7 +174,7 @@ describe('abi/encoder', () => { const testFunctionAbi: FunctionAbi = { name: 'constructor', isInitializer: true, - functionType: FunctionType.SECRET, + functionType: FunctionType.PRIVATE, isInternal: false, isStatic: false, parameters: [ @@ -200,7 +200,7 @@ describe('abi/encoder', () => { const testFunctionAbi: FunctionAbi = { name: 'constructor', isInitializer: true, - functionType: FunctionType.SECRET, + functionType: FunctionType.PRIVATE, isInternal: false, isStatic: false, parameters: [ diff --git a/yarn-project/simulator/src/client/simulator.ts b/yarn-project/simulator/src/client/simulator.ts index 90ea5d3deee..55c4a0e1153 100644 --- a/yarn-project/simulator/src/client/simulator.ts +++ b/yarn-project/simulator/src/client/simulator.ts @@ -68,8 +68,8 @@ export class AcirSimulator { contractAddress: AztecAddress, msgSender = AztecAddress.ZERO, ): Promise { - if (entryPointArtifact.functionType !== FunctionType.SECRET) { - throw new Error(`Cannot run ${entryPointArtifact.functionType} function as secret`); + if (entryPointArtifact.functionType !== FunctionType.PRIVATE) { + throw new Error(`Cannot run ${entryPointArtifact.functionType} function as private`); } if (request.origin !== contractAddress) { diff --git a/yarn-project/types/src/abi/contract_artifact.ts b/yarn-project/types/src/abi/contract_artifact.ts index 9758e85650d..8ca72aa68a7 100644 --- a/yarn-project/types/src/abi/contract_artifact.ts +++ b/yarn-project/types/src/abi/contract_artifact.ts @@ -184,17 +184,17 @@ function generateFunctionArtifact(fn: NoirCompiledContractFunction, contract: No function getFunctionType(fn: NoirCompiledContractFunction): FunctionType { if (fn.custom_attributes.includes(AZTEC_PRIVATE_ATTRIBUTE)) { - return FunctionType.SECRET; + return FunctionType.PRIVATE; } else if ( fn.custom_attributes.includes(AZTEC_PUBLIC_ATTRIBUTE) || fn.custom_attributes.includes(AZTEC_PUBLIC_VM_ATTRIBUTE) ) { - return FunctionType.OPEN; + return FunctionType.PUBLIC; } else if (fn.is_unconstrained) { return FunctionType.UNCONSTRAINED; } else { // Default to a private function (see simple_macro_example_expanded for an example of this behavior) - return FunctionType.SECRET; + return FunctionType.PRIVATE; } }