More Info
Private Name Tags
ContractCreator
TokenTracker
Latest 25 from a total of 461 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Multicall | 21278873 | 17 hrs ago | IN | 0 ETH | 0.00099708 | ||||
Multicall | 21265642 | 2 days ago | IN | 0 ETH | 0.00270517 | ||||
Multicall | 21250750 | 4 days ago | IN | 0 ETH | 0.00104126 | ||||
Transfer From | 21229728 | 7 days ago | IN | 0 ETH | 0.00142918 | ||||
Multicall | 21229698 | 7 days ago | IN | 0 ETH | 0.00143656 | ||||
Multicall | 21173936 | 15 days ago | IN | 0 ETH | 0.00236174 | ||||
Set Approval For... | 21172116 | 15 days ago | IN | 0 ETH | 0.00137761 | ||||
Multicall | 21155454 | 17 days ago | IN | 0 ETH | 0.00113561 | ||||
Multicall | 21155453 | 17 days ago | IN | 0 ETH | 0.00110318 | ||||
Multicall | 21104867 | 24 days ago | IN | 0 ETH | 0.00029534 | ||||
Multicall | 21099127 | 25 days ago | IN | 0 ETH | 0.00042509 | ||||
Multicall | 21099122 | 25 days ago | IN | 0 ETH | 0.00041626 | ||||
Multicall | 21075338 | 29 days ago | IN | 0 ETH | 0.00053728 | ||||
Multicall | 21058728 | 31 days ago | IN | 0 ETH | 0.00050128 | ||||
Multicall | 21054877 | 31 days ago | IN | 0 ETH | 0.0002841 | ||||
Multicall | 21054875 | 31 days ago | IN | 0 ETH | 0.00028578 | ||||
Multicall | 21054873 | 31 days ago | IN | 0 ETH | 0.0002933 | ||||
Multicall | 21051423 | 32 days ago | IN | 0 ETH | 0.00045615 | ||||
Multicall | 21051418 | 32 days ago | IN | 0 ETH | 0.00037933 | ||||
Multicall | 21050992 | 32 days ago | IN | 0 ETH | 0.00097031 | ||||
Multicall | 21050868 | 32 days ago | IN | 0 ETH | 0.00070352 | ||||
Multicall | 21050865 | 32 days ago | IN | 0 ETH | 0.00069941 | ||||
Multicall | 21029311 | 35 days ago | IN | 0 ETH | 0.00217818 | ||||
Multicall | 21013429 | 37 days ago | IN | 0 ETH | 0.00055542 | ||||
Multicall | 21008491 | 38 days ago | IN | 0 ETH | 0.00073834 |
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
20038937 | 173 days ago | 32 ETH | ||||
19936752 | 188 days ago | 32 ETH | ||||
19811500 | 205 days ago | 32 ETH | ||||
19811500 | 205 days ago | 32 ETH | ||||
19624340 | 231 days ago | 32 ETH | ||||
19486972 | 251 days ago | 32 ETH | ||||
19447677 | 256 days ago | 32 ETH | ||||
19447677 | 256 days ago | 32 ETH | ||||
19447677 | 256 days ago | 64 ETH | ||||
19314385 | 275 days ago | 32 ETH | ||||
19314385 | 275 days ago | 32 ETH | ||||
19314385 | 275 days ago | 32 ETH | ||||
19314090 | 275 days ago | 32 ETH | ||||
19314090 | 275 days ago | 32 ETH | ||||
19314090 | 275 days ago | 32 ETH | ||||
19314090 | 275 days ago | 32 ETH | ||||
19314090 | 275 days ago | 32 ETH | ||||
19314090 | 275 days ago | 32 ETH | ||||
19314090 | 275 days ago | 32 ETH | ||||
19314090 | 275 days ago | 32 ETH | ||||
19306495 | 276 days ago | 32 ETH | ||||
19296934 | 277 days ago | 32 ETH | ||||
19202343 | 291 days ago | 32 ETH | ||||
19202343 | 291 days ago | 32 ETH | ||||
19134128 | 300 days ago | 32 ETH |
Loading...
Loading
Contract Name:
StakefishNFTManager
Compiler Version
v0.8.12+commit.f00d7308
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.7; import "ReentrancyGuard.sol"; import "ERC721Enumerable.sol"; import "IStakefishNFTManager.sol"; import "IStakefishValidatorFactory.sol"; import "IStakefishValidator.sol"; import "IStakefishValidatorWallet.sol"; /// @title StakefishNFTManager implementation /// @notice Extends ERC721, mints and burns NFT representing validators contract StakefishNFTManager is IStakefishNFTManager, ERC721Enumerable, ReentrancyGuard { address public immutable override factory; /// @dev deployed validator contract => tokenId mapping(address => uint256) private _validatorToToken; /// @dev tokenId => deployed validator contract mapping(uint256 => address) private _tokenToValidator; /// @dev The ID of the next token that will be minted. uint256 internal _nextId = 1; modifier isAuthorizedForToken(uint256 tokenId) { require(_isApprovedOrOwner(msg.sender, tokenId), 'Not approved'); _; } modifier isNFTOwner(uint256 tokenId) { require(ownerOf(tokenId) == msg.sender, 'Not nft owner'); _; } constructor(address factory_) ERC721("stakefish validator", "SF-VLDR") { require(factory_ != address(0), "missing factory"); factory = factory_; } /// PUBLIC WRITE FUNCTIONS function mint(uint256 validatorCount) external override payable nonReentrant { require(validatorCount > 0, "wrong value: at least 1 validator must be minted"); require(validatorCount <= IStakefishValidatorFactory(factory).maxValidatorsPerTransaction(), "wrong value: validatorCount exceeds factory limit per transaction"); require(msg.value == validatorCount * 32 ether, "wrong value: must be 32 ETH per validator"); for(uint256 i=0; i < validatorCount; i++) { _mintOne(); } } function verifyAndBurn(address newManager, uint256 tokenId) external override isAuthorizedForToken(tokenId) nonReentrant { require(newManager != address(this), "new NFTManager cannot be the same as the current NFTManager"); require(IStakefishNFTManager(newManager).validatorOwner( _tokenToValidator[tokenId]) == ownerOf(tokenId), "owner on new NFTManager not confirmed"); address validatorAddress = _tokenToValidator[tokenId]; _burn(tokenId); _validatorToToken[validatorAddress] = 0; _tokenToValidator[tokenId] = address(0); require(IStakefishValidatorWallet(payable(validatorAddress)).getNFTManager() == newManager, "validator not changed to new nft manager"); emit StakefishBurnedWithContract(tokenId, validatorAddress, msg.sender); } function multicallStatic(uint256[] calldata tokenIds, bytes[] calldata data) external view override returns (bytes[] memory results) { results = new bytes[](data.length); for (uint256 i = 0; i < data.length; i++) { address validatorAddr = _tokenToValidator[tokenIds[i]]; require(validatorAddr != address(0), "multicall: address is null"); results[i] = Address.functionStaticCall(validatorAddr, data[i]); } return results; } function multicall(uint256[] calldata tokenIds, bytes[] calldata data) external override returns (bytes[] memory results) { results = new bytes[](data.length); for (uint256 i = 0; i < data.length; i++) { address validatorAddr = _tokenToValidator[tokenIds[i]]; require(validatorAddr != address(0), "multicall: address is null"); require(ownerOf(tokenIds[i]) == msg.sender, "only nft owner allowed"); results[i] = Address.functionCall(validatorAddr, data[i]); burnIfNecessary(tokenIds[i]); } return results; } function withdraw(uint256 tokenId) external override isNFTOwner(tokenId) nonReentrant { address validatorAddr = validatorForTokenId(tokenId); IStakefishValidator(validatorAddr).withdraw(); burnIfNecessary(tokenId); } function claim(address, uint256) external virtual override { require(false, "migration is unsupported"); } function burnIfNecessary(uint256 tokenId) internal { address validatorAddr = validatorForTokenId(tokenId); // must be burned by migrate() if(validatorAddr == address(0)) { return; } IStakefishValidator.StateChange memory lastState = IStakefishValidator(validatorAddr).lastStateChange(); if(lastState.state == IStakefishValidator.State.Burnable) { _burn(tokenId); _validatorToToken[validatorAddr] = 0; _tokenToValidator[tokenId] = address(0); emit StakefishBurnedWithContract(tokenId, validatorAddr, msg.sender); } } /// PUBLIC READ FUNCTIONS function validatorOwner(address validator) external override view returns (address) { return ownerOf(_validatorToToken[validator]); } function validatorForTokenId(uint256 tokenId) public override view returns (address) { return _tokenToValidator[tokenId]; } function tokenForValidatorAddr(address validator) external override view returns (uint256) { return _validatorToToken[validator]; } function computeAddress(uint256 tokenId) external override view returns (address) { return IStakefishValidatorFactory(factory).computeAddress(address(this), tokenId); } function tokenURI(uint256 tokenId) public view override(ERC721, IERC721Metadata) returns (string memory) { IStakefishValidator validator = IStakefishValidator(validatorForTokenId(tokenId)); return validator.render(); } /// PRIVATE WRITE FUNCTIONS function _updateTokenId(uint256 tokenId, address validatorAddr) internal { require(_validatorToToken[validatorAddr] == 0, "mint: must be empty tokenId"); _validatorToToken[validatorAddr] = tokenId; _tokenToValidator[tokenId] = validatorAddr; } function _mintOne() internal { uint256 tokenId = _nextId++; address validatorAddr = IStakefishValidatorFactory(factory).createValidator{value: 32 ether}(tokenId); _mint(msg.sender, tokenId); _updateTokenId(tokenId, validatorAddr); emit StakefishMintedWithContract(tokenId, validatorAddr, msg.sender); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/ERC721Enumerable.sol) pragma solidity ^0.8.0; import "ERC721.sol"; import "IERC721Enumerable.sol"; /** * @dev This implements an optional extension of {ERC721} defined in the EIP that adds * enumerability of all the token ids in the contract as well as all token ids owned by each * account. */ abstract contract ERC721Enumerable is ERC721, IERC721Enumerable { // Mapping from owner to list of owned token IDs mapping(address => mapping(uint256 => uint256)) private _ownedTokens; // Mapping from token ID to index of the owner tokens list mapping(uint256 => uint256) private _ownedTokensIndex; // Array with all token ids, used for enumeration uint256[] private _allTokens; // Mapping from token id to position in the allTokens array mapping(uint256 => uint256) private _allTokensIndex; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) { return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}. */ function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) { require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds"); return _ownedTokens[owner][index]; } /** * @dev See {IERC721Enumerable-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _allTokens.length; } /** * @dev See {IERC721Enumerable-tokenByIndex}. */ function tokenByIndex(uint256 index) public view virtual override returns (uint256) { require(index < ERC721Enumerable.totalSupply(), "ERC721Enumerable: global index out of bounds"); return _allTokens[index]; } /** * @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` cannot be the zero address. * - `to` cannot be the zero address. * * 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 override { super._beforeTokenTransfer(from, to, tokenId); if (from == address(0)) { _addTokenToAllTokensEnumeration(tokenId); } else if (from != to) { _removeTokenFromOwnerEnumeration(from, tokenId); } if (to == address(0)) { _removeTokenFromAllTokensEnumeration(tokenId); } else if (to != from) { _addTokenToOwnerEnumeration(to, tokenId); } } /** * @dev Private function to add a token to this extension's ownership-tracking data structures. * @param to address representing the new owner of the given token ID * @param tokenId uint256 ID of the token to be added to the tokens list of the given address */ function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private { uint256 length = ERC721.balanceOf(to); _ownedTokens[to][length] = tokenId; _ownedTokensIndex[tokenId] = length; } /** * @dev Private function to add a token to this extension's token tracking data structures. * @param tokenId uint256 ID of the token to be added to the tokens list */ function _addTokenToAllTokensEnumeration(uint256 tokenId) private { _allTokensIndex[tokenId] = _allTokens.length; _allTokens.push(tokenId); } /** * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for * gas optimizations e.g. when performing a transfer operation (avoiding double writes). * This has O(1) time complexity, but alters the order of the _ownedTokens array. * @param from address representing the previous owner of the given token ID * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address */ function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private { // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = ERC721.balanceOf(from) - 1; uint256 tokenIndex = _ownedTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary if (tokenIndex != lastTokenIndex) { uint256 lastTokenId = _ownedTokens[from][lastTokenIndex]; _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index } // This also deletes the contents at the last position of the array delete _ownedTokensIndex[tokenId]; delete _ownedTokens[from][lastTokenIndex]; } /** * @dev Private function to remove a token from this extension's token tracking data structures. * This has O(1) time complexity, but alters the order of the _allTokens array. * @param tokenId uint256 ID of the token to be removed from the tokens list */ function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private { // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = _allTokens.length - 1; uint256 tokenIndex = _allTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding // an 'if' statement (like in _removeTokenFromOwnerEnumeration) uint256 lastTokenId = _allTokens[lastTokenIndex]; _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index // This also deletes the contents at the last position of the array delete _allTokensIndex[tokenId]; _allTokens.pop(); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/ERC721.sol) pragma solidity ^0.8.0; import "IERC721.sol"; import "IERC721Receiver.sol"; import "IERC721Metadata.sol"; import "Address.sol"; import "Context.sol"; import "Strings.sol"; import "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: balance query for the zero address"); 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: owner query for nonexistent token"); 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) { require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token"); 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 owner nor approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { require(_exists(tokenId), "ERC721: approved query for nonexistent token"); 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: transfer caller is not 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: transfer caller is not 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) { require(_exists(tokenId), "ERC721: operator query for nonexistent token"); 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 a {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 a {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 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 { 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.6.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "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 be 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 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 // 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.5.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 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 v4.4.1 (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @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); } }
// 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 (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol) pragma solidity ^0.8.0; import "IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Enumerable is IERC721 { /** * @dev Returns the total amount of tokens stored by the contract. */ function totalSupply() external view returns (uint256); /** * @dev Returns a token ID owned by `owner` at a given `index` of its token list. * Use along with {balanceOf} to enumerate all of ``owner``'s tokens. */ function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256); /** * @dev Returns a token ID at a given `index` of all the tokens stored by the contract. * Use along with {totalSupply} to enumerate all tokens. */ function tokenByIndex(uint256 index) external view returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.7; import "IERC721Metadata.sol"; import "IERC721Enumerable.sol"; interface IStakefishNFTManager is IERC721Metadata, IERC721Enumerable { event StakefishMintedWithContract(uint256 tokenId, address validatorContract, address to); event StakefishBurnedWithContract(uint256 tokenId, address validatorContract, address from); /// @dev implements immutable types function factory() external view returns (address); /// @notice Mints a new NFT Validator for each 32 ETH /// @param validators The number of validators requested function mint(uint256 validators) external payable; /// @notice Withdraw from NFT - only allowed for ownerOf(tokenId) /// @param tokenId of the NFT function withdraw(uint256 tokenId) external; /// @notice computes address based on token /// @param tokenId of the NFT /// @return address of the validator contract function computeAddress(uint256 tokenId) external view returns (address); /// @notice lookups the NFT Owner by address => tokenId => owner /// @param validator address created by mint /// @return address of the owner function validatorOwner(address validator) external view returns (address); /// @notice lookups the tokenId based on validator address /// @param validator address created by mint /// @return tokenId of the NFT function tokenForValidatorAddr(address validator) external view returns (uint256); /// @notice lookups the validator address based on tokenId /// @param tokenId of the NFT /// @return address of the validator contract function validatorForTokenId(uint256 tokenId) external view returns (address); /// @notice Burn NFT /// @notice Burns the token if the new nft manager implements the validatorOwner correctly /// function does not destroy validator contract, which freely allow /// them to associate to a new NFT Issuer contract for migration function verifyAndBurn(address newManager, uint256 tokenId) external; /// @notice claim NFT from another NFT Manager, used for migration /// @param oldManager old nft manager /// @param tokenId of the NFT on the old manager function claim(address oldManager, uint256 tokenId) external; /// @notice multicall static function multicallStatic(uint256[] calldata tokenIds, bytes[] calldata data) external view returns (bytes[] memory results); /// @notice multicall across multiple tokenIds function multicall(uint256[] calldata tokenIds, bytes[] calldata data) external returns (bytes[] memory results); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.7; /// @dev We can pas salt in to create deterministic address in solidity // https://docs.soliditylang.org/en/develop/control-structures.html#salted-contract-creations-create2 // Reference: https://github.com/Uniswap/v3-core/blob/main/contracts/UniswapV3Factory.sol // Reference: https://github.com/Uniswap/v3-core/blob/main/contracts/UniswapV3PoolDeployer.sol /// @title Interface for StakefishValidatorFactory /// @notice The interface for validator factory responsible for deploying validator address. /// There's no need chain dependency against NFTManager which adds complexity. Instead NFTManager /// can define which factory it trusts to deploy its validators. interface IStakefishValidatorFactory { /// @notice Create validator contract with ETH deposits /// @param tokenId The number of validators function createValidator(uint256 tokenId) external payable returns (address); /// @notice computes the validator contract address /// @param tokenId Computes based on tokenId function computeAddress(address deployer, uint256 tokenId) external view returns (address); /// @notice sets operator address function setOperator(address operator) external; /// @notice sets owner who can set the fees function setDeployer(address deployer, bool enabled) external; /// @notice sets the protocol fee /// @param feePercent is the fee percent in basis points eg. 1% = 100 function setFee(uint256 feePercent) external; /// @notice sets the rate by minter /// @param minter is the address of NFT minter /// @param feePercent is the fee percent in basis points eg. 1% = 100 function setFeeForMinter(address minter, uint256 feePercent) external; /// @notice sets migration address function setMigrationAddress(address _migrationAddress) external; /// @notice sets the max number of validators that can be created per transaction /// @param maxCount the new max number of validators per transaction function setMaxValidatorsPerTransaction(uint256 maxCount) external; /// @notice sets the server url for NFT metadata function setNFTArtUrl(string calldata _nftURL) external; /// @notice returns latest version contract function addVersion(address implementation) external; /// @notice returns implementation at index function implementations(uint256 index) external view returns (address); /// @notice returns latest version contract function latestVersion() external view returns (address); /// @notice returns operator address (which can be a contract or EOA) function operatorAddress() external view returns (address); /// @notice returns migration nft manager address function migrationAddress() external view returns (address); /// @notice returns protocol fee function protocolFee() external view returns (uint256); /// @notice returns protocol fee by minter function getProtocolFeeForMinter(address minter) external view returns (uint256); /// @notice returns max number of validators that can be created per transaction function maxValidatorsPerTransaction() external view returns (uint256); /// @notice returns server URL function nftArtURL() external view returns (string memory); /// @notice withdraw commission function withdraw() external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.7; /// @title The interface for StakefishValidator /// @notice Defines implementation of the wallet (deposit, withdraw, collect fees) interface IStakefishValidator { event StakefishValidatorDeposited(bytes validatorPubKey); event StakefishValidatorExitRequest(bytes validatorPubKey); event StakefishValidatorStarted(bytes validatorPubKey, uint256 startTimestamp); event StakefishValidatorExited(bytes validatorPubKey, uint256 stopTimestamp); event StakefishValidatorWithdrawn(bytes validatorPubKey, uint256 amount); event StakefishValidatorCommissionTransferred(bytes validatorPubKey, uint256 amount); event StakefishValidatorFeePoolChanged(bytes validatorPubKey, address feePoolAddress); enum State { PreDeposit, PostDeposit, Active, ExitRequested, Exited, Withdrawn, Burnable } /// @dev aligns into 32 byte struct StateChange { State state; // 1 byte bytes15 userData; // 15 byte (future use) uint128 changedAt; // 16 byte } /// @notice initializer function setup() external; function validatorIndex() external view returns (uint256); function pubkey() external view returns (bytes memory); /// @notice Inspect state of the change function lastStateChange() external view returns (StateChange memory); /// @notice Submits a Phase 0 DepositData to the eth2 deposit contract. /// @dev https://github.com/ethereum/consensus-specs/blob/master/solidity_deposit_contract/deposit_contract.sol#L33 /// @param validatorPubKey A BLS12-381 public key. /// @param depositSignature A BLS12-381 signature. /// @param depositDataRoot The SHA-256 hash of the SSZ-encoded DepositData object. function makeEth2Deposit( bytes calldata validatorPubKey, // 48 bytes bytes calldata depositSignature, // 96 bytes bytes32 depositDataRoot ) external; /// @notice Operator updates the start state of the validator /// Updates validator state to running /// State.PostDeposit -> State.Running function validatorStarted( uint256 _startTimestamp, uint256 _validatorIndex, address _feePoolAddress) external; /// @notice Operator updates the exited from beaconchain. /// State.ExitRequested -> State.Exited /// emit ValidatorExited(pubkey, stopTimestamp); function validatorExited(uint256 _stopTimestamp) external; /// @notice NFT Owner requests a validator exit /// State.Running -> State.ExitRequested /// emit ValidatorExitRequest(pubkey) function requestExit() external; /// @notice user withdraw balance and charge a fee function withdraw() external; /// @notice ability to change fee pool function validatorFeePoolChange(address _feePoolAddress) external; /// @notice get pending fee pool rewards function pendingFeePoolReward() external view returns (uint256, uint256); /// @notice claim fee pool and forward to nft owner function claimFeePool(uint256 amountRequested) external; /// @notice get early access discount function earlyAccessDiscount() external view returns (uint); /// @notice volume discount function volumeDiscount() external view returns (uint); /// @notice calculates effect fee after discounts function effectiveFee() external view returns (uint256); /// @notice computes commission, useful for showing on UI function computeCommission(uint256 amount) external view returns (uint256); function render() external view returns (string memory); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.7; /// @title The interface for StakefishValidatorWallet /// @notice Factory created contract representing the validator withdrawal address interface IStakefishValidatorWallet { /// @notice receives ether from withdrawals receive() external payable; /// @notice current nft manager function getNFTManager() external returns (address); /// @notice allows owner to upgrade their validator contract to gain new features function upgradeByNFTOwner(address implementation) external; /// @notice migrate orchestrates 1) burn nft 2) mint nft 3) set nft manager /// @param newNftManager the new NFT Manager function migrate(address newNftManager) external; }
{ "evmVersion": "istanbul", "optimizer": { "enabled": true, "runs": 200 }, "libraries": { "StakefishNFTManager.sol": {} }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"factory_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"validatorContract","type":"address"},{"indexed":false,"internalType":"address","name":"from","type":"address"}],"name":"StakefishBurnedWithContract","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"validatorContract","type":"address"},{"indexed":false,"internalType":"address","name":"to","type":"address"}],"name":"StakefishMintedWithContract","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"computeAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"factory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"validatorCount","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"bytes[]","name":"data","type":"bytes[]"}],"name":"multicall","outputs":[{"internalType":"bytes[]","name":"results","type":"bytes[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"bytes[]","name":"data","type":"bytes[]"}],"name":"multicallStatic","outputs":[{"internalType":"bytes[]","name":"results","type":"bytes[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"validator","type":"address"}],"name":"tokenForValidatorAddr","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"validatorForTokenId","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"validator","type":"address"}],"name":"validatorOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newManager","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"verifyAndBurn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60a06040526001600d553480156200001657600080fd5b5060405162003006380380620030068339810160408190526200003991620001c0565b604080518082018252601381527f7374616b65666973682076616c696461746f720000000000000000000000000060208083019182528351808501909452600784526629a316ab26222960c91b9084015281519192916200009d916000916200011a565b508051620000b39060019060208401906200011a565b50506001600a55506001600160a01b038116620001085760405162461bcd60e51b815260206004820152600f60248201526e6d697373696e6720666163746f727960881b604482015260640160405180910390fd5b6001600160a01b03166080526200022f565b8280546200012890620001f2565b90600052602060002090601f0160209004810192826200014c576000855562000197565b82601f106200016757805160ff191683800117855562000197565b8280016001018555821562000197579182015b82811115620001975782518255916020019190600101906200017a565b50620001a5929150620001a9565b5090565b5b80821115620001a55760008155600101620001aa565b600060208284031215620001d357600080fd5b81516001600160a01b0381168114620001eb57600080fd5b9392505050565b600181811c908216806200020757607f821691505b602082108114156200022957634e487b7160e01b600052602260045260246000fd5b50919050565b608051612da6620002606000396000818161050801528181610d3001528181610e420152611b0c0152612da66000f3fe60806040526004361061019c5760003560e01c80634f6ccce7116100ec578063aad3ec961161008a578063bfe6646e11610064578063bfe6646e146104d6578063c45a0155146104f6578063c87b56dd1461052a578063e985e9c51461054a57600080fd5b8063aad3ec9614610476578063b88d4fde14610496578063bbd2524b146104b657600080fd5b80638a6d2cc8116100c65780638a6d2cc81461040e57806395d89b411461042e578063a0712d6814610443578063a22cb4651461045657600080fd5b80634f6ccce7146103ae5780636352211e146103ce57806370a08231146103ee57600080fd5b806323b872dd116101595780632f745c59116101335780632f745c591461030b578063388202951461032b5780633d4998a91461036157806342842e0e1461038e57600080fd5b806323b872dd146102ab5780632944aedc146102cb5780632e1a7d4d146102eb57600080fd5b806301ffc9a7146101a157806306fdde03146101d657806307518709146101f8578063081812fc1461023c578063095ea7b31461027457806318160ddd14610296575b600080fd5b3480156101ad57600080fd5b506101c16101bc36600461258f565b610593565b60405190151581526020015b60405180910390f35b3480156101e257600080fd5b506101eb6105be565b6040516101cd9190612604565b34801561020457600080fd5b5061022e61021336600461262c565b6001600160a01b03166000908152600b602052604090205490565b6040519081526020016101cd565b34801561024857600080fd5b5061025c610257366004612649565b610650565b6040516001600160a01b0390911681526020016101cd565b34801561028057600080fd5b5061029461028f366004612662565b6106ea565b005b3480156102a257600080fd5b5060085461022e565b3480156102b757600080fd5b506102946102c636600461268e565b610800565b3480156102d757600080fd5b5061025c6102e636600461262c565b610831565b3480156102f757600080fd5b50610294610306366004612649565b610853565b34801561031757600080fd5b5061022e610326366004612662565b61094c565b34801561033757600080fd5b5061025c610346366004612649565b6000908152600c60205260409020546001600160a01b031690565b34801561036d57600080fd5b5061038161037c36600461271b565b6109e2565b6040516101cd9190612787565b34801561039a57600080fd5b506102946103a936600461268e565b610b65565b3480156103ba57600080fd5b5061022e6103c9366004612649565b610b80565b3480156103da57600080fd5b5061025c6103e9366004612649565b610c13565b3480156103fa57600080fd5b5061022e61040936600461262c565b610c8a565b34801561041a57600080fd5b5061025c610429366004612649565b610d11565b34801561043a57600080fd5b506101eb610da3565b610294610451366004612649565b610db2565b34801561046257600080fd5b506102946104713660046127e9565b610fe2565b34801561048257600080fd5b50610294610491366004612662565b610ff1565b3480156104a257600080fd5b506102946104b1366004612896565b611039565b3480156104c257600080fd5b506102946104d1366004612662565b611071565b3480156104e257600080fd5b506103816104f136600461271b565b6113b9565b34801561050257600080fd5b5061025c7f000000000000000000000000000000000000000000000000000000000000000081565b34801561053657600080fd5b506101eb610545366004612649565b6115c3565b34801561055657600080fd5b506101c1610565366004612945565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b60006001600160e01b0319821663780e9d6360e01b14806105b857506105b88261164e565b92915050565b6060600080546105cd90612973565b80601f01602080910402602001604051908101604052809291908181526020018280546105f990612973565b80156106465780601f1061061b57610100808354040283529160200191610646565b820191906000526020600020905b81548152906001019060200180831161062957829003601f168201915b5050505050905090565b6000818152600260205260408120546001600160a01b03166106ce5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152600460205260409020546001600160a01b031690565b60006106f582610c13565b9050806001600160a01b0316836001600160a01b031614156107635760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084016106c5565b336001600160a01b038216148061077f575061077f8133610565565b6107f15760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c000000000000000060648201526084016106c5565b6107fb838361169e565b505050565b61080a338261170c565b6108265760405162461bcd60e51b81526004016106c5906129ae565b6107fb838383611802565b6001600160a01b0381166000908152600b60205260408120546105b890610c13565b803361085e82610c13565b6001600160a01b0316146108a45760405162461bcd60e51b815260206004820152600d60248201526c2737ba1037333a1037bbb732b960991b60448201526064016106c5565b6002600a5414156108c75760405162461bcd60e51b81526004016106c5906129ff565b6002600a556000828152600c60205260408120546001600160a01b03169050806001600160a01b0316633ccfd60b6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561092157600080fd5b505af1158015610935573d6000803e3d6000fd5b50505050610942836119a9565b50506001600a5550565b600061095783610c8a565b82106109b95760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b60648201526084016106c5565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b60608167ffffffffffffffff8111156109fd576109fd612827565b604051908082528060200260200182016040528015610a3057816020015b6060815260200190600190039081610a1b5790505b50905060005b82811015610b5b576000600c6000888885818110610a5657610a56612a36565b60209081029290920135835250810191909152604001600020546001600160a01b0316905080610ac85760405162461bcd60e51b815260206004820152601a60248201527f6d756c746963616c6c3a2061646472657373206973206e756c6c00000000000060448201526064016106c5565b610b2a81868685818110610ade57610ade612a36565b9050602002810190610af09190612a4c565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611acc92505050565b838381518110610b3c57610b3c612a36565b6020026020010181905250508080610b5390612aa9565b915050610a36565b505b949350505050565b6107fb83838360405180602001604052806000815250611039565b6000610b8b60085490565b8210610bee5760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b60648201526084016106c5565b60088281548110610c0157610c01612a36565b90600052602060002001549050919050565b6000818152600260205260408120546001600160a01b0316806105b85760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b60648201526084016106c5565b60006001600160a01b038216610cf55760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b60648201526084016106c5565b506001600160a01b031660009081526003602052604090205490565b6040516336b5aa2d60e01b8152306004820152602481018290526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906336b5aa2d90604401602060405180830381865afa158015610d7f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105b89190612ac4565b6060600180546105cd90612973565b6002600a541415610dd55760405162461bcd60e51b81526004016106c5906129ff565b6002600a5580610e405760405162461bcd60e51b815260206004820152603060248201527f77726f6e672076616c75653a206174206c6561737420312076616c696461746f60448201526f1c881b5d5cdd081899481b5a5b9d195960821b60648201526084016106c5565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663461db21b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e9e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ec29190612ae1565b811115610f415760405162461bcd60e51b815260206004820152604160248201527f77726f6e672076616c75653a2076616c696461746f72436f756e74206578636560448201527f65647320666163746f7279206c696d697420706572207472616e73616374696f6064820152603760f91b608482015260a4016106c5565b610f54816801bc16d674ec800000612afa565b3414610fb45760405162461bcd60e51b815260206004820152602960248201527f77726f6e672076616c75653a206d7573742062652033322045544820706572206044820152683b30b634b230ba37b960b91b60648201526084016106c5565b60005b81811015610fd957610fc7611af1565b80610fd181612aa9565b915050610fb7565b50506001600a55565b610fed338383611c06565b5050565b60405162461bcd60e51b815260206004820152601860248201527f6d6967726174696f6e20697320756e737570706f72746564000000000000000060448201526064016106c5565b611043338361170c565b61105f5760405162461bcd60e51b81526004016106c5906129ae565b61106b84848484611cd5565b50505050565b8061107c338261170c565b6110b75760405162461bcd60e51b815260206004820152600c60248201526b139bdd08185c1c1c9bdd995960a21b60448201526064016106c5565b6002600a5414156110da5760405162461bcd60e51b81526004016106c5906129ff565b6002600a556001600160a01b03831630141561115e5760405162461bcd60e51b815260206004820152603b60248201527f6e6577204e46544d616e616765722063616e6e6f74206265207468652073616d60448201527f65206173207468652063757272656e74204e46544d616e61676572000000000060648201526084016106c5565b61116782610c13565b6000838152600c602052604090819020549051630a512bb760e21b81526001600160a01b0391821660048201529181169190851690632944aedc90602401602060405180830381865afa1580156111c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111e69190612ac4565b6001600160a01b03161461124a5760405162461bcd60e51b815260206004820152602560248201527f6f776e6572206f6e206e6577204e46544d616e61676572206e6f7420636f6e666044820152641a5c9b595960da1b60648201526084016106c5565b6000828152600c60205260409020546001600160a01b031661126b83611d08565b6001600160a01b038082166000818152600b60209081526040808320839055878352600c825280832080546001600160a01b031916905580516313960c3760e31b8152905194891694639cb061b8936004808401949383900301908290875af11580156112dc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113009190612ac4565b6001600160a01b0316146113675760405162461bcd60e51b815260206004820152602860248201527f76616c696461746f72206e6f74206368616e67656420746f206e6577206e66746044820152671036b0b730b3b2b960c11b60648201526084016106c5565b604080518481526001600160a01b0383166020820152338183015290517f3d0b7d84487ace92db8ede5693663e052893b5710a9b799e6999b34cc3b51b5d9181900360600190a150506001600a555050565b60608167ffffffffffffffff8111156113d4576113d4612827565b60405190808252806020026020018201604052801561140757816020015b60608152602001906001900390816113f25790505b50905060005b82811015610b5b576000600c600088888581811061142d5761142d612a36565b60209081029290920135835250810191909152604001600020546001600160a01b031690508061149f5760405162461bcd60e51b815260206004820152601a60248201527f6d756c746963616c6c3a2061646472657373206973206e756c6c00000000000060448201526064016106c5565b336114c18888858181106114b5576114b5612a36565b90506020020135610c13565b6001600160a01b0316146115105760405162461bcd60e51b81526020600482015260166024820152751bdb9b1e481b999d081bdddb995c88185b1b1bddd95960521b60448201526064016106c5565b6115728186868581811061152657611526612a36565b90506020028101906115389190612a4c565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611daf92505050565b83838151811061158457611584612a36565b60200260200101819052506115b08787848181106115a4576115a4612a36565b905060200201356119a9565b50806115bb81612aa9565b91505061140d565b6000818152600c6020526040812054606091906001600160a01b03169050806001600160a01b031663d607497a6040518163ffffffff1660e01b8152600401600060405180830381865afa15801561161f573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526116479190810190612b19565b9392505050565b60006001600160e01b031982166380ac58cd60e01b148061167f57506001600160e01b03198216635b5e139f60e01b145b806105b857506301ffc9a760e01b6001600160e01b03198316146105b8565b600081815260046020526040902080546001600160a01b0319166001600160a01b03841690811790915581906116d382610c13565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000818152600260205260408120546001600160a01b03166117855760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084016106c5565b600061179083610c13565b9050806001600160a01b0316846001600160a01b031614806117d757506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b80610b5d5750836001600160a01b03166117f084610650565b6001600160a01b031614949350505050565b826001600160a01b031661181582610c13565b6001600160a01b0316146118795760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b60648201526084016106c5565b6001600160a01b0382166118db5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016106c5565b6118e6838383611df1565b6118f160008261169e565b6001600160a01b038316600090815260036020526040812080546001929061191a908490612b90565b90915550506001600160a01b0382166000908152600360205260408120805460019290611948908490612ba7565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6000818152600c60205260409020546001600160a01b0316806119ca575050565b6000816001600160a01b031663aee792f86040518163ffffffff1660e01b8152600401606060405180830381865afa158015611a0a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a2e9190612bbf565b9050600681516006811115611a4557611a45612c61565b14156107fb57611a5483611d08565b6001600160a01b0382166000818152600b60209081526040808320839055868352600c82529182902080546001600160a01b03191690558151868152908101929092523382820152517f3d0b7d84487ace92db8ede5693663e052893b5710a9b799e6999b34cc3b51b5d9181900360600190a1505050565b60606116478383604051806060016040528060258152602001612d4c60259139611ea9565b600d805460009182611b0283612aa9565b91905055905060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316630b5c22626801bc16d674ec800000846040518363ffffffff1660e01b8152600401611b6291815260200190565b60206040518083038185885af1158015611b80573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190611ba59190612ac4565b9050611bb13383611f83565b611bbb82826120d1565b604080518381526001600160a01b0383166020820152338183015290517f22342631dad8ae2e4df7b793d1dc2fce1568c4a5a885b2b63e62c17f120906fe9181900360600190a15050565b816001600160a01b0316836001600160a01b03161415611c685760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016106c5565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b611ce0848484611802565b611cec84848484612172565b61106b5760405162461bcd60e51b81526004016106c590612c77565b6000611d1382610c13565b9050611d2181600084611df1565b611d2c60008361169e565b6001600160a01b0381166000908152600360205260408120805460019290611d55908490612b90565b909155505060008281526002602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b606061164783836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061226d565b6001600160a01b038316611e4c57611e4781600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b611e6f565b816001600160a01b0316836001600160a01b031614611e6f57611e6f838261227c565b6001600160a01b038216611e86576107fb81612319565b826001600160a01b0316826001600160a01b0316146107fb576107fb82826123c8565b60606001600160a01b0384163b611f0e5760405162461bcd60e51b8152602060048201526024808201527f416464726573733a207374617469632063616c6c20746f206e6f6e2d636f6e746044820152631c9858dd60e21b60648201526084016106c5565b600080856001600160a01b031685604051611f299190612cc9565b600060405180830381855afa9150503d8060008114611f64576040519150601f19603f3d011682016040523d82523d6000602084013e611f69565b606091505b5091509150611f7982828661240c565b9695505050505050565b6001600160a01b038216611fd95760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016106c5565b6000818152600260205260409020546001600160a01b03161561203e5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016106c5565b61204a60008383611df1565b6001600160a01b0382166000908152600360205260408120805460019290612073908490612ba7565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6001600160a01b0381166000908152600b6020526040902054156121375760405162461bcd60e51b815260206004820152601b60248201527f6d696e743a206d75737420626520656d70747920746f6b656e4964000000000060448201526064016106c5565b6001600160a01b03166000818152600b60209081526040808320859055938252600c90529190912080546001600160a01b0319169091179055565b60006001600160a01b0384163b1561226557604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906121b6903390899088908890600401612ce5565b6020604051808303816000875af19250505080156121f1575060408051601f3d908101601f191682019092526121ee91810190612d18565b60015b61224b573d80801561221f576040519150601f19603f3d011682016040523d82523d6000602084013e612224565b606091505b5080516122435760405162461bcd60e51b81526004016106c590612c77565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050610b5d565b506001610b5d565b6060610b5d8484600085612445565b6000600161228984610c8a565b6122939190612b90565b6000838152600760205260409020549091508082146122e6576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b60085460009061232b90600190612b90565b6000838152600960205260408120546008805493945090928490811061235357612353612a36565b90600052602060002001549050806008838154811061237457612374612a36565b60009182526020808320909101929092558281526009909152604080822084905585825281205560088054806123ac576123ac612d35565b6001900381819060005260206000200160009055905550505050565b60006123d383610c8a565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b6060831561241b575081611647565b82511561242b5782518084602001fd5b8160405162461bcd60e51b81526004016106c59190612604565b6060824710156124a65760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016106c5565b6001600160a01b0385163b6124fd5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016106c5565b600080866001600160a01b031685876040516125199190612cc9565b60006040518083038185875af1925050503d8060008114612556576040519150601f19603f3d011682016040523d82523d6000602084013e61255b565b606091505b509150915061256b82828661240c565b979650505050505050565b6001600160e01b03198116811461258c57600080fd5b50565b6000602082840312156125a157600080fd5b813561164781612576565b60005b838110156125c75781810151838201526020016125af565b8381111561106b5750506000910152565b600081518084526125f08160208601602086016125ac565b601f01601f19169290920160200192915050565b60208152600061164760208301846125d8565b6001600160a01b038116811461258c57600080fd5b60006020828403121561263e57600080fd5b813561164781612617565b60006020828403121561265b57600080fd5b5035919050565b6000806040838503121561267557600080fd5b823561268081612617565b946020939093013593505050565b6000806000606084860312156126a357600080fd5b83356126ae81612617565b925060208401356126be81612617565b929592945050506040919091013590565b60008083601f8401126126e157600080fd5b50813567ffffffffffffffff8111156126f957600080fd5b6020830191508360208260051b850101111561271457600080fd5b9250929050565b6000806000806040858703121561273157600080fd5b843567ffffffffffffffff8082111561274957600080fd5b612755888389016126cf565b9096509450602087013591508082111561276e57600080fd5b5061277b878288016126cf565b95989497509550505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b828110156127dc57603f198886030184526127ca8583516125d8565b945092850192908501906001016127ae565b5092979650505050505050565b600080604083850312156127fc57600080fd5b823561280781612617565b91506020830135801515811461281c57600080fd5b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561286657612866612827565b604052919050565b600067ffffffffffffffff82111561288857612888612827565b50601f01601f191660200190565b600080600080608085870312156128ac57600080fd5b84356128b781612617565b935060208501356128c781612617565b925060408501359150606085013567ffffffffffffffff8111156128ea57600080fd5b8501601f810187136128fb57600080fd5b803561290e6129098261286e565b61283d565b81815288602083850101111561292357600080fd5b8160208401602083013760006020838301015280935050505092959194509250565b6000806040838503121561295857600080fd5b823561296381612617565b9150602083013561281c81612617565b600181811c9082168061298757607f821691505b602082108114156129a857634e487b7160e01b600052602260045260246000fd5b50919050565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112612a6357600080fd5b83018035915067ffffffffffffffff821115612a7e57600080fd5b60200191503681900382131561271457600080fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415612abd57612abd612a93565b5060010190565b600060208284031215612ad657600080fd5b815161164781612617565b600060208284031215612af357600080fd5b5051919050565b6000816000190483118215151615612b1457612b14612a93565b500290565b600060208284031215612b2b57600080fd5b815167ffffffffffffffff811115612b4257600080fd5b8201601f81018413612b5357600080fd5b8051612b616129098261286e565b818152856020838501011115612b7657600080fd5b612b878260208301602086016125ac565b95945050505050565b600082821015612ba257612ba2612a93565b500390565b60008219821115612bba57612bba612a93565b500190565b600060608284031215612bd157600080fd5b6040516060810181811067ffffffffffffffff82111715612bf457612bf4612827565b604052825160078110612c0657600080fd5b8152602083015170ffffffffffffffffffffffffffffffffff1981168114612c2d57600080fd5b602082015260408301516fffffffffffffffffffffffffffffffff81168114612c5557600080fd5b60408201529392505050565b634e487b7160e01b600052602160045260246000fd5b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b60008251612cdb8184602087016125ac565b9190910192915050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090611f79908301846125d8565b600060208284031215612d2a57600080fd5b815161164781612576565b634e487b7160e01b600052603160045260246000fdfe416464726573733a206c6f772d6c6576656c207374617469632063616c6c206661696c6564a2646970667358221220d95ac177ccce42bc420f663d0e59d8ba75ff7cc0a74493907f7540af42617ef564736f6c634300080c00330000000000000000000000008862d8dab077d529ca3f976b6518be3862207372
Deployed Bytecode
0x60806040526004361061019c5760003560e01c80634f6ccce7116100ec578063aad3ec961161008a578063bfe6646e11610064578063bfe6646e146104d6578063c45a0155146104f6578063c87b56dd1461052a578063e985e9c51461054a57600080fd5b8063aad3ec9614610476578063b88d4fde14610496578063bbd2524b146104b657600080fd5b80638a6d2cc8116100c65780638a6d2cc81461040e57806395d89b411461042e578063a0712d6814610443578063a22cb4651461045657600080fd5b80634f6ccce7146103ae5780636352211e146103ce57806370a08231146103ee57600080fd5b806323b872dd116101595780632f745c59116101335780632f745c591461030b578063388202951461032b5780633d4998a91461036157806342842e0e1461038e57600080fd5b806323b872dd146102ab5780632944aedc146102cb5780632e1a7d4d146102eb57600080fd5b806301ffc9a7146101a157806306fdde03146101d657806307518709146101f8578063081812fc1461023c578063095ea7b31461027457806318160ddd14610296575b600080fd5b3480156101ad57600080fd5b506101c16101bc36600461258f565b610593565b60405190151581526020015b60405180910390f35b3480156101e257600080fd5b506101eb6105be565b6040516101cd9190612604565b34801561020457600080fd5b5061022e61021336600461262c565b6001600160a01b03166000908152600b602052604090205490565b6040519081526020016101cd565b34801561024857600080fd5b5061025c610257366004612649565b610650565b6040516001600160a01b0390911681526020016101cd565b34801561028057600080fd5b5061029461028f366004612662565b6106ea565b005b3480156102a257600080fd5b5060085461022e565b3480156102b757600080fd5b506102946102c636600461268e565b610800565b3480156102d757600080fd5b5061025c6102e636600461262c565b610831565b3480156102f757600080fd5b50610294610306366004612649565b610853565b34801561031757600080fd5b5061022e610326366004612662565b61094c565b34801561033757600080fd5b5061025c610346366004612649565b6000908152600c60205260409020546001600160a01b031690565b34801561036d57600080fd5b5061038161037c36600461271b565b6109e2565b6040516101cd9190612787565b34801561039a57600080fd5b506102946103a936600461268e565b610b65565b3480156103ba57600080fd5b5061022e6103c9366004612649565b610b80565b3480156103da57600080fd5b5061025c6103e9366004612649565b610c13565b3480156103fa57600080fd5b5061022e61040936600461262c565b610c8a565b34801561041a57600080fd5b5061025c610429366004612649565b610d11565b34801561043a57600080fd5b506101eb610da3565b610294610451366004612649565b610db2565b34801561046257600080fd5b506102946104713660046127e9565b610fe2565b34801561048257600080fd5b50610294610491366004612662565b610ff1565b3480156104a257600080fd5b506102946104b1366004612896565b611039565b3480156104c257600080fd5b506102946104d1366004612662565b611071565b3480156104e257600080fd5b506103816104f136600461271b565b6113b9565b34801561050257600080fd5b5061025c7f0000000000000000000000008862d8dab077d529ca3f976b6518be386220737281565b34801561053657600080fd5b506101eb610545366004612649565b6115c3565b34801561055657600080fd5b506101c1610565366004612945565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b60006001600160e01b0319821663780e9d6360e01b14806105b857506105b88261164e565b92915050565b6060600080546105cd90612973565b80601f01602080910402602001604051908101604052809291908181526020018280546105f990612973565b80156106465780601f1061061b57610100808354040283529160200191610646565b820191906000526020600020905b81548152906001019060200180831161062957829003601f168201915b5050505050905090565b6000818152600260205260408120546001600160a01b03166106ce5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152600460205260409020546001600160a01b031690565b60006106f582610c13565b9050806001600160a01b0316836001600160a01b031614156107635760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084016106c5565b336001600160a01b038216148061077f575061077f8133610565565b6107f15760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c000000000000000060648201526084016106c5565b6107fb838361169e565b505050565b61080a338261170c565b6108265760405162461bcd60e51b81526004016106c5906129ae565b6107fb838383611802565b6001600160a01b0381166000908152600b60205260408120546105b890610c13565b803361085e82610c13565b6001600160a01b0316146108a45760405162461bcd60e51b815260206004820152600d60248201526c2737ba1037333a1037bbb732b960991b60448201526064016106c5565b6002600a5414156108c75760405162461bcd60e51b81526004016106c5906129ff565b6002600a556000828152600c60205260408120546001600160a01b03169050806001600160a01b0316633ccfd60b6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561092157600080fd5b505af1158015610935573d6000803e3d6000fd5b50505050610942836119a9565b50506001600a5550565b600061095783610c8a565b82106109b95760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b60648201526084016106c5565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b60608167ffffffffffffffff8111156109fd576109fd612827565b604051908082528060200260200182016040528015610a3057816020015b6060815260200190600190039081610a1b5790505b50905060005b82811015610b5b576000600c6000888885818110610a5657610a56612a36565b60209081029290920135835250810191909152604001600020546001600160a01b0316905080610ac85760405162461bcd60e51b815260206004820152601a60248201527f6d756c746963616c6c3a2061646472657373206973206e756c6c00000000000060448201526064016106c5565b610b2a81868685818110610ade57610ade612a36565b9050602002810190610af09190612a4c565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611acc92505050565b838381518110610b3c57610b3c612a36565b6020026020010181905250508080610b5390612aa9565b915050610a36565b505b949350505050565b6107fb83838360405180602001604052806000815250611039565b6000610b8b60085490565b8210610bee5760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b60648201526084016106c5565b60088281548110610c0157610c01612a36565b90600052602060002001549050919050565b6000818152600260205260408120546001600160a01b0316806105b85760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b60648201526084016106c5565b60006001600160a01b038216610cf55760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b60648201526084016106c5565b506001600160a01b031660009081526003602052604090205490565b6040516336b5aa2d60e01b8152306004820152602481018290526000907f0000000000000000000000008862d8dab077d529ca3f976b6518be38622073726001600160a01b0316906336b5aa2d90604401602060405180830381865afa158015610d7f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105b89190612ac4565b6060600180546105cd90612973565b6002600a541415610dd55760405162461bcd60e51b81526004016106c5906129ff565b6002600a5580610e405760405162461bcd60e51b815260206004820152603060248201527f77726f6e672076616c75653a206174206c6561737420312076616c696461746f60448201526f1c881b5d5cdd081899481b5a5b9d195960821b60648201526084016106c5565b7f0000000000000000000000008862d8dab077d529ca3f976b6518be38622073726001600160a01b031663461db21b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e9e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ec29190612ae1565b811115610f415760405162461bcd60e51b815260206004820152604160248201527f77726f6e672076616c75653a2076616c696461746f72436f756e74206578636560448201527f65647320666163746f7279206c696d697420706572207472616e73616374696f6064820152603760f91b608482015260a4016106c5565b610f54816801bc16d674ec800000612afa565b3414610fb45760405162461bcd60e51b815260206004820152602960248201527f77726f6e672076616c75653a206d7573742062652033322045544820706572206044820152683b30b634b230ba37b960b91b60648201526084016106c5565b60005b81811015610fd957610fc7611af1565b80610fd181612aa9565b915050610fb7565b50506001600a55565b610fed338383611c06565b5050565b60405162461bcd60e51b815260206004820152601860248201527f6d6967726174696f6e20697320756e737570706f72746564000000000000000060448201526064016106c5565b611043338361170c565b61105f5760405162461bcd60e51b81526004016106c5906129ae565b61106b84848484611cd5565b50505050565b8061107c338261170c565b6110b75760405162461bcd60e51b815260206004820152600c60248201526b139bdd08185c1c1c9bdd995960a21b60448201526064016106c5565b6002600a5414156110da5760405162461bcd60e51b81526004016106c5906129ff565b6002600a556001600160a01b03831630141561115e5760405162461bcd60e51b815260206004820152603b60248201527f6e6577204e46544d616e616765722063616e6e6f74206265207468652073616d60448201527f65206173207468652063757272656e74204e46544d616e61676572000000000060648201526084016106c5565b61116782610c13565b6000838152600c602052604090819020549051630a512bb760e21b81526001600160a01b0391821660048201529181169190851690632944aedc90602401602060405180830381865afa1580156111c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111e69190612ac4565b6001600160a01b03161461124a5760405162461bcd60e51b815260206004820152602560248201527f6f776e6572206f6e206e6577204e46544d616e61676572206e6f7420636f6e666044820152641a5c9b595960da1b60648201526084016106c5565b6000828152600c60205260409020546001600160a01b031661126b83611d08565b6001600160a01b038082166000818152600b60209081526040808320839055878352600c825280832080546001600160a01b031916905580516313960c3760e31b8152905194891694639cb061b8936004808401949383900301908290875af11580156112dc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113009190612ac4565b6001600160a01b0316146113675760405162461bcd60e51b815260206004820152602860248201527f76616c696461746f72206e6f74206368616e67656420746f206e6577206e66746044820152671036b0b730b3b2b960c11b60648201526084016106c5565b604080518481526001600160a01b0383166020820152338183015290517f3d0b7d84487ace92db8ede5693663e052893b5710a9b799e6999b34cc3b51b5d9181900360600190a150506001600a555050565b60608167ffffffffffffffff8111156113d4576113d4612827565b60405190808252806020026020018201604052801561140757816020015b60608152602001906001900390816113f25790505b50905060005b82811015610b5b576000600c600088888581811061142d5761142d612a36565b60209081029290920135835250810191909152604001600020546001600160a01b031690508061149f5760405162461bcd60e51b815260206004820152601a60248201527f6d756c746963616c6c3a2061646472657373206973206e756c6c00000000000060448201526064016106c5565b336114c18888858181106114b5576114b5612a36565b90506020020135610c13565b6001600160a01b0316146115105760405162461bcd60e51b81526020600482015260166024820152751bdb9b1e481b999d081bdddb995c88185b1b1bddd95960521b60448201526064016106c5565b6115728186868581811061152657611526612a36565b90506020028101906115389190612a4c565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611daf92505050565b83838151811061158457611584612a36565b60200260200101819052506115b08787848181106115a4576115a4612a36565b905060200201356119a9565b50806115bb81612aa9565b91505061140d565b6000818152600c6020526040812054606091906001600160a01b03169050806001600160a01b031663d607497a6040518163ffffffff1660e01b8152600401600060405180830381865afa15801561161f573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526116479190810190612b19565b9392505050565b60006001600160e01b031982166380ac58cd60e01b148061167f57506001600160e01b03198216635b5e139f60e01b145b806105b857506301ffc9a760e01b6001600160e01b03198316146105b8565b600081815260046020526040902080546001600160a01b0319166001600160a01b03841690811790915581906116d382610c13565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000818152600260205260408120546001600160a01b03166117855760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084016106c5565b600061179083610c13565b9050806001600160a01b0316846001600160a01b031614806117d757506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b80610b5d5750836001600160a01b03166117f084610650565b6001600160a01b031614949350505050565b826001600160a01b031661181582610c13565b6001600160a01b0316146118795760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b60648201526084016106c5565b6001600160a01b0382166118db5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016106c5565b6118e6838383611df1565b6118f160008261169e565b6001600160a01b038316600090815260036020526040812080546001929061191a908490612b90565b90915550506001600160a01b0382166000908152600360205260408120805460019290611948908490612ba7565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6000818152600c60205260409020546001600160a01b0316806119ca575050565b6000816001600160a01b031663aee792f86040518163ffffffff1660e01b8152600401606060405180830381865afa158015611a0a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a2e9190612bbf565b9050600681516006811115611a4557611a45612c61565b14156107fb57611a5483611d08565b6001600160a01b0382166000818152600b60209081526040808320839055868352600c82529182902080546001600160a01b03191690558151868152908101929092523382820152517f3d0b7d84487ace92db8ede5693663e052893b5710a9b799e6999b34cc3b51b5d9181900360600190a1505050565b60606116478383604051806060016040528060258152602001612d4c60259139611ea9565b600d805460009182611b0283612aa9565b91905055905060007f0000000000000000000000008862d8dab077d529ca3f976b6518be38622073726001600160a01b0316630b5c22626801bc16d674ec800000846040518363ffffffff1660e01b8152600401611b6291815260200190565b60206040518083038185885af1158015611b80573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190611ba59190612ac4565b9050611bb13383611f83565b611bbb82826120d1565b604080518381526001600160a01b0383166020820152338183015290517f22342631dad8ae2e4df7b793d1dc2fce1568c4a5a885b2b63e62c17f120906fe9181900360600190a15050565b816001600160a01b0316836001600160a01b03161415611c685760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016106c5565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b611ce0848484611802565b611cec84848484612172565b61106b5760405162461bcd60e51b81526004016106c590612c77565b6000611d1382610c13565b9050611d2181600084611df1565b611d2c60008361169e565b6001600160a01b0381166000908152600360205260408120805460019290611d55908490612b90565b909155505060008281526002602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b606061164783836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c6564000081525061226d565b6001600160a01b038316611e4c57611e4781600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b611e6f565b816001600160a01b0316836001600160a01b031614611e6f57611e6f838261227c565b6001600160a01b038216611e86576107fb81612319565b826001600160a01b0316826001600160a01b0316146107fb576107fb82826123c8565b60606001600160a01b0384163b611f0e5760405162461bcd60e51b8152602060048201526024808201527f416464726573733a207374617469632063616c6c20746f206e6f6e2d636f6e746044820152631c9858dd60e21b60648201526084016106c5565b600080856001600160a01b031685604051611f299190612cc9565b600060405180830381855afa9150503d8060008114611f64576040519150601f19603f3d011682016040523d82523d6000602084013e611f69565b606091505b5091509150611f7982828661240c565b9695505050505050565b6001600160a01b038216611fd95760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016106c5565b6000818152600260205260409020546001600160a01b03161561203e5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016106c5565b61204a60008383611df1565b6001600160a01b0382166000908152600360205260408120805460019290612073908490612ba7565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6001600160a01b0381166000908152600b6020526040902054156121375760405162461bcd60e51b815260206004820152601b60248201527f6d696e743a206d75737420626520656d70747920746f6b656e4964000000000060448201526064016106c5565b6001600160a01b03166000818152600b60209081526040808320859055938252600c90529190912080546001600160a01b0319169091179055565b60006001600160a01b0384163b1561226557604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906121b6903390899088908890600401612ce5565b6020604051808303816000875af19250505080156121f1575060408051601f3d908101601f191682019092526121ee91810190612d18565b60015b61224b573d80801561221f576040519150601f19603f3d011682016040523d82523d6000602084013e612224565b606091505b5080516122435760405162461bcd60e51b81526004016106c590612c77565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050610b5d565b506001610b5d565b6060610b5d8484600085612445565b6000600161228984610c8a565b6122939190612b90565b6000838152600760205260409020549091508082146122e6576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b60085460009061232b90600190612b90565b6000838152600960205260408120546008805493945090928490811061235357612353612a36565b90600052602060002001549050806008838154811061237457612374612a36565b60009182526020808320909101929092558281526009909152604080822084905585825281205560088054806123ac576123ac612d35565b6001900381819060005260206000200160009055905550505050565b60006123d383610c8a565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b6060831561241b575081611647565b82511561242b5782518084602001fd5b8160405162461bcd60e51b81526004016106c59190612604565b6060824710156124a65760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016106c5565b6001600160a01b0385163b6124fd5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016106c5565b600080866001600160a01b031685876040516125199190612cc9565b60006040518083038185875af1925050503d8060008114612556576040519150601f19603f3d011682016040523d82523d6000602084013e61255b565b606091505b509150915061256b82828661240c565b979650505050505050565b6001600160e01b03198116811461258c57600080fd5b50565b6000602082840312156125a157600080fd5b813561164781612576565b60005b838110156125c75781810151838201526020016125af565b8381111561106b5750506000910152565b600081518084526125f08160208601602086016125ac565b601f01601f19169290920160200192915050565b60208152600061164760208301846125d8565b6001600160a01b038116811461258c57600080fd5b60006020828403121561263e57600080fd5b813561164781612617565b60006020828403121561265b57600080fd5b5035919050565b6000806040838503121561267557600080fd5b823561268081612617565b946020939093013593505050565b6000806000606084860312156126a357600080fd5b83356126ae81612617565b925060208401356126be81612617565b929592945050506040919091013590565b60008083601f8401126126e157600080fd5b50813567ffffffffffffffff8111156126f957600080fd5b6020830191508360208260051b850101111561271457600080fd5b9250929050565b6000806000806040858703121561273157600080fd5b843567ffffffffffffffff8082111561274957600080fd5b612755888389016126cf565b9096509450602087013591508082111561276e57600080fd5b5061277b878288016126cf565b95989497509550505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b828110156127dc57603f198886030184526127ca8583516125d8565b945092850192908501906001016127ae565b5092979650505050505050565b600080604083850312156127fc57600080fd5b823561280781612617565b91506020830135801515811461281c57600080fd5b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561286657612866612827565b604052919050565b600067ffffffffffffffff82111561288857612888612827565b50601f01601f191660200190565b600080600080608085870312156128ac57600080fd5b84356128b781612617565b935060208501356128c781612617565b925060408501359150606085013567ffffffffffffffff8111156128ea57600080fd5b8501601f810187136128fb57600080fd5b803561290e6129098261286e565b61283d565b81815288602083850101111561292357600080fd5b8160208401602083013760006020838301015280935050505092959194509250565b6000806040838503121561295857600080fd5b823561296381612617565b9150602083013561281c81612617565b600181811c9082168061298757607f821691505b602082108114156129a857634e487b7160e01b600052602260045260246000fd5b50919050565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112612a6357600080fd5b83018035915067ffffffffffffffff821115612a7e57600080fd5b60200191503681900382131561271457600080fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415612abd57612abd612a93565b5060010190565b600060208284031215612ad657600080fd5b815161164781612617565b600060208284031215612af357600080fd5b5051919050565b6000816000190483118215151615612b1457612b14612a93565b500290565b600060208284031215612b2b57600080fd5b815167ffffffffffffffff811115612b4257600080fd5b8201601f81018413612b5357600080fd5b8051612b616129098261286e565b818152856020838501011115612b7657600080fd5b612b878260208301602086016125ac565b95945050505050565b600082821015612ba257612ba2612a93565b500390565b60008219821115612bba57612bba612a93565b500190565b600060608284031215612bd157600080fd5b6040516060810181811067ffffffffffffffff82111715612bf457612bf4612827565b604052825160078110612c0657600080fd5b8152602083015170ffffffffffffffffffffffffffffffffff1981168114612c2d57600080fd5b602082015260408301516fffffffffffffffffffffffffffffffff81168114612c5557600080fd5b60408201529392505050565b634e487b7160e01b600052602160045260246000fd5b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b60008251612cdb8184602087016125ac565b9190910192915050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090611f79908301846125d8565b600060208284031215612d2a57600080fd5b815161164781612576565b634e487b7160e01b600052603160045260246000fdfe416464726573733a206c6f772d6c6576656c207374617469632063616c6c206661696c6564a2646970667358221220d95ac177ccce42bc420f663d0e59d8ba75ff7cc0a74493907f7540af42617ef564736f6c634300080c0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000008862d8DaB077D529Ca3F976B6518bE3862207372
-----Decoded View---------------
Arg [0] : factory_ (address): 0x8862d8DaB077D529Ca3F976B6518bE3862207372
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000008862d8DaB077D529Ca3F976B6518bE3862207372
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.