More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 507 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Withdraw Rewards | 21463768 | 29 hrs ago | IN | 0 ETH | 0.00395336 | ||||
Withdraw Rewards | 21462125 | 34 hrs ago | IN | 0 ETH | 0.00243257 | ||||
Deposit Both | 21457416 | 2 days ago | IN | 0 ETH | 0.0031627 | ||||
Withdraw Rewards | 21456866 | 2 days ago | IN | 0 ETH | 0.00165071 | ||||
Withdraw Rewards | 21450137 | 3 days ago | IN | 0 ETH | 0.00257528 | ||||
Withdraw Rewards | 21419257 | 7 days ago | IN | 0 ETH | 0.00373974 | ||||
Withdraw Both | 21409739 | 8 days ago | IN | 0 ETH | 0.00181648 | ||||
Withdraw Rewards | 21409736 | 8 days ago | IN | 0 ETH | 0.00188283 | ||||
Withdraw Rewards | 21409735 | 8 days ago | IN | 0 ETH | 0.00200847 | ||||
Withdraw Rewards | 21400488 | 10 days ago | IN | 0 ETH | 0.0067457 | ||||
Withdraw Rewards | 21396774 | 10 days ago | IN | 0 ETH | 0.00270582 | ||||
Withdraw Both | 21396767 | 10 days ago | IN | 0 ETH | 0.01605076 | ||||
Withdraw Rewards | 21358668 | 15 days ago | IN | 0 ETH | 0.01410098 | ||||
Withdraw Rewards | 21300846 | 23 days ago | IN | 0 ETH | 0.00177184 | ||||
Withdraw Rewards | 21291508 | 25 days ago | IN | 0 ETH | 0.00532189 | ||||
Withdraw Rewards | 21284807 | 26 days ago | IN | 0 ETH | 0.0022978 | ||||
Withdraw Rewards | 21264015 | 29 days ago | IN | 0 ETH | 0.00432193 | ||||
Withdraw Rewards | 21263229 | 29 days ago | IN | 0 ETH | 0.00220383 | ||||
Deposit | 21254160 | 30 days ago | IN | 0 ETH | 0.00630266 | ||||
Withdraw Rewards | 21253721 | 30 days ago | IN | 0 ETH | 0.00435007 | ||||
Withdraw Rewards | 21250672 | 30 days ago | IN | 0 ETH | 0.00433394 | ||||
Withdraw Rewards | 21220050 | 35 days ago | IN | 0 ETH | 0.00203102 | ||||
Withdraw Both | 21220048 | 35 days ago | IN | 0 ETH | 0.0015134 | ||||
Withdraw Both | 21207225 | 37 days ago | IN | 0 ETH | 0.00231582 | ||||
Withdraw Rewards | 21206134 | 37 days ago | IN | 0 ETH | 0.00289675 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
Cyberia
Compiler Version
v0.8.19+commit.7dd6d404
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT /** Telegram Portal: https://t.me/ShibaDoge_Portal Website: https://realshibadoge.com & https://warzone.realshibadoge.com/operation-cyberia Twitter: https://twitter.com/RealShibaDoge Medium: https://realshibadoge.medium.com Discord: https://discord.gg/realshibadoge ▄▄· ▄· ▄▌▄▄▄▄· ▄▄▄ .▄▄▄ ▪ ▄▄▄· ▐█ ▌▪▐█▪██▌▐█ ▀█▪▀▄.▀·▀▄ █·██ ▐█ ▀█ ██ ▄▄▐█▌▐█▪▐█▀▀█▄▐▀▀▪▄▐▀▀▄ ▐█·▄█▀▀█ ▐███▌ ▐█▀·.██▄▪▐█▐█▄▄▌▐█•█▌▐█▌▐█ ▪▐▌ ·▀▀▀ ▀ • ·▀▀▀▀ ▀▀▀ .▀ ▀▀▀▀ ▀ ▀ */ import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/math/Math.sol"; import "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol"; pragma solidity ^0.8.13; contract Cyberia is Ownable, Pausable, ReentrancyGuard, ERC1155Holder { IERC721 public DOGE_NFT; IERC721 public SHIBA_NFT; IERC20 public ShibaDoge; address public treasury; address public signerAddress; bool public stakingLaunched; uint256 public stakingEndTime; bool public depositPaused; bool public isWithdrawPaused; struct Staker { uint256 currentYield; uint256 accumulatedAmount; uint256 lastCheckpoint; uint256[] stakedDOGE; uint256[] stakedSHIBA; } enum ContractTypes { DOGE, SHIBA } mapping(address => Staker) public _stakers; mapping(address => mapping(uint256 => address)) public _ownerOfToken; mapping(address => ContractTypes) private _contractTypes; mapping(address => mapping(uint256 => uint256)) public _nftYield; mapping(address => uint256) public spentAmount; event Deposit( address indexed staker, address contractAddress, uint256 tokensAmount ); event Withdraw( address indexed staker, address contractAddress, uint256 tokensAmount ); event WithdrawStuckERC721( address indexed receiver, address indexed tokenAddress, uint256 indexed tokenId ); event WithdrawRewards(address indexed staker, uint256 tokens); constructor( address _DOGE, address _SHIBA, address _SHIBDOGE_TOKEN, address _treasury ) { DOGE_NFT = IERC721(_DOGE); _contractTypes[_DOGE] = ContractTypes.DOGE; SHIBA_NFT = IERC721(_SHIBA); _contractTypes[_SHIBA] = ContractTypes.SHIBA; ShibaDoge = IERC20(_SHIBDOGE_TOKEN); signerAddress = 0xf1eaDDf8453CC8953448b0a21e64C77B4203d230; // frontend signing address treasury = _treasury; } /** * @dev Function allows admin to pause reward withdraw. */ function pauseWithdraw(bool _pause) external onlyOwner { isWithdrawPaused = _pause; } function depositBoth( uint256[] memory dogeIds, uint256[] memory dogeTraits, uint256 dogeValidUntil, bytes calldata dogeSignature, uint256[] memory shibaIds, uint256[] memory shibaTraits, uint256 shibaValidUntil, bytes calldata shibaSignature ) external { deposit(address(DOGE_NFT), dogeIds, dogeTraits, dogeValidUntil, dogeSignature); deposit(address(SHIBA_NFT), shibaIds, shibaTraits, shibaValidUntil, shibaSignature); } function deposit( address contractAddress, uint256[] memory tokenIds, uint256[] memory tokenTraits, uint256 validUntil, bytes calldata signature ) public nonReentrant { require(!depositPaused, "Deposit paused"); require(stakingLaunched, "Staking is not launched yet"); require(block.timestamp < stakingEndTime, "Staking has ended"); require( contractAddress == address(DOGE_NFT) || contractAddress == address(SHIBA_NFT), "Unknown contract" ); ContractTypes contractType = _contractTypes[contractAddress]; require( _validateSignature( signature, contractAddress, tokenIds, tokenTraits, validUntil ), "Invalid data provided" ); _setTokensValues(contractAddress, tokenIds, tokenTraits); Staker storage user = _stakers[_msgSender()]; uint256 newYield = user.currentYield; for (uint256 i; i < tokenIds.length; i++) { require( IERC721(contractAddress).ownerOf(tokenIds[i]) == _msgSender(), "Not the owner" ); IERC721(contractAddress).safeTransferFrom( _msgSender(), address(this), tokenIds[i] ); _ownerOfToken[contractAddress][tokenIds[i]] = _msgSender(); newYield += getTokenYield(contractAddress, tokenIds[i]); if (contractType == ContractTypes.DOGE) { user.stakedDOGE.push(tokenIds[i]); } if (contractType == ContractTypes.SHIBA) { user.stakedSHIBA.push(tokenIds[i]); } } accumulate(_msgSender()); user.currentYield = newYield; emit Deposit(_msgSender(), contractAddress, tokenIds.length); } function withdrawBoth( uint256[] memory dogeIds, uint256[] memory shibaIds ) external { withdraw(address(DOGE_NFT), dogeIds); withdraw(address(SHIBA_NFT), shibaIds); } function withdraw( address contractAddress, uint256[] memory tokenIds ) public nonReentrant { require( contractAddress == address(DOGE_NFT) || contractAddress == address(SHIBA_NFT), "Unknown contract" ); ContractTypes contractType = _contractTypes[contractAddress]; Staker storage user = _stakers[_msgSender()]; uint256 newYield = user.currentYield; for (uint256 i; i < tokenIds.length; i++) { require( IERC721(contractAddress).ownerOf(tokenIds[i]) == address(this), "Not the owner" ); _ownerOfToken[contractAddress][tokenIds[i]] = address(0); if (user.currentYield != 0) { uint256 tokenYield = getTokenYield( contractAddress, tokenIds[i] ); newYield -= tokenYield; } if (contractType == ContractTypes.DOGE) { user.stakedDOGE = _moveTokenInTheList( user.stakedDOGE, tokenIds[i] ); user.stakedDOGE.pop(); } if (contractType == ContractTypes.SHIBA) { user.stakedSHIBA = _moveTokenInTheList( user.stakedSHIBA, tokenIds[i] ); user.stakedSHIBA.pop(); } IERC721(contractAddress).safeTransferFrom( address(this), _msgSender(), tokenIds[i] ); } if (user.stakedDOGE.length == 0 && user.stakedSHIBA.length == 0) { newYield = 0; } accumulate(_msgSender()); user.currentYield = newYield; emit Withdraw(_msgSender(), contractAddress, tokenIds.length); } function getTokenYield( address contractAddress, uint256 tokenId ) public view returns (uint256) { uint256 tokenYield = _nftYield[contractAddress][tokenId]; return tokenYield; } function getStakerYield(address staker) public view returns (uint256) { return _stakers[staker].currentYield; } function getStakerTokens( address staker ) public view returns (uint256[] memory, uint256[] memory) { return (_stakers[staker].stakedDOGE, _stakers[staker].stakedSHIBA); } function isTokenYieldSet( address contractAddress, uint256 tokenId ) public view returns (bool) { return _nftYield[contractAddress][tokenId] > 0; } function _moveTokenInTheList( uint256[] memory list, uint256 tokenId ) internal pure returns (uint256[] memory) { uint256 tokenIndex = 0; uint256 lastTokenIndex = list.length - 1; uint256 length = list.length; for (uint256 i = 0; i < length; i++) { if (list[i] == tokenId) { tokenIndex = i + 1; break; } } require(tokenIndex != 0, "msg.sender is not the owner"); tokenIndex -= 1; if (tokenIndex != lastTokenIndex) { list[tokenIndex] = list[lastTokenIndex]; list[lastTokenIndex] = tokenId; } return list; } function _validateSignature( bytes calldata signature, address contractAddress, uint256[] memory tokenIds, uint256[] memory tokenTraits, uint256 validUntil ) internal view returns (bool) { if (block.timestamp > validUntil) { return false; } bytes32 dataHash = keccak256( abi.encodePacked(contractAddress, tokenIds, tokenTraits, validUntil) ); bytes32 message = ECDSA.toEthSignedMessageHash(dataHash); address receivedAddress = ECDSA.recover(message, signature); return (receivedAddress != address(0) && receivedAddress == signerAddress); } function _setTokensValues( address contractAddress, uint256[] memory tokenIds, uint256[] memory tokenTraits ) internal { require(tokenIds.length == tokenTraits.length, "Wrong arrays provided"); for (uint256 i; i < tokenIds.length; i++) { if (tokenTraits[i] != 0) { _nftYield[contractAddress][tokenIds[i]] = tokenTraits[i]; } } } function getCurrentReward(address staker) public view returns (uint256) { Staker memory user = _stakers[staker]; if (user.lastCheckpoint == 0) { return 0; } return ((Math.min(block.timestamp, stakingEndTime) - user.lastCheckpoint) * user.currentYield) / 1 days; } function accumulate(address staker) internal { _stakers[staker].accumulatedAmount += getCurrentReward(staker); _stakers[staker].lastCheckpoint = Math.min( block.timestamp, stakingEndTime ); } /** * @dev Returns token owner address (returns address(0) if token is not inside the gateway) */ function ownerOf( address contractAddress, uint256 tokenId ) public view returns (address) { return _ownerOfToken[contractAddress][tokenId]; } /** * @dev Function allows admin withdraw ERC721 in case of emergency. */ function emergencyWithdraw( address tokenAddress, uint256[] memory tokenIds ) public onlyOwner { require(tokenIds.length <= 50, "50 is max per tx"); pauseDeposit(true); for (uint256 i; i < tokenIds.length; i++) { address receiver = _ownerOfToken[tokenAddress][tokenIds[i]]; if ( receiver != address(0) && IERC721(tokenAddress).ownerOf(tokenIds[i]) == address(this) ) { IERC721(tokenAddress).safeTransferFrom( address(this), receiver, tokenIds[i] ); emit WithdrawStuckERC721(receiver, tokenAddress, tokenIds[i]); } } } /** * @dev Function allows to pause deposits if needed. Withdraw remains active. */ function pauseDeposit(bool _pause) public onlyOwner { depositPaused = _pause; } function updateSignerAddress(address _signer) public onlyOwner { signerAddress = _signer; } function updateTreasuryAddress(address _treasury) public onlyOwner { treasury = _treasury; } function launchStaking() public onlyOwner { require(!stakingLaunched, "Staking has been launched already"); stakingLaunched = true; stakingEndTime = block.timestamp + 365 days; } function setStakingEndTime(uint256 endTime) external onlyOwner { require(endTime > stakingEndTime); stakingEndTime = endTime; } function onERC721Received( address, address, uint256, bytes calldata ) external pure returns (bytes4) { return bytes4( keccak256("onERC721Received(address,address,uint256,bytes)") ); } /** * @dev Function to withdraw staked rewards */ function withdrawRewards() public nonReentrant whenNotPaused { require(!isWithdrawPaused, "Withdraw Paused"); uint256 amount = getUserBalance(_msgSender()); require(amount > 0, "Insufficient balance"); spentAmount[_msgSender()] += amount; ShibaDoge.transferFrom( treasury, _msgSender(), amount ); emit WithdrawRewards(_msgSender(), amount); } /** * @dev user's lifetime earnings */ function getAccumulatedAmount( address staker ) public view returns (uint256) { return _stakers[staker].accumulatedAmount + getCurrentReward(staker); } /** * @dev Returns current withdrawable balance of a specific user. */ function getUserBalance(address user) public view returns (uint256) { return (getAccumulatedAmount(user) - spentAmount[user]); } // Safety functions /** * @dev Allows owner to withdraw any ERC20 Token sent directly to the contract */ function rescueTokens(address _stuckToken) external onlyOwner { uint256 balance = IERC20(_stuckToken).balanceOf(address(this)); IERC20(_stuckToken).transfer(msg.sender, balance); } /** * @dev Allows owner to withdraw any ERC721 Token sent directly to the contract */ function rescueERC721(address _stuckToken, uint256 id) external onlyOwner { if ( _stuckToken == address(DOGE_NFT) || _stuckToken == address(SHIBA_NFT) ) { require(_ownerOfToken[_stuckToken][id] == address(0)); } IERC721(_stuckToken).safeTransferFrom(address(this), msg.sender, id); } function rescueERC1155(address _stuckToken, uint256 id, bytes calldata data) external onlyOwner { uint256 amount = IERC1155(_stuckToken).balanceOf(address(this), id); IERC1155(_stuckToken).safeTransferFrom(address(this), msg.sender, id, amount, data); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract Pausable is Context { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ constructor() { _paused = false; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { _requireNotPaused(); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { _requirePaused(); _; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Throws if the contract is paused. */ function _requireNotPaused() internal view virtual { require(!paused(), "Pausable: paused"); } /** * @dev Throws if the contract is not paused. */ function _requirePaused() internal view virtual { require(paused(), "Pausable: not paused"); } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (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() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { // On the first call to nonReentrant, _status will be _NOT_ENTERED require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; } function _nonReentrantAfter() private { // 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 (last updated v4.7.0) (token/ERC1155/IERC1155.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC1155 compliant contract, as defined in the * https://eips.ethereum.org/EIPS/eip-1155[EIP]. * * _Available since v3.1._ */ interface IERC1155 is IERC165 { /** * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`. */ event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value); /** * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all * transfers. */ event TransferBatch( address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values ); /** * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to * `approved`. */ event ApprovalForAll(address indexed account, address indexed operator, bool approved); /** * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI. * * If an {URI} event was emitted for `id`, the standard * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value * returned by {IERC1155MetadataURI-uri}. */ event URI(string value, uint256 indexed id); /** * @dev Returns the amount of tokens of token type `id` owned by `account`. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) external view returns (uint256); /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids) external view returns (uint256[] memory); /** * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`, * * Emits an {ApprovalForAll} event. * * Requirements: * * - `operator` cannot be the caller. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns true if `operator` is approved to transfer ``account``'s tokens. * * See {setApprovalForAll}. */ function isApprovedForAll(address account, address operator) external view returns (bool); /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}. * - `from` must have a balance of tokens of type `id` of at least `amount`. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes calldata data ) external; /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `amounts` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function safeBatchTransferFrom( address from, address to, uint256[] calldata ids, uint256[] calldata amounts, bytes calldata data ) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev _Available since v3.1._ */ interface IERC1155Receiver is IERC165 { /** * @dev Handles the receipt of a single ERC1155 token type. This function is * called at the end of a `safeTransferFrom` after the balance has been updated. * * NOTE: To accept the transfer, this must return * `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` * (i.e. 0xf23a6e61, or its own function selector). * * @param operator The address which initiated the transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param id The ID of the token being transferred * @param value The amount of tokens being transferred * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed */ function onERC1155Received( address operator, address from, uint256 id, uint256 value, bytes calldata data ) external returns (bytes4); /** * @dev Handles the receipt of a multiple ERC1155 token types. This function * is called at the end of a `safeBatchTransferFrom` after the balances have * been updated. * * NOTE: To accept the transfer(s), this must return * `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` * (i.e. 0xbc197c81, or its own function selector). * * @param operator The address which initiated the batch transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param ids An array containing ids of each token being transferred (order and length must match values array) * @param values An array containing amounts of each token being transferred (order and length must match ids array) * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed */ function onERC1155BatchReceived( address operator, address from, uint256[] calldata ids, uint256[] calldata values, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/utils/ERC1155Holder.sol) pragma solidity ^0.8.0; import "./ERC1155Receiver.sol"; /** * Simple implementation of `ERC1155Receiver` that will allow a contract to hold ERC1155 tokens. * * IMPORTANT: When inheriting this contract, you must include a way to use the received tokens, otherwise they will be * stuck. * * @dev _Available since v3.1._ */ contract ERC1155Holder is ERC1155Receiver { function onERC1155Received( address, address, uint256, uint256, bytes memory ) public virtual override returns (bytes4) { return this.onERC1155Received.selector; } function onERC1155BatchReceived( address, address, uint256[] memory, uint256[] memory, bytes memory ) public virtual override returns (bytes4) { return this.onERC1155BatchReceived.selector; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC1155/utils/ERC1155Receiver.sol) pragma solidity ^0.8.0; import "../IERC1155Receiver.sol"; import "../../../utils/introspection/ERC165.sol"; /** * @dev _Available since v3.1._ */ abstract contract ERC1155Receiver is ERC165, IERC1155Receiver { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC1155Receiver).interfaceId || super.supportsInterface(interfaceId); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 amount ) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721 * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must * understand this adds an external call which potentially creates a reentrancy vulnerability. * * 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/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol) pragma solidity ^0.8.0; import "../Strings.sol"; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSA { enum RecoverError { NoError, InvalidSignature, InvalidSignatureLength, InvalidSignatureS, InvalidSignatureV // Deprecated in v4.8 } function _throwError(RecoverError error) private pure { if (error == RecoverError.NoError) { return; // no error: do nothing } else if (error == RecoverError.InvalidSignature) { revert("ECDSA: invalid signature"); } else if (error == RecoverError.InvalidSignatureLength) { revert("ECDSA: invalid signature length"); } else if (error == RecoverError.InvalidSignatureS) { revert("ECDSA: invalid signature 's' value"); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature` or error string. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. * * Documentation for signature generation: * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js] * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) { if (signature.length == 65) { bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. /// @solidity memory-safe-assembly assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } return tryRecover(hash, v, r, s); } else { return (address(0), RecoverError.InvalidSignatureLength); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, signature); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately. * * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures] * * _Available since v4.3._ */ function tryRecover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address, RecoverError) { bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff); uint8 v = uint8((uint256(vs) >> 255) + 27); return tryRecover(hash, v, r, s); } /** * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately. * * _Available since v4.2._ */ function recover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, r, vs); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `v`, * `r` and `s` signature fields separately. * * _Available since v4.3._ */ function tryRecover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address, RecoverError) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { return (address(0), RecoverError.InvalidSignatureS); } // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); if (signer == address(0)) { return (address(0), RecoverError.InvalidSignature); } return (signer, RecoverError.NoError); } /** * @dev Overload of {ECDSA-recover} that receives the `v`, * `r` and `s` signature fields separately. */ function recover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, v, r, s); _throwError(error); return recovered; } /** * @dev Returns an Ethereum Signed Message, created from a `hash`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) { // 32 is the length in bytes of hash, // enforced by the type signature above return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)); } /** * @dev Returns an Ethereum Signed Message, created from `s`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s)); } /** * @dev Returns an Ethereum Signed Typed Data, created from a * `domainSeparator` and a `structHash`. This produces hash corresponding * to the one signed with the * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] * JSON-RPC method as part of EIP-712. * * See {recover}. */ function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv( uint256 x, uint256 y, uint256 denominator ) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv( uint256 x, uint256 y, uint256 denominator, Rounding rounding ) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10**64) { value /= 10**64; result += 64; } if (value >= 10**32) { value /= 10**32; result += 32; } if (value >= 10**16) { value /= 10**16; result += 16; } if (value >= 10**8) { value /= 10**8; result += 8; } if (value >= 10**4) { value /= 10**4; result += 4; } if (value >= 10**2) { value /= 10**2; result += 2; } if (value >= 10**1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/Math.sol"; /** * @dev String operations. */ library Strings { bytes16 private constant _SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @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] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_DOGE","type":"address"},{"internalType":"address","name":"_SHIBA","type":"address"},{"internalType":"address","name":"_SHIBDOGE_TOKEN","type":"address"},{"internalType":"address","name":"_treasury","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"staker","type":"address"},{"indexed":false,"internalType":"address","name":"contractAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokensAmount","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"staker","type":"address"},{"indexed":false,"internalType":"address","name":"contractAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokensAmount","type":"uint256"}],"name":"Withdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"staker","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokens","type":"uint256"}],"name":"WithdrawRewards","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":true,"internalType":"address","name":"tokenAddress","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"WithdrawStuckERC721","type":"event"},{"inputs":[],"name":"DOGE_NFT","outputs":[{"internalType":"contract IERC721","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SHIBA_NFT","outputs":[{"internalType":"contract IERC721","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ShibaDoge","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"_nftYield","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"_ownerOfToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"_stakers","outputs":[{"internalType":"uint256","name":"currentYield","type":"uint256"},{"internalType":"uint256","name":"accumulatedAmount","type":"uint256"},{"internalType":"uint256","name":"lastCheckpoint","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"contractAddress","type":"address"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"tokenTraits","type":"uint256[]"},{"internalType":"uint256","name":"validUntil","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"dogeIds","type":"uint256[]"},{"internalType":"uint256[]","name":"dogeTraits","type":"uint256[]"},{"internalType":"uint256","name":"dogeValidUntil","type":"uint256"},{"internalType":"bytes","name":"dogeSignature","type":"bytes"},{"internalType":"uint256[]","name":"shibaIds","type":"uint256[]"},{"internalType":"uint256[]","name":"shibaTraits","type":"uint256[]"},{"internalType":"uint256","name":"shibaValidUntil","type":"uint256"},{"internalType":"bytes","name":"shibaSignature","type":"bytes"}],"name":"depositBoth","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"depositPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"staker","type":"address"}],"name":"getAccumulatedAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"staker","type":"address"}],"name":"getCurrentReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"staker","type":"address"}],"name":"getStakerTokens","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"staker","type":"address"}],"name":"getStakerYield","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"contractAddress","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getTokenYield","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getUserBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"contractAddress","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"isTokenYieldSet","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isWithdrawPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"launchStaking","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155BatchReceived","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"contractAddress","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"_pause","type":"bool"}],"name":"pauseDeposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_pause","type":"bool"}],"name":"pauseWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_stuckToken","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"rescueERC1155","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_stuckToken","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"rescueERC721","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_stuckToken","type":"address"}],"name":"rescueTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"endTime","type":"uint256"}],"name":"setStakingEndTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"signerAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"spentAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stakingEndTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stakingLaunched","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_signer","type":"address"}],"name":"updateSignerAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_treasury","type":"address"}],"name":"updateTreasuryAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"contractAddress","type":"address"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"dogeIds","type":"uint256[]"},{"internalType":"uint256[]","name":"shibaIds","type":"uint256[]"}],"name":"withdrawBoth","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawRewards","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60806040523480156200001157600080fd5b5060405162002f2a38038062002f2a833981016040819052620000349162000156565b6200003f33620000e9565b6000805460ff60a01b191681556001808055600280546001600160a01b03199081166001600160a01b03988916908117909255908352600b6020526040808420805460ff19908116909155600380548416988a169889179055968452909220805490951617909355600480549285169284169290921790915560068054831673f1eaddf8453cc8953448b0a21e64c77b4203d23017905560058054919093169116179055620001b3565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b03811681146200015157600080fd5b919050565b600080600080608085870312156200016d57600080fd5b620001788562000139565b9350620001886020860162000139565b9250620001986040860162000139565b9150620001a86060860162000139565b905092959194509250565b612d6780620001c36000396000f3fe608060405234801561001057600080fd5b50600436106102735760003560e01c80636d031d0a116101515780639191501a116100c3578063d798183411610087578063d7981834146106a8578063dfeaa74c146106bb578063e1af5698146106ce578063ebd462cb146106e2578063f23a6e61146106f5578063f2fde38b1461071457600080fd5b80639191501a146106535780639f5cf2b614610666578063a30a247414610679578063bc197c8114610681578063c7b8981c146106a057600080fd5b80637884ee67116101155780637884ee67146105ed5780638293744b14610600578063841e4561146106135780638ac33487146106265780638da5cb5b1461062f5780638fa2a9f01461064057600080fd5b80636d031d0a146105345780636f3b5a711461055457806370f7007114610567578063715018a61461059b57806375e032f4146105a357600080fd5b80632ed3b83b116101ea5780635a0b3045116101ae5780635a0b3045146104a15780635b7633d0146104b45780635c975abb146104c757806361499ab9146104d957806361d027b31461050f57806367800b5f1461052257600080fd5b80632ed3b83b1461042c578063415855d61461043f57806347734892146104525780634bee21d4146104655780634d307e3f1461048e57600080fd5b8063150b7a021161023c578063150b7a021461031b57806317636b861461036c57806319647af5146103975780631f29d2dc146103aa5780632161a2b6146103e05780632ab2e4d01461040157600080fd5b8062ae3bf81461027857806301ffc9a71461028d57806302befd24146102b557806304129667146102c25780630bac0e2f146102e3575b600080fd5b61028b610286366004612440565b610727565b005b6102a061029b36600461245d565b610813565b60405190151581526020015b60405180910390f35b6008546102a09060ff1681565b6102d56102d0366004612440565b61084a565b6040519081526020016102ac565b6102a06102f1366004612487565b6001600160a01b03919091166000908152600c602090815260408083209383529290522054151590565b6103536103293660046124f5565b7f150b7a023d4804d13e8c85fb27262cb750cf6ba9f9dd3bb30d90f482ceeb4b1f95945050505050565b6040516001600160e01b031990911681526020016102ac565b60035461037f906001600160a01b031681565b6040516001600160a01b0390911681526020016102ac565b61028b6103a536600461262f565b61087b565b61037f6103b8366004612487565b6001600160a01b039182166000908152600a6020908152604080832093835292905220541690565b6103f36103ee366004612440565b6108ab565b6040516102ac9291906126ce565b6102d561040f366004612487565b600c60209081526000928352604080842090915290825290205481565b60045461037f906001600160a01b031681565b61028b61044d36600461270a565b61097c565b6102d5610460366004612440565b610997565b6102d5610473366004612440565b6001600160a01b031660009081526009602052604090205490565b6102d561049c366004612440565b6109c3565b61028b6104af366004612727565b610b04565b60065461037f906001600160a01b031681565b600054600160a01b900460ff166102a0565b6102d56104e7366004612487565b6001600160a01b03919091166000908152600c60209081526040808320938352929052205490565b60055461037f906001600160a01b031681565b6008546102a090610100900460ff1681565b6102d5610542366004612440565b600d6020526000908152604090205481565b61028b610562366004612740565b610b1f565b61037f610575366004612487565b600a6020908152600092835260408084209091529082529020546001600160a01b031681565b61028b611039565b6105d26105b1366004612440565b60096020526000908152604090208054600182015460029092015490919083565b604080519384526020840192909252908201526060016102ac565b61028b6105fb3660046127eb565b61104d565b61028b61060e366004612904565b61108d565b61028b610621366004612440565b611546565b6102d560075481565b6000546001600160a01b031661037f565b61028b61064e366004612440565b611570565b61028b61066136600461294a565b61159a565b60025461037f906001600160a01b031681565b61028b611684565b61035361068f366004612a16565b63bc197c8160e01b95945050505050565b61028b611711565b61028b6106b6366004612487565b61189c565b61028b6106c9366004612904565b611960565b6006546102a090600160a01b900460ff1681565b61028b6106f036600461270a565b611bac565b610353610703366004612ac4565b63f23a6e6160e01b95945050505050565b61028b610722366004612440565b611bce565b61072f611c47565b6040516370a0823160e01b81523060048201526000906001600160a01b038316906370a0823190602401602060405180830381865afa158015610776573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061079a9190612b2d565b60405163a9059cbb60e01b8152336004820152602481018290529091506001600160a01b0383169063a9059cbb906044016020604051808303816000875af11580156107ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061080e9190612b46565b505050565b60006001600160e01b03198216630271189760e51b148061084457506301ffc9a760e01b6001600160e01b03198316145b92915050565b6000610855826109c3565b6001600160a01b0383166000908152600960205260409020600101546108449190612b79565b600254610891906001600160a01b03168361108d565b6003546108a7906001600160a01b03168261108d565b5050565b6001600160a01b03811660009081526009602090815260409182902060038101805484518185028101850190955280855260609485949293600401929091849183018282801561091a57602002820191906000526020600020905b815481526020019060010190808311610906575b505050505091508080548060200260200160405190810160405280929190818152602001828054801561096c57602002820191906000526020600020905b815481526020019060010190808311610958575b5050505050905091509150915091565b610984611c47565b6008805460ff1916911515919091179055565b6001600160a01b0381166000908152600d60205260408120546109b98361084a565b6108449190612b8c565b6001600160a01b0381166000908152600960209081526040808320815160a0810183528154815260018201548185015260028201548184015260038201805484518187028101870190955280855286959294606086019390929190830182828015610a4d57602002820191906000526020600020905b815481526020019060010190808311610a39575b5050505050815260200160048201805480602002602001604051908101604052809291908181526020018280548015610aa557602002820191906000526020600020905b815481526020019060010190808311610a91575b50505050508152505090508060400151600003610ac55750600092915050565b6201518081600001518260400151610adf42600754611ca1565b610ae99190612b8c565b610af39190612b9f565b610afd9190612bb6565b9392505050565b610b0c611c47565b6007548111610b1a57600080fd5b600755565b610b27611cb7565b60085460ff1615610b705760405162461bcd60e51b815260206004820152600e60248201526d11195c1bdcda5d081c185d5cd95960921b60448201526064015b60405180910390fd5b600654600160a01b900460ff16610bc95760405162461bcd60e51b815260206004820152601b60248201527f5374616b696e67206973206e6f74206c61756e636865642079657400000000006044820152606401610b67565b6007544210610c0e5760405162461bcd60e51b815260206004820152601160248201527014dd185ada5b99c81a185cc8195b991959607a1b6044820152606401610b67565b6002546001600160a01b0387811691161480610c3757506003546001600160a01b038781169116145b610c765760405162461bcd60e51b815260206004820152601060248201526f155b9adb9bdddb8818dbdb9d1c9858dd60821b6044820152606401610b67565b6001600160a01b0386166000908152600b602052604090205460ff16610ca0838389898989611d10565b610ce45760405162461bcd60e51b8152602060048201526015602482015274125b9d985b1a590819185d18481c1c9bdd9a591959605a1b6044820152606401610b67565b610cef878787611e27565b336000908152600960205260408120805490915b8851811015610fd157336001600160a01b03168a6001600160a01b0316636352211e8b8481518110610d3757610d37612bd8565b60200260200101516040518263ffffffff1660e01b8152600401610d5d91815260200190565b602060405180830381865afa158015610d7a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d9e9190612bee565b6001600160a01b031614610de45760405162461bcd60e51b815260206004820152600d60248201526c2737ba103a34329037bbb732b960991b6044820152606401610b67565b6001600160a01b038a166342842e0e33308c8581518110610e0757610e07612bd8565b60200260200101516040518463ffffffff1660e01b8152600401610e2d93929190612c0b565b600060405180830381600087803b158015610e4757600080fd5b505af1158015610e5b573d6000803e3d6000fd5b50505050610e663390565b6001600160a01b038b166000908152600a602052604081208b519091908c9085908110610e9557610e95612bd8565b6020026020010151815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b03160217905550610f158a8a8381518110610ee557610ee5612bd8565b60200260200101516001600160a01b03919091166000908152600c60209081526040808320938352929052205490565b610f1f9083612b79565b91506000846001811115610f3557610f35612c2f565b03610f705782600301898281518110610f5057610f50612bd8565b602090810291909101810151825460018101845560009384529190922001555b6001846001811115610f8457610f84612c2f565b03610fbf5782600401898281518110610f9f57610f9f612bd8565b602090810291909101810151825460018101845560009384529190922001555b80610fc981612c45565b915050610d03565b50610fdb33611f23565b8082558751604080516001600160a01b038c168152602081019290925233917f5548c837ab068cf56a2c2479df0882a4922fd203edb7517321831d95078c5f62910160405180910390a250505061103160018055565b505050505050565b611041611c47565b61104b6000611f89565b565b600254611067906001600160a01b03168b8b8b8b8b610b1f565b600354611081906001600160a01b03168686868686610b1f565b50505050505050505050565b611095611cb7565b6002546001600160a01b03838116911614806110be57506003546001600160a01b038381169116145b6110fd5760405162461bcd60e51b815260206004820152601060248201526f155b9adb9bdddb8818dbdb9d1c9858dd60821b6044820152606401610b67565b6001600160a01b0382166000908152600b602090815260408083205433845260099092528220805460ff909216929091905b84518110156114c957306001600160a01b0316866001600160a01b0316636352211e87848151811061116357611163612bd8565b60200260200101516040518263ffffffff1660e01b815260040161118991815260200190565b602060405180830381865afa1580156111a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111ca9190612bee565b6001600160a01b0316146112105760405162461bcd60e51b815260206004820152600d60248201526c2737ba103a34329037bbb732b960991b6044820152606401610b67565b6001600160a01b0386166000908152600a602052604081208651829088908590811061123e5761123e612bd8565b6020026020010151815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b0316021790555082600001546000146112ac57600061129c87878481518110610ee557610ee5612bd8565b90506112a88184612b8c565b9250505b60008460018111156112c0576112c0612c2f565b0361137b5761133a8360030180548060200260200160405190810160405280929190818152602001828054801561131657602002820191906000526020600020905b815481526020019060010190808311611302575b505050505086838151811061132d5761132d612bd8565b6020026020010151611fd9565b80516113509160038601916020909101906123cb565b508260030180548061136457611364612c5e565b600190038181906000526020600020016000905590555b600184600181111561138f5761138f612c2f565b0361143b576113fa83600401805480602002602001604051908101604052809291908181526020018280548015611316576020028201919060005260206000209081548152602001906001019080831161130257505050505086838151811061132d5761132d612bd8565b80516114109160048601916020909101906123cb565b508260040180548061142457611424612c5e565b600190038181906000526020600020016000905590555b6001600160a01b0386166342842e0e303388858151811061145e5761145e612bd8565b60200260200101516040518463ffffffff1660e01b815260040161148493929190612c0b565b600060405180830381600087803b15801561149e57600080fd5b505af11580156114b2573d6000803e3d6000fd5b5050505080806114c190612c45565b91505061112f565b5060038201541580156114de57506004820154155b156114e7575060005b6114f033611f23565b8082558351604080516001600160a01b0388168152602081019290925233917f9b1bfa7fa9ee420a16e124f794c35ac9f90472acc99140eb2f6447c714cad8eb910160405180910390a25050506108a760018055565b61154e611c47565b600580546001600160a01b0319166001600160a01b0392909216919091179055565b611578611c47565b600680546001600160a01b0319166001600160a01b0392909216919091179055565b6115a2611c47565b604051627eeac760e11b8152306004820152602481018490526000906001600160a01b0386169062fdd58e90604401602060405180830381865afa1580156115ee573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116129190612b2d565b604051637921219560e11b81529091506001600160a01b0386169063f242432a9061164b9030903390899087908a908a90600401612c74565b600060405180830381600087803b15801561166557600080fd5b505af1158015611679573d6000803e3d6000fd5b505050505050505050565b61168c611c47565b600654600160a01b900460ff16156116f05760405162461bcd60e51b815260206004820152602160248201527f5374616b696e6720686173206265656e206c61756e6368656420616c726561646044820152607960f81b6064820152608401610b67565b6006805460ff60a01b1916600160a01b179055610b1a426301e13380612b79565b611719611cb7565b611721612107565b600854610100900460ff161561176b5760405162461bcd60e51b815260206004820152600f60248201526e15da5d1a191c985dc814185d5cd959608a1b6044820152606401610b67565b600061177633610997565b9050600081116117bf5760405162461bcd60e51b8152602060048201526014602482015273496e73756666696369656e742062616c616e636560601b6044820152606401610b67565b336000908152600d6020526040812080548392906117de908490612b79565b9091555050600480546005546040516323b872dd60e01b81526001600160a01b03928316936323b872dd936118199316913391879101612c0b565b6020604051808303816000875af1158015611838573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061185c9190612b46565b5060405181815233907faa1377f7ec93c239e959efa811f7b8554c036fd7a706c23e58024626a8f3db969060200160405180910390a25061104b60018055565b6118a4611c47565b6002546001600160a01b03838116911614806118cd57506003546001600160a01b038381169116145b15611902576001600160a01b038281166000908152600a60209081526040808320858452909152902054161561190257600080fd5b604051632142170760e11b81526001600160a01b038316906342842e0e9061193290309033908690600401612c0b565b600060405180830381600087803b15801561194c57600080fd5b505af1158015611031573d6000803e3d6000fd5b611968611c47565b6032815111156119ad5760405162461bcd60e51b815260206004820152601060248201526f06a6040d2e640dac2f040e0cae440e8f60831b6044820152606401610b67565b6119b7600161097c565b60005b815181101561080e576001600160a01b0383166000908152600a60205260408120835182908590859081106119f1576119f1612bd8565b6020908102919091018101518252810191909152604001600020546001600160a01b031690508015801590611abe5750306001600160a01b0316846001600160a01b0316636352211e858581518110611a4c57611a4c612bd8565b60200260200101516040518263ffffffff1660e01b8152600401611a7291815260200190565b602060405180830381865afa158015611a8f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ab39190612bee565b6001600160a01b0316145b15611b9957836001600160a01b03166342842e0e3083868681518110611ae657611ae6612bd8565b60200260200101516040518463ffffffff1660e01b8152600401611b0c93929190612c0b565b600060405180830381600087803b158015611b2657600080fd5b505af1158015611b3a573d6000803e3d6000fd5b50505050828281518110611b5057611b50612bd8565b6020026020010151846001600160a01b0316826001600160a01b03167ffefe036cac4ee3a4aca074a81cbcc4376e1484693289078dbec149c890101d5b60405160405180910390a45b5080611ba481612c45565b9150506119ba565b611bb4611c47565b600880549115156101000261ff0019909216919091179055565b611bd6611c47565b6001600160a01b038116611c3b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610b67565b611c4481611f89565b50565b6000546001600160a01b0316331461104b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b67565b6000818310611cb05781610afd565b5090919050565b600260015403611d095760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610b67565b6002600155565b600081421115611d2257506000611e1d565b600085858585604051602001611d3b9493929190612cf5565b6040516020818303038152906040528051906020012090506000611dac826040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b90506000611df0828b8b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061215492505050565b90506001600160a01b03811615801590611e1757506006546001600160a01b038281169116145b93505050505b9695505050505050565b8051825114611e705760405162461bcd60e51b815260206004820152601560248201527415dc9bdb99c8185c9c985e5cc81c1c9bdd9a591959605a1b6044820152606401610b67565b60005b8251811015611f1d57818181518110611e8e57611e8e612bd8565b6020026020010151600014611f0b57818181518110611eaf57611eaf612bd8565b6020026020010151600c6000866001600160a01b03166001600160a01b031681526020019081526020016000206000858481518110611ef057611ef0612bd8565b60200260200101518152602001908152602001600020819055505b80611f1581612c45565b915050611e73565b50505050565b611f2c816109c3565b6001600160a01b03821660009081526009602052604081206001018054909190611f57908490612b79565b92505081905550611f6a42600754611ca1565b6001600160a01b03909116600090815260096020526040902060020155565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b606060008060018551611fec9190612b8c565b855190915060005b81811015612040578587828151811061200f5761200f612bd8565b60200260200101510361202e57612027816001612b79565b9350612040565b8061203881612c45565b915050611ff4565b50826000036120915760405162461bcd60e51b815260206004820152601b60248201527f6d73672e73656e646572206973206e6f7420746865206f776e657200000000006044820152606401610b67565b61209c600184612b8c565b92508183146120fd578582815181106120b7576120b7612bd8565b60200260200101518684815181106120d1576120d1612bd8565b602002602001018181525050848683815181106120f0576120f0612bd8565b6020026020010181815250505b5093949350505050565b600054600160a01b900460ff161561104b5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610b67565b60008060006121638585612178565b91509150612170816121bd565b509392505050565b60008082516041036121ae5760208301516040840151606085015160001a6121a287828585612307565b945094505050506121b6565b506000905060025b9250929050565b60008160048111156121d1576121d1612c2f565b036121d95750565b60018160048111156121ed576121ed612c2f565b0361223a5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610b67565b600281600481111561224e5761224e612c2f565b0361229b5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610b67565b60038160048111156122af576122af612c2f565b03611c445760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610b67565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561233e57506000905060036123c2565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015612392573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166123bb576000600192509250506123c2565b9150600090505b94509492505050565b828054828255906000526020600020908101928215612406579160200282015b828111156124065782518255916020019190600101906123eb565b50612412929150612416565b5090565b5b808211156124125760008155600101612417565b6001600160a01b0381168114611c4457600080fd5b60006020828403121561245257600080fd5b8135610afd8161242b565b60006020828403121561246f57600080fd5b81356001600160e01b031981168114610afd57600080fd5b6000806040838503121561249a57600080fd5b82356124a58161242b565b946020939093013593505050565b60008083601f8401126124c557600080fd5b50813567ffffffffffffffff8111156124dd57600080fd5b6020830191508360208285010111156121b657600080fd5b60008060008060006080868803121561250d57600080fd5b85356125188161242b565b945060208601356125288161242b565b935060408601359250606086013567ffffffffffffffff81111561254b57600080fd5b612557888289016124b3565b969995985093965092949392505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff811182821017156125a7576125a7612568565b604052919050565b600082601f8301126125c057600080fd5b8135602067ffffffffffffffff8211156125dc576125dc612568565b8160051b6125eb82820161257e565b928352848101820192828101908785111561260557600080fd5b83870192505b848310156126245782358252918301919083019061260b565b979650505050505050565b6000806040838503121561264257600080fd5b823567ffffffffffffffff8082111561265a57600080fd5b612666868387016125af565b9350602085013591508082111561267c57600080fd5b50612689858286016125af565b9150509250929050565b600081518084526020808501945080840160005b838110156126c3578151875295820195908201906001016126a7565b509495945050505050565b6040815260006126e16040830185612693565b82810360208401526126f38185612693565b95945050505050565b8015158114611c4457600080fd5b60006020828403121561271c57600080fd5b8135610afd816126fc565b60006020828403121561273957600080fd5b5035919050565b60008060008060008060a0878903121561275957600080fd5b86356127648161242b565b9550602087013567ffffffffffffffff8082111561278157600080fd5b61278d8a838b016125af565b965060408901359150808211156127a357600080fd5b6127af8a838b016125af565b95506060890135945060808901359150808211156127cc57600080fd5b506127d989828a016124b3565b979a9699509497509295939492505050565b6000806000806000806000806000806101008b8d03121561280b57600080fd5b8a3567ffffffffffffffff8082111561282357600080fd5b61282f8e838f016125af565b9b5060208d013591508082111561284557600080fd5b6128518e838f016125af565b9a5060408d0135995060608d013591508082111561286e57600080fd5b61287a8e838f016124b3565b909950975060808d013591508082111561289357600080fd5b61289f8e838f016125af565b965060a08d01359150808211156128b557600080fd5b6128c18e838f016125af565b955060c08d0135945060e08d01359150808211156128de57600080fd5b506128eb8d828e016124b3565b915080935050809150509295989b9194979a5092959850565b6000806040838503121561291757600080fd5b82356129228161242b565b9150602083013567ffffffffffffffff81111561293e57600080fd5b612689858286016125af565b6000806000806060858703121561296057600080fd5b843561296b8161242b565b935060208501359250604085013567ffffffffffffffff81111561298e57600080fd5b61299a878288016124b3565b95989497509550505050565b600082601f8301126129b757600080fd5b813567ffffffffffffffff8111156129d1576129d1612568565b6129e4601f8201601f191660200161257e565b8181528460208386010111156129f957600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a08688031215612a2e57600080fd5b8535612a398161242b565b94506020860135612a498161242b565b9350604086013567ffffffffffffffff80821115612a6657600080fd5b612a7289838a016125af565b94506060880135915080821115612a8857600080fd5b612a9489838a016125af565b93506080880135915080821115612aaa57600080fd5b50612ab7888289016129a6565b9150509295509295909350565b600080600080600060a08688031215612adc57600080fd5b8535612ae78161242b565b94506020860135612af78161242b565b93506040860135925060608601359150608086013567ffffffffffffffff811115612b2157600080fd5b612ab7888289016129a6565b600060208284031215612b3f57600080fd5b5051919050565b600060208284031215612b5857600080fd5b8151610afd816126fc565b634e487b7160e01b600052601160045260246000fd5b8082018082111561084457610844612b63565b8181038181111561084457610844612b63565b808202811582820484141761084457610844612b63565b600082612bd357634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603260045260246000fd5b600060208284031215612c0057600080fd5b8151610afd8161242b565b6001600160a01b039384168152919092166020820152604081019190915260600190565b634e487b7160e01b600052602160045260246000fd5b600060018201612c5757612c57612b63565b5060010190565b634e487b7160e01b600052603160045260246000fd5b6001600160a01b03878116825286166020820152604081018590526060810184905260a06080820181905281018290526000828460c0840137600060c0848401015260c0601f19601f8501168301019050979650505050505050565b805160009060208084018383156126c3578151875295820195908201906001016126a7565b6bffffffffffffffffffffffff198560601b1681526000612d22612d1c6014840187612cd0565b85612cd0565b9283525050602001939250505056fea2646970667358221220fb668d6b75020c23dd8ee41fd892703dee43f7e898fd35f0da0c990026e8d14464736f6c6343000813003300000000000000000000000021177c97be40b52b002fbee000a03212708bcf470000000000000000000000000e043e39e1f9382e4b3cb9b859a1452a93993be70000000000000000000000006adb2e268de2aa1abf6578e4a8119b960e02928f0000000000000000000000005b875e4bd3025a5158986f5e509e405190813a7d
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106102735760003560e01c80636d031d0a116101515780639191501a116100c3578063d798183411610087578063d7981834146106a8578063dfeaa74c146106bb578063e1af5698146106ce578063ebd462cb146106e2578063f23a6e61146106f5578063f2fde38b1461071457600080fd5b80639191501a146106535780639f5cf2b614610666578063a30a247414610679578063bc197c8114610681578063c7b8981c146106a057600080fd5b80637884ee67116101155780637884ee67146105ed5780638293744b14610600578063841e4561146106135780638ac33487146106265780638da5cb5b1461062f5780638fa2a9f01461064057600080fd5b80636d031d0a146105345780636f3b5a711461055457806370f7007114610567578063715018a61461059b57806375e032f4146105a357600080fd5b80632ed3b83b116101ea5780635a0b3045116101ae5780635a0b3045146104a15780635b7633d0146104b45780635c975abb146104c757806361499ab9146104d957806361d027b31461050f57806367800b5f1461052257600080fd5b80632ed3b83b1461042c578063415855d61461043f57806347734892146104525780634bee21d4146104655780634d307e3f1461048e57600080fd5b8063150b7a021161023c578063150b7a021461031b57806317636b861461036c57806319647af5146103975780631f29d2dc146103aa5780632161a2b6146103e05780632ab2e4d01461040157600080fd5b8062ae3bf81461027857806301ffc9a71461028d57806302befd24146102b557806304129667146102c25780630bac0e2f146102e3575b600080fd5b61028b610286366004612440565b610727565b005b6102a061029b36600461245d565b610813565b60405190151581526020015b60405180910390f35b6008546102a09060ff1681565b6102d56102d0366004612440565b61084a565b6040519081526020016102ac565b6102a06102f1366004612487565b6001600160a01b03919091166000908152600c602090815260408083209383529290522054151590565b6103536103293660046124f5565b7f150b7a023d4804d13e8c85fb27262cb750cf6ba9f9dd3bb30d90f482ceeb4b1f95945050505050565b6040516001600160e01b031990911681526020016102ac565b60035461037f906001600160a01b031681565b6040516001600160a01b0390911681526020016102ac565b61028b6103a536600461262f565b61087b565b61037f6103b8366004612487565b6001600160a01b039182166000908152600a6020908152604080832093835292905220541690565b6103f36103ee366004612440565b6108ab565b6040516102ac9291906126ce565b6102d561040f366004612487565b600c60209081526000928352604080842090915290825290205481565b60045461037f906001600160a01b031681565b61028b61044d36600461270a565b61097c565b6102d5610460366004612440565b610997565b6102d5610473366004612440565b6001600160a01b031660009081526009602052604090205490565b6102d561049c366004612440565b6109c3565b61028b6104af366004612727565b610b04565b60065461037f906001600160a01b031681565b600054600160a01b900460ff166102a0565b6102d56104e7366004612487565b6001600160a01b03919091166000908152600c60209081526040808320938352929052205490565b60055461037f906001600160a01b031681565b6008546102a090610100900460ff1681565b6102d5610542366004612440565b600d6020526000908152604090205481565b61028b610562366004612740565b610b1f565b61037f610575366004612487565b600a6020908152600092835260408084209091529082529020546001600160a01b031681565b61028b611039565b6105d26105b1366004612440565b60096020526000908152604090208054600182015460029092015490919083565b604080519384526020840192909252908201526060016102ac565b61028b6105fb3660046127eb565b61104d565b61028b61060e366004612904565b61108d565b61028b610621366004612440565b611546565b6102d560075481565b6000546001600160a01b031661037f565b61028b61064e366004612440565b611570565b61028b61066136600461294a565b61159a565b60025461037f906001600160a01b031681565b61028b611684565b61035361068f366004612a16565b63bc197c8160e01b95945050505050565b61028b611711565b61028b6106b6366004612487565b61189c565b61028b6106c9366004612904565b611960565b6006546102a090600160a01b900460ff1681565b61028b6106f036600461270a565b611bac565b610353610703366004612ac4565b63f23a6e6160e01b95945050505050565b61028b610722366004612440565b611bce565b61072f611c47565b6040516370a0823160e01b81523060048201526000906001600160a01b038316906370a0823190602401602060405180830381865afa158015610776573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061079a9190612b2d565b60405163a9059cbb60e01b8152336004820152602481018290529091506001600160a01b0383169063a9059cbb906044016020604051808303816000875af11580156107ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061080e9190612b46565b505050565b60006001600160e01b03198216630271189760e51b148061084457506301ffc9a760e01b6001600160e01b03198316145b92915050565b6000610855826109c3565b6001600160a01b0383166000908152600960205260409020600101546108449190612b79565b600254610891906001600160a01b03168361108d565b6003546108a7906001600160a01b03168261108d565b5050565b6001600160a01b03811660009081526009602090815260409182902060038101805484518185028101850190955280855260609485949293600401929091849183018282801561091a57602002820191906000526020600020905b815481526020019060010190808311610906575b505050505091508080548060200260200160405190810160405280929190818152602001828054801561096c57602002820191906000526020600020905b815481526020019060010190808311610958575b5050505050905091509150915091565b610984611c47565b6008805460ff1916911515919091179055565b6001600160a01b0381166000908152600d60205260408120546109b98361084a565b6108449190612b8c565b6001600160a01b0381166000908152600960209081526040808320815160a0810183528154815260018201548185015260028201548184015260038201805484518187028101870190955280855286959294606086019390929190830182828015610a4d57602002820191906000526020600020905b815481526020019060010190808311610a39575b5050505050815260200160048201805480602002602001604051908101604052809291908181526020018280548015610aa557602002820191906000526020600020905b815481526020019060010190808311610a91575b50505050508152505090508060400151600003610ac55750600092915050565b6201518081600001518260400151610adf42600754611ca1565b610ae99190612b8c565b610af39190612b9f565b610afd9190612bb6565b9392505050565b610b0c611c47565b6007548111610b1a57600080fd5b600755565b610b27611cb7565b60085460ff1615610b705760405162461bcd60e51b815260206004820152600e60248201526d11195c1bdcda5d081c185d5cd95960921b60448201526064015b60405180910390fd5b600654600160a01b900460ff16610bc95760405162461bcd60e51b815260206004820152601b60248201527f5374616b696e67206973206e6f74206c61756e636865642079657400000000006044820152606401610b67565b6007544210610c0e5760405162461bcd60e51b815260206004820152601160248201527014dd185ada5b99c81a185cc8195b991959607a1b6044820152606401610b67565b6002546001600160a01b0387811691161480610c3757506003546001600160a01b038781169116145b610c765760405162461bcd60e51b815260206004820152601060248201526f155b9adb9bdddb8818dbdb9d1c9858dd60821b6044820152606401610b67565b6001600160a01b0386166000908152600b602052604090205460ff16610ca0838389898989611d10565b610ce45760405162461bcd60e51b8152602060048201526015602482015274125b9d985b1a590819185d18481c1c9bdd9a591959605a1b6044820152606401610b67565b610cef878787611e27565b336000908152600960205260408120805490915b8851811015610fd157336001600160a01b03168a6001600160a01b0316636352211e8b8481518110610d3757610d37612bd8565b60200260200101516040518263ffffffff1660e01b8152600401610d5d91815260200190565b602060405180830381865afa158015610d7a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d9e9190612bee565b6001600160a01b031614610de45760405162461bcd60e51b815260206004820152600d60248201526c2737ba103a34329037bbb732b960991b6044820152606401610b67565b6001600160a01b038a166342842e0e33308c8581518110610e0757610e07612bd8565b60200260200101516040518463ffffffff1660e01b8152600401610e2d93929190612c0b565b600060405180830381600087803b158015610e4757600080fd5b505af1158015610e5b573d6000803e3d6000fd5b50505050610e663390565b6001600160a01b038b166000908152600a602052604081208b519091908c9085908110610e9557610e95612bd8565b6020026020010151815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b03160217905550610f158a8a8381518110610ee557610ee5612bd8565b60200260200101516001600160a01b03919091166000908152600c60209081526040808320938352929052205490565b610f1f9083612b79565b91506000846001811115610f3557610f35612c2f565b03610f705782600301898281518110610f5057610f50612bd8565b602090810291909101810151825460018101845560009384529190922001555b6001846001811115610f8457610f84612c2f565b03610fbf5782600401898281518110610f9f57610f9f612bd8565b602090810291909101810151825460018101845560009384529190922001555b80610fc981612c45565b915050610d03565b50610fdb33611f23565b8082558751604080516001600160a01b038c168152602081019290925233917f5548c837ab068cf56a2c2479df0882a4922fd203edb7517321831d95078c5f62910160405180910390a250505061103160018055565b505050505050565b611041611c47565b61104b6000611f89565b565b600254611067906001600160a01b03168b8b8b8b8b610b1f565b600354611081906001600160a01b03168686868686610b1f565b50505050505050505050565b611095611cb7565b6002546001600160a01b03838116911614806110be57506003546001600160a01b038381169116145b6110fd5760405162461bcd60e51b815260206004820152601060248201526f155b9adb9bdddb8818dbdb9d1c9858dd60821b6044820152606401610b67565b6001600160a01b0382166000908152600b602090815260408083205433845260099092528220805460ff909216929091905b84518110156114c957306001600160a01b0316866001600160a01b0316636352211e87848151811061116357611163612bd8565b60200260200101516040518263ffffffff1660e01b815260040161118991815260200190565b602060405180830381865afa1580156111a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111ca9190612bee565b6001600160a01b0316146112105760405162461bcd60e51b815260206004820152600d60248201526c2737ba103a34329037bbb732b960991b6044820152606401610b67565b6001600160a01b0386166000908152600a602052604081208651829088908590811061123e5761123e612bd8565b6020026020010151815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b0316021790555082600001546000146112ac57600061129c87878481518110610ee557610ee5612bd8565b90506112a88184612b8c565b9250505b60008460018111156112c0576112c0612c2f565b0361137b5761133a8360030180548060200260200160405190810160405280929190818152602001828054801561131657602002820191906000526020600020905b815481526020019060010190808311611302575b505050505086838151811061132d5761132d612bd8565b6020026020010151611fd9565b80516113509160038601916020909101906123cb565b508260030180548061136457611364612c5e565b600190038181906000526020600020016000905590555b600184600181111561138f5761138f612c2f565b0361143b576113fa83600401805480602002602001604051908101604052809291908181526020018280548015611316576020028201919060005260206000209081548152602001906001019080831161130257505050505086838151811061132d5761132d612bd8565b80516114109160048601916020909101906123cb565b508260040180548061142457611424612c5e565b600190038181906000526020600020016000905590555b6001600160a01b0386166342842e0e303388858151811061145e5761145e612bd8565b60200260200101516040518463ffffffff1660e01b815260040161148493929190612c0b565b600060405180830381600087803b15801561149e57600080fd5b505af11580156114b2573d6000803e3d6000fd5b5050505080806114c190612c45565b91505061112f565b5060038201541580156114de57506004820154155b156114e7575060005b6114f033611f23565b8082558351604080516001600160a01b0388168152602081019290925233917f9b1bfa7fa9ee420a16e124f794c35ac9f90472acc99140eb2f6447c714cad8eb910160405180910390a25050506108a760018055565b61154e611c47565b600580546001600160a01b0319166001600160a01b0392909216919091179055565b611578611c47565b600680546001600160a01b0319166001600160a01b0392909216919091179055565b6115a2611c47565b604051627eeac760e11b8152306004820152602481018490526000906001600160a01b0386169062fdd58e90604401602060405180830381865afa1580156115ee573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116129190612b2d565b604051637921219560e11b81529091506001600160a01b0386169063f242432a9061164b9030903390899087908a908a90600401612c74565b600060405180830381600087803b15801561166557600080fd5b505af1158015611679573d6000803e3d6000fd5b505050505050505050565b61168c611c47565b600654600160a01b900460ff16156116f05760405162461bcd60e51b815260206004820152602160248201527f5374616b696e6720686173206265656e206c61756e6368656420616c726561646044820152607960f81b6064820152608401610b67565b6006805460ff60a01b1916600160a01b179055610b1a426301e13380612b79565b611719611cb7565b611721612107565b600854610100900460ff161561176b5760405162461bcd60e51b815260206004820152600f60248201526e15da5d1a191c985dc814185d5cd959608a1b6044820152606401610b67565b600061177633610997565b9050600081116117bf5760405162461bcd60e51b8152602060048201526014602482015273496e73756666696369656e742062616c616e636560601b6044820152606401610b67565b336000908152600d6020526040812080548392906117de908490612b79565b9091555050600480546005546040516323b872dd60e01b81526001600160a01b03928316936323b872dd936118199316913391879101612c0b565b6020604051808303816000875af1158015611838573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061185c9190612b46565b5060405181815233907faa1377f7ec93c239e959efa811f7b8554c036fd7a706c23e58024626a8f3db969060200160405180910390a25061104b60018055565b6118a4611c47565b6002546001600160a01b03838116911614806118cd57506003546001600160a01b038381169116145b15611902576001600160a01b038281166000908152600a60209081526040808320858452909152902054161561190257600080fd5b604051632142170760e11b81526001600160a01b038316906342842e0e9061193290309033908690600401612c0b565b600060405180830381600087803b15801561194c57600080fd5b505af1158015611031573d6000803e3d6000fd5b611968611c47565b6032815111156119ad5760405162461bcd60e51b815260206004820152601060248201526f06a6040d2e640dac2f040e0cae440e8f60831b6044820152606401610b67565b6119b7600161097c565b60005b815181101561080e576001600160a01b0383166000908152600a60205260408120835182908590859081106119f1576119f1612bd8565b6020908102919091018101518252810191909152604001600020546001600160a01b031690508015801590611abe5750306001600160a01b0316846001600160a01b0316636352211e858581518110611a4c57611a4c612bd8565b60200260200101516040518263ffffffff1660e01b8152600401611a7291815260200190565b602060405180830381865afa158015611a8f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ab39190612bee565b6001600160a01b0316145b15611b9957836001600160a01b03166342842e0e3083868681518110611ae657611ae6612bd8565b60200260200101516040518463ffffffff1660e01b8152600401611b0c93929190612c0b565b600060405180830381600087803b158015611b2657600080fd5b505af1158015611b3a573d6000803e3d6000fd5b50505050828281518110611b5057611b50612bd8565b6020026020010151846001600160a01b0316826001600160a01b03167ffefe036cac4ee3a4aca074a81cbcc4376e1484693289078dbec149c890101d5b60405160405180910390a45b5080611ba481612c45565b9150506119ba565b611bb4611c47565b600880549115156101000261ff0019909216919091179055565b611bd6611c47565b6001600160a01b038116611c3b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610b67565b611c4481611f89565b50565b6000546001600160a01b0316331461104b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b67565b6000818310611cb05781610afd565b5090919050565b600260015403611d095760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610b67565b6002600155565b600081421115611d2257506000611e1d565b600085858585604051602001611d3b9493929190612cf5565b6040516020818303038152906040528051906020012090506000611dac826040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b90506000611df0828b8b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061215492505050565b90506001600160a01b03811615801590611e1757506006546001600160a01b038281169116145b93505050505b9695505050505050565b8051825114611e705760405162461bcd60e51b815260206004820152601560248201527415dc9bdb99c8185c9c985e5cc81c1c9bdd9a591959605a1b6044820152606401610b67565b60005b8251811015611f1d57818181518110611e8e57611e8e612bd8565b6020026020010151600014611f0b57818181518110611eaf57611eaf612bd8565b6020026020010151600c6000866001600160a01b03166001600160a01b031681526020019081526020016000206000858481518110611ef057611ef0612bd8565b60200260200101518152602001908152602001600020819055505b80611f1581612c45565b915050611e73565b50505050565b611f2c816109c3565b6001600160a01b03821660009081526009602052604081206001018054909190611f57908490612b79565b92505081905550611f6a42600754611ca1565b6001600160a01b03909116600090815260096020526040902060020155565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b606060008060018551611fec9190612b8c565b855190915060005b81811015612040578587828151811061200f5761200f612bd8565b60200260200101510361202e57612027816001612b79565b9350612040565b8061203881612c45565b915050611ff4565b50826000036120915760405162461bcd60e51b815260206004820152601b60248201527f6d73672e73656e646572206973206e6f7420746865206f776e657200000000006044820152606401610b67565b61209c600184612b8c565b92508183146120fd578582815181106120b7576120b7612bd8565b60200260200101518684815181106120d1576120d1612bd8565b602002602001018181525050848683815181106120f0576120f0612bd8565b6020026020010181815250505b5093949350505050565b600054600160a01b900460ff161561104b5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610b67565b60008060006121638585612178565b91509150612170816121bd565b509392505050565b60008082516041036121ae5760208301516040840151606085015160001a6121a287828585612307565b945094505050506121b6565b506000905060025b9250929050565b60008160048111156121d1576121d1612c2f565b036121d95750565b60018160048111156121ed576121ed612c2f565b0361223a5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610b67565b600281600481111561224e5761224e612c2f565b0361229b5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610b67565b60038160048111156122af576122af612c2f565b03611c445760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610b67565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561233e57506000905060036123c2565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015612392573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166123bb576000600192509250506123c2565b9150600090505b94509492505050565b828054828255906000526020600020908101928215612406579160200282015b828111156124065782518255916020019190600101906123eb565b50612412929150612416565b5090565b5b808211156124125760008155600101612417565b6001600160a01b0381168114611c4457600080fd5b60006020828403121561245257600080fd5b8135610afd8161242b565b60006020828403121561246f57600080fd5b81356001600160e01b031981168114610afd57600080fd5b6000806040838503121561249a57600080fd5b82356124a58161242b565b946020939093013593505050565b60008083601f8401126124c557600080fd5b50813567ffffffffffffffff8111156124dd57600080fd5b6020830191508360208285010111156121b657600080fd5b60008060008060006080868803121561250d57600080fd5b85356125188161242b565b945060208601356125288161242b565b935060408601359250606086013567ffffffffffffffff81111561254b57600080fd5b612557888289016124b3565b969995985093965092949392505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff811182821017156125a7576125a7612568565b604052919050565b600082601f8301126125c057600080fd5b8135602067ffffffffffffffff8211156125dc576125dc612568565b8160051b6125eb82820161257e565b928352848101820192828101908785111561260557600080fd5b83870192505b848310156126245782358252918301919083019061260b565b979650505050505050565b6000806040838503121561264257600080fd5b823567ffffffffffffffff8082111561265a57600080fd5b612666868387016125af565b9350602085013591508082111561267c57600080fd5b50612689858286016125af565b9150509250929050565b600081518084526020808501945080840160005b838110156126c3578151875295820195908201906001016126a7565b509495945050505050565b6040815260006126e16040830185612693565b82810360208401526126f38185612693565b95945050505050565b8015158114611c4457600080fd5b60006020828403121561271c57600080fd5b8135610afd816126fc565b60006020828403121561273957600080fd5b5035919050565b60008060008060008060a0878903121561275957600080fd5b86356127648161242b565b9550602087013567ffffffffffffffff8082111561278157600080fd5b61278d8a838b016125af565b965060408901359150808211156127a357600080fd5b6127af8a838b016125af565b95506060890135945060808901359150808211156127cc57600080fd5b506127d989828a016124b3565b979a9699509497509295939492505050565b6000806000806000806000806000806101008b8d03121561280b57600080fd5b8a3567ffffffffffffffff8082111561282357600080fd5b61282f8e838f016125af565b9b5060208d013591508082111561284557600080fd5b6128518e838f016125af565b9a5060408d0135995060608d013591508082111561286e57600080fd5b61287a8e838f016124b3565b909950975060808d013591508082111561289357600080fd5b61289f8e838f016125af565b965060a08d01359150808211156128b557600080fd5b6128c18e838f016125af565b955060c08d0135945060e08d01359150808211156128de57600080fd5b506128eb8d828e016124b3565b915080935050809150509295989b9194979a5092959850565b6000806040838503121561291757600080fd5b82356129228161242b565b9150602083013567ffffffffffffffff81111561293e57600080fd5b612689858286016125af565b6000806000806060858703121561296057600080fd5b843561296b8161242b565b935060208501359250604085013567ffffffffffffffff81111561298e57600080fd5b61299a878288016124b3565b95989497509550505050565b600082601f8301126129b757600080fd5b813567ffffffffffffffff8111156129d1576129d1612568565b6129e4601f8201601f191660200161257e565b8181528460208386010111156129f957600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a08688031215612a2e57600080fd5b8535612a398161242b565b94506020860135612a498161242b565b9350604086013567ffffffffffffffff80821115612a6657600080fd5b612a7289838a016125af565b94506060880135915080821115612a8857600080fd5b612a9489838a016125af565b93506080880135915080821115612aaa57600080fd5b50612ab7888289016129a6565b9150509295509295909350565b600080600080600060a08688031215612adc57600080fd5b8535612ae78161242b565b94506020860135612af78161242b565b93506040860135925060608601359150608086013567ffffffffffffffff811115612b2157600080fd5b612ab7888289016129a6565b600060208284031215612b3f57600080fd5b5051919050565b600060208284031215612b5857600080fd5b8151610afd816126fc565b634e487b7160e01b600052601160045260246000fd5b8082018082111561084457610844612b63565b8181038181111561084457610844612b63565b808202811582820484141761084457610844612b63565b600082612bd357634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603260045260246000fd5b600060208284031215612c0057600080fd5b8151610afd8161242b565b6001600160a01b039384168152919092166020820152604081019190915260600190565b634e487b7160e01b600052602160045260246000fd5b600060018201612c5757612c57612b63565b5060010190565b634e487b7160e01b600052603160045260246000fd5b6001600160a01b03878116825286166020820152604081018590526060810184905260a06080820181905281018290526000828460c0840137600060c0848401015260c0601f19601f8501168301019050979650505050505050565b805160009060208084018383156126c3578151875295820195908201906001016126a7565b6bffffffffffffffffffffffff198560601b1681526000612d22612d1c6014840187612cd0565b85612cd0565b9283525050602001939250505056fea2646970667358221220fb668d6b75020c23dd8ee41fd892703dee43f7e898fd35f0da0c990026e8d14464736f6c63430008130033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000021177c97be40b52b002fbee000a03212708bcf470000000000000000000000000e043e39e1f9382e4b3cb9b859a1452a93993be70000000000000000000000006adb2e268de2aa1abf6578e4a8119b960e02928f0000000000000000000000005b875e4bd3025a5158986f5e509e405190813a7d
-----Decoded View---------------
Arg [0] : _DOGE (address): 0x21177C97Be40b52b002fbeE000a03212708BCf47
Arg [1] : _SHIBA (address): 0x0e043e39E1F9382E4b3cB9B859a1452A93993bE7
Arg [2] : _SHIBDOGE_TOKEN (address): 0x6ADb2E268de2aA1aBF6578E4a8119b960E02928F
Arg [3] : _treasury (address): 0x5B875E4Bd3025a5158986f5e509E405190813A7D
-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 00000000000000000000000021177c97be40b52b002fbee000a03212708bcf47
Arg [1] : 0000000000000000000000000e043e39e1f9382e4b3cb9b859a1452a93993be7
Arg [2] : 0000000000000000000000006adb2e268de2aa1abf6578e4a8119b960e02928f
Arg [3] : 0000000000000000000000005b875e4bd3025a5158986f5e509e405190813a7d
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ 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.