-
Notifications
You must be signed in to change notification settings - Fork 29
Add MultiToken docs #156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Add MultiToken docs #156
Changes from 157 commits
Commits
Show all changes
158 commits
Select commit
Hold shift + click to select a range
fc77ac2
add erc1155 workspace
andrew-fleming 5211853
start erc1155
andrew-fleming 3e19fba
add logic to _setApprovalForAll
andrew-fleming 2463e56
add setApprove tests
andrew-fleming a8212e3
add _safeTransferFrom tests
andrew-fleming 505708f
add overflow check in _update
andrew-fleming 78a267b
add _update and _setURI tests
andrew-fleming 8cd89ee
add tests for _mint and _burn
andrew-fleming 86a0ca7
add _setApprovalForAll tests
andrew-fleming ed90183
add template comment
andrew-fleming 3dbac35
add circuit comments in contract
andrew-fleming bea3cb9
add balanceOfBatch
andrew-fleming 6198271
add template comments
andrew-fleming 43e0b37
add balanceOfBatch tests
andrew-fleming 9f8d0b7
add assertion for ownerNoBal
andrew-fleming e22e689
fix comment
andrew-fleming 996201f
improve test
andrew-fleming db67fa7
add generic data param to safe transfer
andrew-fleming f00717c
Add pausable (#22)
andrew-fleming a292657
remove data param
andrew-fleming b3fd9bc
remove safeBatchTransferFrom
andrew-fleming 375425a
change Field to Uint
andrew-fleming 2e7683b
change id back to field
andrew-fleming 9a866c0
remove unused test vars
andrew-fleming 1894d16
remove safe prefix from transferFrom
andrew-fleming 969e3b0
Bump midnight-js, transition to biome, basic improvements (#35)
andrew-fleming 2fd085b
fix fmt
andrew-fleming 063d1be
fix lint
andrew-fleming 354ad56
simplify jest config
andrew-fleming 4c2a02a
fix comment
andrew-fleming 4b8a089
use stdlib burn_address circuit for zero
andrew-fleming 2fe9aef
change erc1155 to MultiToken
andrew-fleming c6b6c61
improve mod description
andrew-fleming aac410d
replace Field type with Uint<128> for ids
andrew-fleming 635cef1
fix fmt
andrew-fleming 8916680
Add PR and issue templates (#43)
andrew-fleming a4700ad
Add security doc (#42)
andrew-fleming bcf0914
chore: add code owners (#53)
0xisk 1ca410e
Improve compact scripts (#41)
andrew-fleming ecb4c6e
fix fmt and lint, remove barrel files
andrew-fleming b16db49
Add license (#44)
andrew-fleming 668554b
Support compact 0.23.0, migrate to vitest (#68)
andrew-fleming 5f90d1f
Update .nvmrc (#73)
andrew-fleming 3f232f8
remove jest, add vitest
andrew-fleming 60043db
fix types
andrew-fleming a688b35
fix fmt
andrew-fleming 26abc19
fix lint
andrew-fleming efafafa
bump lang version
andrew-fleming a1d8f38
Apply suggestions from code review
andrew-fleming 8b9d3e3
bump types/node
andrew-fleming b4febfd
change initializer => initialize
andrew-fleming 3f00b0a
chore(tests): adding more edge test cases for ERC1155 (#78)
0xisk a604eba
fix max uint128 transfer test
andrew-fleming 544bbea
add initialized check in initialize
andrew-fleming 11cb6c1
add todos
andrew-fleming 85c3048
add missing feature list for erc1155 spec compatibility
andrew-fleming 2366410
Merge branch 'main' into erc1155-unshielded
emnul 67ca450
Add string types to multitoken
emnul 6e5285c
Remove comment
emnul 9a92430
Merge branch 'main' into erc1155-unshielded
andrew-fleming 9512210
add init assertion to all circuits
andrew-fleming 1fedde7
remove maybe from uri string
andrew-fleming c798d08
fix fmt/lint
andrew-fleming 838c677
change _update to internal (not exported)
andrew-fleming 460ffe6
test bad initialization
andrew-fleming 5561196
fix bad init test
andrew-fleming f614ff3
remove unused vars
andrew-fleming 70ad72e
fix fmt/lint
andrew-fleming 9eb5f6c
fix comments
andrew-fleming dc15385
add _unsafeMint
andrew-fleming 0553106
update utils module
andrew-fleming cfaf0f2
add _unsafeMint tests, improve _mint tests
andrew-fleming e5093f9
fix fmt/lint
andrew-fleming 99f5197
add unsafe transfer variants
andrew-fleming 5c67927
fix tests with zero key
andrew-fleming 916a082
add test for _transferFrom to contract
andrew-fleming afef819
add unsafe circuits to mock and sim / add unsafe circuit tests
andrew-fleming 53e629a
fix fmt/lint
andrew-fleming 43896b2
improve unsafe transfer tests
andrew-fleming f1a4526
clean up tests
andrew-fleming 552e025
improve utils, clean up tests
andrew-fleming 7686c14
fix fmt/lint
andrew-fleming 36a9186
parametrize caller in transferFrom tests
andrew-fleming 2bc800c
improve tests
andrew-fleming 0ff0a0f
fix comment
andrew-fleming 691d397
improve code docs
andrew-fleming ba83067
fix comment
andrew-fleming 48c39c7
add docstrings to multitoken sim
andrew-fleming 59e855b
fix comment
andrew-fleming ab294dd
add additional failing circuits on bad init
andrew-fleming 2af3595
improve balanceOf tests
andrew-fleming f020f6b
improve failing circuits test
andrew-fleming 000f292
fix tests and fmt
andrew-fleming 88e7450
fix package name
andrew-fleming c0b4100
fix comment description
andrew-fleming 1717c03
improve doc comments
andrew-fleming 1923a57
Rename multitoken -> multiToken
andrew-fleming 9f9738a
fix formatting
andrew-fleming 2192260
Apply suggestions from code review
andrew-fleming f781c83
Apply suggestions from code review
andrew-fleming 7e22450
move unsafe circuits toward bottom of module
andrew-fleming f8dedb3
remove trailing space
andrew-fleming 9af8ea3
add tests for 1000 batch
andrew-fleming 0ff4714
add no pad test for balanceOfBatch
andrew-fleming 78b5fbe
Apply suggestions from code review
andrew-fleming 96e77a7
Merge branch 'erc1155-unshielded' of https://github.com/OpenZeppelin/…
andrew-fleming 42d535d
fix return comment
andrew-fleming 680ddf7
tidy up comments
andrew-fleming 74e852e
remove balanceOfBatch
andrew-fleming 90259a7
add balanceOfBatch to missing features list
andrew-fleming 7f85b17
fix conflicts
andrew-fleming 06ceb87
Remove old dir, add renamed dir
andrew-fleming ef94613
fix fmt
andrew-fleming fcaab82
tmp disable cache
andrew-fleming 7fc6c9d
cancel tmp no-cache
andrew-fleming ba01b85
clear zk-params cache
andrew-fleming 3553522
add debug
andrew-fleming 50f799d
revert changes to CI
andrew-fleming aeee13b
bump cache keys
andrew-fleming 84d1fbe
add clean cache key
andrew-fleming 7dded55
remove cache before installing
andrew-fleming a9911c9
restore action
andrew-fleming 0f8c7c2
restore test
andrew-fleming d111b91
revert contract dir name
andrew-fleming e76c64a
remove dir
andrew-fleming 153245e
restore multiToken
andrew-fleming f55a99b
fix lock file
andrew-fleming ebba50c
change back to lower case again
andrew-fleming 086765f
try new ci
andrew-fleming 6f79282
fix conflicts
andrew-fleming 0feb366
replace _transferFrom/_unsafeUncheckedTransferFrom => _transfer/_unsa…
andrew-fleming 1e8624e
fix doc comments
andrew-fleming e278204
add multitoken pages to nav
andrew-fleming 366fe3f
add initial template guide for multitoken (needs to be finished)
andrew-fleming 38a914f
add multitoken API
andrew-fleming cf5bf32
small cleanup
andrew-fleming ced8009
Merge branch 'main' into multi-token-docs
andrew-fleming 11ca23b
re-add new line
andrew-fleming 9cf7605
finish missing features, add c2c section
andrew-fleming f88b941
update import name
andrew-fleming ba134ec
Merge branch 'main' into multi-token-docs
andrew-fleming 85d7522
Merge branch 'main' into multi-token-docs
andrew-fleming b6619c6
Merge branch 'main' into multi-token-docs
andrew-fleming 3e21c17
Merge branch 'multi-token-docs' of https://github.com/OpenZeppelin/co…
andrew-fleming 5f2f228
fix conflicts
andrew-fleming cc505a3
improve usage example
andrew-fleming 942f332
fix conflicts
andrew-fleming 9879230
reorder mods in sidebar
andrew-fleming c9a8952
fix gh links
andrew-fleming fa7dfe8
fix param type
andrew-fleming cf9e603
remove note from _burn
andrew-fleming fdd0e5f
fix zswap pk type
andrew-fleming 47cc972
Apply suggestions from code review
andrew-fleming 82b7451
add _update (internal) to API
andrew-fleming 0b26e7b
add _update to ToC
andrew-fleming d09377d
Apply suggestions from code review
andrew-fleming 15438e9
move attr value output
andrew-fleming 77c33c8
fix import example links, fix fmt
andrew-fleming File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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 |
|---|---|---|
| @@ -1,11 +1,16 @@ | ||
| * xref:index.adoc[Overview] | ||
|
|
||
| * Learn | ||
|
|
||
| ** xref:extensibility.adoc[Extensibility] | ||
|
|
||
| * Modules | ||
|
|
||
| ** xref:ownable.adoc[Ownable] | ||
| *** xref:api/ownable.adoc[API Reference] | ||
|
|
||
| ** xref:fungibleToken.adoc[FungibleToken] | ||
| *** xref:/api/fungibleToken.adoc[API Reference] | ||
|
|
||
| ** xref:multitoken.adoc[MultiToken] | ||
| *** xref:api/multitoken.adoc[API Reference] |
This file contains hidden or 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,257 @@ | ||
| :github-icon: pass:[<svg class="icon"><use href="#github-icon"/></svg>] | ||
| :multiToken-guide: xref:multitoken.adoc[MultiToken guide] | ||
| :erc1155-metadata: https://eips.ethereum.org/EIPS/eip-1155#metadata[ERC1155-Metadata] | ||
|
|
||
| = MultiToken | ||
|
|
||
| This module provides the full MultiToken module API. | ||
|
|
||
| TIP: For an overview of the module, read the {multiToken-guide}. | ||
|
|
||
| == Core | ||
|
|
||
| [.hljs-theme-dark] | ||
| ```ts | ||
| import "./node_modules/@openzeppelin-compact/multi-token/MultiToken" prefix MultiToken_; | ||
| ``` | ||
|
|
||
| [.contract] | ||
| [[MultiToken]] | ||
| === `++MultiToken++` link:https://github.com/OpenZeppelin/compact-contracts/blob/main/contracts/multiToken/src/MultiToken.compact[{github-icon},role=heading-link] | ||
|
|
||
| [.contract-index] | ||
| .Circuits | ||
| -- | ||
|
|
||
| [.sub-index#MultiTokenModule] | ||
| * xref:#MultiTokenModule-initialize[`++initialize(uri_)++`] | ||
| * xref:#MultiTokenModule-uri[`++uri(id)++`] | ||
| * xref:#MultiTokenModule-balanceOf[`++balanceOf(account, id)++`] | ||
| * xref:#MultiTokenModule-setApprovalForAll[`++setApprovalForAll(operator, approved)++`] | ||
| * xref:#MultiTokenModule-isApprovedForAll[`++isApprovedForAll(account, operator)++`] | ||
| * xref:#MultiTokenModule-transferFrom[`++transferFrom(from, to, id, value)++`] | ||
| * xref:#MultiTokenModule-_transfer[`++_transfer(from, to, id, value)++`] | ||
| * xref:#MultiTokenModule-_update[`++_update(from, to, id, value)++`] | ||
| * xref:#MultiTokenModule-_unsafeTransferFrom[`++_unsafeTransferFrom(from, to, id, value)++`] | ||
| * xref:#MultiTokenModule-_unsafeTransfer[`++_unsafeTransfer(from, to, id, value)++`] | ||
| * xref:#MultiTokenModule-_setURI[`++_setURI(newURI)++`] | ||
| * xref:#MultiTokenModule-_mint[`++_mint(to, id, value)++`] | ||
| * xref:#MultiTokenModule-_unsafeMint[`++_unsafeMint(to, id, value)++`] | ||
| * xref:#MultiTokenModule-_burn[`++_burn(from, id, value)++`] | ||
| * xref:#MultiTokenModule-_setApprovalForAll[`++_setApprovalForAll(owner, operator, approved)++`] | ||
| -- | ||
|
|
||
| [.contract-item] | ||
| [[MultiTokenModule-initialize]] | ||
| ==== `[.contract-item-name]#++initialize++#++(uri_: Opaque<"string">) → []++` [.item-kind]#circuit# | ||
|
|
||
| Initializes the contract by setting the base URI for all tokens. | ||
|
|
||
| This MUST be called in the implementing contract's constructor. | ||
| Failure to do so can lead to an irreparable contract. | ||
|
|
||
| Requirements: | ||
|
|
||
| - Contract is not initialized. | ||
|
|
||
| [.contract-item] | ||
| [[MultiTokenModule-uri]] | ||
| ==== `[.contract-item-name]#++uri++#++(id: Uint<128>) → Opaque<"string">++` [.item-kind]#circuit# | ||
|
|
||
| This implementation returns the same URI for *all* token types. | ||
| It relies on the token type ID substitution mechanism defined in the EIP: {erc1155-metadata}. | ||
|
andrew-fleming marked this conversation as resolved.
|
||
| Clients calling this function must replace the `\{id\}` substring with the actual token type ID. | ||
|
|
||
| Requirements: | ||
|
|
||
| - Contract is initialized. | ||
|
|
||
| [.contract-item] | ||
| [[MultiTokenModule-balanceOf]] | ||
| ==== `[.contract-item-name]#++balanceOf++#++(account: Either<ZswapCoinPublicKey, ContractAddress>, id: Uint<128>) → Uint<128>++` [.item-kind]#circuit# | ||
|
|
||
| Returns the amount of `id` tokens owned by `account`. | ||
|
|
||
| Requirements: | ||
|
|
||
| - Contract is initialized. | ||
|
|
||
|
|
||
|
|
||
| [.contract-item] | ||
| [[MultiTokenModule-setApprovalForAll]] | ||
| ==== `[.contract-item-name]#++setApprovalForAll++#++(operator: Either<ZswapCoinPublicKey, ContractAddress>, approved: Boolean) → []++` [.item-kind]#circuit# | ||
|
|
||
| Enables or disables approval for `operator` to manage all of the caller's assets. | ||
|
|
||
| Requirements: | ||
|
|
||
| - Contract is initialized. | ||
| - `operator` is not the zero address. | ||
|
|
||
|
|
||
| [.contract-item] | ||
| [[MultiTokenModule-isApprovedForAll]] | ||
| ==== `[.contract-item-name]#++balanceOf++#++(account: Either<ZswapCoinPublicKey, ContractAddress>, operator: Either<ZswapCoinPublicKey, ContractAddress>) → Boolean++` [.item-kind]#circuit# | ||
|
|
||
| Queries if `operator` is an authorized operator for `owner`. | ||
|
|
||
| Requirements: | ||
|
|
||
| - Contract is initialized. | ||
|
|
||
|
|
||
| [.contract-item] | ||
| [[MultiTokenModule-transferFrom]] | ||
| ==== `[.contract-item-name]#++transferFrom++#++(from: Either<ZswapCoinPublicKey, ContractAddress>, to: Either<ZswapCoinPublicKey, ContractAddress>, id: Uint<128>, value: Uint<128>) → []++` [.item-kind]#circuit# | ||
|
|
||
| Transfers ownership of `value` amount of `id` tokens from `from` to `to`. | ||
| The caller must be `from` or approved to transfer on their behalf. | ||
|
|
||
| NOTE: Transfers to contract addresses are currently disallowed until contract-to-contract interactions are supported in Compact. | ||
| This restriction prevents assets from being inadvertently locked in contracts that cannot currently handle token receipt. | ||
|
|
||
| Requirements: | ||
|
|
||
| - Contract is initialized. | ||
| - `to` is not a ContractAddress. | ||
| - `to` is not the zero address. | ||
| - `from` is not the zero address. | ||
| - Caller must be `from` or approved via `setApprovalForAll`. | ||
| - `from` must have an `id` balance of at least `value`. | ||
|
|
||
| [.contract-item] | ||
| [[MultiTokenModule-_transfer]] | ||
| ==== `[.contract-item-name]#++_transfer++#++(from: Either<ZswapCoinPublicKey, ContractAddress>, to: Either<ZswapCoinPublicKey, ContractAddress>, id: Uint<128>, value: Uint<128>)++` [.item-kind]#circuit# | ||
|
|
||
| Transfers ownership of `value` amount of `id` tokens from `from` to `to`. | ||
| Does not impose restrictions on the caller, making it suitable for composition in higher-level contract logic. | ||
|
|
||
| NOTE: Transfers to contract addresses are currently disallowed until contract-to-contract interactions are supported in Compact. | ||
| This restriction prevents assets from being inadvertently locked in contracts that cannot currently handle token receipt. | ||
|
|
||
| Requirements: | ||
|
|
||
| - Contract is initialized. | ||
| - `to` is not a ContractAddress. | ||
| - `to` is not the zero address. | ||
| - `from` is not the zero address. | ||
| - `from` must have an `id` balance of at least `value`. | ||
|
|
||
| [.contract-item] | ||
| [[MultiTokenModule-_update]] | ||
| ==== `[.contract-item-name]#++_update++#++(from: Either<ZswapCoinPublicKey, ContractAddress>, to: Either<ZswapCoinPublicKey, ContractAddress>, id: Uint<128>, value: Uint<128>)++` [.item-kind]#internal# | ||
|
|
||
| Transfers a value amount of tokens of type id from from to to. | ||
| This circuit will mint (or burn) if `from` (or `to`) is the zero address. | ||
|
|
||
| Requirements: | ||
|
|
||
| - Contract is initialized. | ||
| - If `from` is not zero, the balance of `id` of `from` must be >= `value`. | ||
|
|
||
| [.contract-item] | ||
| [[MultiTokenModule-_unsafeTransferFrom]] | ||
| ==== `[.contract-item-name]#++_unsafeTransferFrom++#++(from: Either<ZswapCoinPublicKey, ContractAddress>, to: Either<ZswapCoinPublicKey, ContractAddress>, id: Uint<128>, value: Uint<128>) → []++` [.item-kind]#circuit# | ||
|
|
||
| Unsafe variant of <<MultiTokenModule-transferFrom,transferFrom>> which allows transfers to contract addresses. | ||
| The caller must be `from` or approved to transfer on their behalf. | ||
|
|
||
| WARNING: Transfers to contract addresses are considered unsafe because contract-to-contract calls are not currently supported. Tokens sent to a contract address may become irretrievable. | ||
| Once contract-to-contract calls are supported, this circuit may be deprecated. | ||
|
|
||
| Requirements: | ||
|
|
||
| - Contract is initialized. | ||
| - `to` is not the zero address. | ||
| - `from` is not the zero address. | ||
| - Caller must be `from` or approved via `setApprovalForAll`. | ||
| - `from` must have an `id` balance of at least `value`. | ||
|
|
||
| [.contract-item] | ||
| [[MultiTokenModule-_unsafeTransfer]] | ||
| ==== `[.contract-item-name]#++_unsafeTransfer++#++(from: Either<ZswapCoinPublicKey, ContractAddress>, to: Either<ZswapCoinPublicKey, ContractAddress>, id: Uint<128>, value: Uint<128>) → []++` [.item-kind]#circuit# | ||
|
|
||
| Unsafe variant of <<MultiTokenModule-_transfer,_transfer>> which allows transfers to contract addresses. | ||
| Does not impose restrictions on the caller, making it suitable as a low-level building block for advanced contract logic. | ||
|
|
||
| WARNING: Transfers to contract addresses are considered unsafe because contract-to-contract calls are not currently supported. Tokens sent to a contract address may become irretrievable. | ||
| Once contract-to-contract calls are supported, this circuit may be deprecated. | ||
|
|
||
| Requirements: | ||
|
|
||
| - Contract is initialized. | ||
| - `from` is not the zero address. | ||
| - `to` is not the zero address. | ||
| - `from` must have an `id` balance of at least `value`. | ||
|
|
||
| [.contract-item] | ||
| [[MultiTokenModule-_setURI]] | ||
| ==== `[.contract-item-name]#++_setURI++#++(newURI: Opaque<"string">) → []++` [.item-kind]#circuit# | ||
|
|
||
| Sets a new URI for all token types, by relying on the token type ID substitution mechanism defined in the MultiToken standard. | ||
| See https://eips.ethereum.org/EIPS/eip-1155#metadata. | ||
|
|
||
| By this mechanism, any occurrence of the `\{id\}` substring | ||
| in either the URI or any of the values in the JSON file at said URI will be replaced by clients with the token type ID. | ||
|
|
||
| For example, the `https://token-cdn-domain/\{id\}.json` URI would be interpreted by clients as | ||
| `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json` for token type ID 0x4cce0. | ||
|
|
||
| Requirements: | ||
|
|
||
| - Contract is initialized. | ||
|
|
||
| [.contract-item] | ||
| [[MultiTokenModule-_mint]] | ||
| ==== `[.contract-item-name]#++_mint++#++(to: Either<ZswapCoinPublicKey, ContractAddress>, id: Uint<128>, value: Uint<128>) → []++` [.item-kind]#circuit# | ||
|
|
||
| Creates a `value` amount of tokens of type `token_id`, and assigns them to `to`. | ||
|
|
||
| NOTE: Transfers to contract addresses are currently disallowed until contract-to-contract interactions are supported in Compact. | ||
| This restriction prevents assets from being inadvertently locked in contracts that cannot currently handle token receipt. | ||
|
|
||
| Requirements: | ||
|
|
||
| - Contract is initialized. | ||
| - `to` is not the zero address. | ||
| - `to` is not a ContractAddress | ||
|
|
||
| [.contract-item] | ||
| [[MultiTokenModule-_unsafeMint]] | ||
| ==== `[.contract-item-name]#++_unsafeMint++#++(to: Either<ZswapCoinPublicKey, ContractAddress>, id: Uint<128>, value: Uint<128>) → []++` [.item-kind]#circuit# | ||
|
|
||
| Unsafe variant of `_mint` which allows transfers to contract addresses. | ||
|
|
||
| WARNING: Transfers to contract addresses are considered unsafe because contract-to-contract calls are not currently supported. | ||
| Tokens sent to a contract address may become irretrievable. | ||
| Once contract-to-contract calls are supported, this circuit may be deprecated. | ||
|
|
||
| Requirements: | ||
|
|
||
| - Contract is initialized. | ||
| - `to` is not the zero address. | ||
|
|
||
| [.contract-item] | ||
| [[MultiTokenModule-_burn]] | ||
| ==== `[.contract-item-name]#++_burn++#++(from: Either<ZswapCoinPublicKey, ContractAddress>, id: Uint<128>, value: Uint<128>) → []++` [.item-kind]#circuit# | ||
|
|
||
| Destroys a `value` amount of tokens of type `token_id` from `from`. | ||
|
|
||
| Requirements: | ||
|
|
||
| - Contract is initialized. | ||
| - `from` is not the zero address. | ||
| - `from` must have an `id` balance of at least `value`. | ||
|
|
||
| [.contract-item] | ||
| [[MultiTokenModule-_setApprovalForAll]] | ||
| ==== `[.contract-item-name]#++_setApprovalForAll++#++(owner: Either<ZswapCoinPublicKey, ContractAddress>, operator: Either<ZswapCoinPublicKey, ContractAddress>, approved: Boolean) → []++` [.item-kind]#circuit# | ||
|
|
||
| Enables or disables approval for `operator` to manage all of the caller's assets. | ||
| This circuit does not check for access permissions but can be useful as a building block for more complex contract logic. | ||
|
|
||
| Requirements: | ||
|
|
||
| - Contract is initialized. | ||
| - `operator` is not the zero address. | ||
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.