code-423n4 / 2022-06-putty-findings

5 stars 0 forks source link

Gas Optimizations #256

Closed code423n4 closed 2 years ago

code423n4 commented 2 years ago

Does not override _burn to delete remove balanceOf modifications

Should also remove balanceOf in _burn

Recommendation

Override _burn in PuttyNft.sol

    function _burn(uint256 id) internal virtual {
        address owner = _ownerOf[id];

        require(owner != address(0), "NOT_MINTED");

        delete _ownerOf[id];

        delete getApproved[id];

        emit Transfer(owner, address(0), id);
    }
HickupHH3 commented 2 years ago

Not a gas optimization.