This repository has been archived by the owner on Jan 12, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from MoMannn/dev
Additional tests and Xcert getAddresses fix.
- Loading branch information
Showing
7 changed files
with
129 additions
and
28 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
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,35 @@ | ||
pragma solidity ^0.4.19; | ||
|
||
import "../tokens/ERC721TokenReceiver.sol"; | ||
|
||
contract ERC721TokenReceiverMock is ERC721TokenReceiver { | ||
|
||
/* | ||
* @dev Magic value of a smart contract that can recieve NFToken. | ||
*/ | ||
bytes4 private constant MAGIC_ONERC721RECEIVED = bytes4( | ||
keccak256("onERC721Received(address,uint256,bytes)") | ||
); | ||
|
||
/* | ||
* @notice Handle the receipt of an NFT | ||
* @dev The ERC721 smart contract calls this function on the recipient | ||
* after a `transfer`. This function MAY throw to revert and reject the | ||
* transfer. This function MUST use 50,000 gas or less. Return of other | ||
* than the magic value MUST result in the transaction being reverted. | ||
* Note: the contract address is always the message sender. | ||
* @param _from The sending address | ||
* @param _tokenId The NFT identifier which is being transfered | ||
* @param data Additional data with no specified format | ||
* @return `bytes4(keccak256("onERC721Received(address,uint256,bytes)"))` | ||
* unless throwing | ||
*/ | ||
function onERC721Received(address _from, | ||
uint256 _tokenId, | ||
bytes data) | ||
external | ||
returns(bytes4) | ||
{ | ||
return MAGIC_ONERC721RECEIVED; | ||
} | ||
} |
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
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