// gkc_hash_code : 01GJ46WV2DZAGQM3EVM8ZB69CM // SPDX-License-Identifier: MIT pragma solidity ^0.8.13; import "./interfaces/IDelegation.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; contract Registry is Initializable, AccessControlUpgradeable { struct Registration { uint256 tokenId; address identityAddress; } function __Registry_init() internal onlyInitializing {} function initialize() external virtual initializer { __Registry_init(); __AccessControl_init(); _grantRole(DEFAULT_ADMIN_ROLE, msg.sender); } mapping(address => Registration) public registers; function register(address account, uint256 tokenId, IDelegation identityAddress) external onlyRole(DEFAULT_ADMIN_ROLE) { // TODO: need require registers[account].tokenId = tokenId; registers[account].identityAddress = address(identityAddress); } function updateRegistration(address account, uint256 tokenId, IDelegation identityAddress) external onlyRole(DEFAULT_ADMIN_ROLE) { // TODO: need require registers[account].tokenId = tokenId; registers[account].identityAddress = address(identityAddress); } function removeRegistration(address account) external { // TODO: need require delete registers[account]; } function validateCredentials(uint256 tokenId, string message, uint8 v, bytes32 r, bytes32 s) external onlyRole(DEFAULT_ADMIN_ROLE) returns(bool) { /* TODO: 1.hash messagemessage 2.call function recover to return address 3. compare registers[account].tokenId with tokenId */ } }
0.7.1