Skip to content
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

Arc-0078.md vault of (ARC-72) NFTs #243

Closed
wants to merge 1 commit into from
Closed
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
116 changes: 116 additions & 0 deletions ARCs/arc-0078.md
Original file line number Diff line number Diff line change
@@ -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 <a href="https://eips.ethereum.org/EIPS/eip-6551">EIP-6551</a>
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 <a href="https://www.ietf.org/rfc/rfc2119.txt">RFC-2119</a>.

### 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 <a href="https://creativecommons.org/publicdomain/zero/1.0/">CCO</a>.
Loading