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

TIP-4.7 (IBurnableNft) standard description #364

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
78 changes: 78 additions & 0 deletions src/standard/TIP-4/7.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
---
title: 4.7. Burnable NFT
sidebar_position: 7
slug: /standard/TIP-4.7
---

# Burnable NFT (TIP-4.7)
Requires: [TIP-4.1](1.md)
Requires: [TIP-6.1](./../TIP-6/1.md)

## Abstract

This standard is intended to provide information about the availability of NFT burning and who can manage it.

## Motivation

The [TIP-4.1](1.md) standard includes only the event to be emited when an NFT is burned and does not provide any additional information. At the same time, some contracts should not be able to be burned.
In such a case, burning will not work and the dapp must know this in order to provide information about it to the user and not call inactive methods

```solidity
interface ITIP4_7 {
enum WhoCanBurn {
BurnManager,
Manager,
Both,
Neither
}

event BurnLocked();
event BurnUnlocked();

function burnAuth() external responsible view returns(WhoCanBurn);

function isBurnable() external responsible view returns(bool);

function burnManager() external responsible view returns(address);
}
```

**TIP4_7.burnAuth()**

```solidity
function burnAuth() external responsible view returns(WhoCanBurn);
```

Returns information about who can call the burn method

**TIP4_7.isBurnable()**

```solidity
function isBurnable() external responsible view returns(bool);
```

Returns information about whether a burn is currently available. If `WhoCanBurn` was set to `Neither` at creation, this method will always return false. Otherwise, the value may change after lock/unlock

**TIP4_7.burnManager()**

```solidity
function burnManager() external responsible view returns(address);
```

Returns the contract address set when the NFT was created. This address can call the burn function if `WhoCanBurn` was set to `BurnManager` or `Both` at creation and burn is not currently blocked.
May return a null address if `burnManager` does not have access to burn (`WhoCanBurn` was set to `Manager` or `Neither`)

### Events

```solidity
event BurnLocked();
event BurnUnlocked();
```

**BurnLocked**

You MUST emit it when burn is blocked

**BurnUnlocked**

You MUST emit it when the burn is unlocked. If unlocking occurs just before the burn itself (e.g. there was a timed lock), the event MUST also be emited together with the unlocking.