From 343da696e1bf88d6945e5e784f3538a0d73ec34a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane?= Date: Fri, 16 Jun 2023 13:41:24 +0200 Subject: [PATCH 01/15] Create arc-0041.md --- ARCs/arc-0041.md | 107 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 ARCs/arc-0041.md diff --git a/ARCs/arc-0041.md b/ARCs/arc-0041.md new file mode 100644 index 000000000..9ef9f4fdc --- /dev/null +++ b/ARCs/arc-0041.md @@ -0,0 +1,107 @@ +--- +arc: 41 +title: ASA's vault of ASAs +description: Application ID storing ASAs for another ASA +author: Stéphane BARROSO (@SudoWeezy) +discussions-to: https://github.com/algorandfoundation/ARCs/pull/213 +status: Draft +type: Standards Track +category: Interface +created: 2023-06-16 +requires: 3, 16 +--- + +## Abstract +This standard is inspired by EIP-6551 +The goal is to allow an ASA to detain & manage ASAs or Algo throught a ”vault”. + +## 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 following syntax: +- Main ASA -> ASA that detain & manage others ASAs +- Vault -> Application ID holding ASAs of the Main ASA + +### Metadata field +In order to allow wallet to identify the vault of the Main ASA must be specified in the metadata. +Using ARC-16: +```json +{ + "title": "Main ASA", + "type": "object", + "properties": { + "vault_id": { + "type": "integer", + "description": "Application ID holding ASAs of the main ASA" + } + } +} +``` + +```json +{ + "name": "Main ASA", + "description": "I have control over other ASAs through my vault", + "properties": { + "vault_id": 123456789 + } +} +``` +### Interface + +{ + "name": "ARC-41", + "desc": "Main ASA's Vault Base Interface", + "methods": [ + { + "name": "isOwner", + "desc": "Indicate if the caller detain the Main ASA of this vault, this method MUST be called before calling every other method of the application", + "readonly": true, + "returns": { "type": "bool", "desc": "True if the caller detain the Main ASA of this vault, False otherwise" } + }, + { + "name": "optInAsa", + "desc": "Opt-in ASA in the vault", + "readonly": false, + "args": [ + { "type": "uint64", "name": "assetId" } + ], + "returns": { "type": "void" } + }, + { + "name": "transferAlgoFrom", + "desc": "Transfers Algos outside of the Vault", + "readonly": false, + "args": [ + { "type": "address", "name": "from" }, + { "type": "address", "name": "to" } + ], + "returns": { "type": "void" } + }, + { + "name": "transferAsaFrom", + "desc": "Transfers ownership of an ASA", + "readonly": false, + "args": [ + { "type": "address", "name": "from" }, + { "type": "address", "name": "to" }, + { "type": "uint64", "name": "assetId" } + ], + "returns": { "type": "void" } + } + ] +} + +## Rationale +Linking the vault ID to the Main ASA using the Metadata allows to have backwards compatibility with current implementations. +The design using an application has vault rather than a logic sig is more flexible and secure. + +## Backwards Compatibility +This stantard is compatible with asa that can be updated [ARC-3](./arc-0003.md) + [ARC-19](./arc-0019.md) or [ARC-69](./arc-0069.md). + +## Security Considerations +The method `isOwner` **MUST** be called by every other method of the application to ensure that the caller detain the main ASA. + +## Copyright +Copyright and related rights waived via CCO. From 27920a8f5ec296310c4b3093d6519c9724bf8895 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane?= Date: Fri, 16 Jun 2023 13:43:56 +0200 Subject: [PATCH 02/15] Update arc-0041.md --- ARCs/arc-0041.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ARCs/arc-0041.md b/ARCs/arc-0041.md index 9ef9f4fdc..e31009883 100644 --- a/ARCs/arc-0041.md +++ b/ARCs/arc-0041.md @@ -3,7 +3,7 @@ arc: 41 title: ASA's vault of ASAs description: Application ID storing ASAs for another ASA author: Stéphane BARROSO (@SudoWeezy) -discussions-to: https://github.com/algorandfoundation/ARCs/pull/213 +discussions-to: https://github.com/algorandfoundation/ARCs/issues/213 status: Draft type: Standards Track category: Interface @@ -98,7 +98,7 @@ Linking the vault ID to the Main ASA using the Metadata allows to have backwards The design using an application has vault rather than a logic sig is more flexible and secure. ## Backwards Compatibility -This stantard is compatible with asa that can be updated [ARC-3](./arc-0003.md) + [ARC-19](./arc-0019.md) or [ARC-69](./arc-0069.md). +This stantard is compatible with ASAs that can be updated [ARC-3](./arc-0003.md) + [ARC-19](./arc-0019.md) or [ARC-69](./arc-0069.md). ## Security Considerations The method `isOwner` **MUST** be called by every other method of the application to ensure that the caller detain the main ASA. From 5a58857d75b6209c5ffe572bbbab73792930d607 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane?= Date: Fri, 16 Jun 2023 13:44:42 +0200 Subject: [PATCH 03/15] Update arc-0041.md --- ARCs/arc-0041.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ARCs/arc-0041.md b/ARCs/arc-0041.md index e31009883..d1bf294e8 100644 --- a/ARCs/arc-0041.md +++ b/ARCs/arc-0041.md @@ -13,7 +13,7 @@ requires: 3, 16 ## Abstract This standard is inspired by EIP-6551 -The goal is to allow an ASA to detain & manage ASAs or Algo throught a ”vault”. +The goal is to allow an ASA to detain & manage ASAs or Algo through a ”vault”. ## 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. From 8f5002bef89bf1394d012fedfcebf1b6cb825aec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane?= Date: Fri, 16 Jun 2023 13:48:35 +0200 Subject: [PATCH 04/15] Fix json + ref ARC-16 --- ARCs/arc-0041.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ARCs/arc-0041.md b/ARCs/arc-0041.md index d1bf294e8..4087814a7 100644 --- a/ARCs/arc-0041.md +++ b/ARCs/arc-0041.md @@ -25,7 +25,7 @@ In the document we will use following syntax: ### Metadata field In order to allow wallet to identify the vault of the Main ASA must be specified in the metadata. -Using ARC-16: +Using [ARC-16](./arc-0016.md): ```json { "title": "Main ASA", @@ -49,7 +49,7 @@ Using ARC-16: } ``` ### Interface - +```json { "name": "ARC-41", "desc": "Main ASA's Vault Base Interface", @@ -92,7 +92,7 @@ Using ARC-16: } ] } - +``` ## Rationale Linking the vault ID to the Main ASA using the Metadata allows to have backwards compatibility with current implementations. The design using an application has vault rather than a logic sig is more flexible and secure. From f99a0642a8fdca6d9b1c9689bd64e54609659daf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane?= Date: Fri, 16 Jun 2023 14:23:57 +0200 Subject: [PATCH 05/15] Main -> Authority + Wording more explicit --- ARCs/arc-0041.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/ARCs/arc-0041.md b/ARCs/arc-0041.md index 4087814a7..a13681fee 100644 --- a/ARCs/arc-0041.md +++ b/ARCs/arc-0041.md @@ -20,20 +20,20 @@ The key words "**MUST**", "**MUST NOT**", "**REQUIRED**", "**SHALL**", "**SHALL ### Glossary In the document we will use following syntax: -- Main ASA -> ASA that detain & manage others ASAs -- Vault -> Application ID holding ASAs of the Main ASA +- Authority ASA -> ASA that indicate an Application ID that detain & manage others ASAs +- Vault -> Application ID holding ASAs of the Authority ASA ### Metadata field -In order to allow wallet to identify the vault of the Main ASA must be specified in the metadata. +In order to allow wallet to identify the vault of the Authority ASA must be specified in the metadata. Using [ARC-16](./arc-0016.md): ```json { - "title": "Main ASA", + "title": "Authority ASA", "type": "object", "properties": { "vault_id": { "type": "integer", - "description": "Application ID holding ASAs of the main ASA" + "description": "Application ID holding ASAs of the Authority ASA" } } } @@ -41,7 +41,7 @@ Using [ARC-16](./arc-0016.md): ```json { - "name": "Main ASA", + "name": "Authority ASA", "description": "I have control over other ASAs through my vault", "properties": { "vault_id": 123456789 @@ -52,13 +52,13 @@ Using [ARC-16](./arc-0016.md): ```json { "name": "ARC-41", - "desc": "Main ASA's Vault Base Interface", + "desc": "Authority ASA's Vault Base Interface", "methods": [ { "name": "isOwner", - "desc": "Indicate if the caller detain the Main ASA of this vault, this method MUST be called before calling every other method of the application", + "desc": "Indicate if the caller detain the Authority ASA of this vault, this method MUST be called internally by every other methods of the application", "readonly": true, - "returns": { "type": "bool", "desc": "True if the caller detain the Main ASA of this vault, False otherwise" } + "returns": { "type": "bool", "desc": "True if the caller detain the Authority ASA of this vault, False otherwise" } }, { "name": "optInAsa", @@ -94,14 +94,14 @@ Using [ARC-16](./arc-0016.md): } ``` ## Rationale -Linking the vault ID to the Main ASA using the Metadata allows to have backwards compatibility with current implementations. +Linking the vault ID to the Authority ASA using the Metadata allows to have backwards compatibility with current implementations. The design using an application has vault rather than a logic sig is more flexible and secure. ## Backwards Compatibility This stantard is compatible with ASAs that can be updated [ARC-3](./arc-0003.md) + [ARC-19](./arc-0019.md) or [ARC-69](./arc-0069.md). ## Security Considerations -The method `isOwner` **MUST** be called by every other method of the application to ensure that the caller detain the main ASA. +The method `isOwner` **MUST** be called internally by the logic of every other method of the application to ensure that the caller detain the Authority ASA. ## Copyright Copyright and related rights waived via CCO. From 765083ae160a085e757fed08b7fe1efe47bc9c8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane?= Date: Fri, 30 Jun 2023 16:23:23 +0200 Subject: [PATCH 06/15] Update to support application NFT --- ARCs/arc-0041.md | 124 ++++++++++++++++++++++++++++++++--------------- 1 file changed, 86 insertions(+), 38 deletions(-) diff --git a/ARCs/arc-0041.md b/ARCs/arc-0041.md index a13681fee..e3ff33e6a 100644 --- a/ARCs/arc-0041.md +++ b/ARCs/arc-0041.md @@ -1,67 +1,96 @@ --- arc: 41 -title: ASA's vault of ASAs -description: Application ID storing ASAs for another ASA +title: NFT's vault of NFTs & FTs +description: Application ID storing NFTs & FTs on behalf of user 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 -requires: 3, 16 --- ## Abstract This standard is inspired by EIP-6551 -The goal is to allow an ASA to detain & manage ASAs or Algo through a ”vault”. +The goal is to create a smart contract who will give is 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 following syntax: -- Authority ASA -> ASA that indicate an Application ID that detain & manage others ASAs -- Vault -> Application ID holding ASAs of the Authority ASA +- Authority NFT -> NFT that detain & manage others NFTs & FTs +- Vault -> Application ID holding NFTs & FTs of the Authority NFT -### Metadata field -In order to allow wallet to identify the vault of the Authority ASA must be specified in the metadata. -Using [ARC-16](./arc-0016.md): +### Events +In order to allow wallet to identify the vault of the Authority NFT, an [ARC-28](./arc-0028.md) event must emitted when creating the vault. ```json { - "title": "Authority ASA", - "type": "object", - "properties": { - "vault_id": { - "type": "integer", - "description": "Application ID holding ASAs of the Authority ASA" + "events": [ + { + "name": "arc41_AccountCreated", + "desc": "Creation of a Vault", + "args": [ + { + "type": "address", + "name": "account", + "desc": "The current owner of the authority NFT" + }, + { + "type": "uint64", + "name": "asaId", + "desc": "The asaId owner of the authority NFT, (0 if application NFT)" + }, + { + "type": "uint256", + "name": "tokenId", + "desc": "The ID of the authority NFT, (0 if ASA)" + }, + { + "type": "uint64", + "name": "AppId", + "desc": "The Application ID of the authority NFT, (0 if ASA)" + } + ] } - } } ``` -```json -{ - "name": "Authority ASA", - "description": "I have control over other ASAs through my vault", - "properties": { - "vault_id": 123456789 - } -} -``` +A `arc41_AccountCreated` event SHOULD be emitted, when a vault is created. + + ### Interface ```json { "name": "ARC-41", - "desc": "Authority ASA's Vault Base Interface", + "desc": "Authority NFT's Vault Base Interface", "methods": [ { - "name": "isOwner", - "desc": "Indicate if the caller detain the Authority ASA of this vault, this method MUST be called internally by every other methods of the application", + "name": "arc41_isOwner", + "desc": "Indicate if the caller detain the Authority NFT of this vault, this method MUST be called internally by every other methods of the application, it must call ARC-72 ownerOf in case of a application NFT", "readonly": true, - "returns": { "type": "bool", "desc": "True if the caller detain the Authority ASA of this vault, False otherwise" } + "args": [ + { + "type": "uint64", + "name": "asaId", + "desc": "The asaId owner of the authority NFT, (0 if application NFT)" + }, + { + "type": "uint256", + "name": "tokenId", + "desc": "The ID of the authority NFT, (0 if ASA)" + }, + { + "type": "uint64", + "name": "AppId", + "desc": "The Application ID of the authority NFT, (0 if ASA)" + } + ] + "returns": { "type": "bool", "desc": "True if the caller detain the Authority NFT of this vault, False otherwise" } }, { - "name": "optInAsa", + "name": "arc41_optIn", "desc": "Opt-in ASA in the vault", "readonly": false, "args": [ @@ -70,7 +99,7 @@ Using [ARC-16](./arc-0016.md): "returns": { "type": "void" } }, { - "name": "transferAlgoFrom", + "name": "arc41_transferAlgoFrom", "desc": "Transfers Algos outside of the Vault", "readonly": false, "args": [ @@ -80,28 +109,47 @@ Using [ARC-16](./arc-0016.md): "returns": { "type": "void" } }, { - "name": "transferAsaFrom", - "desc": "Transfers ownership of an ASA", + "name": "arc41_transferFrom", + "desc": "Transfers ownership of an NFT/fungible Token", "readonly": false, "args": [ { "type": "address", "name": "from" }, { "type": "address", "name": "to" }, - { "type": "uint64", "name": "assetId" } + { "type": "uint64", "name": "amount" }, + { + "type": "uint64", + "name": "asaId", + "desc": "The asaId owner of the authority NFT, (0 if application NFT)" + }, + { + "type": "uint256", + "name": "tokenId", + "desc": "The ID of the authority NFT, (0 if ASA)" + }, + { + "type": "uint64", + "name": "AppId", + "desc": "The Application ID of the authority NFT, (0 if ASA)" + } ], "returns": { "type": "void" } } ] } ``` + +The `arc41_isOwner` method MUST be called internaly by every other methods. +The `arc41_transferAlgoFrom` method MUST error when `from` is not the owner of `asaId` or `tokenId`. +The `arc41_transferFrom` method MUST error when `from` is not the owner of `asaId` or `tokenId`. + ## Rationale -Linking the vault ID to the Authority ASA using the Metadata allows to have backwards compatibility with current implementations. -The design using an application has vault rather than a logic sig is more flexible and secure. +ASAs NFT ([ARC-3](./arc-0003.md), [ARC-69](./arc-0069.md)) and Application NFT ([ARC-72](./arc-0072.md)) are compatible with This standard. ## Backwards Compatibility -This stantard is compatible with ASAs that can be updated [ARC-3](./arc-0003.md) + [ARC-19](./arc-0019.md) or [ARC-69](./arc-0069.md). +This standard is compatible with every NFT standard. ## Security Considerations -The method `isOwner` **MUST** be called internally by the logic of every other method of the application to ensure that the caller detain the Authority ASA. +The method `isOwner` **MUST** be called internally by the logic of every other method of the application to ensure that the caller detain the Authority NFT. ## Copyright Copyright and related rights waived via CCO. From 1d957afbdcdec5531d790276df12826048d0fe6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane?= Date: Mon, 3 Jul 2023 13:59:10 +0200 Subject: [PATCH 07/15] update: MUST Emit event + arc19 compatibility --- ARCs/arc-0041.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ARCs/arc-0041.md b/ARCs/arc-0041.md index e3ff33e6a..39af99ed2 100644 --- a/ARCs/arc-0041.md +++ b/ARCs/arc-0041.md @@ -24,7 +24,7 @@ In the document we will use following syntax: - Vault -> Application ID holding NFTs & FTs of the Authority NFT ### Events -In order to allow wallet to identify the vault of the Authority NFT, an [ARC-28](./arc-0028.md) event must emitted when creating the vault. +In order 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": [ @@ -57,7 +57,7 @@ In order to allow wallet to identify the vault of the Authority NFT, an [ARC-28] } ``` -A `arc41_AccountCreated` event SHOULD be emitted, when a vault is created. +A `arc41_AccountCreated` event MUST be emitted, when a vault is created. ### Interface @@ -143,7 +143,7 @@ The `arc41_transferAlgoFrom` method MUST error when `from` is not the owner of ` The `arc41_transferFrom` method MUST error when `from` is not the owner of `asaId` or `tokenId`. ## Rationale -ASAs NFT ([ARC-3](./arc-0003.md), [ARC-69](./arc-0069.md)) and Application NFT ([ARC-72](./arc-0072.md)) are compatible with This standard. +ASAs NFT following [ARC-3](./arc-0003.md), [ARC-19](./arc-0019.md) or [ARC-69](./arc-0069.md) and Application NFT ([ARC-72](./arc-0072.md)) are compatible with this standard. ## Backwards Compatibility This standard is compatible with every NFT standard. From c108c10a162c0221d176caa9cf31936257ac01c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane?= Date: Tue, 4 Jul 2023 16:32:23 +0200 Subject: [PATCH 08/15] fix linting --- ARCs/arc-0041.md | 1 - 1 file changed, 1 deletion(-) diff --git a/ARCs/arc-0041.md b/ARCs/arc-0041.md index 39af99ed2..f034ca9af 100644 --- a/ARCs/arc-0041.md +++ b/ARCs/arc-0041.md @@ -53,7 +53,6 @@ In order to allow wallet & dApps to identify the vault of the Authority NFT, an "desc": "The Application ID of the authority NFT, (0 if ASA)" } ] - } } ``` From 358206fbabea716807d5a9d78f7d490e5e58e144 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane?= Date: Tue, 4 Jul 2023 16:40:34 +0200 Subject: [PATCH 09/15] Update arc-0041.md --- ARCs/arc-0041.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ARCs/arc-0041.md b/ARCs/arc-0041.md index f034ca9af..cb99cc20f 100644 --- a/ARCs/arc-0041.md +++ b/ARCs/arc-0041.md @@ -28,7 +28,7 @@ In order to allow wallet & dApps to identify the vault of the Authority NFT, an ```json { "events": [ - { + { "name": "arc41_AccountCreated", "desc": "Creation of a Vault", "args": [ @@ -53,6 +53,8 @@ In order to allow wallet & dApps to identify the vault of the Authority NFT, an "desc": "The Application ID of the authority NFT, (0 if ASA)" } ] + } + ] } ``` From bbc1039433db5b2f1cdbf1ed2205d7914455dc8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane?= Date: Mon, 10 Jul 2023 16:58:44 +0200 Subject: [PATCH 10/15] updating methods name + remove `from` arguments --- ARCs/arc-0041.md | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/ARCs/arc-0041.md b/ARCs/arc-0041.md index cb99cc20f..34a72f410 100644 --- a/ARCs/arc-0041.md +++ b/ARCs/arc-0041.md @@ -71,23 +71,6 @@ A `arc41_AccountCreated` event MUST be emitted, when a vault is created. "name": "arc41_isOwner", "desc": "Indicate if the caller detain the Authority NFT of this vault, this method MUST be called internally by every other methods of the application, it must call ARC-72 ownerOf in case of a application NFT", "readonly": true, - "args": [ - { - "type": "uint64", - "name": "asaId", - "desc": "The asaId owner of the authority NFT, (0 if application NFT)" - }, - { - "type": "uint256", - "name": "tokenId", - "desc": "The ID of the authority NFT, (0 if ASA)" - }, - { - "type": "uint64", - "name": "AppId", - "desc": "The Application ID of the authority NFT, (0 if ASA)" - } - ] "returns": { "type": "bool", "desc": "True if the caller detain the Authority NFT of this vault, False otherwise" } }, { @@ -100,21 +83,19 @@ A `arc41_AccountCreated` event MUST be emitted, when a vault is created. "returns": { "type": "void" } }, { - "name": "arc41_transferAlgoFrom", + "name": "arc41_transferAlgoTo", "desc": "Transfers Algos outside of the Vault", "readonly": false, "args": [ - { "type": "address", "name": "from" }, { "type": "address", "name": "to" } ], "returns": { "type": "void" } }, { - "name": "arc41_transferFrom", + "name": "arc41_transferTo", "desc": "Transfers ownership of an NFT/fungible Token", "readonly": false, "args": [ - { "type": "address", "name": "from" }, { "type": "address", "name": "to" }, { "type": "uint64", "name": "amount" }, { From 106dc7179ce7b78cf6f6943dd7270bb34b6ec1df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane?= Date: Tue, 11 Jul 2023 09:56:42 +0200 Subject: [PATCH 11/15] Update arc-0041.md Wording + naming --- ARCs/arc-0041.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/ARCs/arc-0041.md b/ARCs/arc-0041.md index 34a72f410..c6c54c7a2 100644 --- a/ARCs/arc-0041.md +++ b/ARCs/arc-0041.md @@ -1,7 +1,7 @@ --- arc: 41 title: NFT's vault of NFTs & FTs -description: Application ID storing NFTs & FTs on behalf of user +description: Application subsidiaries of an NFT storing NFTs & FTs author: Stéphane BARROSO (@SudoWeezy) discussions-to: https://github.com/algorandfoundation/ARCs/issues/213 status: Draft @@ -12,19 +12,19 @@ created: 2023-06-16 ## Abstract This standard is inspired by EIP-6551 -The goal is to create a smart contract who will give is owner a way to bundle multiple Algo/Fungible Token/NFTs at once. +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 following syntax: +In the document, we will use the following syntax: - Authority NFT -> NFT that detain & manage others NFTs & FTs - Vault -> Application ID holding NFTs & FTs of the Authority NFT ### Events -In order 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. +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": [ @@ -49,7 +49,7 @@ In order to allow wallet & dApps to identify the vault of the Authority NFT, an }, { "type": "uint64", - "name": "AppId", + "name": "appId", "desc": "The Application ID of the authority NFT, (0 if ASA)" } ] @@ -58,7 +58,7 @@ In order to allow wallet & dApps to identify the vault of the Authority NFT, an } ``` -A `arc41_AccountCreated` event MUST be emitted, when a vault is created. +An `arc41_AccountCreated` event MUST be emitted when a vault is created. ### Interface @@ -69,16 +69,16 @@ A `arc41_AccountCreated` event MUST be emitted, when a vault is created. "methods": [ { "name": "arc41_isOwner", - "desc": "Indicate if the caller detain the Authority NFT of this vault, this method MUST be called internally by every other methods of the application, it must call ARC-72 ownerOf in case of a application NFT", + "desc": "Indicate if the caller detains the Authority NFT of this vault, this method MUST be called internally by every other method of the application, it must call ARC-72 ownerOf in case of an application NFT", "readonly": true, - "returns": { "type": "bool", "desc": "True if the caller detain the Authority NFT of this vault, False otherwise" } + "returns": { "type": "bool", "desc": "True if the caller detains the Authority NFT of this vault, False otherwise" } }, { "name": "arc41_optIn", "desc": "Opt-in ASA in the vault", "readonly": false, "args": [ - { "type": "uint64", "name": "assetId" } + { "type": "uint64", "name": "asaId" } ], "returns": { "type": "void" } }, @@ -110,7 +110,7 @@ A `arc41_AccountCreated` event MUST be emitted, when a vault is created. }, { "type": "uint64", - "name": "AppId", + "name": "appId", "desc": "The Application ID of the authority NFT, (0 if ASA)" } ], @@ -120,7 +120,7 @@ A `arc41_AccountCreated` event MUST be emitted, when a vault is created. } ``` -The `arc41_isOwner` method MUST be called internaly by every other methods. +The `arc41_isOwner` method MUST be called internally by every other method. The `arc41_transferAlgoFrom` method MUST error when `from` is not the owner of `asaId` or `tokenId`. The `arc41_transferFrom` method MUST error when `from` is not the owner of `asaId` or `tokenId`. @@ -131,7 +131,7 @@ ASAs NFT following [ARC-3](./arc-0003.md), [ARC-19](./arc-0019.md) or [ARC-69](. This standard is compatible with every NFT standard. ## Security Considerations -The method `isOwner` **MUST** be called internally by the logic of every other method of the application to ensure that the caller detain the Authority NFT. +The method `isOwner` **MUST** be called internally by the logic of every other application method to ensure that the caller detains the Authority NFT. ## Copyright Copyright and related rights waived via CCO. From ea54cb746585d8309978d7a6e4816154299f6c15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane?= Date: Tue, 11 Jul 2023 16:18:41 +0200 Subject: [PATCH 12/15] Update arc-0041.md --- ARCs/arc-0041.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ARCs/arc-0041.md b/ARCs/arc-0041.md index c6c54c7a2..f5304310e 100644 --- a/ARCs/arc-0041.md +++ b/ARCs/arc-0041.md @@ -121,8 +121,8 @@ An `arc41_AccountCreated` event MUST be emitted when a vault is created. ``` The `arc41_isOwner` method MUST be called internally by every other method. -The `arc41_transferAlgoFrom` method MUST error when `from` is not the owner of `asaId` or `tokenId`. -The `arc41_transferFrom` method MUST error when `from` is not the owner of `asaId` or `tokenId`. +The `arc41_transferAlgoTo` method MUST error when `from` is not the owner of `asaId` or `tokenId`. +The `arc41_transferTo` method MUST error when `from` is not the owner of `asaId` or `tokenId`. ## Rationale ASAs NFT following [ARC-3](./arc-0003.md), [ARC-19](./arc-0019.md) or [ARC-69](./arc-0069.md) and Application NFT ([ARC-72](./arc-0072.md)) are compatible with this standard. From a15a20bb0a2b40f9e6050e3dd9253b56d4f7163d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane?= Date: Wed, 12 Jul 2023 15:20:32 +0200 Subject: [PATCH 13/15] Adding set Owner method --- ARCs/arc-0041.md | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/ARCs/arc-0041.md b/ARCs/arc-0041.md index f5304310e..5204fcf6f 100644 --- a/ARCs/arc-0041.md +++ b/ARCs/arc-0041.md @@ -73,6 +73,12 @@ An `arc41_AccountCreated` event MUST be emitted when a vault is created. "readonly": true, "returns": { "type": "bool", "desc": "True if the caller detains the Authority NFT of this vault, False otherwise" } }, + { + "name": "arc41_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": "arc41_optIn", "desc": "Opt-in ASA in the vault", @@ -101,17 +107,17 @@ An `arc41_AccountCreated` event MUST be emitted when a vault is created. { "type": "uint64", "name": "asaId", - "desc": "The asaId owner of the authority NFT, (0 if application NFT)" + "desc": "The asaId of the NFT to transfer (0 if application NFT)" }, { "type": "uint256", "name": "tokenId", - "desc": "The ID of the authority NFT, (0 if ASA)" + "desc": "The ID of the Smart Contract/Application NFT to transfer (0 if ASA)" }, { "type": "uint64", "name": "appId", - "desc": "The Application ID of the authority NFT, (0 if ASA)" + "desc": "The Application ID of the Smart Contract/Application NFT to transfer (0 if ASA)" } ], "returns": { "type": "void" } @@ -121,8 +127,9 @@ An `arc41_AccountCreated` event MUST be emitted when a vault is created. ``` The `arc41_isOwner` method MUST be called internally by every other method. -The `arc41_transferAlgoTo` method MUST error when `from` is not the owner of `asaId` or `tokenId`. -The `arc41_transferTo` method MUST error when `from` is not the owner of `asaId` or `tokenId`. +The `arc41_setOwner` method MUST error when the caller is not the owner of authority NFT. +The `arc41_transferAlgoTo` method MUST error when `arc41_isOwner` returns false. +The `arc41_transferTo` method MUST error when `arc41_isOwner` returns false. ## Rationale ASAs NFT following [ARC-3](./arc-0003.md), [ARC-19](./arc-0019.md) or [ARC-69](./arc-0069.md) and Application NFT ([ARC-72](./arc-0072.md)) are compatible with this standard. From 0a0bab984c3180fd184b9f2b17071453767f6c13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane?= Date: Wed, 12 Jul 2023 15:30:15 +0200 Subject: [PATCH 14/15] Update arc-0041.md --- ARCs/arc-0041.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ARCs/arc-0041.md b/ARCs/arc-0041.md index 5204fcf6f..6d6bc5194 100644 --- a/ARCs/arc-0041.md +++ b/ARCs/arc-0041.md @@ -69,7 +69,7 @@ An `arc41_AccountCreated` event MUST be emitted when a vault is created. "methods": [ { "name": "arc41_isOwner", - "desc": "Indicate if the caller detains the Authority NFT of this vault, this method MUST be called internally by every other method of the application, it must call ARC-72 ownerOf in case of an application NFT", + "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" } }, @@ -138,7 +138,7 @@ ASAs NFT following [ARC-3](./arc-0003.md), [ARC-19](./arc-0019.md) or [ARC-69](. This standard is compatible with every NFT standard. ## Security Considerations -The method `isOwner` **MUST** be called internally by the logic of every other application method to ensure that the caller detains the Authority NFT. +The method `isOwner` **MUST** be called internally by the logic of every other application method (except arc41_setOwner) to ensure that the caller detains the Authority NFT. ## Copyright Copyright and related rights waived via CCO. From 36aef547d5d3eeef51e2a98af7dceec7e233d898 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane?= Date: Wed, 12 Jul 2023 21:21:51 +0200 Subject: [PATCH 15/15] Add quote for CI tool --- ARCs/arc-0041.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ARCs/arc-0041.md b/ARCs/arc-0041.md index 6d6bc5194..6f60ace76 100644 --- a/ARCs/arc-0041.md +++ b/ARCs/arc-0041.md @@ -138,7 +138,7 @@ ASAs NFT following [ARC-3](./arc-0003.md), [ARC-19](./arc-0019.md) or [ARC-69](. This standard is compatible with every NFT standard. ## Security Considerations -The method `isOwner` **MUST** be called internally by the logic of every other application method (except arc41_setOwner) to ensure that the caller detains the Authority NFT. +The method `isOwner` **MUST** be called internally by the logic of every other application method (except `arc41_setOwner`) to ensure that the caller detains the Authority NFT. ## Copyright Copyright and related rights waived via CCO.