From b6f4677fcb9cc3f0d0bb81f9a9f8ed9d3aa12721 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane?= Date: Fri, 8 Sep 2023 16:13:09 +0200 Subject: [PATCH] Create arc-0078.md --- ARCs/arc-0078.md | 116 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 ARCs/arc-0078.md diff --git a/ARCs/arc-0078.md b/ARCs/arc-0078.md new file mode 100644 index 000000000..1533e6874 --- /dev/null +++ b/ARCs/arc-0078.md @@ -0,0 +1,116 @@ +--- +arc: 78 +title: NFT's vault of Application NFTs +description: Application subsidiaries of an NFT storing Application NFTs +author: Stéphane BARROSO (@SudoWeezy) +discussions-to: https://github.com/algorandfoundation/ARCs/issues/213 +status: Draft +type: Standards Track +category: Interface +created: 2023-06-16 +--- + +## Abstract +This standard is inspired by EIP-6551 +The goal is to create a smart contract that will give its owner a way to bundle multiple Algo/Fungible Token/NFTs at once. + + +## Specification +The key words "**MUST**", "**MUST NOT**", "**REQUIRED**", "**SHALL**", "**SHALL NOT**", "**SHOULD**", "**SHOULD NOT**", "**RECOMMENDED**", "**MAY**", and "**OPTIONAL**" in this document are to be interpreted as described in RFC-2119. + +### Glossary +In the document, we will use the following syntax: +- Authority NFT -> [ARC-72](./arc-0072.md) NFT that detain & manage others ARC-72 NFTs +- Vault -> Application ID holding ARC-72 NFTs of the Authority NFT + +### Events +To allow wallet & dApps to identify the vault of the Authority NFT, an [ARC-28](./arc-0028.md) event MUST be emitted when creating the vault. +```json +{ + "events": [ + { + "name": "arc78_AccountCreated", + "desc": "Creation of a Vault", + "args": [ + { + "type": "address", + "name": "account", + "desc": "The current owner of the authority NFT" + }, + { + "type": "uint256", + "name": "tokenId", + "desc": "The ID of the authority NFT" + }, + { + "type": "uint64", + "name": "appId", + "desc": "The Application ID of the authority NFT" + } + ] + } + ] +} +``` + +An `arc78_AccountCreated` event MUST be emitted when a vault is created. + + +### Interface +```json +{ + "name": "ARC-78", + "desc": "Authority NFT's Vault Base Interface", + "methods": [ + { + "name": "arc78_isOwner", + "desc": "Indicate if the caller detains the Authority NFT of this vault", + "readonly": true, + "returns": { "type": "bool", "desc": "True if the caller detains the Authority NFT of this vault, False otherwise" } + }, + { + "name": "arc78_setOwner", + "desc": "If the caller detains the Authority NFT of this vault, this method MUST set him as Owner of the vault", + "readonly": true, + "returns": { "type": "bool", "desc": "True if the caller detains the Authority NFT of this vault, False otherwise" } + }, + { + "name": "arc78_transferTo", + "desc": "Transfers ownership of an NFT/fungible Token", + "readonly": false, + "args": [ + { "type": "address", "name": "to" }, + { "type": "uint64", "name": "amount" }, + { + "type": "uint256", + "name": "tokenId", + "desc": "The ID of the Smart Contract/Application NFT to transfer (0 if ASA)" + }, + { + "type": "uint64", + "name": "appId", + "desc": "The Application ID of the Smart Contract/Application NFT to transfer (0 if ASA)" + } + ], + "returns": { "type": "void" } + } + ] +} +``` + +The `arc78_isOwner` method MUST be called internally by every other method. +The `arc78_setOwner` method MUST error when the caller is not the owner of authority NFT. +The `arc78_transferAlgoTo` method MUST error when `arc78_isOwner` returns false. +The `arc78_transferTo` method MUST error when `arc78_isOwner` returns false. + +## Rationale +Application NFT are compatible with this standard. + +## Backwards Compatibility +This standard is compatible ARC-72 NFT standard. + +## Security Considerations +The method `isOwner` **MUST** be called internally by the logic of every other application method (except `arc78_setOwner`) to ensure that the caller detains the Authority NFT. + +## Copyright +Copyright and related rights waived via CCO.