Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions docs/docs/guides/js_apps/authwit.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ When creating an authwit, you will need to pass the authwit giver, the authwit r

You can define the action like this:

#include_code authwit_computeAuthWitMessageHash yarn-project/end-to-end/src/e2e_blacklist_token_contract/transfer_private.test.ts typescript
#include_code authwit_computeAuthWitMessageHash yarn-project/end-to-end/src/e2e_escrowable_token_contract/transfer_private.test.ts typescript

In this example,

Expand All @@ -68,9 +68,9 @@ Then create the outer hash by hashing the inner hash with the authwit receiver a

## Create the authwit

There are slightly different interfaces depending on whether your contract is checking the authwit in private or public.
There are slightly different interfaces depending on whether your contract is checking the authwit in private or public.

Public authwits are stored in the account contract and batched with the authwit action call, so a user must send a transaction to update their account contract, authorizing an action before the authorized contract's public call will succeed.
Public authwits are stored in the account contract and batched with the authwit action call, so a user must send a transaction to update their account contract, authorizing an action before the authorized contract's public call will succeed.

Private execution uses oracles and are executed locally by the PXE, so the authwit needs to be created by the authwit giver and then added to the authwit receiver's PXE.

Expand All @@ -80,7 +80,7 @@ This is expected to be used alongside [private authwits in Aztec.nr contract](..

Create a private authwit like this:

#include_code create_authwit yarn-project/end-to-end/src/e2e_blacklist_token_contract/transfer_private.test.ts typescript
#include_code create_authwit yarn-project/end-to-end/src/e2e_escrowable_token_contract/transfer_private.test.ts typescript

In this example,

Expand All @@ -94,15 +94,15 @@ If you created an artbitrary message, you can create the authwit by replacing th

Then add it to the wallet of the authwit receiver (the caller of the function):

#include_code add_authwit yarn-project/end-to-end/src/e2e_blacklist_token_contract/transfer_private.test.ts typescript
#include_code add_authwit yarn-project/end-to-end/src/e2e_escrowable_token_contract/transfer_private.test.ts typescript

### Public

This is expected to be used alongside [public authwits in Aztec.nr contract](../smart_contracts/writing_contracts/authwit.md#public-functions).

Set a public authwit like this:

#include_code set_public_authwit yarn-project/end-to-end/src/e2e_blacklist_token_contract/transfer_public.test.ts typescript
#include_code set_public_authwit yarn-project/end-to-end/src/e2e_escrowable_token_contract/transfer_public.test.ts typescript

Remember it is a transaction and calls a method in the account contract. In this example,

Expand Down
1 change: 0 additions & 1 deletion docs/docs/reference/sandbox_reference/sandbox-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,6 @@ SchnorrSingleKeyAccountContractArtifact
SlowTreeContractArtifact
StatefulTestContractArtifact
TestContractArtifact
TokenBlacklistContractArtifact
TokenBridgeContractArtifact
TokenContractArtifact
UniswapContractArtifact
Expand Down
3 changes: 2 additions & 1 deletion noir-projects/noir-contracts/Nargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ members = [
"contracts/easy_private_voting_contract",
"contracts/ecdsa_account_contract",
"contracts/escrow_contract",
"contracts/simple_escrow_contract",
"contracts/escrowable_token_contract",
"contracts/gas_token_contract",
"contracts/import_test_contract",
"contracts/key_registry_contract",
Expand All @@ -36,7 +38,6 @@ members = [
"contracts/stateful_test_contract",
"contracts/test_contract",
"contracts/token_contract",
"contracts/token_blacklist_contract",
"contracts/token_bridge_contract",
"contracts/uniswap_contract",
"contracts/multi_call_entrypoint_contract",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
[package]
name = "token_blacklist_contract"
name = "escrowable_token_contract"
authors = [""]
compiler_version = ">=0.25.0"
type = "contract"

[dependencies]
aztec = { path = "../../../aztec-nr/aztec" }
compressed_string = { path = "../../../aztec-nr/compressed-string" }
authwit = { path = "../../../aztec-nr/authwit" }
Loading