Add constant modifier to ERC721_RECEIVED magic value

pull/803/head
Santiago Palladino 7 years ago
parent 15f9556622
commit b33299569b
  1. 5
      contracts/token/ERC721/ERC721BasicToken.sol
  2. 5
      contracts/token/ERC721/ERC721Receiver.sol

@ -13,8 +13,9 @@ contract ERC721BasicToken is ERC721Basic {
using SafeMath for uint256;
using AddressUtils for address;
// Equals to bytes4(keccak256("onERC721Received(address,uint256,bytes)"))
bytes4 ERC721_RECEIVED = 0xf0b9e5ba;
// Equals to `bytes4(keccak256("onERC721Received(address,uint256,bytes)"))`
// which can be also obtained as `ERC721Receiver(0).onERC721Received.selector`
bytes4 constant ERC721_RECEIVED = 0xf0b9e5ba;
// Mapping from token ID to owner
mapping (uint256 => address) internal tokenOwner;

@ -8,9 +8,10 @@ pragma solidity ^0.4.18;
contract ERC721Receiver {
/**
* @dev Magic value to be returned upon successful reception of an NFT
* Equals to bytes4(keccak256("onERC721Received(address,uint256,bytes)"))
* Equals to `bytes4(keccak256("onERC721Received(address,uint256,bytes)"))`,
* which can be also obtained as `ERC721Receiver(0).onERC721Received.selector`
*/
bytes4 ERC721_RECEIVED = 0xf0b9e5ba;
bytes4 constant ERC721_RECEIVED = 0xf0b9e5ba;
/**
* @notice Handle the receipt of an NFT

Loading…
Cancel
Save