forked from aragon/aragon-apps
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Agent: add ERC721Receiver support (aragon#1058)
* Agent: add ERC721Receiver support * Lint * Test * Address review comments * cosmetic: small whitespace changes Co-authored-by: Brett Sun <qisheng.brett.sun@gmail.com>
- Loading branch information
Showing
3 changed files
with
48 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
pragma solidity 0.4.24; | ||
|
||
|
||
interface IERC721Receiver { | ||
/** | ||
* @notice Handle the receipt of an NFT | ||
* @dev The ERC721 smart contract calls this function on the recipient | ||
* after a {IERC721-safeTransferFrom}. This function MUST return the function selector, | ||
* otherwise the caller will revert the transaction. The selector to be | ||
* returned can be obtained as `this.onERC721Received.selector`. This | ||
* function MAY throw to revert and reject the transfer. | ||
* Note: the ERC721 contract address is always the message sender. | ||
* @param operator The address which called `safeTransferFrom` function | ||
* @param from The address which previously owned the token | ||
* @param tokenId The NFT identifier which is being transferred | ||
* @param data Additional data with no specified format | ||
* @return bytes4 `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))` | ||
*/ | ||
function onERC721Received(address operator, address from, uint256 tokenId, bytes data) external returns (bytes4); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters