From d59abbfc61ae2c897c99695d78f5c58d84104087 Mon Sep 17 00:00:00 2001 From: Martin Becze Date: Fri, 17 Nov 2023 22:02:02 +0100 Subject: [PATCH] implement relay metadata for shops --- src/store-reg.sol | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/store-reg.sol b/src/store-reg.sol index cfad498..708d817 100644 --- a/src/store-reg.sol +++ b/src/store-reg.sol @@ -9,6 +9,8 @@ import "lib/delegatable-sol/contracts/Delegatable.sol"; contract Store is ERC721Enumerable, Delegatable { string public baseURI; mapping(uint256 => bytes32) public storeRootHash; + mapping(uint256 => string[]) public relays; + constructor( string memory _name, @@ -38,6 +40,17 @@ contract Store is ERC721Enumerable, Delegatable { storeRootHash[id] = hash; } + function updateRelays(uint256 id, string[] memory _relays) public { + address owner = _ownerOf(id); + require( + msg.sender == owner || + isApprovedForAll(owner, msg.sender) || + msg.sender == getApproved(id), + "NOT_AUTHORIZED" + ); + relays[id] = _relays; + } + function _msgSender() internal view