More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 146 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Register | 19079410 | 322 days ago | IN | 0.00447471 ETH | 0.00290478 | ||||
Commit | 19079393 | 322 days ago | IN | 0 ETH | 0.0004119 | ||||
Commit | 19079382 | 322 days ago | IN | 0 ETH | 0.00038983 | ||||
Register | 19079371 | 322 days ago | IN | 0.00447471 ETH | 0.00366255 | ||||
Commit | 19079363 | 322 days ago | IN | 0 ETH | 0.00050157 | ||||
Register | 19079361 | 322 days ago | IN | 0.00447471 ETH | 0.00361305 | ||||
Commit | 19079353 | 322 days ago | IN | 0 ETH | 0.0005161 | ||||
Register | 19079338 | 322 days ago | IN | 0.00447471 ETH | 0.00477868 | ||||
Commit | 19079330 | 322 days ago | IN | 0 ETH | 0.00042354 | ||||
Register | 19079312 | 322 days ago | IN | 0.00447471 ETH | 0.00301046 | ||||
Commit | 19079304 | 322 days ago | IN | 0 ETH | 0.00043864 | ||||
Register | 19079293 | 322 days ago | IN | 0.00447194 ETH | 0.00320297 | ||||
Commit | 19079280 | 322 days ago | IN | 0 ETH | 0.00043395 | ||||
Register | 19079271 | 322 days ago | IN | 0.00447194 ETH | 0.00338538 | ||||
Commit | 19079261 | 322 days ago | IN | 0 ETH | 0.00042991 | ||||
Register | 19079234 | 322 days ago | IN | 0.0442226 ETH | 0.0032368 | ||||
Commit | 19079226 | 322 days ago | IN | 0 ETH | 0.00045074 | ||||
Register | 19079201 | 322 days ago | IN | 0.00447194 ETH | 0.00326371 | ||||
Commit | 19079193 | 322 days ago | IN | 0 ETH | 0.00046575 | ||||
Register | 19079159 | 322 days ago | IN | 0.04445796 ETH | 0.00330336 | ||||
Commit | 19079152 | 322 days ago | IN | 0 ETH | 0.00046765 | ||||
Register | 19078855 | 322 days ago | IN | 0.00445133 ETH | 0.00406882 | ||||
Commit | 19078835 | 322 days ago | IN | 0 ETH | 0.00047238 | ||||
Register | 19078831 | 322 days ago | IN | 0.00445133 ETH | 0.00346792 | ||||
Commit | 19078820 | 322 days ago | IN | 0 ETH | 0.00049829 |
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
19079410 | 322 days ago | 0.00040679 ETH | ||||
19079371 | 322 days ago | 0.00040679 ETH | ||||
19079361 | 322 days ago | 0.00040679 ETH | ||||
19079338 | 322 days ago | 0.00040679 ETH | ||||
19079312 | 322 days ago | 0.00040679 ETH | ||||
19079293 | 322 days ago | 0.00040654 ETH | ||||
19079271 | 322 days ago | 0.00040654 ETH | ||||
19079234 | 322 days ago | 0.00402023 ETH | ||||
19079201 | 322 days ago | 0.00040654 ETH | ||||
19079159 | 322 days ago | 0.00404163 ETH | ||||
19078855 | 322 days ago | 0.00040466 ETH | ||||
19078831 | 322 days ago | 0.00040466 ETH | ||||
19078812 | 322 days ago | 0.00040466 ETH | ||||
19078792 | 322 days ago | 0.00042855 ETH | ||||
19077930 | 322 days ago | 0.00040172 ETH | ||||
18924378 | 344 days ago | 0.00037998 ETH | ||||
18923778 | 344 days ago | 0.00037904 ETH | ||||
18923674 | 344 days ago | 0.00049567 ETH | ||||
18034793 | 468 days ago | 0.00052635 ETH | ||||
17909690 | 486 days ago | 0.00048913 ETH | ||||
17872512 | 491 days ago | 0.00077435 ETH | ||||
17872417 | 491 days ago | 0.00077596 ETH | ||||
17754734 | 507 days ago | 0.00076795 ETH | ||||
17751555 | 508 days ago | 0.000477 ETH | ||||
17453984 | 550 days ago | 0.00053595 ETH |
Loading...
Loading
Contract Name:
RootRegistrarController
Compiler Version
v0.8.17+commit.8df45f5f
Contract Source Code (Solidity Standard Json-Input format)
//SPDX-License-Identifier: MIT pragma solidity ~0.8.17; import {BaseRegistrarImplementation} from "./BaseRegistrarImplementation.sol"; import {StringUtils} from "./StringUtils.sol"; import {Resolver} from "../resolvers/Resolver.sol"; import {ReverseRegistrar} from "../registry/ReverseRegistrar.sol"; import {IRootRegistrarController, IPriceOracle} from "./IRootRegistrarController.sol"; import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import {Strings} from "@openzeppelin/contracts/utils/Strings.sol"; import {PaymentSplitter} from "@openzeppelin/contracts/finance/PaymentSplitter.sol"; import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol"; import {Address} from "@openzeppelin/contracts/utils/Address.sol"; import {INameWrapper} from "../wrapper/INameWrapper.sol"; import {ERC20Recoverable} from "../utils/ERC20Recoverable.sol"; import {IReservedDomains} from "./IReservedDomains.sol"; error CommitmentTooNew(bytes32 commitment); error CommitmentTooOld(bytes32 commitment); error NameNotAvailable(string name); error DurationTooShort(uint256 duration); error ResolverRequiredWhenDataSupplied(); error UnexpiredCommitmentExists(bytes32 commitment); error InsufficientValue(); error Unauthorised(bytes32 node); error MaxCommitmentAgeTooLow(); error MaxCommitmentAgeTooHigh(); /** * @dev A registrar controller for registering and renewing names at fixed cost. */ contract RootRegistrarController is IRootRegistrarController, IERC165, ERC20Recoverable, PaymentSplitter { using StringUtils for *; using Address for address; uint256 public constant MIN_REGISTRATION_DURATION = 28 days; bytes32 private constant ROOT_NODE = 0; uint64 private constant MAX_EXPIRY = type(uint64).max; uint256 public immutable START; BaseRegistrarImplementation immutable base; IPriceOracle public immutable prices; uint256 public immutable minCommitmentAge; uint256 public immutable maxCommitmentAge; ReverseRegistrar public immutable reverseRegistrar; INameWrapper public immutable nameWrapper; IReservedDomains public immutable reservedDomains; IERC721 public immutable BAYC; mapping(bytes32 => uint256) public commitments; event NameRegistered( string name, bytes32 indexed label, address indexed owner, uint256 baseCost, uint256 premium, uint256 expires ); event NameRenewed( string name, bytes32 indexed label, uint256 cost, uint256 expires ); constructor( BaseRegistrarImplementation _base, IPriceOracle _prices, uint256 _minCommitmentAge, uint256 _maxCommitmentAge, ReverseRegistrar _reverseRegistrar, INameWrapper _nameWrapper, IReservedDomains _reservedDomains, IERC721 _BAYC, address[] memory _payees, uint256[] memory _shares ) PaymentSplitter(_payees, _shares) { if (_maxCommitmentAge <= _minCommitmentAge) { revert MaxCommitmentAgeTooLow(); } if (_maxCommitmentAge > block.timestamp) { revert MaxCommitmentAgeTooHigh(); } base = _base; prices = _prices; minCommitmentAge = _minCommitmentAge; maxCommitmentAge = _maxCommitmentAge; reverseRegistrar = _reverseRegistrar; nameWrapper = _nameWrapper; reservedDomains = _reservedDomains; BAYC = _BAYC; START = block.timestamp; } function rentPrice(string memory name, uint256 duration) public view override returns (IPriceOracle.Price memory price) { bytes32 label = keccak256(bytes(name)); price = prices.price( name, base.nameExpires(uint256(label)), duration, reservedDomains.isSpecial(label) ); } function valid(string memory name) public pure returns (bool) { uint256 len = name.strlen(); return len >= 1 && len <= 63; } function available(string memory name) public view override returns (bool) { bytes32 label = keccak256(bytes(name)); return valid(name) && base.available(uint256(label)); } function availableNFT(uint256 id, address _address) public view override returns (bool) { if(id < 1000 || block.timestamp - START > 60 days){ return false; } try BAYC.ownerOf(id) returns (address owner){ if (owner == _address){ string memory name = Strings.toString(id); bytes32 label = keccak256(bytes(name)); return valid(name) && base.available(uint256(label)); } return false; } catch { return false; } } function makeCommitment( string memory name, address owner, uint256 duration, bytes32 secret, address resolver, bytes[] calldata data, bool reverseRecord, uint32 fuses, uint64 wrapperExpiry ) public pure override returns (bytes32) { bytes32 label = keccak256(bytes(name)); if (data.length > 0 && resolver == address(0)) { revert ResolverRequiredWhenDataSupplied(); } return keccak256( abi.encode( label, owner, duration, resolver, data, secret, reverseRecord, fuses, wrapperExpiry ) ); } function commit(bytes32 commitment) public override { if (commitments[commitment] + maxCommitmentAge >= block.timestamp) { revert UnexpiredCommitmentExists(commitment); } commitments[commitment] = block.timestamp; } function register( string calldata name, address owner, uint256 duration, bytes32 secret, address resolver, bytes[] calldata data, bool reverseRecord, uint32 fuses, uint64 wrapperExpiry ) external payable override { IPriceOracle.Price memory price = rentPrice(name, duration); if (msg.value < price.base + price.premium) { revert InsufficientValue(); } if (!available(name)) { revert NameNotAvailable(name); } _consumeCommitment( makeCommitment( name, owner, duration, secret, resolver, data, reverseRecord, fuses, wrapperExpiry ) ); if (duration < MIN_REGISTRATION_DURATION) { revert DurationTooShort(duration); } uint256 expires = nameWrapper.registerAndWrap( name, owner, duration, resolver, fuses, wrapperExpiry ); if (data.length > 0) { _setRecords(resolver, keccak256(bytes(name)), data); } if (reverseRecord) { _setReverseRecord(name, resolver, msg.sender); } emit NameRegistered( name, keccak256(bytes(name)), owner, price.base, price.premium, expires ); if (msg.value > (price.base + price.premium)) { payable(msg.sender).transfer( msg.value - (price.base + price.premium) ); } } function registerNFT( uint256 id, address owner, bytes32 secret, address resolver, bytes[] calldata data, bool reverseRecord, uint32 fuses, uint64 wrapperExpiry ) external override { string memory name = Strings.toString(id); if (!availableNFT(id, msg.sender)) { revert NameNotAvailable(name); } _consumeCommitment( makeCommitment( name, owner, 365 days, secret, resolver, data, reverseRecord, fuses, wrapperExpiry ) ); uint256 expires = nameWrapper.registerAndWrap( name, owner, 365 days, resolver, fuses, wrapperExpiry ); if (data.length > 0) { _setRecords(resolver, keccak256(bytes(name)), data); } if (reverseRecord) { _setReverseRecord(name, resolver, msg.sender); } emit NameRegistered( name, keccak256(bytes(name)), owner, 0, 0, expires ); } function renew(string calldata name, uint256 duration) external payable override { _renew(name, duration, 0, 0); } function renewWithFuses( string calldata name, uint256 duration, uint32 fuses, uint64 wrapperExpiry ) external payable { bytes32 labelhash = keccak256(bytes(name)); bytes32 nodehash = keccak256(abi.encodePacked(ROOT_NODE, labelhash)); if (!nameWrapper.isTokenOwnerOrApproved(nodehash, msg.sender)) { revert Unauthorised(nodehash); } _renew(name, duration, fuses, wrapperExpiry); } function _renew( string calldata name, uint256 duration, uint32 fuses, uint64 wrapperExpiry ) internal { bytes32 labelhash = keccak256(bytes(name)); uint256 tokenId = uint256(labelhash); IPriceOracle.Price memory price = rentPrice(name, duration); if (msg.value < price.base) { revert InsufficientValue(); } uint256 expires; expires = nameWrapper.renew(tokenId, duration, fuses, wrapperExpiry); if (msg.value > price.base) { payable(msg.sender).transfer(msg.value - price.base); } emit NameRenewed(name, labelhash, msg.value, expires); } function supportsInterface(bytes4 interfaceID) external pure returns (bool) { return interfaceID == type(IERC165).interfaceId || interfaceID == type(IRootRegistrarController).interfaceId; } /* Internal functions */ function _consumeCommitment( bytes32 commitment ) internal { // Require an old enough commitment. if (commitments[commitment] + minCommitmentAge > block.timestamp) { revert CommitmentTooNew(commitment); } // If the commitment is too old stop if (commitments[commitment] + maxCommitmentAge <= block.timestamp) { revert CommitmentTooOld(commitment); } delete (commitments[commitment]); } function _setRecords( address resolverAddress, bytes32 label, bytes[] calldata data ) internal { bytes32 nodehash = keccak256(abi.encodePacked(ROOT_NODE, label)); Resolver resolver = Resolver(resolverAddress); resolver.multicallWithNodeCheck(nodehash, data); } function _setReverseRecord( string memory name, address resolver, address owner ) internal { reverseRegistrar.setNameForAddr( msg.sender, owner, resolver, name ); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (finance/PaymentSplitter.sol) pragma solidity ^0.8.0; import "../token/ERC20/utils/SafeERC20.sol"; import "../utils/Address.sol"; import "../utils/Context.sol"; /** * @title PaymentSplitter * @dev This contract allows to split Ether payments among a group of accounts. The sender does not need to be aware * that the Ether will be split in this way, since it is handled transparently by the contract. * * The split can be in equal parts or in any other arbitrary proportion. The way this is specified is by assigning each * account to a number of shares. Of all the Ether that this contract receives, each account will then be able to claim * an amount proportional to the percentage of total shares they were assigned. The distribution of shares is set at the * time of contract deployment and can't be updated thereafter. * * `PaymentSplitter` follows a _pull payment_ model. This means that payments are not automatically forwarded to the * accounts but kept in this contract, and the actual transfer is triggered as a separate step by calling the {release} * function. * * NOTE: This contract assumes that ERC20 tokens will behave similarly to native tokens (Ether). Rebasing tokens, and * tokens that apply fees during transfers, are likely to not be supported as expected. If in doubt, we encourage you * to run tests before sending real value to this contract. */ contract PaymentSplitter is Context { event PayeeAdded(address account, uint256 shares); event PaymentReleased(address to, uint256 amount); event ERC20PaymentReleased(IERC20 indexed token, address to, uint256 amount); event PaymentReceived(address from, uint256 amount); uint256 private _totalShares; uint256 private _totalReleased; mapping(address => uint256) private _shares; mapping(address => uint256) private _released; address[] private _payees; mapping(IERC20 => uint256) private _erc20TotalReleased; mapping(IERC20 => mapping(address => uint256)) private _erc20Released; /** * @dev Creates an instance of `PaymentSplitter` where each account in `payees` is assigned the number of shares at * the matching position in the `shares` array. * * All addresses in `payees` must be non-zero. Both arrays must have the same non-zero length, and there must be no * duplicates in `payees`. */ constructor(address[] memory payees, uint256[] memory shares_) payable { require(payees.length == shares_.length, "PaymentSplitter: payees and shares length mismatch"); require(payees.length > 0, "PaymentSplitter: no payees"); for (uint256 i = 0; i < payees.length; i++) { _addPayee(payees[i], shares_[i]); } } /** * @dev The Ether received will be logged with {PaymentReceived} events. Note that these events are not fully * reliable: it's possible for a contract to receive Ether without triggering this function. This only affects the * reliability of the events, and not the actual splitting of Ether. * * To learn more about this see the Solidity documentation for * https://solidity.readthedocs.io/en/latest/contracts.html#fallback-function[fallback * functions]. */ receive() external payable virtual { emit PaymentReceived(_msgSender(), msg.value); } /** * @dev Getter for the total shares held by payees. */ function totalShares() public view returns (uint256) { return _totalShares; } /** * @dev Getter for the total amount of Ether already released. */ function totalReleased() public view returns (uint256) { return _totalReleased; } /** * @dev Getter for the total amount of `token` already released. `token` should be the address of an IERC20 * contract. */ function totalReleased(IERC20 token) public view returns (uint256) { return _erc20TotalReleased[token]; } /** * @dev Getter for the amount of shares held by an account. */ function shares(address account) public view returns (uint256) { return _shares[account]; } /** * @dev Getter for the amount of Ether already released to a payee. */ function released(address account) public view returns (uint256) { return _released[account]; } /** * @dev Getter for the amount of `token` tokens already released to a payee. `token` should be the address of an * IERC20 contract. */ function released(IERC20 token, address account) public view returns (uint256) { return _erc20Released[token][account]; } /** * @dev Getter for the address of the payee number `index`. */ function payee(uint256 index) public view returns (address) { return _payees[index]; } /** * @dev Getter for the amount of payee's releasable Ether. */ function releasable(address account) public view returns (uint256) { uint256 totalReceived = address(this).balance + totalReleased(); return _pendingPayment(account, totalReceived, released(account)); } /** * @dev Getter for the amount of payee's releasable `token` tokens. `token` should be the address of an * IERC20 contract. */ function releasable(IERC20 token, address account) public view returns (uint256) { uint256 totalReceived = token.balanceOf(address(this)) + totalReleased(token); return _pendingPayment(account, totalReceived, released(token, account)); } /** * @dev Triggers a transfer to `account` of the amount of Ether they are owed, according to their percentage of the * total shares and their previous withdrawals. */ function release(address payable account) public virtual { require(_shares[account] > 0, "PaymentSplitter: account has no shares"); uint256 payment = releasable(account); require(payment != 0, "PaymentSplitter: account is not due payment"); _released[account] += payment; _totalReleased += payment; Address.sendValue(account, payment); emit PaymentReleased(account, payment); } /** * @dev Triggers a transfer to `account` of the amount of `token` tokens they are owed, according to their * percentage of the total shares and their previous withdrawals. `token` must be the address of an IERC20 * contract. */ function release(IERC20 token, address account) public virtual { require(_shares[account] > 0, "PaymentSplitter: account has no shares"); uint256 payment = releasable(token, account); require(payment != 0, "PaymentSplitter: account is not due payment"); _erc20Released[token][account] += payment; _erc20TotalReleased[token] += payment; SafeERC20.safeTransfer(token, account, payment); emit ERC20PaymentReleased(token, account, payment); } /** * @dev internal logic for computing the pending payment of an `account` given the token historical balances and * already released amounts. */ function _pendingPayment( address account, uint256 totalReceived, uint256 alreadyReleased ) private view returns (uint256) { return (totalReceived * _shares[account]) / _totalShares - alreadyReleased; } /** * @dev Add a new payee to the contract. * @param account The address of the payee to add. * @param shares_ The number of shares owned by the payee. */ function _addPayee(address account, uint256 shares_) private { require(account != address(0), "PaymentSplitter: account is the zero address"); require(shares_ > 0, "PaymentSplitter: shares are 0"); require(_shares[account] == 0, "PaymentSplitter: account already has shares"); _payees.push(account); _shares[account] = shares_; _totalShares = _totalShares + shares_; emit PayeeAdded(account, shares_); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC1155 compliant contract, as defined in the * https://eips.ethereum.org/EIPS/eip-1155[EIP]. * * _Available since v3.1._ */ interface IERC1155 is IERC165 { /** * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`. */ event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value); /** * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all * transfers. */ event TransferBatch( address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values ); /** * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to * `approved`. */ event ApprovalForAll(address indexed account, address indexed operator, bool approved); /** * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI. * * If an {URI} event was emitted for `id`, the standard * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value * returned by {IERC1155MetadataURI-uri}. */ event URI(string value, uint256 indexed id); /** * @dev Returns the amount of tokens of token type `id` owned by `account`. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) external view returns (uint256); /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids) external view returns (uint256[] memory); /** * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`, * * Emits an {ApprovalForAll} event. * * Requirements: * * - `operator` cannot be the caller. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns true if `operator` is approved to transfer ``account``'s tokens. * * See {setApprovalForAll}. */ function isApprovedForAll(address account, address operator) external view returns (bool); /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}. * - `from` must have a balance of tokens of type `id` of at least `amount`. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes calldata data ) external; /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `amounts` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function safeBatchTransferFrom( address from, address to, uint256[] calldata ids, uint256[] calldata amounts, bytes calldata data ) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 amount ) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. */ interface IERC20Permit { /** * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, * given ``owner``'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event. * * Requirements: * * - `spender` cannot be the zero address. * - `deadline` must be a timestamp in the future. * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` * over the EIP712-formatted function arguments. * - the signature must use ``owner``'s current nonce (see {nonces}). * * For more information on the signature format, see the * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP * section]. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; /** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. * * Every successful call to {permit} increases ``owner``'s nonce by one. This * prevents a signature from being used multiple times. */ function nonces(address owner) external view returns (uint256); /** * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view returns (bytes32); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; import "../extensions/draft-IERC20Permit.sol"; import "../../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; function safeTransfer( IERC20 token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom( IERC20 token, address from, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove( IERC20 token, address spender, uint256 value ) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance( IERC20 token, address spender, uint256 value ) internal { uint256 newAllowance = token.allowance(address(this), spender) + value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance( IERC20 token, address spender, uint256 value ) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); uint256 newAllowance = oldAllowance - value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } } function safePermit( IERC20Permit token, address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) internal { uint256 nonceBefore = token.nonces(owner); token.permit(owner, spender, value, deadline, v, r, s); uint256 nonceAfter = token.nonces(owner); require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed"); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/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"; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _owners; // Mapping owner address to token count mapping(address => uint256) private _balances; // Mapping from token ID to approved address mapping(uint256 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual override returns (uint256) { require(owner != address(0), "ERC721: address zero is not a valid owner"); return _balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { address owner = _owners[tokenId]; require(owner != address(0), "ERC721: invalid token ID"); return owner; } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { _requireMinted(tokenId); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ""; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overridden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ 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 token owner nor approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { _requireMinted(tokenId); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom( address from, address to, uint256 tokenId ) public virtual override { //solhint-disable-next-line max-line-length require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner nor approved"); _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory data ) public virtual override { require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner nor approved"); _safeTransfer(from, to, tokenId, data); } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * `data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ 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"); } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), * and stop existing when they are burned (`_burn`). */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return _owners[tokenId] != address(0); } /** * @dev Returns whether `spender` is allowed to manage `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { address owner = ERC721.ownerOf(tokenId); return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender); } /** * @dev Safely mints `tokenId` and transfers it to `to`. * * Requirements: * * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal virtual { _safeMint(to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ 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" ); } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ 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); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { address owner = ERC721.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId); // Clear approvals _approve(address(0), tokenId); _balances[owner] -= 1; delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId); _afterTokenTransfer(owner, address(0), tokenId); } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ 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); // Clear approvals from the previous owner _approve(address(0), tokenId); _balances[from] -= 1; _balances[to] += 1; _owners[tokenId] = to; emit Transfer(from, to, tokenId); _afterTokenTransfer(from, to, tokenId); } /** * @dev Approve `to` to operate on `tokenId` * * Emits an {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721.ownerOf(tokenId), to, tokenId); } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits an {ApprovalForAll} event. */ 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); } /** * @dev Reverts if the `tokenId` has not been minted yet. */ function _requireMinted(uint256 tokenId) internal view virtual { require(_exists(tokenId), "ERC721: invalid token ID"); } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ 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 { /// @solidity memory-safe-assembly assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Metadata is IERC721 { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ 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"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ 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"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ 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); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ 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); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ 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); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol 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); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ 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); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed 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); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
//SPDX-License-Identifier: MIT pragma solidity >=0.8.4; import "../registry/BDNS.sol"; import "./IBaseRegistrar.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; contract BaseRegistrarImplementation is ERC721, IBaseRegistrar, Ownable { // A map of expiry times mapping(uint256 => uint256) expiries; // The BDNS registry BDNS public bdns; // The namehash of the TLD this registrar owns (eg, .eth) bytes32 constant public baseNode = 0; // A map of addresses that are authorised to register and renew names. mapping(address => bool) public controllers; uint256 public constant GRACE_PERIOD = 90 days; bytes4 private constant INTERFACE_META_ID = bytes4(keccak256("supportsInterface(bytes4)")); bytes4 private constant ERC721_ID = bytes4( keccak256("balanceOf(address)") ^ keccak256("ownerOf(uint256)") ^ keccak256("approve(address,uint256)") ^ keccak256("getApproved(uint256)") ^ keccak256("setApprovalForAll(address,bool)") ^ keccak256("isApprovedForAll(address,address)") ^ keccak256("transferFrom(address,address,uint256)") ^ keccak256("safeTransferFrom(address,address,uint256)") ^ keccak256("safeTransferFrom(address,address,uint256,bytes)") ); bytes4 private constant RECLAIM_ID = bytes4(keccak256("reclaim(uint256,address)")); /** * v2.1.3 version of _isApprovedOrOwner which calls ownerOf(tokenId) and takes grace period into consideration instead of ERC721.ownerOf(tokenId); * https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v2.1.3/contracts/token/ERC721/ERC721.sol#L187 * @dev Returns whether the given spender can transfer a given token ID * @param spender address of the spender to query * @param tokenId uint256 ID of the token to be transferred * @return bool whether the msg.sender is approved for the given token ID, * is an operator of the owner, or is the owner of the token */ function _isApprovedOrOwner(address spender, uint256 tokenId) internal view override returns (bool) { address owner = ownerOf(tokenId); return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender)); } constructor(BDNS _bdns) ERC721("", "") { bdns = _bdns; } modifier live() { require(bdns.owner(baseNode) == address(this)); _; } modifier onlyController() { require(controllers[msg.sender]); _; } /** * @dev Gets the owner of the specified token ID. Names become unowned * when their registration expires. * @param tokenId uint256 ID of the token to query the owner of * @return address currently marked as the owner of the given token ID */ function ownerOf(uint256 tokenId) public view override(IERC721, ERC721) returns (address) { require(expiries[tokenId] > block.timestamp); return super.ownerOf(tokenId); } // Authorises a controller, who can register and renew domains. function addController(address controller) external override onlyOwner { controllers[controller] = true; emit ControllerAdded(controller); } // Revoke controller permission for an address. function removeController(address controller) external override onlyOwner { controllers[controller] = false; emit ControllerRemoved(controller); } // Set the resolver for the TLD this registrar manages. function setResolver(address resolver) external override onlyOwner { bdns.setResolver(baseNode, resolver); } // Returns the expiration timestamp of the specified id. function nameExpires(uint256 id) external view override returns (uint256) { return expiries[id]; } // Returns true iff the specified name is available for registration. function available(uint256 id) public view override returns (bool) { // Not available if it's registered here or in its grace period. return expiries[id] + GRACE_PERIOD < block.timestamp; } /** * @dev Register a name. * @param id The token ID (keccak256 of the label). * @param owner The address that should own the registration. * @param duration Duration in seconds for the registration. */ function register( uint256 id, address owner, uint256 duration ) external override returns (uint256) { return _register(id, owner, duration, true); } /** * @dev Register a name, without modifying the registry. * @param id The token ID (keccak256 of the label). * @param owner The address that should own the registration. * @param duration Duration in seconds for the registration. */ function registerOnly( uint256 id, address owner, uint256 duration ) external returns (uint256) { return _register(id, owner, duration, false); } function _register( uint256 id, address owner, uint256 duration, bool updateRegistry ) internal live onlyController returns (uint256) { require(available(id)); require( block.timestamp + duration + GRACE_PERIOD > block.timestamp + GRACE_PERIOD ); // Prevent future overflow expiries[id] = block.timestamp + duration; if (_exists(id)) { // Name was previously owned, and expired _burn(id); } _mint(owner, id); if (updateRegistry) { bdns.setSubnodeOwner(baseNode, bytes32(id), owner); } emit NameRegistered(id, owner, block.timestamp + duration); return block.timestamp + duration; } function renew(uint256 id, uint256 duration) external override live onlyController returns (uint256) { require(expiries[id] + GRACE_PERIOD >= block.timestamp); // Name must be registered here or in grace period require( expiries[id] + duration + GRACE_PERIOD > duration + GRACE_PERIOD ); // Prevent future overflow expiries[id] += duration; emit NameRenewed(id, expiries[id]); return expiries[id]; } /** * @dev Reclaim ownership of a name in BDNS, if you own it in the registrar. */ function reclaim(uint256 id, address owner) external override live { require(_isApprovedOrOwner(msg.sender, id)); bdns.setSubnodeOwner(baseNode, bytes32(id), owner); } function supportsInterface(bytes4 interfaceID) public view override(ERC721, IERC165) returns (bool) { return interfaceID == INTERFACE_META_ID || interfaceID == ERC721_ID || interfaceID == RECLAIM_ID; } }
//SPDX-License-Identifier: MIT import "../registry/BDNS.sol"; import "./IBaseRegistrar.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; interface IBaseRegistrar is IERC721 { event ControllerAdded(address indexed controller); event ControllerRemoved(address indexed controller); event NameMigrated( uint256 indexed id, address indexed owner, uint256 expires ); event NameRegistered( uint256 indexed id, address indexed owner, uint256 expires ); event NameRenewed(uint256 indexed id, uint256 expires); // Authorises a controller, who can register and renew domains. function addController(address controller) external; // Revoke controller permission for an address. function removeController(address controller) external; // Set the resolver for the TLD this registrar manages. function setResolver(address resolver) external; // Returns the expiration timestamp of the specified label hash. function nameExpires(uint256 id) external view returns (uint256); // Returns true iff the specified name is available for registration. function available(uint256 id) external view returns (bool); /** * @dev Register a name. */ function register( uint256 id, address owner, uint256 duration ) external returns (uint256); function renew(uint256 id, uint256 duration) external returns (uint256); /** * @dev Reclaim ownership of a name in BDNS, if you own it in the registrar. */ function reclaim(uint256 id, address owner) external; }
//SPDX-License-Identifier: MIT pragma solidity >=0.8.17 <0.9.0; import {IReservedDomains} from "./IReservedDomains.sol"; interface IPriceOracle { struct Price { uint256 base; uint256 premium; } /** * @dev Returns the price to register or renew a name. * @param name The name being registered or renewed. * @param expires When the name presently expires (0 if this is a new registration). * @param duration How long the name is being registered or extended for, in seconds. * @return base premium tuple of base price + premium price */ function price( string calldata name, uint256 expires, uint256 duration, bool isSpecial ) external view returns (Price memory); }
//SPDX-License-Identifier: MIT pragma solidity ~0.8.17; interface IReservedDomains { function isSpecial(bytes32) external view returns (bool); }
//SPDX-License-Identifier: MIT pragma solidity ~0.8.17; import "./IPriceOracle.sol"; interface IRootRegistrarController { function rentPrice(string memory, uint256) external view returns (IPriceOracle.Price memory); function available(string memory) external returns (bool); function availableNFT(uint256, address _address) external returns (bool); function makeCommitment( string memory, address, uint256, bytes32, address, bytes[] calldata, bool, uint32, uint64 ) external pure returns (bytes32); function commit(bytes32) external; function register( string calldata, address, uint256, bytes32, address, bytes[] calldata, bool, uint32, uint64 ) external payable; function registerNFT( uint256, address, bytes32, address, bytes[] calldata, bool, uint32, uint64 ) external; function renew(string calldata, uint256) external payable; }
//SPDX-License-Identifier: MIT pragma solidity >=0.8.4; library StringUtils { /** * @dev Returns the length of a given string * * @param s The string to measure the length of * @return The length of the input string */ function strlen(string memory s) internal pure returns (uint256) { uint256 len; uint256 i = 0; uint256 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; } }
//SPDX-License-Identifier: MIT pragma solidity >=0.8.4; interface BDNS { // Logged when the owner of a node assigns a new owner to a subnode. event NewOwner(bytes32 indexed node, bytes32 indexed label, address owner); // Logged when the owner of a node transfers ownership to a new account. event Transfer(bytes32 indexed node, address owner); // Logged when the resolver for a node changes. event NewResolver(bytes32 indexed node, address resolver); // Logged when the TTL of a node changes event NewTTL(bytes32 indexed node, uint64 ttl); // Logged when an operator is added or removed. event ApprovalForAll( address indexed owner, address indexed operator, bool approved ); function setRecord( bytes32 node, address owner, address resolver, uint64 ttl ) external; function setSubnodeRecord( bytes32 node, bytes32 label, address owner, address resolver, uint64 ttl ) external; function setSubnodeOwner( bytes32 node, bytes32 label, address owner ) external returns (bytes32); function setResolver(bytes32 node, address resolver) external; function setOwner(bytes32 node, address owner) external; function setTTL(bytes32 node, uint64 ttl) external; function setApprovalForAll(address operator, bool approved) external; function owner(bytes32 node) external view returns (address); function resolver(bytes32 node) external view returns (address); function ttl(bytes32 node) external view returns (uint64); function recordExists(bytes32 node) external view returns (bool); function isApprovedForAll(address owner, address operator) external view returns (bool); }
//SPDX-License-Identifier: MIT pragma solidity >=0.8.4; interface IReverseRegistrar { function setDefaultResolver(address resolver) external; function claim(address owner) external returns (bytes32); function claimForAddr( address addr, address owner, address resolver ) external returns (bytes32); function claimWithResolver(address owner, address resolver) external returns (bytes32); function setName(string memory name) external returns (bytes32); function setNameForAddr( address addr, address owner, address resolver, string memory name ) external returns (bytes32); function node(address addr) external pure returns (bytes32); }
//SPDX-License-Identifier: MIT pragma solidity >=0.8.4; import "./BDNS.sol"; import "./IReverseRegistrar.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "../utils/Controllable.sol"; abstract contract NameResolver { function setName(bytes32 node, string memory name) public virtual; } bytes32 constant lookup = 0x3031323334353637383961626364656600000000000000000000000000000000; bytes32 constant ADDR_REVERSE_NODE = 0x91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e2; // namehash('addr.reverse') contract ReverseRegistrar is Ownable, Controllable, IReverseRegistrar { BDNS public immutable bdns; NameResolver public defaultResolver; event ReverseClaimed(address indexed addr, bytes32 indexed node); event DefaultResolverChanged(NameResolver indexed resolver); /** * @dev Constructor * @param bdnsAddr The address of the BDNS registry. */ constructor(BDNS bdnsAddr) { bdns = bdnsAddr; // Assign ownership of the reverse record to our deployer ReverseRegistrar oldRegistrar = ReverseRegistrar( bdnsAddr.owner(ADDR_REVERSE_NODE) ); if (address(oldRegistrar) != address(0x0)) { oldRegistrar.claim(msg.sender); } } modifier authorised(address addr) { require( addr == msg.sender || controllers[msg.sender] || bdns.isApprovedForAll(addr, msg.sender) || ownsContract(addr), "ReverseRegistrar: Caller is not a controller or authorised by address or the address itself" ); _; } function setDefaultResolver(address resolver) public override onlyOwner { require( address(resolver) != address(0), "ReverseRegistrar: Resolver address must not be 0" ); defaultResolver = NameResolver(resolver); emit DefaultResolverChanged(NameResolver(resolver)); } /** * @dev Transfers ownership of the reverse BDNS record associated with the * calling account. * @param owner The address to set as the owner of the reverse record in BDNS. * @return The BDNS node hash of the reverse record. */ function claim(address owner) public override returns (bytes32) { return claimForAddr(msg.sender, owner, address(defaultResolver)); } /** * @dev Transfers ownership of the reverse BDNS record associated with the * calling account. * @param addr The reverse record to set * @param owner The address to set as the owner of the reverse record in BDNS. * @param resolver The resolver of the reverse node * @return The BDNS node hash of the reverse record. */ function claimForAddr( address addr, address owner, address resolver ) public override authorised(addr) returns (bytes32) { bytes32 labelHash = sha3HexAddress(addr); bytes32 reverseNode = keccak256( abi.encodePacked(ADDR_REVERSE_NODE, labelHash) ); emit ReverseClaimed(addr, reverseNode); bdns.setSubnodeRecord(ADDR_REVERSE_NODE, labelHash, owner, resolver, 0); return reverseNode; } /** * @dev Transfers ownership of the reverse BDNS record associated with the * calling account. * @param owner The address to set as the owner of the reverse record in BDNS. * @param resolver The address of the resolver to set; 0 to leave unchanged. * @return The BDNS node hash of the reverse record. */ function claimWithResolver(address owner, address resolver) public override returns (bytes32) { return claimForAddr(msg.sender, owner, resolver); } /** * @dev Sets the `name()` record for the reverse BDNS record associated with * the calling account. First updates the resolver to the default reverse * resolver if necessary. * @param name The name to set for this address. * @return The BDNS node hash of the reverse record. */ function setName(string memory name) public override returns (bytes32) { return setNameForAddr( msg.sender, msg.sender, address(defaultResolver), name ); } /** * @dev Sets the `name()` record for the reverse BDNS record associated with * the account provided. Updates the resolver to a designated resolver * Only callable by controllers and authorised users * @param addr The reverse record to set * @param owner The owner of the reverse node * @param resolver The resolver of the reverse node * @param name The name to set for this address. * @return The BDNS node hash of the reverse record. */ function setNameForAddr( address addr, address owner, address resolver, string memory name ) public override returns (bytes32) { bytes32 node = claimForAddr(addr, owner, resolver); NameResolver(resolver).setName(node, name); return node; } /** * @dev Returns the node hash for a given account's reverse records. * @param addr The address to hash * @return The BDNS node hash. */ function node(address addr) public pure override returns (bytes32) { return keccak256( abi.encodePacked(ADDR_REVERSE_NODE, sha3HexAddress(addr)) ); } /** * @dev An optimised function to compute the sha3 of the lower-case * hexadecimal representation of an Ethereum address. * @param addr The address to hash * @return ret The SHA3 hash of the lower-case hexadecimal encoding of the * input address. */ function sha3HexAddress(address addr) private pure returns (bytes32 ret) { assembly { for { let i := 40 } gt(i, 0) { } { i := sub(i, 1) mstore8(i, byte(and(addr, 0xf), lookup)) addr := div(addr, 0x10) i := sub(i, 1) mstore8(i, byte(and(addr, 0xf), lookup)) addr := div(addr, 0x10) } ret := keccak256(0, 40) } } function ownsContract(address addr) internal view returns (bool) { try Ownable(addr).owner() returns (address owner) { return owner == msg.sender; } catch { return false; } } }
//SPDX-License-Identifier: MIT pragma solidity >=0.8.4; import "@openzeppelin/contracts/utils/introspection/IERC165.sol"; import "./profiles/IABIResolver.sol"; import "./profiles/IAddressResolver.sol"; import "./profiles/IAddrResolver.sol"; import "./profiles/IContentHashResolver.sol"; import "./profiles/IDNSRecordResolver.sol"; import "./profiles/IDNSZoneResolver.sol"; import "./profiles/IInterfaceResolver.sol"; import "./profiles/INameResolver.sol"; import "./profiles/IPubkeyResolver.sol"; import "./profiles/ITextResolver.sol"; import "./profiles/IExtendedResolver.sol"; /** * A generic resolver interface which includes all the functions including the ones deprecated */ interface Resolver is IERC165, IABIResolver, IAddressResolver, IAddrResolver, IContentHashResolver, IDNSRecordResolver, IDNSZoneResolver, IInterfaceResolver, INameResolver, IPubkeyResolver, ITextResolver, IExtendedResolver { /* Deprecated events */ event ContentChanged(bytes32 indexed node, bytes32 hash); function setABI( bytes32 node, uint256 contentType, bytes calldata data ) external; function setAddr(bytes32 node, address addr) external; function setAddr( bytes32 node, uint256 coinType, bytes calldata a ) external; function setContenthash(bytes32 node, bytes calldata hash) external; function setDnsrr(bytes32 node, bytes calldata data) external; function setName(bytes32 node, string calldata _name) external; function setPubkey( bytes32 node, bytes32 x, bytes32 y ) external; function setText( bytes32 node, string calldata key, string calldata value ) external; function setInterface( bytes32 node, bytes4 interfaceID, address implementer ) external; function multicall(bytes[] calldata data) external returns (bytes[] memory results); function multicallWithNodeCheck(bytes32 nodehash, bytes[] calldata data) external returns (bytes[] memory results); /* Deprecated functions */ function content(bytes32 node) external view returns (bytes32); function multihash(bytes32 node) external view returns (bytes memory); function setContent(bytes32 node, bytes32 hash) external; function setMultihash(bytes32 node, bytes calldata hash) external; }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.4; import "@openzeppelin/contracts/utils/introspection/ERC165.sol"; import "./profiles/IVersionableResolver.sol"; abstract contract ResolverBase is ERC165, IVersionableResolver { mapping(bytes32 => uint64) public recordVersions; function isAuthorised(bytes32 node) internal view virtual returns (bool); modifier authorised(bytes32 node) { require(isAuthorised(node)); _; } /** * Increments the record version associated with an BDNS node. * May only be called by the owner of that node in the BDNS registry. * @param node The node to update. */ function clearRecords(bytes32 node) public virtual authorised(node) { recordVersions[node]++; emit VersionChanged(node, recordVersions[node]); } function supportsInterface(bytes4 interfaceID) public view virtual override returns (bool) { return interfaceID == type(IVersionableResolver).interfaceId || super.supportsInterface(interfaceID); } }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.4; import "./IABIResolver.sol"; import "../ResolverBase.sol"; interface IABIResolver { event ABIChanged(bytes32 indexed node, uint256 indexed contentType); /** * Returns the ABI associated with an BDNS node. * Defined in EIP205. * @param node The BDNS node to query * @param contentTypes A bitwise OR of the ABI formats accepted by the caller. * @return contentType The content type of the return value * @return data The ABI data */ function ABI(bytes32 node, uint256 contentTypes) external view returns (uint256, bytes memory); }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.4; /** * Interface for the legacy (ETH-only) addr function. */ interface IAddrResolver { event AddrChanged(bytes32 indexed node, address a); /** * Returns the address associated with an BDNS node. * @param node The BDNS node to query. * @return The associated address. */ function addr(bytes32 node) external view returns (address payable); }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.4; /** * Interface for the new (multicoin) addr function. */ interface IAddressResolver { event AddressChanged( bytes32 indexed node, uint256 coinType, bytes newAddress ); function addr(bytes32 node, uint256 coinType) external view returns (bytes memory); }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.4; interface IContentHashResolver { event ContenthashChanged(bytes32 indexed node, bytes hash); /** * Returns the contenthash associated with an BDNS node. * @param node The BDNS node to query. * @return The associated contenthash. */ function contenthash(bytes32 node) external view returns (bytes memory); }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.4; interface IDNSRecordResolver { // DNSRecordChanged is emitted whenever a given node/name/resource's RRSET is updated. event DNSRecordChanged( bytes32 indexed node, bytes name, uint16 resource, bytes record ); // DNSRecordDeleted is emitted whenever a given node/name/resource's RRSET is deleted. event DNSRecordDeleted(bytes32 indexed node, bytes name, uint16 resource); /** * Obtain a DNS record. * @param node the namehash of the node for which to fetch the record * @param name the keccak-256 hash of the fully-qualified name for which to fetch the record * @param resource the ID of the resource as per https://en.wikipedia.org/wiki/List_of_DNS_record_types * @return the DNS record in wire format if present, otherwise empty */ function dnsRecord( bytes32 node, bytes32 name, uint16 resource ) external view returns (bytes memory); }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.4; interface IDNSZoneResolver { // DNSZonehashChanged is emitted whenever a given node's zone hash is updated. event DNSZonehashChanged( bytes32 indexed node, bytes lastzonehash, bytes zonehash ); /** * zonehash obtains the hash for the zone. * @param node The BDNS node to query. * @return The associated contenthash. */ function zonehash(bytes32 node) external view returns (bytes memory); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; interface IExtendedResolver { function resolve(bytes memory name, bytes memory data) external view returns (bytes memory, address); }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.4; interface IInterfaceResolver { event InterfaceChanged( bytes32 indexed node, bytes4 indexed interfaceID, address implementer ); /** * Returns the address of a contract that implements the specified interface for this name. * If an implementer has not been set for this interfaceID and name, the resolver will query * the contract at `addr()`. If `addr()` is set, a contract exists at that address, and that * contract implements EIP165 and returns `true` for the specified interfaceID, its address * will be returned. * @param node The BDNS node to query. * @param interfaceID The EIP 165 interface ID to check for. * @return The address that implements this interface, or 0 if the interface is unsupported. */ function interfaceImplementer(bytes32 node, bytes4 interfaceID) external view returns (address); }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.4; interface INameResolver { event NameChanged(bytes32 indexed node, string name); /** * Returns the name associated with an BDNS node, for reverse records. * Defined in EIP181. * @param node The BDNS node to query. * @return The associated name. */ function name(bytes32 node) external view returns (string memory); }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.4; interface IPubkeyResolver { event PubkeyChanged(bytes32 indexed node, bytes32 x, bytes32 y); /** * Returns the SECP256k1 public key associated with an BDNS node. * Defined in EIP 619. * @param node The BDNS node to query * @return x The X coordinate of the curve point for the public key. * @return y The Y coordinate of the curve point for the public key. */ function pubkey(bytes32 node) external view returns (bytes32 x, bytes32 y); }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.4; interface ITextResolver { event TextChanged( bytes32 indexed node, string indexed indexedKey, string key, string value ); /** * Returns the text data associated with an BDNS node and key. * @param node The BDNS node to query. * @param key The text data key to query. * @return The associated text data. */ function text(bytes32 node, string calldata key) external view returns (string memory); }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.4; interface IVersionableResolver { event VersionChanged(bytes32 indexed node, uint64 newVersion); function recordVersions(bytes32 node) external view returns (uint64); }
pragma solidity ^0.8.4; import "@openzeppelin/contracts/access/Ownable.sol"; contract Controllable is Ownable { mapping(address => bool) public controllers; event ControllerChanged(address indexed controller, bool enabled); modifier onlyController() { require( controllers[msg.sender], "Controllable: Caller is not a controller" ); _; } function setController(address controller, bool enabled) public onlyOwner { controllers[controller] = enabled; emit ControllerChanged(controller, enabled); } }
//SPDX-License-Identifier: MIT pragma solidity >=0.8.17 <0.9.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; /** @notice Contract is used to recover ERC20 tokens sent to the contract by mistake. */ contract ERC20Recoverable is Ownable { /** @notice Recover ERC20 tokens sent to the contract by mistake. @dev The contract is Ownable and only the owner can call the recover function. @param _to The address to send the tokens to. @param _token The address of the ERC20 token to recover @param _amount The amount of tokens to recover. */ function recoverFunds( address _token, address _to, uint256 _amount ) external onlyOwner { IERC20(_token).transfer(_to, _amount); } }
//SPDX-License-Identifier: MIT pragma solidity ~0.8.17; interface IMetadataService { function uri(uint256) external view returns (string memory); }
//SPDX-License-Identifier: MIT pragma solidity ~0.8.17; import "../registry/BDNS.sol"; import "../ethregistrar/IBaseRegistrar.sol"; import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; import "./IMetadataService.sol"; uint32 constant CANNOT_UNWRAP = 1; uint32 constant CANNOT_BURN_FUSES = 2; uint32 constant CANNOT_TRANSFER = 4; uint32 constant CANNOT_SET_RESOLVER = 8; uint32 constant CANNOT_SET_TTL = 16; uint32 constant PARENT_CANNOT_CONTROL = 32; uint32 constant CAN_DO_EVERYTHING = 0; interface INameWrapper is IERC1155 { event NameWrapped( bytes32 indexed node, bytes name, address owner, uint32 fuses, uint64 expiry ); event NameUnwrapped(bytes32 indexed node, address owner); event FusesSet(bytes32 indexed node, uint32 fuses, uint64 expiry); function bdns() external view returns (BDNS); function registrar() external view returns (IBaseRegistrar); function metadataService() external view returns (IMetadataService); function names(bytes32) external view returns (bytes memory); function wrap( string calldata label, address wrappedOwner, uint32 fuses, uint64 _expiry, address resolver ) external returns (uint64 expiry); function registerAndWrap( string calldata label, address wrappedOwner, uint256 duration, address resolver, uint32 fuses, uint64 expiry ) external returns (uint256 registrarExpiry); function renew( uint256 labelHash, uint256 duration, uint32 fuses, uint64 expiry ) external returns (uint256 expires); function unwrap( bytes32 label, address newRegistrant, address newController ) external; function setFuses(bytes32 node, uint32 fuses) external returns (uint32 newFuses); function setRecord( bytes32 node, address owner, address resolver, uint64 ttl ) external; function isTokenOwnerOrApproved(bytes32 node, address addr) external returns (bool); function setResolver(bytes32 node, address resolver) external; function setTTL(bytes32 node, uint64 ttl) external; function ownerOf(uint256 id) external returns (address owner); function getData(uint256 id) external returns ( address, uint32, uint64 ); function allFusesBurned(bytes32 node, uint32 fuseMask) external view returns (bool); function isWrapped(bytes32 node) external view returns (bool); }
{ "evmVersion": "london", "libraries": {}, "metadata": { "bytecodeHash": "ipfs", "useLiteralContent": true }, "optimizer": { "enabled": true, "runs": 4000 }, "remappings": [], "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"contract BaseRegistrarImplementation","name":"_base","type":"address"},{"internalType":"contract IPriceOracle","name":"_prices","type":"address"},{"internalType":"uint256","name":"_minCommitmentAge","type":"uint256"},{"internalType":"uint256","name":"_maxCommitmentAge","type":"uint256"},{"internalType":"contract ReverseRegistrar","name":"_reverseRegistrar","type":"address"},{"internalType":"contract INameWrapper","name":"_nameWrapper","type":"address"},{"internalType":"contract IReservedDomains","name":"_reservedDomains","type":"address"},{"internalType":"contract IERC721","name":"_BAYC","type":"address"},{"internalType":"address[]","name":"_payees","type":"address[]"},{"internalType":"uint256[]","name":"_shares","type":"uint256[]"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"bytes32","name":"commitment","type":"bytes32"}],"name":"CommitmentTooNew","type":"error"},{"inputs":[{"internalType":"bytes32","name":"commitment","type":"bytes32"}],"name":"CommitmentTooOld","type":"error"},{"inputs":[{"internalType":"uint256","name":"duration","type":"uint256"}],"name":"DurationTooShort","type":"error"},{"inputs":[],"name":"InsufficientValue","type":"error"},{"inputs":[],"name":"MaxCommitmentAgeTooHigh","type":"error"},{"inputs":[],"name":"MaxCommitmentAgeTooLow","type":"error"},{"inputs":[{"internalType":"string","name":"name","type":"string"}],"name":"NameNotAvailable","type":"error"},{"inputs":[],"name":"ResolverRequiredWhenDataSupplied","type":"error"},{"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"}],"name":"Unauthorised","type":"error"},{"inputs":[{"internalType":"bytes32","name":"commitment","type":"bytes32"}],"name":"UnexpiredCommitmentExists","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"},{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ERC20PaymentReleased","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":true,"internalType":"bytes32","name":"label","type":"bytes32"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"baseCost","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"premium","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"expires","type":"uint256"}],"name":"NameRegistered","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":true,"internalType":"bytes32","name":"label","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"cost","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"expires","type":"uint256"}],"name":"NameRenewed","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":false,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"}],"name":"PayeeAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"PaymentReceived","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"PaymentReleased","type":"event"},{"inputs":[],"name":"BAYC","outputs":[{"internalType":"contract IERC721","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MIN_REGISTRATION_DURATION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"START","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"name","type":"string"}],"name":"available","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"address","name":"_address","type":"address"}],"name":"availableNFT","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"commitment","type":"bytes32"}],"name":"commit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"commitments","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"duration","type":"uint256"},{"internalType":"bytes32","name":"secret","type":"bytes32"},{"internalType":"address","name":"resolver","type":"address"},{"internalType":"bytes[]","name":"data","type":"bytes[]"},{"internalType":"bool","name":"reverseRecord","type":"bool"},{"internalType":"uint32","name":"fuses","type":"uint32"},{"internalType":"uint64","name":"wrapperExpiry","type":"uint64"}],"name":"makeCommitment","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"maxCommitmentAge","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minCommitmentAge","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nameWrapper","outputs":[{"internalType":"contract INameWrapper","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"payee","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prices","outputs":[{"internalType":"contract IPriceOracle","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"recoverFunds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"duration","type":"uint256"},{"internalType":"bytes32","name":"secret","type":"bytes32"},{"internalType":"address","name":"resolver","type":"address"},{"internalType":"bytes[]","name":"data","type":"bytes[]"},{"internalType":"bool","name":"reverseRecord","type":"bool"},{"internalType":"uint32","name":"fuses","type":"uint32"},{"internalType":"uint64","name":"wrapperExpiry","type":"uint64"}],"name":"register","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"bytes32","name":"secret","type":"bytes32"},{"internalType":"address","name":"resolver","type":"address"},{"internalType":"bytes[]","name":"data","type":"bytes[]"},{"internalType":"bool","name":"reverseRecord","type":"bool"},{"internalType":"uint32","name":"fuses","type":"uint32"},{"internalType":"uint64","name":"wrapperExpiry","type":"uint64"}],"name":"registerNFT","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"releasable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"address","name":"account","type":"address"}],"name":"releasable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address payable","name":"account","type":"address"}],"name":"release","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"address","name":"account","type":"address"}],"name":"release","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"address","name":"account","type":"address"}],"name":"released","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"released","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"uint256","name":"duration","type":"uint256"}],"name":"renew","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"uint256","name":"duration","type":"uint256"},{"internalType":"uint32","name":"fuses","type":"uint32"},{"internalType":"uint64","name":"wrapperExpiry","type":"uint64"}],"name":"renewWithFuses","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"uint256","name":"duration","type":"uint256"}],"name":"rentPrice","outputs":[{"components":[{"internalType":"uint256","name":"base","type":"uint256"},{"internalType":"uint256","name":"premium","type":"uint256"}],"internalType":"struct IPriceOracle.Price","name":"price","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"reservedDomains","outputs":[{"internalType":"contract IReservedDomains","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"reverseRegistrar","outputs":[{"internalType":"contract ReverseRegistrar","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"shares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceID","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"}],"name":"totalReleased","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalReleased","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalShares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"name","type":"string"}],"name":"valid","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
6101a06040523480156200001257600080fd5b5060405162003c9038038062003c908339810160408190526200003591620005b4565b81816200004233620001fd565b8051825114620000b45760405162461bcd60e51b815260206004820152603260248201527f5061796d656e7453706c69747465723a2070617965657320616e6420736861726044820152710cae640d8cadccee8d040dad2e6dac2e8c6d60731b60648201526084015b60405180910390fd5b6000825111620001075760405162461bcd60e51b815260206004820152601a60248201527f5061796d656e7453706c69747465723a206e6f207061796565730000000000006044820152606401620000ab565b60005b825181101562000173576200015e8382815181106200012d576200012d620006a4565b60200260200101518383815181106200014a576200014a620006a4565b60200260200101516200024d60201b60201c565b806200016a81620006d0565b9150506200010a565b50505087871162000197576040516307cb550760e31b815260040160405180910390fd5b42871115620001b957604051630b4319e560e21b815260040160405180910390fd5b50506001600160a01b0397881660a05295871660c05260e0949094526101009290925284166101205283166101405282166101605216610180524260805262000708565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b038216620002ba5760405162461bcd60e51b815260206004820152602c60248201527f5061796d656e7453706c69747465723a206163636f756e74206973207468652060448201526b7a65726f206164647265737360a01b6064820152608401620000ab565b600081116200030c5760405162461bcd60e51b815260206004820152601d60248201527f5061796d656e7453706c69747465723a207368617265732061726520300000006044820152606401620000ab565b6001600160a01b03821660009081526003602052604090205415620003885760405162461bcd60e51b815260206004820152602b60248201527f5061796d656e7453706c69747465723a206163636f756e7420616c726561647960448201526a206861732073686172657360a81b6064820152608401620000ab565b6005805460018082019092557f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db00180546001600160a01b0319166001600160a01b038516908117909155600090815260036020526040902082905554620003f1908290620006ec565b600155604080516001600160a01b0384168152602081018390527f40c340f65e17194d14ddddb073d3c9f888e3cb52b5aae0c6c7706b4fbc905fac910160405180910390a15050565b6001600160a01b03811681146200045057600080fd5b50565b805162000460816200043a565b919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715620004a657620004a662000465565b604052919050565b60006001600160401b03821115620004ca57620004ca62000465565b5060051b60200190565b600082601f830112620004e657600080fd5b81516020620004ff620004f983620004ae565b6200047b565b82815260059290921b840181019181810190868411156200051f57600080fd5b8286015b848110156200054757805162000539816200043a565b835291830191830162000523565b509695505050505050565b600082601f8301126200056457600080fd5b8151602062000577620004f983620004ae565b82815260059290921b840181019181810190868411156200059757600080fd5b8286015b848110156200054757805183529183019183016200059b565b6000806000806000806000806000806101408b8d031215620005d557600080fd5b620005e08b62000453565b9950620005f060208c0162000453565b985060408b0151975060608b015196506200060e60808c0162000453565b95506200061e60a08c0162000453565b94506200062e60c08c0162000453565b93506200063e60e08c0162000453565b6101008c01519093506001600160401b03808211156200065d57600080fd5b6200066b8e838f01620004d4565b93506101208d01519150808211156200068357600080fd5b50620006928d828e0162000552565b9150509295989b9194979a5092959850565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201620006e557620006e5620006ba565b5060010190565b80820180821115620007025762000702620006ba565b92915050565b60805160a05160c05160e05161010051610120516101405161016051610180516134b5620007db6000396000818161057b015261181c01526000818161038f015261148601526000818161062501528181610d6101528181610fd70152818161125a0152611e26015260008181610436015261217d0152600081816106e001528181611a3f01526120220152600081816105290152611fab01526000818161076a01526113b30152600081816113e801528181611654015261190001526000818161068c01526117b901526134b56000f3fe6080604052600436106102535760003560e01c80639582b6e511610138578063ce1e09c0116100b0578063d555254a1161007f578063e33b7de311610064578063e33b7de3146107e2578063f14fcbc8146107f7578063f2fde38b1461081757600080fd5b8063d555254a1461078c578063d79779b2146107ac57600080fd5b8063ce1e09c0146106ce578063ce7c2ac214610702578063cf31a7af14610738578063d3419bf31461075857600080fd5b8063a8e5fbc011610107578063aeb8ce9b116100ec578063aeb8ce9b1461065a578063ba9a061a1461067a578063c45ac050146106ae57600080fd5b8063a8e5fbc014610613578063acf1a8411461064757600080fd5b80639582b6e5146105695780639791c0971461059d5780639852595c146105bd578063a3f8eace146105f357600080fd5b80637acaaf26116101cb57806383e7f6ff1161019a5780638b83209b1161017f5780638b83209b146104f75780638d839ffe146105175780638da5cb5b1461054b57600080fd5b806383e7f6ff146104a55780638a95b09f146104e057600080fd5b80637acaaf26146104115780638086985314610424578063839df9451461045857806383ae092c1461048557600080fd5b806348b75044116102225780635d3590d5116102075780635d3590d5146103c95780636459220f146103e9578063715018a6146103fc57600080fd5b806348b750441461035d57806359cf34231461037d57600080fd5b806301ffc9a7146102a157806319165587146102d65780633a98ef39146102f8578063406072a91461031757600080fd5b3661029c577f6ef95f06320e7a25a04a175ca677b7052bdd97131872c2192525a629f51be77033604080516001600160a01b0390921682523460208301520160405180910390a1005b600080fd5b3480156102ad57600080fd5b506102c16102bc36600461276e565b610837565b60405190151581526020015b60405180910390f35b3480156102e257600080fd5b506102f66102f13660046127c5565b6108d0565b005b34801561030457600080fd5b506001545b6040519081526020016102cd565b34801561032357600080fd5b506103096103323660046127e2565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205490565b34801561036957600080fd5b506102f66103783660046127e2565b610a7a565b34801561038957600080fd5b506103b17f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016102cd565b3480156103d557600080fd5b506102f66103e436600461281b565b610c49565b6102f66103f73660046128d6565b610ce3565b34801561040857600080fd5b506102f6610e25565b6102f661041f3660046129a2565b610e39565b34801561043057600080fd5b506103b17f000000000000000000000000000000000000000000000000000000000000000081565b34801561046457600080fd5b50610309610473366004612a85565b60086020526000908152604090205481565b34801561049157600080fd5b506102f66104a0366004612a9e565b6111bf565b3480156104b157600080fd5b506104c56104c0366004612c2b565b611369565b604080518251815260209283015192810192909252016102cd565b3480156104ec57600080fd5b506103096224ea0081565b34801561050357600080fd5b506103b1610512366004612a85565b611560565b34801561052357600080fd5b506103097f000000000000000000000000000000000000000000000000000000000000000081565b34801561055757600080fd5b506000546001600160a01b03166103b1565b34801561057557600080fd5b506103b17f000000000000000000000000000000000000000000000000000000000000000081565b3480156105a957600080fd5b506102c16105b8366004612c70565b611590565b3480156105c957600080fd5b506103096105d83660046127c5565b6001600160a01b031660009081526004602052604090205490565b3480156105ff57600080fd5b5061030961060e3660046127c5565b6115b7565b34801561061f57600080fd5b506103b17f000000000000000000000000000000000000000000000000000000000000000081565b6102f6610655366004612ca5565b6115f8565b34801561066657600080fd5b506102c1610675366004612c70565b61160b565b34801561068657600080fd5b506103097f000000000000000000000000000000000000000000000000000000000000000081565b3480156106ba57600080fd5b506103096106c93660046127e2565b6116c7565b3480156106da57600080fd5b506103097f000000000000000000000000000000000000000000000000000000000000000081565b34801561070e57600080fd5b5061030961071d3660046127c5565b6001600160a01b031660009081526003602052604090205490565b34801561074457600080fd5b506102c1610753366004612cf1565b6117a3565b34801561076457600080fd5b506103b17f000000000000000000000000000000000000000000000000000000000000000081565b34801561079857600080fd5b506103096107a7366004612d16565b611987565b3480156107b857600080fd5b506103096107c73660046127c5565b6001600160a01b031660009081526006602052604090205490565b3480156107ee57600080fd5b50600254610309565b34801561080357600080fd5b506102f6610812366004612a85565b611a28565b34801561082357600080fd5b506102f66108323660046127c5565b611ab1565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a70000000000000000000000000000000000000000000000000000000014806108ca57507fffffffff0000000000000000000000000000000000000000000000000000000082167f93e17f0200000000000000000000000000000000000000000000000000000000145b92915050565b6001600160a01b0381166000908152600360205260409020546109605760405162461bcd60e51b815260206004820152602660248201527f5061796d656e7453706c69747465723a206163636f756e7420686173206e6f2060448201527f736861726573000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b600061096b826115b7565b9050806000036109e35760405162461bcd60e51b815260206004820152602b60248201527f5061796d656e7453706c69747465723a206163636f756e74206973206e6f742060448201527f647565207061796d656e740000000000000000000000000000000000000000006064820152608401610957565b6001600160a01b03821660009081526004602052604081208054839290610a0b908490612e1f565b925050819055508060026000828254610a249190612e1f565b90915550610a3490508282611b41565b604080516001600160a01b0384168152602081018390527fdf20fd1e76bc69d672e4814fafb2c449bba3a5369d8359adf9e05e6fde87b056910160405180910390a15050565b6001600160a01b038116600090815260036020526040902054610b055760405162461bcd60e51b815260206004820152602660248201527f5061796d656e7453706c69747465723a206163636f756e7420686173206e6f2060448201527f73686172657300000000000000000000000000000000000000000000000000006064820152608401610957565b6000610b1183836116c7565b905080600003610b895760405162461bcd60e51b815260206004820152602b60248201527f5061796d656e7453706c69747465723a206163636f756e74206973206e6f742060448201527f647565207061796d656e740000000000000000000000000000000000000000006064820152608401610957565b6001600160a01b03808416600090815260076020908152604080832093861683529290529081208054839290610bc0908490612e1f565b90915550506001600160a01b03831660009081526006602052604081208054839290610bed908490612e1f565b90915550610bfe9050838383611c5a565b604080516001600160a01b038481168252602082018490528516917f3be5b7a71e84ed12875d241991c70855ac5817d847039e17a9d895c1ceb0f18a910160405180910390a2505050565b610c51611cda565b6040517fa9059cbb0000000000000000000000000000000000000000000000000000000081526001600160a01b0383811660048301526024820183905284169063a9059cbb906044016020604051808303816000875af1158015610cb9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cdd9190612e32565b50505050565b60008585604051610cf5929190612e4f565b6040805191829003822060006020840181905291830181905292509060600160408051808303601f190181529082905280516020909101207ff44779b90000000000000000000000000000000000000000000000000000000082526004820181905233602483015291507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063f44779b9906044016020604051808303816000875af1158015610db2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dd69190612e32565b610e0f576040517fe4fd57ae00000000000000000000000000000000000000000000000000000000815260048101829052602401610957565b610e1c8787878787611d34565b50505050505050565b610e2d611cda565b610e376000611f2c565b565b6000610e7c8c8c8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508d9250611369915050565b60208101518151919250610e8f91612e1f565b341015610ec8576040517f1101129400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610f078c8c8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061160b92505050565b610f41578b8b6040517f477707e8000000000000000000000000000000000000000000000000000000008152600401610957929190612e8a565b610f93610f8e8d8d8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508f92508e91508d90508c8c8c8c8c8c611987565b611f94565b6224ea00891015610fd3576040517f9a71997b000000000000000000000000000000000000000000000000000000008152600481018a9052602401610957565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663bd87b55b8e8e8e8e8d8a8a6040518863ffffffff1660e01b815260040161102d9796959493929190612e9e565b6020604051808303816000875af115801561104c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110709190612efb565b9050851561109b5761109b888e8e60405161108c929190612e4f565b60405180910390208989612092565b84156110e4576110e48d8d8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508c925033915061214d9050565b8a6001600160a01b03168d8d6040516110fe929190612e4f565b60405180910390207f69e37f151eb98a09618ddaa80c8cfaf1ce5996867c489f45b555b412271ebf278f8f8660000151876020015187604051611145959493929190612f14565b60405180910390a36020820151825161115e9190612e1f565b3411156111b0576020820151825133916108fc9161117c9190612e1f565b6111869034612f45565b6040518115909202916000818181858888f193505050501580156111ae573d6000803e3d6000fd5b505b50505050505050505050505050565b60006111ca8a6121fb565b90506111d68a336117a3565b61120e57806040517f477707e80000000000000000000000000000000000000000000000000000000081526004016109579190612fa8565b611227610f8e828b6301e133808c8c8c8c8c8c8c611987565b6040517fbd87b55b0000000000000000000000000000000000000000000000000000000081526000906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063bd87b55b9061129d9085908e906301e13380908e908b908b90600401612fbb565b6020604051808303816000875af11580156112bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112e09190612efb565b905085156112fb576112fb8883805190602001208989612092565b841561130c5761130c82893361214d565b896001600160a01b031682805190602001207f69e37f151eb98a09618ddaa80c8cfaf1ce5996867c489f45b555b412271ebf2784600080866040516113549493929190613016565b60405180910390a35050505050505050505050565b6040805180820190915260008082526020820152825160208401206040517fd6e4fa86000000000000000000000000000000000000000000000000000000008152600481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691638416a3749187917f00000000000000000000000000000000000000000000000000000000000000009091169063d6e4fa8690602401602060405180830381865afa158015611431573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114559190612efb565b6040517f9c581d530000000000000000000000000000000000000000000000000000000081526004810186905287907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690639c581d5390602401602060405180830381865afa1580156114d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114f99190612e32565b6040518563ffffffff1660e01b81526004016115189493929190613045565b6040805180830381865afa158015611534573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115589190613076565b949350505050565b600060058281548110611575576115756130c5565b6000918252602090912001546001600160a01b031692915050565b60008061159c83612330565b9050600181101580156115b05750603f8111155b9392505050565b6000806115c360025490565b6115cd9047612e1f565b90506115b083826115f3866001600160a01b031660009081526004602052604090205490565b612537565b611606838383600080611d34565b505050565b8051602082012060009061161e83611590565b80156115b057506040517f96e494e8000000000000000000000000000000000000000000000000000000008152600481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906396e494e890602401602060405180830381865afa1580156116a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115b09190612e32565b6001600160a01b03821660009081526006602052604081205481906040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b038616906370a0823190602401602060405180830381865afa15801561173f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117639190612efb565b61176d9190612e1f565b6001600160a01b038086166000908152600760209081526040808320938816835292905220549091506115589084908390612537565b60006103e88310806117e05750624f1a006117de7f000000000000000000000000000000000000000000000000000000000000000042612f45565b115b156117ed575060006108ca565b6040517f6352211e000000000000000000000000000000000000000000000000000000008152600481018490527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690636352211e90602401602060405180830381865afa925050508015611887575060408051601f3d908101601f19168201909252611884918101906130f4565b60015b611893575060006108ca565b826001600160a01b0316816001600160a01b03160361197d5760006118b7856121fb565b805160208201209091506118ca82611590565b801561197357506040517f96e494e8000000000000000000000000000000000000000000000000000000008152600481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906396e494e890602401602060405180830381865afa15801561194f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119739190612e32565b93505050506108ca565b60009150506108ca565b895160208b012060009085158015906119a757506001600160a01b038816155b156119de576040517fd3f605c400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b808b8b8a8a8a8e8b8b8b604051602001611a019a999897969594939291906131c1565b604051602081830303815290604052805190602001209150509a9950505050505050505050565b6000818152600860205260409020544290611a64907f000000000000000000000000000000000000000000000000000000000000000090612e1f565b10611a9e576040517f0a059d7100000000000000000000000000000000000000000000000000000000815260048101829052602401610957565b6000908152600860205260409020429055565b611ab9611cda565b6001600160a01b038116611b355760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610957565b611b3e81611f2c565b50565b80471015611b915760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610957565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114611bde576040519150601f19603f3d011682016040523d82523d6000602084013e611be3565b606091505b50509050806116065760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610957565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052611606908490612575565b6000546001600160a01b03163314610e375760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610957565b60008585604051611d46929190612e4f565b604080519182900382206020601f890181900481028401810190925287835292508291600091611d9391908a908a90819084018382808284376000920191909152508a9250611369915050565b8051909150341015611dd1576040517f1101129400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f47d2e9fe000000000000000000000000000000000000000000000000000000008152600481018390526024810187905263ffffffff8616604482015267ffffffffffffffff851660648201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906347d2e9fe906084016020604051808303816000875af1158015611e77573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e9b9190612efb565b8251909150341115611ee357815133906108fc90611eb99034612f45565b6040518115909202916000818181858888f19350505050158015611ee1573d6000803e3d6000fd5b505b837f3da24c024582931cfaf8267d8ed24d13a82a8068d5bd337d30ec45cea4e506ae8a8a3485604051611f199493929190613236565b60405180910390a2505050505050505050565b600080546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000818152600860205260409020544290611fd0907f000000000000000000000000000000000000000000000000000000000000000090612e1f565b111561200b576040517f5320bcf900000000000000000000000000000000000000000000000000000000815260048101829052602401610957565b6000818152600860205260409020544290612047907f000000000000000000000000000000000000000000000000000000000000000090612e1f565b11612081576040517fcb7690d700000000000000000000000000000000000000000000000000000000815260048101829052602401610957565b600090815260086020526040812055565b604080516000602080830191909152818301869052825180830384018152606083019384905280519101207fe32954eb0000000000000000000000000000000000000000000000000000000090925285906001600160a01b0382169063e32954eb906121069085908890889060640161325d565b6000604051808303816000875af1158015612125573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610e1c9190810190613280565b6040517f7a806d6b0000000000000000000000000000000000000000000000000000000081526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690637a806d6b906121b890339085908790899060040161337f565b6020604051808303816000875af11580156121d7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cdd9190612efb565b60608160000361223e57505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b81156122685780612252816133bd565b91506122619050600a83613424565b9150612242565b60008167ffffffffffffffff81111561228357612283612b4d565b6040519080825280601f01601f1916602001820160405280156122ad576020820181803683370190505b5090505b8415611558576122c2600183612f45565b91506122cf600a86613438565b6122da906030612e1f565b60f81b8183815181106122ef576122ef6130c5565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350612329600a86613424565b94506122b1565b8051600090819081905b8082101561252e576000858381518110612356576123566130c5565b01602001517fff000000000000000000000000000000000000000000000000000000000000001690507f80000000000000000000000000000000000000000000000000000000000000008110156123b9576123b2600184612e1f565b925061251b565b7fe0000000000000000000000000000000000000000000000000000000000000007fff000000000000000000000000000000000000000000000000000000000000008216101561240e576123b2600284612e1f565b7ff0000000000000000000000000000000000000000000000000000000000000007fff0000000000000000000000000000000000000000000000000000000000000082161015612463576123b2600384612e1f565b7ff8000000000000000000000000000000000000000000000000000000000000007fff00000000000000000000000000000000000000000000000000000000000000821610156124b8576123b2600484612e1f565b7ffc000000000000000000000000000000000000000000000000000000000000007fff000000000000000000000000000000000000000000000000000000000000008216101561250d576123b2600584612e1f565b612518600684612e1f565b92505b5082612526816133bd565b93505061233a565b50909392505050565b6001546001600160a01b03841660009081526003602052604081205490918391612561908661344c565b61256b9190613424565b6115589190612f45565b60006125ca826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661265a9092919063ffffffff16565b80519091501561160657808060200190518101906125e89190612e32565b6116065760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610957565b60606115588484600085856001600160a01b0385163b6126bc5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610957565b600080866001600160a01b031685876040516126d89190613463565b60006040518083038185875af1925050503d8060008114612715576040519150601f19603f3d011682016040523d82523d6000602084013e61271a565b606091505b509150915061272a828286612735565b979650505050505050565b606083156127445750816115b0565b8251156127545782518084602001fd5b8160405162461bcd60e51b81526004016109579190612fa8565b60006020828403121561278057600080fd5b81357fffffffff00000000000000000000000000000000000000000000000000000000811681146115b057600080fd5b6001600160a01b0381168114611b3e57600080fd5b6000602082840312156127d757600080fd5b81356115b0816127b0565b600080604083850312156127f557600080fd5b8235612800816127b0565b91506020830135612810816127b0565b809150509250929050565b60008060006060848603121561283057600080fd5b833561283b816127b0565b9250602084013561284b816127b0565b929592945050506040919091013590565b60008083601f84011261286e57600080fd5b50813567ffffffffffffffff81111561288657600080fd5b60208301915083602082850101111561289e57600080fd5b9250929050565b803563ffffffff811681146128b957600080fd5b919050565b803567ffffffffffffffff811681146128b957600080fd5b6000806000806000608086880312156128ee57600080fd5b853567ffffffffffffffff81111561290557600080fd5b6129118882890161285c565b9096509450506020860135925061292a604087016128a5565b9150612938606087016128be565b90509295509295909350565b60008083601f84011261295657600080fd5b50813567ffffffffffffffff81111561296e57600080fd5b6020830191508360208260051b850101111561289e57600080fd5b8015158114611b3e57600080fd5b80356128b981612989565b60008060008060008060008060008060006101208c8e0312156129c457600080fd5b67ffffffffffffffff808d3511156129db57600080fd5b6129e88e8e358f0161285c565b909c509a506129fa60208e01356127b0565b60208d0135995060408d0135985060608d01359750612a1c60808e01356127b0565b60808d013596508060a08e01351115612a3457600080fd5b50612a458d60a08e01358e01612944565b9095509350612a5660c08d01612997565b9250612a6460e08d016128a5565b9150612a736101008d016128be565b90509295989b509295989b9093969950565b600060208284031215612a9757600080fd5b5035919050565b60008060008060008060008060006101008a8c031215612abd57600080fd5b8935985060208a0135612acf816127b0565b975060408a0135965060608a0135612ae6816127b0565b955060808a013567ffffffffffffffff811115612b0257600080fd5b612b0e8c828d01612944565b90965094505060a08a0135612b2281612989565b9250612b3060c08b016128a5565b9150612b3e60e08b016128be565b90509295985092959850929598565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612ba557612ba5612b4d565b604052919050565b600067ffffffffffffffff821115612bc757612bc7612b4d565b50601f01601f191660200190565b600082601f830112612be657600080fd5b8135612bf9612bf482612bad565b612b7c565b818152846020838601011115612c0e57600080fd5b816020850160208301376000918101602001919091529392505050565b60008060408385031215612c3e57600080fd5b823567ffffffffffffffff811115612c5557600080fd5b612c6185828601612bd5565b95602094909401359450505050565b600060208284031215612c8257600080fd5b813567ffffffffffffffff811115612c9957600080fd5b61155884828501612bd5565b600080600060408486031215612cba57600080fd5b833567ffffffffffffffff811115612cd157600080fd5b612cdd8682870161285c565b909790965060209590950135949350505050565b60008060408385031215612d0457600080fd5b823591506020830135612810816127b0565b6000806000806000806000806000806101208b8d031215612d3657600080fd5b8a3567ffffffffffffffff80821115612d4e57600080fd5b612d5a8e838f01612bd5565b9b5060208d01359150612d6c826127b0565b90995060408c0135985060608c0135975060808c013590612d8c826127b0565b90965060a08c01359080821115612da257600080fd5b50612daf8d828e01612944565b9096509450612dc2905060c08c01612997565b9250612dd060e08c016128a5565b9150612ddf6101008c016128be565b90509295989b9194979a5092959850565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b808201808211156108ca576108ca612df0565b600060208284031215612e4457600080fd5b81516115b081612989565b8183823760009101908152919050565b818352818160208501375060006020828401015260006020601f19601f840116840101905092915050565b602081526000611558602083018486612e5f565b60c081526000612eb260c08301898b612e5f565b90506001600160a01b03808816602084015286604084015280861660608401525063ffffffff8416608083015267ffffffffffffffff831660a083015298975050505050505050565b600060208284031215612f0d57600080fd5b5051919050565b608081526000612f28608083018789612e5f565b602083019590955250604081019290925260609091015292915050565b818103818111156108ca576108ca612df0565b60005b83811015612f73578181015183820152602001612f5b565b50506000910152565b60008151808452612f94816020860160208601612f58565b601f01601f19169290920160200192915050565b6020815260006115b06020830184612f7c565b60c081526000612fce60c0830189612f7c565b90506001600160a01b03808816602084015286604084015280861660608401525063ffffffff8416608083015267ffffffffffffffff831660a0830152979650505050505050565b6080815260006130296080830187612f7c565b6020830195909552506040810192909252606090910152919050565b6080815260006130586080830187612f7c565b60208301959095525060408101929092521515606090910152919050565b60006040828403121561308857600080fd5b6040516040810181811067ffffffffffffffff821117156130ab576130ab612b4d565b604052825181526020928301519281019290925250919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60006020828403121561310657600080fd5b81516115b0816127b0565b81835260006020808501808196508560051b810191508460005b878110156131b457828403895281357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe188360301811261316a57600080fd5b8701858101903567ffffffffffffffff81111561318657600080fd5b80360382131561319557600080fd5b6131a0868284612e5f565b9a87019a955050509084019060010161312b565b5091979650505050505050565b60006101208c83526001600160a01b03808d1660208501528b6040850152808b166060850152508060808401526131fb818401898b613111565b60a0840197909752505092151560c084015263ffffffff9190911660e083015267ffffffffffffffff16610100909101529695505050505050565b60608152600061324a606083018688612e5f565b6020830194909452506040015292915050565b838152604060208201526000613277604083018486613111565b95945050505050565b6000602080838503121561329357600080fd5b825167ffffffffffffffff808211156132ab57600080fd5b818501915085601f8301126132bf57600080fd5b8151818111156132d1576132d1612b4d565b8060051b6132e0858201612b7c565b91825283810185019185810190898411156132fa57600080fd5b86860192505b83831015613372578251858111156133185760008081fd5b8601603f81018b1361332a5760008081fd5b87810151604061333c612bf483612bad565b8281528d828486010111156133515760008081fd5b613360838c8301848701612f58565b85525050509186019190860190613300565b9998505050505050505050565b60006001600160a01b0380871683528086166020840152808516604084015250608060608301526133b36080830184612f7c565b9695505050505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036133ee576133ee612df0565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600082613433576134336133f5565b500490565b600082613447576134476133f5565b500690565b80820281158282048414176108ca576108ca612df0565b60008251613475818460208701612f58565b919091019291505056fea26469706673582212202d052cf6362f3ee2a5c2c7213d78dc833b03cea8157bd8199bdf58943ad39e9c64736f6c6343000811003300000000000000000000000067c8aff20754629308ce5be49f5cfeef5c7d5296000000000000000000000000d62c64a8846d704c7775679982219e477dcb564a000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000000000000000000000000000000000000015180000000000000000000000000f48e537ee5619c43bf9586cc132a5fb299e5d79b0000000000000000000000002411c98cc59d88e13cc9cbfc576f7d40828ac47c0000000000000000000000005b832b157623051c48f681b6bab63b4deefa52f5000000000000000000000000bc4ca0eda7647a8ab7c2061c2e118a18a936f13d000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000002a0000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000003acf527f92f87c98bfd86ad8b51681aac693e6b90000000000000000000000004eaf9a20ed5bdca4701747d5fececf02f9c2da99000000000000000000000000e068ace3f29d5ad7deb76e145f16204d2378c3610000000000000000000000001b1687844973cf64ff7b390a88bdf8448f14255d000000000000000000000000e700f467b75270f95e3651ee3ede8bbb06a0fb5c0000000000000000000000002bdae27ae1a7ff0fe811e1a09ee9ea4610adb8b20000000000000000000000002e084ea6f7100d2ffe0d0fc732c550150fcb5096000000000000000000000000f08495bf4aa1f9ecd4ad1371c5fff61c48741dcc000000000000000000000000e8d562606f35cb14da3e8fab1174f9b5ae8319c4000000000000000000000000f9d601a691689c254512e477932ad31f19bdc516000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000f000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000f00000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000000005
Deployed Bytecode
0x6080604052600436106102535760003560e01c80639582b6e511610138578063ce1e09c0116100b0578063d555254a1161007f578063e33b7de311610064578063e33b7de3146107e2578063f14fcbc8146107f7578063f2fde38b1461081757600080fd5b8063d555254a1461078c578063d79779b2146107ac57600080fd5b8063ce1e09c0146106ce578063ce7c2ac214610702578063cf31a7af14610738578063d3419bf31461075857600080fd5b8063a8e5fbc011610107578063aeb8ce9b116100ec578063aeb8ce9b1461065a578063ba9a061a1461067a578063c45ac050146106ae57600080fd5b8063a8e5fbc014610613578063acf1a8411461064757600080fd5b80639582b6e5146105695780639791c0971461059d5780639852595c146105bd578063a3f8eace146105f357600080fd5b80637acaaf26116101cb57806383e7f6ff1161019a5780638b83209b1161017f5780638b83209b146104f75780638d839ffe146105175780638da5cb5b1461054b57600080fd5b806383e7f6ff146104a55780638a95b09f146104e057600080fd5b80637acaaf26146104115780638086985314610424578063839df9451461045857806383ae092c1461048557600080fd5b806348b75044116102225780635d3590d5116102075780635d3590d5146103c95780636459220f146103e9578063715018a6146103fc57600080fd5b806348b750441461035d57806359cf34231461037d57600080fd5b806301ffc9a7146102a157806319165587146102d65780633a98ef39146102f8578063406072a91461031757600080fd5b3661029c577f6ef95f06320e7a25a04a175ca677b7052bdd97131872c2192525a629f51be77033604080516001600160a01b0390921682523460208301520160405180910390a1005b600080fd5b3480156102ad57600080fd5b506102c16102bc36600461276e565b610837565b60405190151581526020015b60405180910390f35b3480156102e257600080fd5b506102f66102f13660046127c5565b6108d0565b005b34801561030457600080fd5b506001545b6040519081526020016102cd565b34801561032357600080fd5b506103096103323660046127e2565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205490565b34801561036957600080fd5b506102f66103783660046127e2565b610a7a565b34801561038957600080fd5b506103b17f0000000000000000000000005b832b157623051c48f681b6bab63b4deefa52f581565b6040516001600160a01b0390911681526020016102cd565b3480156103d557600080fd5b506102f66103e436600461281b565b610c49565b6102f66103f73660046128d6565b610ce3565b34801561040857600080fd5b506102f6610e25565b6102f661041f3660046129a2565b610e39565b34801561043057600080fd5b506103b17f000000000000000000000000f48e537ee5619c43bf9586cc132a5fb299e5d79b81565b34801561046457600080fd5b50610309610473366004612a85565b60086020526000908152604090205481565b34801561049157600080fd5b506102f66104a0366004612a9e565b6111bf565b3480156104b157600080fd5b506104c56104c0366004612c2b565b611369565b604080518251815260209283015192810192909252016102cd565b3480156104ec57600080fd5b506103096224ea0081565b34801561050357600080fd5b506103b1610512366004612a85565b611560565b34801561052357600080fd5b506103097f000000000000000000000000000000000000000000000000000000000000003c81565b34801561055757600080fd5b506000546001600160a01b03166103b1565b34801561057557600080fd5b506103b17f000000000000000000000000bc4ca0eda7647a8ab7c2061c2e118a18a936f13d81565b3480156105a957600080fd5b506102c16105b8366004612c70565b611590565b3480156105c957600080fd5b506103096105d83660046127c5565b6001600160a01b031660009081526004602052604090205490565b3480156105ff57600080fd5b5061030961060e3660046127c5565b6115b7565b34801561061f57600080fd5b506103b17f0000000000000000000000002411c98cc59d88e13cc9cbfc576f7d40828ac47c81565b6102f6610655366004612ca5565b6115f8565b34801561066657600080fd5b506102c1610675366004612c70565b61160b565b34801561068657600080fd5b506103097f000000000000000000000000000000000000000000000000000000006442867781565b3480156106ba57600080fd5b506103096106c93660046127e2565b6116c7565b3480156106da57600080fd5b506103097f000000000000000000000000000000000000000000000000000000000001518081565b34801561070e57600080fd5b5061030961071d3660046127c5565b6001600160a01b031660009081526003602052604090205490565b34801561074457600080fd5b506102c1610753366004612cf1565b6117a3565b34801561076457600080fd5b506103b17f000000000000000000000000d62c64a8846d704c7775679982219e477dcb564a81565b34801561079857600080fd5b506103096107a7366004612d16565b611987565b3480156107b857600080fd5b506103096107c73660046127c5565b6001600160a01b031660009081526006602052604090205490565b3480156107ee57600080fd5b50600254610309565b34801561080357600080fd5b506102f6610812366004612a85565b611a28565b34801561082357600080fd5b506102f66108323660046127c5565b611ab1565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a70000000000000000000000000000000000000000000000000000000014806108ca57507fffffffff0000000000000000000000000000000000000000000000000000000082167f93e17f0200000000000000000000000000000000000000000000000000000000145b92915050565b6001600160a01b0381166000908152600360205260409020546109605760405162461bcd60e51b815260206004820152602660248201527f5061796d656e7453706c69747465723a206163636f756e7420686173206e6f2060448201527f736861726573000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b600061096b826115b7565b9050806000036109e35760405162461bcd60e51b815260206004820152602b60248201527f5061796d656e7453706c69747465723a206163636f756e74206973206e6f742060448201527f647565207061796d656e740000000000000000000000000000000000000000006064820152608401610957565b6001600160a01b03821660009081526004602052604081208054839290610a0b908490612e1f565b925050819055508060026000828254610a249190612e1f565b90915550610a3490508282611b41565b604080516001600160a01b0384168152602081018390527fdf20fd1e76bc69d672e4814fafb2c449bba3a5369d8359adf9e05e6fde87b056910160405180910390a15050565b6001600160a01b038116600090815260036020526040902054610b055760405162461bcd60e51b815260206004820152602660248201527f5061796d656e7453706c69747465723a206163636f756e7420686173206e6f2060448201527f73686172657300000000000000000000000000000000000000000000000000006064820152608401610957565b6000610b1183836116c7565b905080600003610b895760405162461bcd60e51b815260206004820152602b60248201527f5061796d656e7453706c69747465723a206163636f756e74206973206e6f742060448201527f647565207061796d656e740000000000000000000000000000000000000000006064820152608401610957565b6001600160a01b03808416600090815260076020908152604080832093861683529290529081208054839290610bc0908490612e1f565b90915550506001600160a01b03831660009081526006602052604081208054839290610bed908490612e1f565b90915550610bfe9050838383611c5a565b604080516001600160a01b038481168252602082018490528516917f3be5b7a71e84ed12875d241991c70855ac5817d847039e17a9d895c1ceb0f18a910160405180910390a2505050565b610c51611cda565b6040517fa9059cbb0000000000000000000000000000000000000000000000000000000081526001600160a01b0383811660048301526024820183905284169063a9059cbb906044016020604051808303816000875af1158015610cb9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cdd9190612e32565b50505050565b60008585604051610cf5929190612e4f565b6040805191829003822060006020840181905291830181905292509060600160408051808303601f190181529082905280516020909101207ff44779b90000000000000000000000000000000000000000000000000000000082526004820181905233602483015291507f0000000000000000000000002411c98cc59d88e13cc9cbfc576f7d40828ac47c6001600160a01b03169063f44779b9906044016020604051808303816000875af1158015610db2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dd69190612e32565b610e0f576040517fe4fd57ae00000000000000000000000000000000000000000000000000000000815260048101829052602401610957565b610e1c8787878787611d34565b50505050505050565b610e2d611cda565b610e376000611f2c565b565b6000610e7c8c8c8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508d9250611369915050565b60208101518151919250610e8f91612e1f565b341015610ec8576040517f1101129400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610f078c8c8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061160b92505050565b610f41578b8b6040517f477707e8000000000000000000000000000000000000000000000000000000008152600401610957929190612e8a565b610f93610f8e8d8d8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508f92508e91508d90508c8c8c8c8c8c611987565b611f94565b6224ea00891015610fd3576040517f9a71997b000000000000000000000000000000000000000000000000000000008152600481018a9052602401610957565b60007f0000000000000000000000002411c98cc59d88e13cc9cbfc576f7d40828ac47c6001600160a01b031663bd87b55b8e8e8e8e8d8a8a6040518863ffffffff1660e01b815260040161102d9796959493929190612e9e565b6020604051808303816000875af115801561104c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110709190612efb565b9050851561109b5761109b888e8e60405161108c929190612e4f565b60405180910390208989612092565b84156110e4576110e48d8d8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508c925033915061214d9050565b8a6001600160a01b03168d8d6040516110fe929190612e4f565b60405180910390207f69e37f151eb98a09618ddaa80c8cfaf1ce5996867c489f45b555b412271ebf278f8f8660000151876020015187604051611145959493929190612f14565b60405180910390a36020820151825161115e9190612e1f565b3411156111b0576020820151825133916108fc9161117c9190612e1f565b6111869034612f45565b6040518115909202916000818181858888f193505050501580156111ae573d6000803e3d6000fd5b505b50505050505050505050505050565b60006111ca8a6121fb565b90506111d68a336117a3565b61120e57806040517f477707e80000000000000000000000000000000000000000000000000000000081526004016109579190612fa8565b611227610f8e828b6301e133808c8c8c8c8c8c8c611987565b6040517fbd87b55b0000000000000000000000000000000000000000000000000000000081526000906001600160a01b037f0000000000000000000000002411c98cc59d88e13cc9cbfc576f7d40828ac47c169063bd87b55b9061129d9085908e906301e13380908e908b908b90600401612fbb565b6020604051808303816000875af11580156112bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112e09190612efb565b905085156112fb576112fb8883805190602001208989612092565b841561130c5761130c82893361214d565b896001600160a01b031682805190602001207f69e37f151eb98a09618ddaa80c8cfaf1ce5996867c489f45b555b412271ebf2784600080866040516113549493929190613016565b60405180910390a35050505050505050505050565b6040805180820190915260008082526020820152825160208401206040517fd6e4fa86000000000000000000000000000000000000000000000000000000008152600481018290527f000000000000000000000000d62c64a8846d704c7775679982219e477dcb564a6001600160a01b0390811691638416a3749187917f00000000000000000000000067c8aff20754629308ce5be49f5cfeef5c7d52969091169063d6e4fa8690602401602060405180830381865afa158015611431573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114559190612efb565b6040517f9c581d530000000000000000000000000000000000000000000000000000000081526004810186905287907f0000000000000000000000005b832b157623051c48f681b6bab63b4deefa52f56001600160a01b031690639c581d5390602401602060405180830381865afa1580156114d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114f99190612e32565b6040518563ffffffff1660e01b81526004016115189493929190613045565b6040805180830381865afa158015611534573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115589190613076565b949350505050565b600060058281548110611575576115756130c5565b6000918252602090912001546001600160a01b031692915050565b60008061159c83612330565b9050600181101580156115b05750603f8111155b9392505050565b6000806115c360025490565b6115cd9047612e1f565b90506115b083826115f3866001600160a01b031660009081526004602052604090205490565b612537565b611606838383600080611d34565b505050565b8051602082012060009061161e83611590565b80156115b057506040517f96e494e8000000000000000000000000000000000000000000000000000000008152600481018290527f00000000000000000000000067c8aff20754629308ce5be49f5cfeef5c7d52966001600160a01b0316906396e494e890602401602060405180830381865afa1580156116a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115b09190612e32565b6001600160a01b03821660009081526006602052604081205481906040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b038616906370a0823190602401602060405180830381865afa15801561173f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117639190612efb565b61176d9190612e1f565b6001600160a01b038086166000908152600760209081526040808320938816835292905220549091506115589084908390612537565b60006103e88310806117e05750624f1a006117de7f000000000000000000000000000000000000000000000000000000006442867742612f45565b115b156117ed575060006108ca565b6040517f6352211e000000000000000000000000000000000000000000000000000000008152600481018490527f000000000000000000000000bc4ca0eda7647a8ab7c2061c2e118a18a936f13d6001600160a01b031690636352211e90602401602060405180830381865afa925050508015611887575060408051601f3d908101601f19168201909252611884918101906130f4565b60015b611893575060006108ca565b826001600160a01b0316816001600160a01b03160361197d5760006118b7856121fb565b805160208201209091506118ca82611590565b801561197357506040517f96e494e8000000000000000000000000000000000000000000000000000000008152600481018290527f00000000000000000000000067c8aff20754629308ce5be49f5cfeef5c7d52966001600160a01b0316906396e494e890602401602060405180830381865afa15801561194f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119739190612e32565b93505050506108ca565b60009150506108ca565b895160208b012060009085158015906119a757506001600160a01b038816155b156119de576040517fd3f605c400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b808b8b8a8a8a8e8b8b8b604051602001611a019a999897969594939291906131c1565b604051602081830303815290604052805190602001209150509a9950505050505050505050565b6000818152600860205260409020544290611a64907f000000000000000000000000000000000000000000000000000000000001518090612e1f565b10611a9e576040517f0a059d7100000000000000000000000000000000000000000000000000000000815260048101829052602401610957565b6000908152600860205260409020429055565b611ab9611cda565b6001600160a01b038116611b355760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610957565b611b3e81611f2c565b50565b80471015611b915760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610957565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114611bde576040519150601f19603f3d011682016040523d82523d6000602084013e611be3565b606091505b50509050806116065760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610957565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052611606908490612575565b6000546001600160a01b03163314610e375760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610957565b60008585604051611d46929190612e4f565b604080519182900382206020601f890181900481028401810190925287835292508291600091611d9391908a908a90819084018382808284376000920191909152508a9250611369915050565b8051909150341015611dd1576040517f1101129400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f47d2e9fe000000000000000000000000000000000000000000000000000000008152600481018390526024810187905263ffffffff8616604482015267ffffffffffffffff851660648201526000907f0000000000000000000000002411c98cc59d88e13cc9cbfc576f7d40828ac47c6001600160a01b0316906347d2e9fe906084016020604051808303816000875af1158015611e77573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e9b9190612efb565b8251909150341115611ee357815133906108fc90611eb99034612f45565b6040518115909202916000818181858888f19350505050158015611ee1573d6000803e3d6000fd5b505b837f3da24c024582931cfaf8267d8ed24d13a82a8068d5bd337d30ec45cea4e506ae8a8a3485604051611f199493929190613236565b60405180910390a2505050505050505050565b600080546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000818152600860205260409020544290611fd0907f000000000000000000000000000000000000000000000000000000000000003c90612e1f565b111561200b576040517f5320bcf900000000000000000000000000000000000000000000000000000000815260048101829052602401610957565b6000818152600860205260409020544290612047907f000000000000000000000000000000000000000000000000000000000001518090612e1f565b11612081576040517fcb7690d700000000000000000000000000000000000000000000000000000000815260048101829052602401610957565b600090815260086020526040812055565b604080516000602080830191909152818301869052825180830384018152606083019384905280519101207fe32954eb0000000000000000000000000000000000000000000000000000000090925285906001600160a01b0382169063e32954eb906121069085908890889060640161325d565b6000604051808303816000875af1158015612125573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610e1c9190810190613280565b6040517f7a806d6b0000000000000000000000000000000000000000000000000000000081526001600160a01b037f000000000000000000000000f48e537ee5619c43bf9586cc132a5fb299e5d79b1690637a806d6b906121b890339085908790899060040161337f565b6020604051808303816000875af11580156121d7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cdd9190612efb565b60608160000361223e57505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b81156122685780612252816133bd565b91506122619050600a83613424565b9150612242565b60008167ffffffffffffffff81111561228357612283612b4d565b6040519080825280601f01601f1916602001820160405280156122ad576020820181803683370190505b5090505b8415611558576122c2600183612f45565b91506122cf600a86613438565b6122da906030612e1f565b60f81b8183815181106122ef576122ef6130c5565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350612329600a86613424565b94506122b1565b8051600090819081905b8082101561252e576000858381518110612356576123566130c5565b01602001517fff000000000000000000000000000000000000000000000000000000000000001690507f80000000000000000000000000000000000000000000000000000000000000008110156123b9576123b2600184612e1f565b925061251b565b7fe0000000000000000000000000000000000000000000000000000000000000007fff000000000000000000000000000000000000000000000000000000000000008216101561240e576123b2600284612e1f565b7ff0000000000000000000000000000000000000000000000000000000000000007fff0000000000000000000000000000000000000000000000000000000000000082161015612463576123b2600384612e1f565b7ff8000000000000000000000000000000000000000000000000000000000000007fff00000000000000000000000000000000000000000000000000000000000000821610156124b8576123b2600484612e1f565b7ffc000000000000000000000000000000000000000000000000000000000000007fff000000000000000000000000000000000000000000000000000000000000008216101561250d576123b2600584612e1f565b612518600684612e1f565b92505b5082612526816133bd565b93505061233a565b50909392505050565b6001546001600160a01b03841660009081526003602052604081205490918391612561908661344c565b61256b9190613424565b6115589190612f45565b60006125ca826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661265a9092919063ffffffff16565b80519091501561160657808060200190518101906125e89190612e32565b6116065760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610957565b60606115588484600085856001600160a01b0385163b6126bc5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610957565b600080866001600160a01b031685876040516126d89190613463565b60006040518083038185875af1925050503d8060008114612715576040519150601f19603f3d011682016040523d82523d6000602084013e61271a565b606091505b509150915061272a828286612735565b979650505050505050565b606083156127445750816115b0565b8251156127545782518084602001fd5b8160405162461bcd60e51b81526004016109579190612fa8565b60006020828403121561278057600080fd5b81357fffffffff00000000000000000000000000000000000000000000000000000000811681146115b057600080fd5b6001600160a01b0381168114611b3e57600080fd5b6000602082840312156127d757600080fd5b81356115b0816127b0565b600080604083850312156127f557600080fd5b8235612800816127b0565b91506020830135612810816127b0565b809150509250929050565b60008060006060848603121561283057600080fd5b833561283b816127b0565b9250602084013561284b816127b0565b929592945050506040919091013590565b60008083601f84011261286e57600080fd5b50813567ffffffffffffffff81111561288657600080fd5b60208301915083602082850101111561289e57600080fd5b9250929050565b803563ffffffff811681146128b957600080fd5b919050565b803567ffffffffffffffff811681146128b957600080fd5b6000806000806000608086880312156128ee57600080fd5b853567ffffffffffffffff81111561290557600080fd5b6129118882890161285c565b9096509450506020860135925061292a604087016128a5565b9150612938606087016128be565b90509295509295909350565b60008083601f84011261295657600080fd5b50813567ffffffffffffffff81111561296e57600080fd5b6020830191508360208260051b850101111561289e57600080fd5b8015158114611b3e57600080fd5b80356128b981612989565b60008060008060008060008060008060006101208c8e0312156129c457600080fd5b67ffffffffffffffff808d3511156129db57600080fd5b6129e88e8e358f0161285c565b909c509a506129fa60208e01356127b0565b60208d0135995060408d0135985060608d01359750612a1c60808e01356127b0565b60808d013596508060a08e01351115612a3457600080fd5b50612a458d60a08e01358e01612944565b9095509350612a5660c08d01612997565b9250612a6460e08d016128a5565b9150612a736101008d016128be565b90509295989b509295989b9093969950565b600060208284031215612a9757600080fd5b5035919050565b60008060008060008060008060006101008a8c031215612abd57600080fd5b8935985060208a0135612acf816127b0565b975060408a0135965060608a0135612ae6816127b0565b955060808a013567ffffffffffffffff811115612b0257600080fd5b612b0e8c828d01612944565b90965094505060a08a0135612b2281612989565b9250612b3060c08b016128a5565b9150612b3e60e08b016128be565b90509295985092959850929598565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612ba557612ba5612b4d565b604052919050565b600067ffffffffffffffff821115612bc757612bc7612b4d565b50601f01601f191660200190565b600082601f830112612be657600080fd5b8135612bf9612bf482612bad565b612b7c565b818152846020838601011115612c0e57600080fd5b816020850160208301376000918101602001919091529392505050565b60008060408385031215612c3e57600080fd5b823567ffffffffffffffff811115612c5557600080fd5b612c6185828601612bd5565b95602094909401359450505050565b600060208284031215612c8257600080fd5b813567ffffffffffffffff811115612c9957600080fd5b61155884828501612bd5565b600080600060408486031215612cba57600080fd5b833567ffffffffffffffff811115612cd157600080fd5b612cdd8682870161285c565b909790965060209590950135949350505050565b60008060408385031215612d0457600080fd5b823591506020830135612810816127b0565b6000806000806000806000806000806101208b8d031215612d3657600080fd5b8a3567ffffffffffffffff80821115612d4e57600080fd5b612d5a8e838f01612bd5565b9b5060208d01359150612d6c826127b0565b90995060408c0135985060608c0135975060808c013590612d8c826127b0565b90965060a08c01359080821115612da257600080fd5b50612daf8d828e01612944565b9096509450612dc2905060c08c01612997565b9250612dd060e08c016128a5565b9150612ddf6101008c016128be565b90509295989b9194979a5092959850565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b808201808211156108ca576108ca612df0565b600060208284031215612e4457600080fd5b81516115b081612989565b8183823760009101908152919050565b818352818160208501375060006020828401015260006020601f19601f840116840101905092915050565b602081526000611558602083018486612e5f565b60c081526000612eb260c08301898b612e5f565b90506001600160a01b03808816602084015286604084015280861660608401525063ffffffff8416608083015267ffffffffffffffff831660a083015298975050505050505050565b600060208284031215612f0d57600080fd5b5051919050565b608081526000612f28608083018789612e5f565b602083019590955250604081019290925260609091015292915050565b818103818111156108ca576108ca612df0565b60005b83811015612f73578181015183820152602001612f5b565b50506000910152565b60008151808452612f94816020860160208601612f58565b601f01601f19169290920160200192915050565b6020815260006115b06020830184612f7c565b60c081526000612fce60c0830189612f7c565b90506001600160a01b03808816602084015286604084015280861660608401525063ffffffff8416608083015267ffffffffffffffff831660a0830152979650505050505050565b6080815260006130296080830187612f7c565b6020830195909552506040810192909252606090910152919050565b6080815260006130586080830187612f7c565b60208301959095525060408101929092521515606090910152919050565b60006040828403121561308857600080fd5b6040516040810181811067ffffffffffffffff821117156130ab576130ab612b4d565b604052825181526020928301519281019290925250919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60006020828403121561310657600080fd5b81516115b0816127b0565b81835260006020808501808196508560051b810191508460005b878110156131b457828403895281357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe188360301811261316a57600080fd5b8701858101903567ffffffffffffffff81111561318657600080fd5b80360382131561319557600080fd5b6131a0868284612e5f565b9a87019a955050509084019060010161312b565b5091979650505050505050565b60006101208c83526001600160a01b03808d1660208501528b6040850152808b166060850152508060808401526131fb818401898b613111565b60a0840197909752505092151560c084015263ffffffff9190911660e083015267ffffffffffffffff16610100909101529695505050505050565b60608152600061324a606083018688612e5f565b6020830194909452506040015292915050565b838152604060208201526000613277604083018486613111565b95945050505050565b6000602080838503121561329357600080fd5b825167ffffffffffffffff808211156132ab57600080fd5b818501915085601f8301126132bf57600080fd5b8151818111156132d1576132d1612b4d565b8060051b6132e0858201612b7c565b91825283810185019185810190898411156132fa57600080fd5b86860192505b83831015613372578251858111156133185760008081fd5b8601603f81018b1361332a5760008081fd5b87810151604061333c612bf483612bad565b8281528d828486010111156133515760008081fd5b613360838c8301848701612f58565b85525050509186019190860190613300565b9998505050505050505050565b60006001600160a01b0380871683528086166020840152808516604084015250608060608301526133b36080830184612f7c565b9695505050505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036133ee576133ee612df0565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600082613433576134336133f5565b500490565b600082613447576134476133f5565b500690565b80820281158282048414176108ca576108ca612df0565b60008251613475818460208701612f58565b919091019291505056fea26469706673582212202d052cf6362f3ee2a5c2c7213d78dc833b03cea8157bd8199bdf58943ad39e9c64736f6c63430008110033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000067c8aff20754629308ce5be49f5cfeef5c7d5296000000000000000000000000d62c64a8846d704c7775679982219e477dcb564a000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000000000000000000000000000000000000015180000000000000000000000000f48e537ee5619c43bf9586cc132a5fb299e5d79b0000000000000000000000002411c98cc59d88e13cc9cbfc576f7d40828ac47c0000000000000000000000005b832b157623051c48f681b6bab63b4deefa52f5000000000000000000000000bc4ca0eda7647a8ab7c2061c2e118a18a936f13d000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000002a0000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000003acf527f92f87c98bfd86ad8b51681aac693e6b90000000000000000000000004eaf9a20ed5bdca4701747d5fececf02f9c2da99000000000000000000000000e068ace3f29d5ad7deb76e145f16204d2378c3610000000000000000000000001b1687844973cf64ff7b390a88bdf8448f14255d000000000000000000000000e700f467b75270f95e3651ee3ede8bbb06a0fb5c0000000000000000000000002bdae27ae1a7ff0fe811e1a09ee9ea4610adb8b20000000000000000000000002e084ea6f7100d2ffe0d0fc732c550150fcb5096000000000000000000000000f08495bf4aa1f9ecd4ad1371c5fff61c48741dcc000000000000000000000000e8d562606f35cb14da3e8fab1174f9b5ae8319c4000000000000000000000000f9d601a691689c254512e477932ad31f19bdc516000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000f000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000f00000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000000005
-----Decoded View---------------
Arg [0] : _base (address): 0x67C8aFF20754629308Ce5bE49F5cfEEF5c7D5296
Arg [1] : _prices (address): 0xd62c64a8846d704c7775679982219e477dcB564A
Arg [2] : _minCommitmentAge (uint256): 60
Arg [3] : _maxCommitmentAge (uint256): 86400
Arg [4] : _reverseRegistrar (address): 0xF48E537ee5619C43BF9586CC132A5Fb299E5D79B
Arg [5] : _nameWrapper (address): 0x2411C98CC59D88e13Cc9CbFc576F7D40828aC47c
Arg [6] : _reservedDomains (address): 0x5B832b157623051c48F681B6Bab63b4DeEFa52f5
Arg [7] : _BAYC (address): 0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D
Arg [8] : _payees (address[]): 0x3ACf527F92f87C98bFD86Ad8B51681AAc693e6B9,0x4eAF9A20Ed5bDCA4701747D5FeCeCf02f9C2dA99,0xe068ACe3F29d5AD7deB76E145F16204D2378c361,0x1B1687844973Cf64Ff7B390A88bdF8448F14255D,0xE700f467B75270f95e3651EE3eDe8bbb06A0fb5c,0x2BDaE27ae1a7FF0Fe811e1a09ee9Ea4610ADB8b2,0x2E084eA6f7100D2FFe0d0fc732C550150fCb5096,0xF08495bF4AA1f9EcD4AD1371c5fFf61c48741dCC,0xE8D562606F35CB14dA3E8faB1174F9B5AE8319c4,0xF9d601A691689C254512E477932AD31f19bDC516
Arg [9] : _shares (uint256[]): 10,10,15,10,10,10,10,15,5,5
-----Encoded View---------------
32 Constructor Arguments found :
Arg [0] : 00000000000000000000000067c8aff20754629308ce5be49f5cfeef5c7d5296
Arg [1] : 000000000000000000000000d62c64a8846d704c7775679982219e477dcb564a
Arg [2] : 000000000000000000000000000000000000000000000000000000000000003c
Arg [3] : 0000000000000000000000000000000000000000000000000000000000015180
Arg [4] : 000000000000000000000000f48e537ee5619c43bf9586cc132a5fb299e5d79b
Arg [5] : 0000000000000000000000002411c98cc59d88e13cc9cbfc576f7d40828ac47c
Arg [6] : 0000000000000000000000005b832b157623051c48f681b6bab63b4deefa52f5
Arg [7] : 000000000000000000000000bc4ca0eda7647a8ab7c2061c2e118a18a936f13d
Arg [8] : 0000000000000000000000000000000000000000000000000000000000000140
Arg [9] : 00000000000000000000000000000000000000000000000000000000000002a0
Arg [10] : 000000000000000000000000000000000000000000000000000000000000000a
Arg [11] : 0000000000000000000000003acf527f92f87c98bfd86ad8b51681aac693e6b9
Arg [12] : 0000000000000000000000004eaf9a20ed5bdca4701747d5fececf02f9c2da99
Arg [13] : 000000000000000000000000e068ace3f29d5ad7deb76e145f16204d2378c361
Arg [14] : 0000000000000000000000001b1687844973cf64ff7b390a88bdf8448f14255d
Arg [15] : 000000000000000000000000e700f467b75270f95e3651ee3ede8bbb06a0fb5c
Arg [16] : 0000000000000000000000002bdae27ae1a7ff0fe811e1a09ee9ea4610adb8b2
Arg [17] : 0000000000000000000000002e084ea6f7100d2ffe0d0fc732c550150fcb5096
Arg [18] : 000000000000000000000000f08495bf4aa1f9ecd4ad1371c5fff61c48741dcc
Arg [19] : 000000000000000000000000e8d562606f35cb14da3e8fab1174f9b5ae8319c4
Arg [20] : 000000000000000000000000f9d601a691689c254512e477932ad31f19bdc516
Arg [21] : 000000000000000000000000000000000000000000000000000000000000000a
Arg [22] : 000000000000000000000000000000000000000000000000000000000000000a
Arg [23] : 000000000000000000000000000000000000000000000000000000000000000a
Arg [24] : 000000000000000000000000000000000000000000000000000000000000000f
Arg [25] : 000000000000000000000000000000000000000000000000000000000000000a
Arg [26] : 000000000000000000000000000000000000000000000000000000000000000a
Arg [27] : 000000000000000000000000000000000000000000000000000000000000000a
Arg [28] : 000000000000000000000000000000000000000000000000000000000000000a
Arg [29] : 000000000000000000000000000000000000000000000000000000000000000f
Arg [30] : 0000000000000000000000000000000000000000000000000000000000000005
Arg [31] : 0000000000000000000000000000000000000000000000000000000000000005
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|---|---|---|---|---|
ETH | Ether (ETH) | 100.00% | $3,915.52 | 0.8005 | $3,134.18 |
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.