* Updated code style to 4 spaces and 120 max characters per line. * Update contracts/token/ERC721/ERC721Pausable.sol Co-Authored-By: nventuro <nicolas.venturo@gmail.com> * Update contracts/token/ERC721/IERC721.sol Co-Authored-By: nventuro <nicolas.venturo@gmail.com>
22 lines
631 B
Solidity
22 lines
631 B
Solidity
pragma solidity ^0.4.24;
|
|
|
|
import "../token/ERC721/IERC721Receiver.sol";
|
|
|
|
contract ERC721ReceiverMock is IERC721Receiver {
|
|
bytes4 private _retval;
|
|
bool private _reverts;
|
|
|
|
event Received(address operator, address from, uint256 tokenId, bytes data, uint256 gas);
|
|
|
|
constructor (bytes4 retval, bool reverts) public {
|
|
_retval = retval;
|
|
_reverts = reverts;
|
|
}
|
|
|
|
function onERC721Received(address operator, address from, uint256 tokenId, bytes data) public returns (bytes4) {
|
|
require(!_reverts);
|
|
emit Received(operator, from, tokenId, data, gasleft());
|
|
return _retval;
|
|
}
|
|
}
|