Files
openzeppelin-contracts/contracts/mocks/ERC721ReceiverMock.sol
Nicolás Venturo 76abd1a41e Replaced Solium in favor of Solhint (#1575)
* Adding solhint, working on style fixes.

* Upgraded to solhint 1.5.0.

* Removed all references to Solium

* Updated mocks to make the pass the new linter rules.

* Reformatted the .solhint.json file a bit.

* Removed Solium configuration files.

* Remove Solium dependency.

* Add comment explaing disabled time rule in TokenVesting.

* Revert to the old (ugly?) style.

* Revert SignatureBouncerMock style.

* Fix ERC165InterfacesSupported interface.
2019-01-04 17:01:52 -03:00

24 lines
649 B
Solidity

pragma solidity ^0.5.0;
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 memory data)
public returns (bytes4)
{
require(!_reverts);
emit Received(operator, from, tokenId, data, gasleft());
return _retval;
}
}