Created
July 20, 2021 15:30
-
-
Save bogdan/c2f1203154404f3332d23685cc8aa580 to your computer and use it in GitHub Desktop.
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
contract ReverseResolver is CustomContext { | |
mapping (address => uint256) reverses; | |
IERC721 registry; | |
constructor(address_registry) { | |
registry = IERC721(_registry); | |
} | |
function reverseOf(address account) public view returns (uint256) { | |
uint tokenId = reverses[account]; | |
require(registry.ownerOf(tokenId) == account); | |
return tokenId; | |
} | |
function registerReverse(uint256 tokenId) public { | |
address sender = _msgSender(); | |
require(registry.ownerOf(tokenId) == sender); | |
reverses[sender] = tokenId; | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment