文件 1 的 21:Address.sol
pragma solidity ^0.8.1;
library Address {
function isContract(address account) internal view returns (bool) {
return account.code.length > 0;
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(success, returndata, errorMessage);
}
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(success, returndata, errorMessage);
}
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResult(success, returndata, errorMessage);
}
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
if (returndata.length > 0) {
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
文件 2 的 21:Context.sol
pragma solidity ^0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
文件 3 的 21:ERC165.sol
pragma solidity ^0.8.0;
import "./IERC165.sol";
abstract contract ERC165 is IERC165 {
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}
文件 4 的 21:ERC721.sol
pragma solidity ^0.8.0;
import "./IERC721.sol";
import "./IERC721Receiver.sol";
import "./extensions/IERC721Metadata.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/Strings.sol";
import "../../utils/introspection/ERC165.sol";
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
string private _name;
string private _symbol;
mapping(uint256 => address) private _owners;
mapping(address => uint256) private _balances;
mapping(uint256 => address) private _tokenApprovals;
mapping(address => mapping(address => bool)) private _operatorApprovals;
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
return
interfaceId == type(IERC721).interfaceId ||
interfaceId == type(IERC721Metadata).interfaceId ||
super.supportsInterface(interfaceId);
}
function balanceOf(address owner) public view virtual override returns (uint256) {
require(owner != address(0), "ERC721: balance query for the zero address");
return _balances[owner];
}
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
address owner = _owners[tokenId];
require(owner != address(0), "ERC721: owner query for nonexistent token");
return owner;
}
function name() public view virtual override returns (string memory) {
return _name;
}
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");
string memory baseURI = _baseURI();
return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : "";
}
function _baseURI() internal view virtual returns (string memory) {
return "";
}
function approve(address to, uint256 tokenId) public virtual override {
address owner = ERC721.ownerOf(tokenId);
require(to != owner, "ERC721: approval to current owner");
require(
_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
"ERC721: approve caller is not owner nor approved for all"
);
_approve(to, tokenId);
}
function getApproved(uint256 tokenId) public view virtual override returns (address) {
require(_exists(tokenId), "ERC721: approved query for nonexistent token");
return _tokenApprovals[tokenId];
}
function setApprovalForAll(address operator, bool approved) public virtual override {
_setApprovalForAll(_msgSender(), operator, approved);
}
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
return _operatorApprovals[owner][operator];
}
function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_transfer(from, to, tokenId);
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
safeTransferFrom(from, to, tokenId, "");
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public virtual override {
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_safeTransfer(from, to, tokenId, _data);
}
function _safeTransfer(
address from,
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_transfer(from, to, tokenId);
require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
}
function _exists(uint256 tokenId) internal view virtual returns (bool) {
return _owners[tokenId] != address(0);
}
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
require(_exists(tokenId), "ERC721: operator query for nonexistent token");
address owner = ERC721.ownerOf(tokenId);
return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender);
}
function _safeMint(address to, uint256 tokenId) internal virtual {
_safeMint(to, tokenId, "");
}
function _safeMint(
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_mint(to, tokenId);
require(
_checkOnERC721Received(address(0), to, tokenId, _data),
"ERC721: transfer to non ERC721Receiver implementer"
);
}
function _mint(address to, uint256 tokenId) internal virtual {
require(to != address(0), "ERC721: mint to the zero address");
require(!_exists(tokenId), "ERC721: token already minted");
_beforeTokenTransfer(address(0), to, tokenId);
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(address(0), to, tokenId);
_afterTokenTransfer(address(0), to, tokenId);
}
function _burn(uint256 tokenId) internal virtual {
address owner = ERC721.ownerOf(tokenId);
_beforeTokenTransfer(owner, address(0), tokenId);
_approve(address(0), tokenId);
_balances[owner] -= 1;
delete _owners[tokenId];
emit Transfer(owner, address(0), tokenId);
_afterTokenTransfer(owner, address(0), tokenId);
}
function _transfer(
address from,
address to,
uint256 tokenId
) internal virtual {
require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner");
require(to != address(0), "ERC721: transfer to the zero address");
_beforeTokenTransfer(from, to, tokenId);
_approve(address(0), tokenId);
_balances[from] -= 1;
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(from, to, tokenId);
_afterTokenTransfer(from, to, tokenId);
}
function _approve(address to, uint256 tokenId) internal virtual {
_tokenApprovals[tokenId] = to;
emit Approval(ERC721.ownerOf(tokenId), to, tokenId);
}
function _setApprovalForAll(
address owner,
address operator,
bool approved
) internal virtual {
require(owner != operator, "ERC721: approve to caller");
_operatorApprovals[owner][operator] = approved;
emit ApprovalForAll(owner, operator, approved);
}
function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
if (to.isContract()) {
try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
return retval == IERC721Receiver.onERC721Received.selector;
} catch (bytes memory reason) {
if (reason.length == 0) {
revert("ERC721: transfer to non ERC721Receiver implementer");
} else {
assembly {
revert(add(32, reason), mload(reason))
}
}
}
} else {
return true;
}
}
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
function _afterTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
}
文件 5 的 21:IERC1155.sol
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
interface IERC1155 is IERC165 {
event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);
event TransferBatch(
address indexed operator,
address indexed from,
address indexed to,
uint256[] ids,
uint256[] values
);
event ApprovalForAll(address indexed account, address indexed operator, bool approved);
event URI(string value, uint256 indexed id);
function balanceOf(address account, uint256 id) external view returns (uint256);
function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)
external
view
returns (uint256[] memory);
function setApprovalForAll(address operator, bool approved) external;
function isApprovedForAll(address account, address operator) external view returns (bool);
function safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes calldata data
) external;
function safeBatchTransferFrom(
address from,
address to,
uint256[] calldata ids,
uint256[] calldata amounts,
bytes calldata data
) external;
}
文件 6 的 21:IERC165.sol
pragma solidity ^0.8.0;
interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
文件 7 的 21:IERC20.sol
pragma solidity ^0.8.0;
interface IERC20 {
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address to, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address from,
address to,
uint256 amount
) external returns (bool);
}
文件 8 的 21:IERC721.sol
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
interface IERC721 is IERC165 {
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
function balanceOf(address owner) external view returns (uint256 balance);
function ownerOf(uint256 tokenId) external view returns (address owner);
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
function approve(address to, uint256 tokenId) external;
function setApprovalForAll(address operator, bool _approved) external;
function getApproved(uint256 tokenId) external view returns (address operator);
function isApprovedForAll(address owner, address operator) external view returns (bool);
}
文件 9 的 21:IERC721Metadata.sol
pragma solidity ^0.8.0;
import "../IERC721.sol";
interface IERC721Metadata is IERC721 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function tokenURI(uint256 tokenId) external view returns (string memory);
}
文件 10 的 21:IERC721Receiver.sol
pragma solidity ^0.8.0;
interface IERC721Receiver {
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
文件 11 的 21:IWNS_Passes.sol
pragma solidity ^0.8.2;
import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
interface IWNS_Passes is IERC1155 {
function burnTypeBulk(uint256 _typeId, address[] calldata owners) external;
function burnTypeForOwnerAddress(uint256 _typeId, uint256 _quantity, address _typeOwnerAddress) external returns (bool);
function mintTypeToAddress(uint256 _typeId, uint256 _quantity, address _toAddress) external returns (bool);
function bulkSafeTransfer(uint256 _typeId, uint256 _quantityPerRecipient, address[] calldata recipients) external;
}
文件 12 的 21:IWRLD_Name_Service_Bridge.sol
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/utils/introspection/IERC165.sol";
interface IWRLD_Name_Service_Bridge is IERC165 {
function transfer(address from, address to, uint256 tokenId, string memory name) external;
function extendRegistration(string[] calldata _names, uint16[] calldata _additionalYears) external;
function setController(string calldata _name, address _controller) external;
function setStringRecord(string calldata _name, string calldata _record, string calldata _value, string calldata _typeOf, uint256 _ttl) external;
function setAddressRecord(string memory _name, string memory _record, address _value, uint256 _ttl) external;
function setUintRecord(string calldata _name, string calldata _record, uint256 _value, uint256 _ttl) external;
function setIntRecord(string calldata _name, string calldata _record, int256 _value, uint256 _ttl) external;
function setStringEntry(address _setter, string calldata _name, string calldata _entry, string calldata _value) external;
function setAddressEntry(address _setter, string calldata _name, string calldata _entry, address _value) external;
function setUintEntry(address _setter, string calldata _name, string calldata _entry, uint256 _value) external;
function setIntEntry(address _setter, string calldata _name, string calldata _entry, int256 _value) external;
function migrate(string calldata _name, uint256 _networkFlags) external;
}
文件 13 的 21:IWRLD_Name_Service_Metadata.sol
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/utils/introspection/IERC165.sol";
interface IWRLD_Name_Service_Metadata is IERC165 {
function getMetadata(string memory _name, uint256 _expiresAt) external view returns (string memory);
function getImage(string memory _name, uint256 _expiresAt) external view returns (string memory);
}
文件 14 的 21:IWRLD_Name_Service_Registry.sol
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/utils/introspection/IERC165.sol";
interface IWRLD_Name_Service_Registry is IERC165 {
function register(address _registerer, string[] calldata _names, uint16[] memory _registrationYears) external;
function extendRegistration(string[] calldata _names, uint16[] calldata _additionalYears) external;
function getNameTokenId(string calldata _name) external view returns (uint256);
event NameRegistered(string indexed idxName, string name, uint16 registrationYears);
event NameRegistrationExtended(string indexed idxName, string name, uint16 additionalYears);
event NameControllerUpdated(string indexed idxName, string name, address controller);
event ResolverStringRecordUpdated(string indexed idxName, string name, string record, string value, string typeOf, uint256 ttl, address resolver);
event ResolverAddressRecordUpdated(string indexed idxName, string name, string record, address value, uint256 ttl, address resolver);
event ResolverUintRecordUpdated(string indexed idxName, string name, string record, uint256 value, uint256 ttl, address resolver);
event ResolverIntRecordUpdated(string indexed idxName, string name, string record, int256 value, uint256 ttl, address resolver);
event ResolverStringEntryUpdated(address indexed setter, string indexed idxName, string indexed idxEntry, string name, string entry, string value);
event ResolverAddressEntryUpdated(address indexed setter, string indexed idxName, string indexed idxEntry, string name, string entry, address value);
event ResolverUintEntryUpdated(address indexed setter, string indexed idxName, string indexed idxEntry, string name, string entry, uint256 value);
event ResolverIntEntryUpdated(address indexed setter, string indexed idxName, string indexed idxEntry, string name, string entry, int256 value);
}
文件 15 的 21:IWRLD_Name_Service_Resolver.sol
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/utils/introspection/IERC165.sol";
import "./IWRLD_Records.sol";
interface IWRLD_Name_Service_Resolver is IERC165, IWRLD_Records {
function setStringRecord(string calldata _name, string calldata _record, string calldata _value, string calldata _typeOf, uint256 _ttl) external;
function getNameStringRecord(string calldata _name, string calldata _record) external view returns (StringRecord memory);
function getNameStringRecordsList(string calldata _name) external view returns (string[] memory);
function getNameStringRecordsListPaginated(string calldata _name, uint256 _offset, uint256 _limit) external view returns (string[] memory);
function setAddressRecord(string memory _name, string memory _record, address _value, uint256 _ttl) external;
function getNameAddressRecord(string calldata _name, string calldata _record) external view returns (AddressRecord memory);
function getNameAddressRecordsList(string calldata _name) external view returns (string[] memory);
function getNameAddressRecordsListPaginated(string calldata _name, uint256 _offset, uint256 _limit) external view returns (string[] memory);
function setUintRecord(string calldata _name, string calldata _record, uint256 _value, uint256 _ttl) external;
function getNameUintRecord(string calldata _name, string calldata _record) external view returns (UintRecord memory);
function getNameUintRecordsList(string calldata _name) external view returns (string[] memory);
function getNameUintRecordsListPaginated(string calldata _name, uint256 _offset, uint256 _limit) external view returns (string[] memory);
function setIntRecord(string calldata _name, string calldata _record, int256 _value, uint256 _ttl) external;
function getNameIntRecord(string calldata _name, string calldata _record) external view returns (IntRecord memory);
function getNameIntRecordsList(string calldata _name) external view returns (string[] memory);
function getNameIntRecordsListPaginated(string calldata _name, uint256 _offset, uint256 _limit) external view returns (string[] memory);
function setStringEntry(address _setter, string calldata _name, string calldata _entry, string calldata _value) external;
function getStringEntry(address _setter, string calldata _name, string calldata _entry) external view returns (string memory);
function setAddressEntry(address _setter, string calldata _name, string calldata _entry, address _value) external;
function getAddressEntry(address _setter, string calldata _name, string calldata _entry) external view returns (address);
function setUintEntry(address _setter, string calldata _name, string calldata _entry, uint256 _value) external;
function getUintEntry(address _setter, string calldata _name, string calldata _entry) external view returns (uint256);
function setIntEntry(address _setter, string calldata _name, string calldata _entry, int256 _value) external;
function getIntEntry(address _setter, string calldata _name, string calldata _entry) external view returns (int256);
event StringRecordUpdated(string indexed idxName, string name, string record, string value, string typeOf, uint256 ttl);
event AddressRecordUpdated(string indexed idxName, string name, string record, address value, uint256 ttl);
event UintRecordUpdated(string indexed idxName, string name, string record, uint256 value, uint256 ttl);
event IntRecordUpdated(string indexed idxName, string name, string record, int256 value, uint256 ttl);
event StringEntryUpdated(address indexed setter, string indexed idxName, string indexed idxEntry, string name, string entry, string value);
event AddressEntryUpdated(address indexed setter, string indexed idxName, string indexed idxEntry, string name, string entry, address value);
event UintEntryUpdated(address indexed setter, string indexed idxName, string indexed idxEntry, string name, string entry, uint256 value);
event IntEntryUpdated(address indexed setter, string indexed idxName, string indexed idxEntry, string name, string entry, int256 value);
}
文件 16 的 21:IWRLD_Records.sol
pragma solidity ^0.8.4;
interface IWRLD_Records {
struct StringRecord {
string value;
string typeOf;
uint256 ttl;
}
struct AddressRecord {
address value;
uint256 ttl;
}
struct UintRecord {
uint256 value;
uint256 ttl;
}
struct IntRecord {
int256 value;
uint256 ttl;
}
}
文件 17 的 21:Ownable.sol
pragma solidity ^0.8.0;
import "../utils/Context.sol";
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
_transferOwnership(_msgSender());
}
function owner() public view virtual returns (address) {
return _owner;
}
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
文件 18 的 21:ReentrancyGuard.sol
pragma solidity ^0.8.0;
abstract contract ReentrancyGuard {
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
modifier nonReentrant() {
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
_status = _ENTERED;
_;
_status = _NOT_ENTERED;
}
}
文件 19 的 21:StringUtils.sol
pragma solidity >=0.8.4;
library StringUtils {
function strlen(string memory s) internal pure returns (uint256) {
uint len;
uint i = 0;
uint bytelength = bytes(s).length;
for (len = 0; i < bytelength; len++) {
bytes1 b = bytes(s)[i];
if (b < 0x80) {
i += 1;
} else if (b < 0xE0) {
i += 2;
} else if (b < 0xF0) {
i += 3;
} else if (b < 0xF8) {
i += 4;
} else if (b < 0xFC) {
i += 5;
} else {
i += 6;
}
}
return len;
}
function validateUriCharset(string memory s) internal pure returns (bool) {
uint len;
uint i = 0;
uint bytelength = bytes(s).length;
bytes1 b0 = bytes(s)[0];
if (b0==0x2d||b0==0x5f||b0==0x7e) {
return false;
}
for (len = 0; i < bytelength; len++) {
bytes1 b = bytes(s)[i];
if (b < 0x80) {
i += 1;
if (b<0x2d||b==0x2e||b==0x2f||(b>=0x3a&&b<=0x40)||b==0x5b||b==0x5c||b==0x5d||b==0x5e||b==0x60||b==0x7b||b==0x7c||b==0x7d||b==0x7f) {
return false;
}
} else if (b < 0xE0) {
i += 2;
} else if (b < 0xF0) {
i += 3;
} else if (b < 0xF8) {
i += 4;
} else if (b < 0xFC) {
i += 5;
} else {
i += 6;
}
}
return true;
}
function UTS46Normalize(string memory s) internal pure returns (string memory) {
uint len;
uint i = 0;
uint bytelength = bytes(s).length;
bytes1 b0 = bytes(s)[0];
if (b0==0x2d||b0==0x5f||b0==0x7e) {
revert("invalid charset");
}
for (len = 0; i < bytelength; len++) {
bytes1 b = bytes(s)[i];
if (b < 0x80) {
if (b<0x2d||b==0x2e||b==0x2f||(b>=0x3a&&b<=0x40)||b==0x5b||b==0x5c||b==0x5d||b==0x5e||b==0x60||b==0x7b||b==0x7c||b==0x7d||b==0x7f) {
revert("invalid charset");
}
if (b>=0x41&&b<=0x5a) {
bytes(s)[i] = bytes1(uint8(b) + 32);
}
i += 1;
} else if (b < 0xE0) {
i += 2;
} else if (b < 0xF0) {
i += 3;
} else if (b < 0xF8) {
i += 4;
} else if (b < 0xFC) {
i += 5;
} else {
i += 6;
}
}
return s;
}
}
文件 20 的 21:Strings.sol
pragma solidity ^0.8.0;
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
function toString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
function toHexString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0x00";
}
uint256 temp = value;
uint256 length = 0;
while (temp != 0) {
length++;
temp >>= 8;
}
return toHexString(value, length);
}
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _HEX_SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
}
文件 21 的 21:WRLD_Name_Service_Registry.sol
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "./IWNS_Passes.sol";
import "./IWRLD_Name_Service_Bridge.sol";
import "./IWRLD_Name_Service_Metadata.sol";
import "./IWRLD_Name_Service_Resolver.sol";
import "./IWRLD_Name_Service_Registry.sol";
import "./StringUtils.sol";
contract WRLD_Name_Service_Registry is ERC721, IWRLD_Name_Service_Registry, IWRLD_Records, Ownable, ReentrancyGuard {
using StringUtils for *;
IWRLD_Name_Service_Metadata metadata;
IWRLD_Name_Service_Resolver resolver;
IWRLD_Name_Service_Bridge bridge;
uint256 private constant YEAR_SECONDS = 31557600;
mapping(uint256 => WRLDName) public wrldNames;
mapping(string => uint256) private nameTokenId;
address private approvedWithdrawer;
mapping(address => bool) private approvedRegistrars;
struct WRLDName {
string name;
address controller;
uint256 expiresAt;
}
constructor() ERC721("WRLD Name Service", "WNS") {}
function tokenURI(uint256 _tokenId) override public view returns (string memory) {
require(_exists(_tokenId), "ERC721Metadata: URI query for nonexistent token");
return metadata.getMetadata(wrldNames[_tokenId].name, wrldNames[_tokenId].expiresAt);
}
function register(address _registerer, string[] calldata _names, uint16[] memory _registrationYears) external override isApprovedRegistrar {
require(_names.length == _registrationYears.length, "Arg size mismatched");
for (uint256 i = 0; i < _names.length; i++) {
require(_registrationYears[i] > 0 && _registrationYears[i] <= 100, "Years must be between 1 and 100");
string memory name = _names[i].UTS46Normalize();
uint256 expiresAt = block.timestamp + YEAR_SECONDS * _registrationYears[i];
uint256 tokenId = _generateNameId(name);
if (_exists(tokenId)) {
require(wrldNames[tokenId].expiresAt < block.timestamp, "Unavailable name");
_burn(tokenId);
}
wrldNames[tokenId] = WRLDName(name, address(0), expiresAt);
nameTokenId[name] = tokenId;
_safeMint(_registerer, tokenId);
emit NameRegistered(name, name, _registrationYears[i]);
}
}
function extendRegistration(string[] memory _names, uint16[] calldata _additionalYears) external override isApprovedRegistrar {
require(_names.length == _additionalYears.length, "Arg size mismatched");
for (uint256 i = 0; i < _names.length; i++) {
require(_additionalYears[i] > 0, "Years must be greater than zero");
_names[i] = _names[i].UTS46Normalize();
WRLDName storage wrldName = wrldNames[nameTokenId[_names[i]]];
wrldName.expiresAt = wrldName.expiresAt + YEAR_SECONDS * _additionalYears[i];
emit NameRegistrationExtended(_names[i], _names[i], _additionalYears[i]);
}
if (_hasBridge()) {
bridge.extendRegistration(_names, _additionalYears);
}
}
function nameAvailable(string memory _name) external view normalizeName(_name) returns (bool) {
return !nameExists(_name) || getNameExpiration(_name) < block.timestamp;
}
function nameExists(string memory _name) public view normalizeName(_name) returns (bool) {
return nameTokenId[_name] != 0;
}
function getNameTokenId(string memory _name) external view override normalizeName(_name) returns (uint256) {
return nameTokenId[_name];
}
function getTokenName(uint256 _tokenId) external view returns (string memory) {
return wrldNames[_tokenId].name;
}
function getName(string memory _name) external view normalizeName(_name) returns (WRLDName memory) {
return wrldNames[nameTokenId[_name]];
}
function getNameOwner(string memory _name) public view normalizeName(_name) returns (address) {
return ownerOf(nameTokenId[_name]);
}
function getNameController(string memory _name) public view normalizeName(_name) returns (address) {
return wrldNames[nameTokenId[_name]].controller;
}
function getNameExpiration(string memory _name) public view normalizeName(_name) returns (uint256) {
return wrldNames[nameTokenId[_name]].expiresAt;
}
function getNameStringRecord(string memory _name, string calldata _record) external view normalizeName(_name) returns (StringRecord memory) {
return resolver.getNameStringRecord(_name, _record);
}
function getNameStringRecordsList(string memory _name) external view normalizeName(_name) returns (string[] memory) {
return resolver.getNameStringRecordsList(_name);
}
function getNameStringRecordsListPaginated(string calldata _name, uint256 _offset, uint256 _limit) external view returns (string[] memory) {
return resolver.getNameStringRecordsListPaginated(_name, _offset, _limit);
}
function getNameAddressRecord(string memory _name, string calldata _record) external view normalizeName(_name) returns (AddressRecord memory) {
return resolver.getNameAddressRecord(_name, _record);
}
function getNameAddressRecordsList(string memory _name) external view normalizeName(_name) returns (string[] memory) {
return resolver.getNameAddressRecordsList(_name);
}
function getNameAddressRecordsListPaginated(string calldata _name, uint256 _offset, uint256 _limit) external view returns (string[] memory) {
return resolver.getNameAddressRecordsListPaginated(_name, _offset, _limit);
}
function getNameUintRecord(string memory _name, string calldata _record) external view normalizeName(_name) returns (UintRecord memory) {
return resolver.getNameUintRecord(_name, _record);
}
function getNameUintRecordsList(string memory _name) external view normalizeName(_name) returns (string[] memory) {
return resolver.getNameUintRecordsList(_name);
}
function getNameUintRecordsListPaginated(string calldata _name, uint256 _offset, uint256 _limit) external view returns (string[] memory) {
return resolver.getNameUintRecordsListPaginated(_name, _offset, _limit);
}
function getNameIntRecord(string memory _name, string calldata _record) external view normalizeName(_name) returns (IntRecord memory) {
return resolver.getNameIntRecord(_name, _record);
}
function getNameIntRecordsList(string memory _name) external view normalizeName(_name) returns (string[] memory) {
return resolver.getNameIntRecordsList(_name);
}
function getNameIntRecordsListPaginated(string calldata _name, uint256 _offset, uint256 _limit) external view returns (string[] memory) {
return resolver.getNameIntRecordsListPaginated(_name, _offset, _limit);
}
function getStringEntry(address _setter, string memory _name, string calldata _entry) external view normalizeName(_name) returns (string memory) {
return resolver.getStringEntry(_setter, _name, _entry);
}
function getAddressEntry(address _setter, string memory _name, string calldata _entry) external view normalizeName(_name) returns (address) {
return resolver.getAddressEntry(_setter, _name, _entry);
}
function getUintEntry(address _setter, string memory _name, string calldata _entry) external view normalizeName(_name) returns (uint256) {
return resolver.getUintEntry(_setter, _name, _entry);
}
function getIntEntry(address _setter, string memory _name, string calldata _entry) external view normalizeName(_name) returns (int256) {
return resolver.getIntEntry(_setter, _name, _entry);
}
function migrate(string memory _name, uint256 _networkFlags) external normalizeName(_name) isOwnerOrController(_name) {
require(_hasBridge(), "Bridge not set");
bridge.migrate(_name, _networkFlags);
}
function setController(string memory _name, address _controller) external normalizeName(_name) {
require(getNameOwner(_name) == msg.sender, "Sender is not owner");
wrldNames[nameTokenId[_name]].controller = _controller;
emit NameControllerUpdated(_name, _name, _controller);
if (_hasBridge()) {
bridge.setController(_name, _controller);
}
}
function setStringRecord(string memory _name, string calldata _record, string calldata _value, string calldata _typeOf, uint256 _ttl) external normalizeName(_name) isOwnerOrController(_name) {
resolver.setStringRecord(_name, _record, _value, _typeOf, _ttl);
emit ResolverStringRecordUpdated(_name, _name, _record, _value, _typeOf, _ttl, address(resolver));
if (_hasBridge()) {
bridge.setStringRecord(_name, _record, _value, _typeOf, _ttl);
}
}
function setAddressRecord(string memory _name, string memory _record, address _value, uint256 _ttl) external normalizeName(_name) isOwnerOrController(_name) {
resolver.setAddressRecord(_name, _record, _value, _ttl);
emit ResolverAddressRecordUpdated(_name, _name, _record, _value, _ttl, address(resolver));
if (_hasBridge()) {
bridge.setAddressRecord(_name, _record, _value, _ttl);
}
}
function setUintRecord(string memory _name, string calldata _record, uint256 _value, uint256 _ttl) external normalizeName(_name) isOwnerOrController(_name) {
resolver.setUintRecord(_name, _record, _value, _ttl);
emit ResolverUintRecordUpdated(_name, _name, _record, _value, _ttl, address(resolver));
if (_hasBridge()) {
bridge.setUintRecord(_name, _record, _value, _ttl);
}
}
function setIntRecord(string memory _name, string calldata _record, int256 _value, uint256 _ttl) external normalizeName(_name) isOwnerOrController(_name) {
resolver.setIntRecord(_name, _record, _value, _ttl);
emit ResolverIntRecordUpdated(_name, _name, _record, _value, _ttl, address(resolver));
if (_hasBridge()) {
bridge.setIntRecord(_name, _record, _value, _ttl);
}
}
function setStringEntry(string memory _name, string calldata _entry, string calldata _value) external normalizeName(_name) {
resolver.setStringEntry(msg.sender, _name, _entry, _value);
emit ResolverStringEntryUpdated(msg.sender, _name, _entry, _name, _entry, _value);
if (_hasBridge()) {
bridge.setStringEntry(msg.sender, _name, _entry, _value);
}
}
function setAddressEntry(string memory _name, string calldata _entry, address _value) external normalizeName(_name) {
resolver.setAddressEntry(msg.sender, _name, _entry, _value);
emit ResolverAddressEntryUpdated(msg.sender, _name, _entry, _name, _entry, _value);
if (_hasBridge()) {
bridge.setAddressEntry(msg.sender, _name, _entry, _value);
}
}
function setUintEntry(string memory _name, string calldata _entry, uint256 _value) external normalizeName(_name) {
resolver.setUintEntry(msg.sender, _name, _entry, _value);
emit ResolverUintEntryUpdated(msg.sender, _name, _entry, _name, _entry, _value);
if (_hasBridge()) {
bridge.setUintEntry(msg.sender, _name, _entry, _value);
}
}
function setIntEntry(string memory _name, string calldata _entry, int256 _value) external normalizeName(_name) {
resolver.setIntEntry(msg.sender, _name, _entry, _value);
emit ResolverIntEntryUpdated(msg.sender, _name, _entry, _name, _entry, _value);
if (_hasBridge()) {
bridge.setIntEntry(msg.sender, _name, _entry, _value);
}
}
function setApprovedWithdrawer(address _approvedWithdrawer) external onlyOwner {
approvedWithdrawer = _approvedWithdrawer;
}
function setApprovedRegistrar(address _approvedRegistrar, bool _approved) external onlyOwner {
approvedRegistrars[_approvedRegistrar] = _approved;
}
function setMetadataContract(address _metadata) external onlyOwner {
IWRLD_Name_Service_Metadata metadataContract = IWRLD_Name_Service_Metadata(_metadata);
require(metadataContract.supportsInterface(type(IWRLD_Name_Service_Metadata).interfaceId), "Invalid metadata contract");
metadata = metadataContract;
}
function setResolverContract(address _resolver) external onlyOwner {
IWRLD_Name_Service_Resolver resolverContract = IWRLD_Name_Service_Resolver(_resolver);
require(resolverContract.supportsInterface(type(IWRLD_Name_Service_Resolver).interfaceId), "Invalid resolver contract");
resolver = resolverContract;
}
function setBridgeContract(address _bridge) external onlyOwner {
IWRLD_Name_Service_Bridge bridgeContract = IWRLD_Name_Service_Bridge(_bridge);
require(bridgeContract.supportsInterface(type(IWRLD_Name_Service_Bridge).interfaceId), "Invalid bridge contract");
bridge = bridgeContract;
}
function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal override {
WRLDName storage wrldName = wrldNames[tokenId];
wrldName.controller = to;
resolver.setAddressRecord(wrldName.name, "evm_default", to, 3600);
emit ResolverAddressRecordUpdated(wrldName.name, wrldName.name, "evm_default", to, 3600, address(resolver));
if (_hasBridge()) {
bridge.transfer(from, to, tokenId, wrldName.name);
}
super._beforeTokenTransfer(from, to, tokenId);
}
function _hasBridge() private view returns (bool) {
return address(bridge) != address(0);
}
function _generateNameId(string memory _name) private pure returns (uint256) {
return uint256(uint160(uint256(keccak256(bytes(_name)))));
}
modifier isApprovedRegistrar() {
require(approvedRegistrars[msg.sender], "msg sender is not registrar");
_;
}
modifier isOwnerOrController(string memory _name) {
require((getNameOwner(_name) == msg.sender || getNameController(_name) == msg.sender), "Sender is not owner or controller");
_;
}
modifier normalizeName(string memory _name) {
_name = _name.UTS46Normalize();
_;
}
}
{
"compilationTarget": {
"contracts/WRLD_Name_Service_Registry.sol": "WRLD_Name_Service_Registry"
},
"evmVersion": "istanbul",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": true,
"runs": 800
},
"remappings": []
}
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"string","name":"idxName","type":"string"},{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"address","name":"controller","type":"address"}],"name":"NameControllerUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"string","name":"idxName","type":"string"},{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"uint16","name":"registrationYears","type":"uint16"}],"name":"NameRegistered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"string","name":"idxName","type":"string"},{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"uint16","name":"additionalYears","type":"uint16"}],"name":"NameRegistrationExtended","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"setter","type":"address"},{"indexed":true,"internalType":"string","name":"idxName","type":"string"},{"indexed":true,"internalType":"string","name":"idxEntry","type":"string"},{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"string","name":"entry","type":"string"},{"indexed":false,"internalType":"address","name":"value","type":"address"}],"name":"ResolverAddressEntryUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"string","name":"idxName","type":"string"},{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"string","name":"record","type":"string"},{"indexed":false,"internalType":"address","name":"value","type":"address"},{"indexed":false,"internalType":"uint256","name":"ttl","type":"uint256"},{"indexed":false,"internalType":"address","name":"resolver","type":"address"}],"name":"ResolverAddressRecordUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"setter","type":"address"},{"indexed":true,"internalType":"string","name":"idxName","type":"string"},{"indexed":true,"internalType":"string","name":"idxEntry","type":"string"},{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"string","name":"entry","type":"string"},{"indexed":false,"internalType":"int256","name":"value","type":"int256"}],"name":"ResolverIntEntryUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"string","name":"idxName","type":"string"},{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"string","name":"record","type":"string"},{"indexed":false,"internalType":"int256","name":"value","type":"int256"},{"indexed":false,"internalType":"uint256","name":"ttl","type":"uint256"},{"indexed":false,"internalType":"address","name":"resolver","type":"address"}],"name":"ResolverIntRecordUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"setter","type":"address"},{"indexed":true,"internalType":"string","name":"idxName","type":"string"},{"indexed":true,"internalType":"string","name":"idxEntry","type":"string"},{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"string","name":"entry","type":"string"},{"indexed":false,"internalType":"string","name":"value","type":"string"}],"name":"ResolverStringEntryUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"string","name":"idxName","type":"string"},{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"string","name":"record","type":"string"},{"indexed":false,"internalType":"string","name":"value","type":"string"},{"indexed":false,"internalType":"string","name":"typeOf","type":"string"},{"indexed":false,"internalType":"uint256","name":"ttl","type":"uint256"},{"indexed":false,"internalType":"address","name":"resolver","type":"address"}],"name":"ResolverStringRecordUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"setter","type":"address"},{"indexed":true,"internalType":"string","name":"idxName","type":"string"},{"indexed":true,"internalType":"string","name":"idxEntry","type":"string"},{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"string","name":"entry","type":"string"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"ResolverUintEntryUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"string","name":"idxName","type":"string"},{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"string","name":"record","type":"string"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"ttl","type":"uint256"},{"indexed":false,"internalType":"address","name":"resolver","type":"address"}],"name":"ResolverUintRecordUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string[]","name":"_names","type":"string[]"},{"internalType":"uint16[]","name":"_additionalYears","type":"uint16[]"}],"name":"extendRegistration","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_setter","type":"address"},{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_entry","type":"string"}],"name":"getAddressEntry","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_setter","type":"address"},{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_entry","type":"string"}],"name":"getIntEntry","outputs":[{"internalType":"int256","name":"","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_name","type":"string"}],"name":"getName","outputs":[{"components":[{"internalType":"string","name":"name","type":"string"},{"internalType":"address","name":"controller","type":"address"},{"internalType":"uint256","name":"expiresAt","type":"uint256"}],"internalType":"struct WRLD_Name_Service_Registry.WRLDName","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_record","type":"string"}],"name":"getNameAddressRecord","outputs":[{"components":[{"internalType":"address","name":"value","type":"address"},{"internalType":"uint256","name":"ttl","type":"uint256"}],"internalType":"struct IWRLD_Records.AddressRecord","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_name","type":"string"}],"name":"getNameAddressRecordsList","outputs":[{"internalType":"string[]","name":"","type":"string[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"uint256","name":"_offset","type":"uint256"},{"internalType":"uint256","name":"_limit","type":"uint256"}],"name":"getNameAddressRecordsListPaginated","outputs":[{"internalType":"string[]","name":"","type":"string[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_name","type":"string"}],"name":"getNameController","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_name","type":"string"}],"name":"getNameExpiration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_record","type":"string"}],"name":"getNameIntRecord","outputs":[{"components":[{"internalType":"int256","name":"value","type":"int256"},{"internalType":"uint256","name":"ttl","type":"uint256"}],"internalType":"struct IWRLD_Records.IntRecord","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_name","type":"string"}],"name":"getNameIntRecordsList","outputs":[{"internalType":"string[]","name":"","type":"string[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"uint256","name":"_offset","type":"uint256"},{"internalType":"uint256","name":"_limit","type":"uint256"}],"name":"getNameIntRecordsListPaginated","outputs":[{"internalType":"string[]","name":"","type":"string[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_name","type":"string"}],"name":"getNameOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_record","type":"string"}],"name":"getNameStringRecord","outputs":[{"components":[{"internalType":"string","name":"value","type":"string"},{"internalType":"string","name":"typeOf","type":"string"},{"internalType":"uint256","name":"ttl","type":"uint256"}],"internalType":"struct IWRLD_Records.StringRecord","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_name","type":"string"}],"name":"getNameStringRecordsList","outputs":[{"internalType":"string[]","name":"","type":"string[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"uint256","name":"_offset","type":"uint256"},{"internalType":"uint256","name":"_limit","type":"uint256"}],"name":"getNameStringRecordsListPaginated","outputs":[{"internalType":"string[]","name":"","type":"string[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_name","type":"string"}],"name":"getNameTokenId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_record","type":"string"}],"name":"getNameUintRecord","outputs":[{"components":[{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"ttl","type":"uint256"}],"internalType":"struct IWRLD_Records.UintRecord","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_name","type":"string"}],"name":"getNameUintRecordsList","outputs":[{"internalType":"string[]","name":"","type":"string[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"uint256","name":"_offset","type":"uint256"},{"internalType":"uint256","name":"_limit","type":"uint256"}],"name":"getNameUintRecordsListPaginated","outputs":[{"internalType":"string[]","name":"","type":"string[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_setter","type":"address"},{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_entry","type":"string"}],"name":"getStringEntry","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"getTokenName","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_setter","type":"address"},{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_entry","type":"string"}],"name":"getUintEntry","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"uint256","name":"_networkFlags","type":"uint256"}],"name":"migrate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_name","type":"string"}],"name":"nameAvailable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_name","type":"string"}],"name":"nameExists","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_registerer","type":"address"},{"internalType":"string[]","name":"_names","type":"string[]"},{"internalType":"uint16[]","name":"_registrationYears","type":"uint16[]"}],"name":"register","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_entry","type":"string"},{"internalType":"address","name":"_value","type":"address"}],"name":"setAddressEntry","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_record","type":"string"},{"internalType":"address","name":"_value","type":"address"},{"internalType":"uint256","name":"_ttl","type":"uint256"}],"name":"setAddressRecord","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_approvedRegistrar","type":"address"},{"internalType":"bool","name":"_approved","type":"bool"}],"name":"setApprovedRegistrar","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_approvedWithdrawer","type":"address"}],"name":"setApprovedWithdrawer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_bridge","type":"address"}],"name":"setBridgeContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"address","name":"_controller","type":"address"}],"name":"setController","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_entry","type":"string"},{"internalType":"int256","name":"_value","type":"int256"}],"name":"setIntEntry","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_record","type":"string"},{"internalType":"int256","name":"_value","type":"int256"},{"internalType":"uint256","name":"_ttl","type":"uint256"}],"name":"setIntRecord","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_metadata","type":"address"}],"name":"setMetadataContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_resolver","type":"address"}],"name":"setResolverContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_entry","type":"string"},{"internalType":"string","name":"_value","type":"string"}],"name":"setStringEntry","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_record","type":"string"},{"internalType":"string","name":"_value","type":"string"},{"internalType":"string","name":"_typeOf","type":"string"},{"internalType":"uint256","name":"_ttl","type":"uint256"}],"name":"setStringRecord","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_entry","type":"string"},{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"setUintEntry","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_record","type":"string"},{"internalType":"uint256","name":"_value","type":"uint256"},{"internalType":"uint256","name":"_ttl","type":"uint256"}],"name":"setUintRecord","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"wrldNames","outputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"address","name":"controller","type":"address"},{"internalType":"uint256","name":"expiresAt","type":"uint256"}],"stateMutability":"view","type":"function"}]