Skip to Content
Mastering Blockchain Programming with Solidity
book

Mastering Blockchain Programming with Solidity

by Jitendra Chittoda
August 2019
Intermediate to advanced
486 pages
13h 52m
English
Packt Publishing
Content preview from Mastering Blockchain Programming with Solidity

Another _burn internal function

There are two _burn() internal functions present in the implementation. These are overloaded functions that have the same name; however, they take different arguments.

The function takes the tokenId of an NFT that is to be burned. The _burn() function code is defined as follows:

function _burn(uint256 tokenId) internal {    _burn(ownerOf(tokenId), tokenId);}

The code finds the owner of the token and calls the other overloaded _burn() function. As it is an internal function, this can be used in the inherited contract to burn specific tokens when required.

 

This function should be used by the inherited contracts when they directly want to burn a token using just its tokenId only. For example, you can implement ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering Ethereum

Mastering Ethereum

Andreas M. Antonopoulos, Gavin Wood
Complete Cryptocurrency and Blockchain Course | Learn Solidity

Complete Cryptocurrency and Blockchain Course | Learn Solidity

Ravinder Deol, Codestars By Rob Percival, Thomas Wiesner

Publisher Resources

ISBN: 9781839218262Supplemental Content