diff --git a/src/standard/TIP-4/7.md b/src/standard/TIP-4/7.md new file mode 100644 index 000000000..7be488da9 --- /dev/null +++ b/src/standard/TIP-4/7.md @@ -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.