Skip to content

Commit

Permalink
Use pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
cygaar committed Jun 13, 2022
1 parent 223ebf9 commit d5308ee
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion contracts/ERC721A.sol
Original file line number Diff line number Diff line change
Expand Up @@ -508,9 +508,10 @@ contract ERC721A is IERC721A {
* @dev Zeroes out _tokenApprovals[tokenId]
*/
function deleteTokenApproval(uint256 tokenId) private {
mapping(uint256 => address) storage tokenApprovalPtr = _tokenApprovals;
assembly {
mstore(0, tokenId)
mstore(32, _tokenApprovals.slot)
mstore(32, tokenApprovalPtr.slot)
let hash := keccak256(0, 64)
sstore(hash, 0)
}
Expand Down

0 comments on commit d5308ee

Please sign in to comment.