-
Notifications
You must be signed in to change notification settings - Fork 297
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ca29b1a
commit e6bae66
Showing
10 changed files
with
216 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,12 +7,12 @@ FROM aztecprotocol/noir-projects as noir-projects | |
# We need yarn. Start fresh container. | ||
FROM node:18.19.0 | ||
RUN apt update && apt install netcat-openbsd | ||
RUN npx -y [email protected] install --with-deps | ||
COPY --from=aztec /usr/src /usr/src | ||
COPY --from=noir /usr/src/noir/target/release/nargo /usr/src/noir/target/release/nargo | ||
COPY --from=noir-projects /usr/src/noir-projects/aztec-nr /usr/src/noir-projects/aztec-nr | ||
WORKDIR /usr/src/boxes | ||
ENV AZTEC_NARGO=/usr/src/noir/target/release/nargo | ||
ENV AZTEC_CLI=/usr/src/yarn-project/cli/aztec-cli-dest | ||
RUN yarn && yarn build | ||
RUN npx -y [email protected] install --with-deps | ||
ENTRYPOINT ["/bin/sh", "-c"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
|
||
/* Autogenerated file, do not edit! */ | ||
|
||
/* eslint-disable */ | ||
import { | ||
AztecAddress, | ||
AztecAddressLike, | ||
CompleteAddress, | ||
Contract, | ||
ContractArtifact, | ||
ContractBase, | ||
ContractFunctionInteraction, | ||
ContractInstanceWithAddress, | ||
ContractMethod, | ||
DeployMethod, | ||
EthAddress, | ||
EthAddressLike, | ||
FieldLike, | ||
Fr, | ||
FunctionSelectorLike, | ||
loadContractArtifact, | ||
NoirCompiledContract, | ||
Point, | ||
PublicKey, | ||
Wallet, | ||
WrappedFieldLike, | ||
} from '@aztec/aztec.js'; | ||
import BoxReactContractArtifactJson from '../src/contracts/target/boxreact-BoxReact.json' assert { type: 'json' }; | ||
export const BoxReactContractArtifact = loadContractArtifact(BoxReactContractArtifactJson as NoirCompiledContract); | ||
|
||
/** | ||
* Type-safe interface for contract BoxReact; | ||
*/ | ||
export class BoxReactContract extends ContractBase { | ||
|
||
private constructor( | ||
instance: ContractInstanceWithAddress, | ||
wallet: Wallet, | ||
) { | ||
super(instance, BoxReactContractArtifact, wallet); | ||
} | ||
|
||
|
||
|
||
/** | ||
* Creates a contract instance. | ||
* @param address - The deployed contract's address. | ||
* @param wallet - The wallet to use when interacting with the contract. | ||
* @returns A promise that resolves to a new Contract instance. | ||
*/ | ||
public static async at( | ||
address: AztecAddress, | ||
wallet: Wallet, | ||
) { | ||
return Contract.at(address, BoxReactContract.artifact, wallet) as Promise<BoxReactContract>; | ||
} | ||
|
||
|
||
/** | ||
* Creates a tx to deploy a new instance of this contract. | ||
*/ | ||
public static deploy(wallet: Wallet, number: FieldLike, owner: AztecAddressLike) { | ||
return new DeployMethod<BoxReactContract>(Point.ZERO, wallet, BoxReactContractArtifact, BoxReactContract.at, Array.from(arguments).slice(1)); | ||
} | ||
|
||
/** | ||
* Creates a tx to deploy a new instance of this contract using the specified public key to derive the address. | ||
*/ | ||
public static deployWithPublicKey(publicKey: PublicKey, wallet: Wallet, number: FieldLike, owner: AztecAddressLike) { | ||
return new DeployMethod<BoxReactContract>(publicKey, wallet, BoxReactContractArtifact, BoxReactContract.at, Array.from(arguments).slice(2)); | ||
} | ||
|
||
|
||
|
||
/** | ||
* Returns this contract's artifact. | ||
*/ | ||
public static get artifact(): ContractArtifact { | ||
return BoxReactContractArtifact; | ||
} | ||
|
||
|
||
/** Type-safe wrappers for the public methods exposed by the contract. */ | ||
public methods!: { | ||
|
||
/** setNumber(number: field, owner: struct) */ | ||
setNumber: ((number: FieldLike, owner: AztecAddressLike) => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>; | ||
|
||
/** compute_note_hash_and_nullifier(contract_address: struct, nonce: field, storage_slot: field, note_type_id: field, serialized_note: array) */ | ||
compute_note_hash_and_nullifier: ((contract_address: AztecAddressLike, nonce: FieldLike, storage_slot: FieldLike, note_type_id: FieldLike, serialized_note: FieldLike[]) => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>; | ||
|
||
/** constructor(number: field, owner: struct) */ | ||
constructor: ((number: FieldLike, owner: AztecAddressLike) => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>; | ||
|
||
/** getNumber(owner: struct) */ | ||
getNumber: ((owner: AztecAddressLike) => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>; | ||
}; | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
|
||
/* Autogenerated file, do not edit! */ | ||
|
||
/* eslint-disable */ | ||
import { | ||
AztecAddress, | ||
AztecAddressLike, | ||
CompleteAddress, | ||
Contract, | ||
ContractArtifact, | ||
ContractBase, | ||
ContractFunctionInteraction, | ||
ContractInstanceWithAddress, | ||
ContractMethod, | ||
DeployMethod, | ||
EthAddress, | ||
EthAddressLike, | ||
FieldLike, | ||
Fr, | ||
FunctionSelectorLike, | ||
loadContractArtifact, | ||
NoirCompiledContract, | ||
Point, | ||
PublicKey, | ||
Wallet, | ||
WrappedFieldLike, | ||
} from '@aztec/aztec.js'; | ||
import VanillaContractArtifactJson from '../src/contracts/target/vanilla-Vanilla.json' assert { type: 'json' }; | ||
export const VanillaContractArtifact = loadContractArtifact(VanillaContractArtifactJson as NoirCompiledContract); | ||
|
||
/** | ||
* Type-safe interface for contract Vanilla; | ||
*/ | ||
export class VanillaContract extends ContractBase { | ||
|
||
private constructor( | ||
instance: ContractInstanceWithAddress, | ||
wallet: Wallet, | ||
) { | ||
super(instance, VanillaContractArtifact, wallet); | ||
} | ||
|
||
|
||
|
||
/** | ||
* Creates a contract instance. | ||
* @param address - The deployed contract's address. | ||
* @param wallet - The wallet to use when interacting with the contract. | ||
* @returns A promise that resolves to a new Contract instance. | ||
*/ | ||
public static async at( | ||
address: AztecAddress, | ||
wallet: Wallet, | ||
) { | ||
return Contract.at(address, VanillaContract.artifact, wallet) as Promise<VanillaContract>; | ||
} | ||
|
||
|
||
/** | ||
* Creates a tx to deploy a new instance of this contract. | ||
*/ | ||
public static deploy(wallet: Wallet, number: FieldLike, owner: AztecAddressLike) { | ||
return new DeployMethod<VanillaContract>(Point.ZERO, wallet, VanillaContractArtifact, VanillaContract.at, Array.from(arguments).slice(1)); | ||
} | ||
|
||
/** | ||
* Creates a tx to deploy a new instance of this contract using the specified public key to derive the address. | ||
*/ | ||
public static deployWithPublicKey(publicKey: PublicKey, wallet: Wallet, number: FieldLike, owner: AztecAddressLike) { | ||
return new DeployMethod<VanillaContract>(publicKey, wallet, VanillaContractArtifact, VanillaContract.at, Array.from(arguments).slice(2)); | ||
} | ||
|
||
|
||
|
||
/** | ||
* Returns this contract's artifact. | ||
*/ | ||
public static get artifact(): ContractArtifact { | ||
return VanillaContractArtifact; | ||
} | ||
|
||
|
||
/** Type-safe wrappers for the public methods exposed by the contract. */ | ||
public methods!: { | ||
|
||
/** constructor(number: field, owner: struct) */ | ||
constructor: ((number: FieldLike, owner: AztecAddressLike) => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>; | ||
|
||
/** getNumber(owner: struct) */ | ||
getNumber: ((owner: AztecAddressLike) => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>; | ||
|
||
/** setNumber(number: field, owner: struct) */ | ||
setNumber: ((number: FieldLike, owner: AztecAddressLike) => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>; | ||
|
||
/** compute_note_hash_and_nullifier(contract_address: struct, nonce: field, storage_slot: field, note_type_id: field, serialized_note: array) */ | ||
compute_note_hash_and_nullifier: ((contract_address: AztecAddressLike, nonce: FieldLike, storage_slot: FieldLike, note_type_id: FieldLike, serialized_note: FieldLike[]) => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>Aztec Vanilla JS Box</title><style></style><script defer="defer" src="main.js"></script></head><body><button id="deploy">Deploy</button> <button id="get" hidden>Get Number</button><form id="set" hidden><input id="number" type="number" value="0"/> <button type="submit">Set Number</button></form></body></html> |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/*! | ||
* The buffer module from node.js, for the browser. | ||
* | ||
* @author Feross Aboukhadijeh <https://feross.org> | ||
* @license MIT | ||
*/ | ||
|
||
/*! For license information please see index.js.LICENSE.txt */ | ||
|
||
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */ | ||
|
||
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */ |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters