ERC-721 Burnable

ERC-721 Token that can be burned (destroyed).

Usage

In order to make ERC-721 Burnable methods “external” so that other contracts can call them, you need to implement them by yourself for your final contract as follows:

use openzeppelin_stylus::{
    token::erc721::{
        extensions::IErc721Burnable,
        Erc721, IErc721,
    },
};

sol_storage! {
    #[entrypoint]
    struct Erc721Example {
        #[borrow]
        Erc721 erc721;
    }
}

#[public]
#[inherit(Erc721)]
impl Erc721Example {
    pub fn burn(&mut self, token_id: U256) -> Result<(), Vec<u8>> {
        // ...
        self.erc721.burn(token_id).map_err(|e| e.into())
    }
}