-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Lazy setting of bridged tokens metadata (#43)
- Loading branch information
1 parent
ec4a47d
commit 9b862b1
Showing
5 changed files
with
149 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
pragma solidity 0.7.5; | ||
|
||
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; | ||
import "../interfaces/IERC1155TokenReceiver.sol"; | ||
|
||
contract NFTWithoutMetadata { | ||
function safeTransferFrom( | ||
address _from, | ||
address _to, | ||
uint256 _id, | ||
bytes memory _data | ||
) external { | ||
IERC721Receiver to = IERC721Receiver(_to); | ||
require(to.onERC721Received(msg.sender, _from, _id, _data) == to.onERC721Received.selector); | ||
} | ||
|
||
function safeTransferFrom( | ||
address _from, | ||
address _to, | ||
uint256 _id, | ||
uint256 _amount, | ||
bytes memory _data | ||
) external { | ||
IERC1155TokenReceiver to = IERC1155TokenReceiver(_to); | ||
require(to.onERC1155Received(msg.sender, _from, _id, _amount, _data) == to.onERC1155Received.selector); | ||
} | ||
|
||
function balanceOf(address, uint256) external view returns (uint256) { | ||
return 1000; | ||
} | ||
|
||
function ownerOf(uint256) external view returns (address) { | ||
return msg.sender; | ||
} | ||
} |
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