More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 183 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Withdraw | 13747511 | 1178 days ago | IN | 0 ETH | 0.01809392 | ||||
Withdraw | 12585785 | 1359 days ago | IN | 0 ETH | 0.00112975 | ||||
Withdraw | 12585717 | 1359 days ago | IN | 0 ETH | 0.00141276 | ||||
Withdraw | 12372961 | 1392 days ago | IN | 0 ETH | 0.00429036 | ||||
Withdraw | 12310701 | 1402 days ago | IN | 0 ETH | 0.0067639 | ||||
Withdraw | 12302186 | 1403 days ago | IN | 0 ETH | 0.00716843 | ||||
Withdraw | 12297346 | 1404 days ago | IN | 0 ETH | 0.01027592 | ||||
Withdraw | 12282882 | 1406 days ago | IN | 0 ETH | 0.01529639 | ||||
Withdraw | 12263663 | 1409 days ago | IN | 0 ETH | 0.01391802 | ||||
Withdraw | 12262289 | 1409 days ago | IN | 0 ETH | 0.02243342 | ||||
Withdraw | 12260123 | 1409 days ago | IN | 0 ETH | 0.0131051 | ||||
Withdraw | 12259994 | 1409 days ago | IN | 0 ETH | 0.01231266 | ||||
Withdraw | 12256118 | 1410 days ago | IN | 0 ETH | 0.01242245 | ||||
Withdraw | 12253829 | 1410 days ago | IN | 0 ETH | 0.01761383 | ||||
Withdraw | 12236465 | 1413 days ago | IN | 0 ETH | 0.01080987 | ||||
Withdraw | 12178807 | 1422 days ago | IN | 0 ETH | 0.01024887 | ||||
Withdraw | 12178799 | 1422 days ago | IN | 0 ETH | 0.01359643 | ||||
Deposit | 12132449 | 1429 days ago | IN | 0 ETH | 0.01421112 | ||||
Deposit | 12123843 | 1430 days ago | IN | 0 ETH | 0.02119029 | ||||
Deposit | 12116420 | 1431 days ago | IN | 0 ETH | 0.03343181 | ||||
Withdraw | 12111135 | 1432 days ago | IN | 0 ETH | 0.01423537 | ||||
Withdraw | 12074198 | 1438 days ago | IN | 0 ETH | 0.01409314 | ||||
Deposit | 12036123 | 1444 days ago | IN | 0 ETH | 0.02379388 | ||||
Deposit | 12004119 | 1449 days ago | IN | 0 ETH | 0.01733751 | ||||
Withdraw | 11973767 | 1453 days ago | IN | 0 ETH | 0.010174 |
Advanced mode: Intended for advanced users or developers and will display all Internal Transactions including zero value transfers. Name tag integration is not available in advanced view.
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Block |
From
|
To
|
||||
---|---|---|---|---|---|---|---|
13747511 | 1178 days ago | 0 ETH | |||||
13747511 | 1178 days ago | 0 ETH | |||||
12585785 | 1359 days ago | 0 ETH | |||||
12585785 | 1359 days ago | 0 ETH | |||||
12585717 | 1359 days ago | 0 ETH | |||||
12585717 | 1359 days ago | 0 ETH | |||||
12372961 | 1392 days ago | 0 ETH | |||||
12372961 | 1392 days ago | 0 ETH | |||||
12310701 | 1402 days ago | 0 ETH | |||||
12310701 | 1402 days ago | 0 ETH | |||||
12302186 | 1403 days ago | 0 ETH | |||||
12302186 | 1403 days ago | 0 ETH | |||||
12297346 | 1404 days ago | 0 ETH | |||||
12297346 | 1404 days ago | 0 ETH | |||||
12282882 | 1406 days ago | 0 ETH | |||||
12282882 | 1406 days ago | 0 ETH | |||||
12263663 | 1409 days ago | 0 ETH | |||||
12263663 | 1409 days ago | 0 ETH | |||||
12262289 | 1409 days ago | 0 ETH | |||||
12262289 | 1409 days ago | 0 ETH | |||||
12260123 | 1409 days ago | 0 ETH | |||||
12260123 | 1409 days ago | 0 ETH | |||||
12259994 | 1409 days ago | 0 ETH | |||||
12259994 | 1409 days ago | 0 ETH | |||||
12256118 | 1410 days ago | 0 ETH |
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
RoyalDecks
Compiler Version
v0.6.12+commit.27d51765
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
pragma solidity 0.6.12; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import "./libraries/SafeMath96.sol"; import "./libraries/SafeMath32.sol"; // Stake a package from one NFT and some amount of $KINGs to "farm" more $KINGs. // If $KING airdrops for NFT holders happen, rewards will go to stake holders. contract RoyalDecks is Ownable, ReentrancyGuard { using SafeMath for uint256; using SafeMath96 for uint96; using SafeMath32 for uint32; using SafeERC20 for IERC20; // The $KING amount to return on stake withdrawal is calculated as: // `amountDue = Stake.amountStaked * TermSheet.kingFactor/1e+6` (1) // On top of amount (1), airdrop $KING rewards may be distributed // between NFTs holders. The contract collects airdrops for users. // Any time, pended airdrop $KING amount entitled to a stake holder: // `airdrop = accAirKingPerNft[nft] - accAirKingBias[stakeId]` (2) struct Stake { uint96 amountStaked; // $KING amount staked on `startTime` uint96 amountDue; // $KING amount due on `unlockTime` uint32 startTime; // UNIX-time the tokens get staked on uint32 unlockTime; // UNIX-time the tokens get locked until } struct TermSheet { bool enabled; // If staking is enabled address nft; // ERC-721 contract of the NFT to stake uint96 minAmount; // Min $KING amount to stake (with the NFT) uint96 kingFactor; // Multiplier, scaled by 1e+6 (see (1) above) uint16 lockHours; // Staking period in hours } // All stakes of a user struct UserStakes { // Set of (unique) stake IDs (see `encodeStakeId` function) uint256[] ids; // Mapping from stake ID to stake data mapping(uint256 => Stake) data; } bool public emergencyWithdrawEnabled = false; // Latest block when airdrops rewards was "collected" uint32 lastAirBlock; // Amounts in $KING uint96 public kingDue; uint96 public kingReserves; // The $KING token contract address public king; // Info on each TermSheet TermSheet[] internal termSheets; // Addresses and "airdrop weights" of NFT contracts (stored as uint256) uint256[] internal airPools; uint256 constant internal MAX_AIR_POOLS_QTY = 12; // to limit gas // Mapping from user account to user stakes mapping(address => UserStakes) internal stakes; // Mapping from NFT address to accumulated airdrop rewards - see (2) above mapping(address => uint256) internal accAirKingPerNft; // Mapping from stake ID to "reward bias" for the stake - see (2) above mapping(uint256 => uint256) internal accAirKingBias; event Deposit( address indexed user, uint256 stakeId, // ID of the NFT uint256 amountStaked, // $KING amount staked uint256 amountDue, // $KING amount to be returned uint256 unlockTime // UNIX-time when the stake is unlocked ); event Withdraw( address indexed user, uint256 stakeId // ID of the NFT ); event Emergency(bool enabled); event EmergencyWithdraw( address indexed user, uint256 stakeId // ID of the NFT ); event NewTermSheet( uint256 indexed termsId, address indexed nft, // Address of the ERC-721 contract uint256 minAmount, // Min $KING amount to stake uint256 lockHours, // Staking period in hours uint256 kingFactor // See (1) above ); event TermsEnabled(uint256 indexed termsId); event TermsDisabled(uint256 indexed termsId); // $KING added to or removed from stakes repayment reserves event Reserved(uint256 amount); event Removed(uint256 amount); // $KING amount collected as an airdrop reward event Airdrop(uint256 amount); constructor(address _king) public { king = _king; } // Stake ID uniquely identifies a stake // (`stakeHours` excessive for stakes identification but needed for the UI) function encodeStakeId( address nft, // NFT contract address uint256 nftId, // Token ID (limited to 48 bits) uint256 startTime, // UNIX time (limited to 32 bits) uint256 stakeHours // Stake duration (limited to 16 bits) ) public pure returns (uint256) { require(nftId < 2**48, "RDeck::nftId_EXCEEDS_48_BITS"); require(startTime < 2**32, "RDeck::nftId_EXCEEDS_32_BITS"); require(stakeHours < 2**16, "RDeck::stakeHours_EXCEEDS_16_BITS"); return _encodeStakeId(nft, nftId, startTime, stakeHours); } function decodeStakeId(uint256 stakeId) public pure returns ( address nft, uint256 nftId, uint256 startTime, uint256 stakeHours ) { nft = address(stakeId >> 96); nftId = (stakeId >> 48) & (2**48 - 1); startTime = (stakeId >> 16) & (2**32 - 1); stakeHours = stakeId & (2**16 - 1); } function stakeIds(address user) external view returns (uint256[] memory) { _revertZeroAddress(user); UserStakes storage userStakes = stakes[user]; return userStakes.ids; } function stakeData( address user, uint256 stakeId ) external view returns (Stake memory) { return stakes[_nonZeroAddr(user)].data[stakeId]; } function pendedAirdrop( uint256 stakeId ) external view returns (uint256 kingAmount) { kingAmount = 0; (address nft, , , ) = decodeStakeId(stakeId); if (nft != address(0)) { uint256 accAir = accAirKingPerNft[nft]; if (accAir > 1) { uint256 bias = accAirKingBias[stakeId]; if (accAir > bias) kingAmount = accAir.sub(bias); } } } function termSheet(uint256 termsId) external view returns (TermSheet memory) { return termSheets[_validTermsID(termsId)]; } function termsLength() external view returns (uint256) { return termSheets.length; } // Deposit 1 NFT and `kingAmount` of $KING function deposit( uint256 termsId, // term sheet ID uint256 nftId, // ID of NFT to stake uint256 kingAmount // $KING amount to stake ) public nonReentrant { TermSheet memory terms = termSheets[_validTermsID(termsId)]; require(terms.enabled, "deposit: terms disabled"); uint96 amountStaked = SafeMath96.fromUint(kingAmount); require(amountStaked >= terms.minAmount, "deposit: too small amount"); uint96 amountDue = SafeMath96.fromUint( kingAmount.mul(uint256(terms.kingFactor)).div(1e6) ); uint96 _totalDue = kingDue.add(amountDue); uint96 _newReserves = kingReserves.add(amountStaked); require(_newReserves >= _totalDue, "deposit: too low reserves"); uint256 stakeId = _encodeStakeId( terms.nft, nftId, now, terms.lockHours ); IERC20(king).safeTransferFrom(msg.sender, address(this), amountStaked); IERC721(terms.nft).safeTransferFrom( msg.sender, address(this), nftId, _NFT_PASS ); kingDue = _totalDue; kingReserves = _newReserves; uint32 startTime = SafeMath32.fromUint(now); uint32 unlockTime = startTime.add(uint32(terms.lockHours) * 3600); _addUserStake( stakes[msg.sender], stakeId, Stake( amountStaked, amountDue, startTime, SafeMath32.fromUint(unlockTime) ) ); uint256 accAir = accAirKingPerNft[terms.nft]; if (accAir > 1) accAirKingBias[stakeId] = accAir; emit Deposit(msg.sender, stakeId, kingAmount, amountDue, unlockTime); } // Withdraw staked 1 NFT and entire $KING token amount due function withdraw(uint256 stakeId) public nonReentrant { _withdraw(stakeId, false); emit Withdraw(msg.sender, stakeId); } // Withdraw staked 1 NFT and staked $KING token amount, w/o any rewards // !!! All possible rewards entitled be lost. Use in emergency only !!! function emergencyWithdraw(uint256 stakeId) public nonReentrant { _withdraw(stakeId, true); emit EmergencyWithdraw(msg.sender, stakeId); } // Account for $KING amount the contact has got as airdrops for NFTs staked // !!! Be cautious of high gas cost function collectAirdrops() external nonReentrant { if (block.number <= lastAirBlock) return; lastAirBlock = SafeMath32.fromUint(block.number); // $KING balance exceeding `kingReserves` treated as airdrop rewards uint256 reward; { uint256 _kingReserves = kingReserves; uint256 kingBalance = IERC20(king).balanceOf(address(this)); if (kingBalance <= _kingReserves) return; reward = kingBalance.sub(_kingReserves); kingReserves = SafeMath96.fromUint(_kingReserves.add(reward)); kingDue = kingDue.add(uint96(reward)); } // First, compute "weights" for rewards distribution address[MAX_AIR_POOLS_QTY] memory nfts; uint256[MAX_AIR_POOLS_QTY] memory weights; uint256 totalWeight; uint256 qty = airPools.length; uint256 k = 0; for (uint256 i = 0; i < qty; i++) { (address nft, uint256 weight) = _unpackAirPoolData(airPools[i]); uint256 nftQty = IERC721(nft).balanceOf(address(this)); if (nftQty == 0 || weight == 0) continue; nfts[k] = nft; weights[k] = weight; k++; totalWeight = totalWeight.add(nftQty.mul(weight)); } // Then account for rewards in pools for (uint i = 0; i <= k; i++) { address nft = nfts[i]; accAirKingPerNft[nft] = accAirKingPerNft[nft].add( reward.mul(weights[i]).div(totalWeight) // can't be zero ); } emit Airdrop(reward); } function addTerms(TermSheet[] memory _termSheets) public onlyOwner { for (uint256 i = 0; i < _termSheets.length; i++) { _addTermSheet(_termSheets[i]); } } function enableTerms(uint256 termsId) external onlyOwner { termSheets[_validTermsID(termsId)].enabled = true; emit TermsEnabled(termsId); } function disableTerms(uint256 termsId) external onlyOwner { termSheets[_validTermsID(termsId)].enabled = false; emit TermsDisabled(termsId); } function enableEmergencyWithdraw() external onlyOwner { emergencyWithdrawEnabled = true; emit Emergency(true); } function disableEmergencyWithdraw() external onlyOwner { emergencyWithdrawEnabled = false; emit Emergency(false); } function addAirdropPools( address[] memory nftAddresses, uint8[] memory nftWeights ) public onlyOwner { uint length = nftAddresses.length; require(length == nftWeights.length, "RDeck:INVALID_ARRAY_LENGTH"); for (uint256 i = 0; i < length; i++) { require( airPools.length < MAX_AIR_POOLS_QTY, "RDeck:MAX_AIR_POOLS_QTY" ); uint8 w = nftWeights[i]; require(w != 0, "RDeck:INVALID_AIR_WEIGHT"); address a = nftAddresses[i]; _revertZeroAddress(a); require(accAirKingPerNft[a] == 0, "RDeck:AIR_POOL_EXISTS"); accAirKingPerNft[a] == 1; airPools.push(_packAirPoolData(a, w)); } } // Caution: it may kill pended airdrop rewards function removeAirdropPool( address nft, uint8 weight ) external onlyOwner { require(accAirKingPerNft[nft] != 0, "RDeck:UNKNOWN_AIR_POOL"); accAirKingPerNft[nft] = 0; _removeArrayElement(airPools, _packAirPoolData(nft, weight)); } function addKingReserves(address from, uint256 amount) external onlyOwner { IERC20(king).safeTransferFrom(from, address(this), amount); kingReserves = kingReserves.add(SafeMath96.fromUint(amount)); emit Reserved(amount); } function removeKingReserves(uint256 amount) external onlyOwner { uint96 _newReserves = kingReserves.sub(SafeMath96.fromUint(amount)); require(_newReserves >= kingDue, "RDeck:TOO_LOW_RESERVES"); kingReserves = _newReserves; IERC20(king).safeTransfer(owner(), amount); emit Removed(amount); } // Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))` bytes4 private constant _ERC721_RECEIVED = 0x150b7a02; // Equals to `bytes4(keccak256("RoyalDecks"))` bytes private constant _NFT_PASS = abi.encodePacked(bytes4(0x8adbe135)); // Implementation of the ERC721 Receiver function onERC721Received(address, address, uint256, bytes calldata data) external returns (bytes4) { // Only accept transfers with _NFT_PASS passed as `data` return (data.length == 4 && data[0] == 0x8a && data[3] == 0x35) ? _ERC721_RECEIVED : bytes4(0); } function _withdraw(uint256 stakeId, bool isEmergency) internal { require( !isEmergency || emergencyWithdrawEnabled, "withdraw: emergency disabled" ); (address nft, uint256 nftId, , ) = decodeStakeId(stakeId); UserStakes storage userStakes = stakes[msg.sender]; Stake memory stake = userStakes.data[stakeId]; require( isEmergency || now >= stake.unlockTime, "withdraw: stake is locked" ); uint96 amountDue = stake.amountDue; require(amountDue != 0, "withdraw: unknown or returned stake"); { // Pended airdrop rewards uint256 accAir = accAirKingPerNft[nft]; if (accAir > 1) { uint256 bias = accAirKingBias[stakeId]; if (accAir > bias) amountDue = amountDue.add( SafeMath96.fromUint(accAir.sub(bias)) ); } } uint96 amountToUser = isEmergency ? stake.amountStaked : amountDue; _removeUserStake(userStakes, stakeId); kingDue = kingDue.sub(amountDue); kingReserves = kingReserves.sub(amountDue); IERC20(king).safeTransfer(msg.sender, uint256(amountToUser)); IERC721(nft).safeTransferFrom(address(this), msg.sender, nftId); } function _addTermSheet(TermSheet memory tS) internal { _revertZeroAddress(tS.nft); require( (tS.minAmount != 0) && (tS.lockHours != 0) && (tS.kingFactor != 0), "RDeck::add:INVALID_ZERO_PARAM" ); require(_isMissingTerms(tS), "RDeck::add:TERMS_DUPLICATED"); termSheets.push(tS); emit NewTermSheet( termSheets.length - 1, tS.nft, tS.minAmount, tS.lockHours, tS.kingFactor ); if (tS.enabled) emit TermsEnabled(termSheets.length); } function _safeKingTransfer(address _to, uint256 _amount) internal { uint256 kingBal = IERC20(king).balanceOf(address(this)); IERC20(king).safeTransfer(_to, _amount > kingBal ? kingBal : _amount); } // Returns `true` if the term sheet has NOT been yet added. function _isMissingTerms(TermSheet memory newSheet) internal view returns (bool) { for (uint256 i = 0; i < termSheets.length; i++) { TermSheet memory sheet = termSheets[i]; if ( sheet.nft == newSheet.nft && sheet.minAmount == newSheet.minAmount && sheet.lockHours == newSheet.lockHours && sheet.kingFactor == newSheet.kingFactor ) { return false; } } return true; } function _addUserStake( UserStakes storage userStakes, uint256 stakeId, Stake memory stake ) internal { require( userStakes.data[stakeId].amountDue == 0, "RDeck:DUPLICATED_STAKE_ID" ); userStakes.data[stakeId] = stake; userStakes.ids.push(stakeId); } function _removeUserStake(UserStakes storage userStakes, uint256 stakeId) internal { require( userStakes.data[stakeId].amountDue != 0, "RDeck:INVALID_STAKE_ID" ); userStakes.data[stakeId].amountDue = 0; _removeArrayElement(userStakes.ids, stakeId); } // Assuming the given array does contain the given element function _removeArrayElement(uint256[] storage arr, uint256 el) internal { uint256 lastIndex = arr.length - 1; if (lastIndex != 0) { uint256 replaced = arr[lastIndex]; if (replaced != el) { // Shift elements until the one being removed is replaced do { uint256 replacing = replaced; replaced = arr[lastIndex - 1]; lastIndex--; arr[lastIndex] = replacing; } while (replaced != el && lastIndex != 0); } } // Remove the last (and quite probably the only) element arr.pop(); } function _encodeStakeId( address nft, uint256 nftId, uint256 startTime, uint256 stakeHours ) internal pure returns (uint256) { require(nftId < 2**48, "RDeck::nftId_EXCEEDS_48_BITS"); return uint256(nft) << 96 | nftId << 48 | startTime << 16 | stakeHours; } function _packAirPoolData( address nft, uint8 weight ) internal pure returns(uint256) { return (uint256(nft) << 8) | uint256(weight); } function _unpackAirPoolData( uint256 packed ) internal pure returns(address nft, uint8 weight) { return (address(packed >> 8), uint8(packed & 7)); } function _revertZeroAddress(address _address) internal pure { require(_address != address(0), "RDeck::ZERO_ADDRESS"); } function _nonZeroAddr(address _address) private pure returns (address) { _revertZeroAddress(_address); return _address; } function _validTermsID(uint256 termsId) private view returns (uint256) { require(termsId < termSheets.length, "RDeck::INVALID_TERMS_ID"); return termsId; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.6.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 GSN 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 payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; import "../GSN/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. */ 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 () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { 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 { emit OwnershipTransferred(_owner, address(0)); _owner = 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"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @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 `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, 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 `sender` to `recipient` 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 sender, address recipient, uint256 amount) external returns (bool); /** * @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); }
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; import "./IERC20.sol"; import "../../math/SafeMath.sol"; import "../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove(IERC20 token, address spender, uint256 value) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' // solhint-disable-next-line max-line-length require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).add(value); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero"); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.6.2; import "../../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`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom(address from, address to, uint256 tokenId) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 tokenId) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @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 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); /** * @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; }
// SPDX-License-Identifier: MIT pragma solidity ^0.6.2; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies in extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.6.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]. */ 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 () internal { _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 make it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } }
pragma solidity 0.6.12; library SafeMath32 { function add(uint32 a, uint32 b, string memory errorMessage) internal pure returns (uint32) { uint32 c = a + b; require(c >= a, errorMessage); return c; } function add(uint32 a, uint32 b) internal pure returns (uint32) { return add(a, b, "SafeMath32: addition overflow"); } function sub(uint32 a, uint32 b, string memory errorMessage) internal pure returns (uint32) { require(b <= a, errorMessage); return a - b; } function sub(uint32 a, uint32 b) internal pure returns (uint32) { return sub(a, b, "SafeMath32: subtraction overflow"); } function fromUint(uint n, string memory errorMessage) internal pure returns (uint32) { require(n < 2**32, errorMessage); return uint32(n); } function fromUint(uint n) internal pure returns (uint32) { return fromUint(n, "SafeMath32: exceeds 32 bits"); } }
pragma solidity 0.6.12; library SafeMath96 { function add(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) { uint96 c = a + b; require(c >= a, errorMessage); return c; } function add(uint96 a, uint96 b) internal pure returns (uint96) { return add(a, b, "SafeMath96: addition overflow"); } function sub(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) { require(b <= a, errorMessage); return a - b; } function sub(uint96 a, uint96 b) internal pure returns (uint96) { return sub(a, b, "SafeMath96: subtraction overflow"); } function fromUint(uint n, string memory errorMessage) internal pure returns (uint96) { require(n < 2**96, errorMessage); return uint96(n); } function fromUint(uint n) internal pure returns (uint96) { return fromUint(n, "SafeMath96: exceeds 96 bits"); } }
{ "remappings": [], "optimizer": { "enabled": true, "runs": 200 }, "evmVersion": "istanbul", "libraries": { "": {} }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_king","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Airdrop","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"stakeId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountStaked","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountDue","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"unlockTime","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"enabled","type":"bool"}],"name":"Emergency","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"stakeId","type":"uint256"}],"name":"EmergencyWithdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"termsId","type":"uint256"},{"indexed":true,"internalType":"address","name":"nft","type":"address"},{"indexed":false,"internalType":"uint256","name":"minAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lockHours","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"kingFactor","type":"uint256"}],"name":"NewTermSheet","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":"uint256","name":"amount","type":"uint256"}],"name":"Removed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Reserved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"termsId","type":"uint256"}],"name":"TermsDisabled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"termsId","type":"uint256"}],"name":"TermsEnabled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"stakeId","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[{"internalType":"address[]","name":"nftAddresses","type":"address[]"},{"internalType":"uint8[]","name":"nftWeights","type":"uint8[]"}],"name":"addAirdropPools","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"addKingReserves","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"bool","name":"enabled","type":"bool"},{"internalType":"address","name":"nft","type":"address"},{"internalType":"uint96","name":"minAmount","type":"uint96"},{"internalType":"uint96","name":"kingFactor","type":"uint96"},{"internalType":"uint16","name":"lockHours","type":"uint16"}],"internalType":"struct RoyalDecks.TermSheet[]","name":"_termSheets","type":"tuple[]"}],"name":"addTerms","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"collectAirdrops","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"stakeId","type":"uint256"}],"name":"decodeStakeId","outputs":[{"internalType":"address","name":"nft","type":"address"},{"internalType":"uint256","name":"nftId","type":"uint256"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"stakeHours","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"termsId","type":"uint256"},{"internalType":"uint256","name":"nftId","type":"uint256"},{"internalType":"uint256","name":"kingAmount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"disableEmergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"termsId","type":"uint256"}],"name":"disableTerms","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"stakeId","type":"uint256"}],"name":"emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"emergencyWithdrawEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"enableEmergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"termsId","type":"uint256"}],"name":"enableTerms","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"nft","type":"address"},{"internalType":"uint256","name":"nftId","type":"uint256"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"stakeHours","type":"uint256"}],"name":"encodeStakeId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"king","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"kingDue","outputs":[{"internalType":"uint96","name":"","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"kingReserves","outputs":[{"internalType":"uint96","name":"","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"stakeId","type":"uint256"}],"name":"pendedAirdrop","outputs":[{"internalType":"uint256","name":"kingAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"nft","type":"address"},{"internalType":"uint8","name":"weight","type":"uint8"}],"name":"removeAirdropPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"removeKingReserves","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"stakeId","type":"uint256"}],"name":"stakeData","outputs":[{"components":[{"internalType":"uint96","name":"amountStaked","type":"uint96"},{"internalType":"uint96","name":"amountDue","type":"uint96"},{"internalType":"uint32","name":"startTime","type":"uint32"},{"internalType":"uint32","name":"unlockTime","type":"uint32"}],"internalType":"struct RoyalDecks.Stake","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"stakeIds","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"termsId","type":"uint256"}],"name":"termSheet","outputs":[{"components":[{"internalType":"bool","name":"enabled","type":"bool"},{"internalType":"address","name":"nft","type":"address"},{"internalType":"uint96","name":"minAmount","type":"uint96"},{"internalType":"uint96","name":"kingFactor","type":"uint96"},{"internalType":"uint16","name":"lockHours","type":"uint16"}],"internalType":"struct RoyalDecks.TermSheet","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"termsLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"stakeId","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60806040526002805460ff191690553480156200001b57600080fd5b50604051620034d3380380620034d38339810160408190526200003e91620000c2565b60006200004a620000be565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a35060018055600380546001600160a01b0319166001600160a01b0392909216919091179055620000f2565b3390565b600060208284031215620000d4578081fd5b81516001600160a01b0381168114620000eb578182fd5b9392505050565b6133d180620001026000396000f3fe608060405234801561001057600080fd5b50600436106101c35760003560e01c8063715018a6116100f9578063a4f53fd111610097578063c74446d311610071578063c74446d3146103bb578063cc181ca8146103ce578063de4e5a45146103d6578063f2fde38b146103de576101c3565b8063a4f53fd114610372578063a5ebac5014610395578063bd112073146103a8576101c3565b80638ac0df3e116100d35780638ac0df3e146103225780638da5cb5b1461032a5780639d782b2a1461033f5780639ef9bc2e14610352576101c3565b8063715018a6146102f25780637369b0c5146102fa57806380e73bde1461030f576101c3565b806343cca29411610166578063570903a211610140578063570903a2146102a25780635747e69f146102b757806359c8bf00146102cc5780636820e8dd146102df576101c3565b806343cca2941461025c5780634d39c9e21461027c5780635312ea8e1461028f576101c3565b806313365374116101a2578063133653741461020e578063150b7a02146102215780632e1a7d4d146102415780633630153314610254576101c3565b8062aeef8a146101c857806307a310aa146101dd5780630febeed9146101e5575b600080fd5b6101db6101d6366004612a48565b6103f1565b005b6101db61081c565b6101f86101f3366004612a18565b610bb1565b6040516102059190613257565b60405180910390f35b6101db61021c3660046128ff565b610c4b565b61023461022f366004612702565b610cb4565b6040516102059190612bc9565b6101db61024f366004612a18565b610d36565b6101db610db1565b61026f61026a36600461279a565b610e2e565b604051610205919061320e565b6101db61028a366004612a18565b610ebe565b6101db61029d366004612a18565b610f55565b6102aa610fc4565b60405161020591906132ac565b6102bf610fca565b6040516102059190612bbe565b6101db6102da366004612a18565b610fd3565b6101db6102ed36600461279a565b61106a565b6101db61113d565b6103026111bc565b60405161020591906132df565b6102aa61031d3660046127c4565b6111d2565b610302611257565b61033261126d565b6040516102059190612ad0565b6102aa61034d366004612a18565b61127c565b6103656103603660046126e7565b6112ed565b6040516102059190612b7a565b610385610380366004612a18565b611367565b6040516102059493929190612b54565b6101db6103a3366004612809565b611390565b6101db6103b6366004612a18565b611427565b6101db6103c936600461283d565b61152d565b61033261168a565b6101db611699565b6101db6103ec3660046126e7565b611709565b6002600154141561041d5760405162461bcd60e51b815260040161041490613169565b60405180910390fd5b600260015561042a6125a1565b6004610435856117bf565b8154811061043f57fe5b60009182526020918290206040805160a081018252600293909302909101805460ff811615158085526101009091046001600160a01b031694840194909452600101546001600160601b0380821692840192909252600160601b81049091166060830152600160c01b900461ffff16608082015291506104d15760405162461bcd60e51b815260040161041490612d81565b60006104dc836117e7565b905081604001516001600160601b0316816001600160601b031610156105145760405162461bcd60e51b815260040161041490612c5f565b600061054b610546620f424061054086606001516001600160601b03168861182890919063ffffffff16565b90611869565b6117e7565b60025490915060009061056e90600160281b90046001600160601b0316836118ab565b60025490915060009061059190600160881b90046001600160601b0316856118ab565b9050816001600160601b0316816001600160601b031610156105c55760405162461bcd60e51b815260040161041490612e56565b60006105df86602001518942896080015161ffff166118ed565b600354909150610603906001600160a01b031633306001600160601b03891661193b565b85602001516001600160a01b031663b88d4fde33308b638adbe13560e01b6040516020016106319190612a9f565b6040516020818303038152906040526040518563ffffffff1660e01b815260040161065f9493929190612ae4565b600060405180830381600087803b15801561067957600080fd5b505af115801561068d573d6000803e3d6000fd5b5050600280546001600160601b03868116600160881b02600160881b600160e81b0319918916600160281b0270ffffffffffffffffffffffff000000000019909316929092171617905550600090506106e542611993565b9050600061070e886080015161ffff16610e10028363ffffffff166119d490919063ffffffff16565b905061078a60066000336001600160a01b03166001600160a01b031681526020019081526020016000208460405180608001604052808b6001600160601b031681526020018a6001600160601b031681526020018663ffffffff16815260200161077d8663ffffffff16611993565b63ffffffff169052611a16565b6020808901516001600160a01b031660009081526007909152604090205460018111156107c35760008481526008602052604090208190555b336001600160a01b03167f7162984403f6c73c8639375d45a9187dfd04602231bd8e587c415718b5f7e5f9858c8a8660405161080294939291906132b5565b60405180910390a250506001805550505050505050505050565b6002600154141561083f5760405162461bcd60e51b815260040161041490613169565b6002600181905554610100900463ffffffff16431161085d57610bab565b61086643611993565b6002805463ffffffff929092166101000264ffffffff001990921691909117908190556003546040516370a0823160e01b81526000926001600160601b03600160881b909104169183916001600160a01b03909116906370a08231906108d0903090600401612ad0565b60206040518083038186803b1580156108e857600080fd5b505afa1580156108fc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109209190612a30565b905081811161093157505050610bab565b61093b8183611af4565b925061094a6105468385611b36565b60028054600160881b600160e81b031916600160881b6001600160601b0393841602179081905561098491600160281b90910416846118ab565b600260056101000a8154816001600160601b0302191690836001600160601b0316021790555050506109b46125cf565b6109bc6125cf565b60055460009081805b82811015610ae9576000806109f0600584815481106109e057fe5b9060005260206000200154611b5b565b60ff16915091506000826001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401610a259190612ad0565b60206040518083038186803b158015610a3d57600080fd5b505afa158015610a51573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a759190612a30565b9050801580610a82575081155b15610a8f57505050610ae1565b828986600c8110610a9c57fe5b6001600160a01b039092166020929092020152818886600c8110610abc57fe5b6020020152600190940193610adb610ad48284611828565b8890611b36565b96505050505b6001016109c5565b5060005b818111610b6c5760008682600c8110610b0257fe5b60200201519050610b4a610b2b866105408986600c8110610b1f57fe5b60200201518c90611828565b6001600160a01b03831660009081526007602052604090205490611b36565b6001600160a01b03909116600090815260076020526040902055600101610aed565b507fd0ecdf4854f39daba34ba0e2c1ed0132a7023a5434bffc90b24f3335fb90e5e386604051610b9c91906132ac565b60405180910390a15050505050505b60018055565b610bb96125a1565b6004610bc4836117bf565b81548110610bce57fe5b60009182526020918290206040805160a081018252600293909302909101805460ff81161515845261010090046001600160a01b0316938301939093526001909201546001600160601b0380821693830193909352600160601b81049092166060820152600160c01b90910461ffff16608082015290505b919050565b610c53611b69565b6000546001600160a01b03908116911614610c805760405162461bcd60e51b815260040161041490612f05565b60005b8151811015610cb057610ca8828281518110610c9b57fe5b6020026020010151611b6d565b600101610c83565b5050565b6000600482148015610ce9575082826000818110610cce57fe5b9050013560f81c60f81b6001600160f81b031916608a60f81b145b8015610d18575082826003818110610cfd57fe5b9050013560f81c60f81b6001600160f81b031916603560f81b145b610d23576000610d2c565b630a85bd0160e11b5b9695505050505050565b60026001541415610d595760405162461bcd60e51b815260040161041490613169565b6002600155610d69816000611d60565b336001600160a01b03167f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a942436482604051610da291906132ac565b60405180910390a25060018055565b610db9611b69565b6000546001600160a01b03908116911614610de65760405162461bcd60e51b815260040161041490612f05565b6002805460ff191660019081179091556040517f68c3b30f53252b4a7ebb8cbe118f644313c1c59953a3eb90ba5f43a42d242ae191610e2491612bbe565b60405180910390a1565b610e366125ee565b60066000610e4385611ff8565b6001600160a01b03168152602080820192909252604090810160009081208582526001018352819020815160808101835290546001600160601b038082168352600160601b8204169382019390935263ffffffff600160c01b8404811692820192909252600160e01b90920416606082015290505b92915050565b610ec6611b69565b6000546001600160a01b03908116911614610ef35760405162461bcd60e51b815260040161041490612f05565b60006004610f00836117bf565b81548110610f0a57fe5b60009182526020822060029190910201805460ff19169215159290921790915560405182917fc87b2d8df2c2fc232146effca27a0c5aa06a9a4677e1014f088b72d45ca01a2f91a250565b60026001541415610f785760405162461bcd60e51b815260040161041490613169565b6002600181905550610f8b816001611d60565b336001600160a01b03167f5fafa99d0643513820be26656b45130b01e1c03062e1266bf36f88cbd3bd969582604051610da291906132ac565b60045490565b60025460ff1681565b610fdb611b69565b6000546001600160a01b039081169116146110085760405162461bcd60e51b815260040161041490612f05565b60016004611015836117bf565b8154811061101f57fe5b60009182526020822060029190910201805460ff19169215159290921790915560405182917f0e7a48c601b1a627275b6d51f24200a652a0018fafe123b6d2d7c0bfbe54f12491a250565b611072611b69565b6000546001600160a01b0390811691161461109f5760405162461bcd60e51b815260040161041490612f05565b6003546110b7906001600160a01b031683308461193b565b6110dc6110c3826117e7565b600254600160881b90046001600160601b0316906118ab565b600260116101000a8154816001600160601b0302191690836001600160601b031602179055507f672216a7a59f7b075c6becc0eebb0ab5404d392281d509c1c1a4a6accd036f498160405161113191906132ac565b60405180910390a15050565b611145611b69565b6000546001600160a01b039081169116146111725760405162461bcd60e51b815260040161041490612f05565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600254600160881b90046001600160601b031681565b6000660100000000000084106111fa5760405162461bcd60e51b815260040161041490612d4a565b640100000000831061121e5760405162461bcd60e51b815260040161041490612e8d565b6201000082106112405760405162461bcd60e51b815260040161041490612bf1565b61124c858585856118ed565b90505b949350505050565b600254600160281b90046001600160601b031681565b6000546001600160a01b031690565b60008061128883611367565b5091925050506001600160a01b038116156112e7576001600160a01b03811660009081526007602052604090205460018111156112e557600084815260086020526040902054808211156112e3576112e08282611af4565b93505b505b505b50919050565b60606112f882611fff565b6001600160a01b038216600090815260066020908152604091829020805483518184028101840190945280845290929183919083018282801561135a57602002820191906000526020600020905b815481526020019060010190808311611346575b5050505050915050919050565b606081901c9165ffffffffffff603083901c169163ffffffff601082901c169161ffff90911690565b611398611b69565b6000546001600160a01b039081169116146113c55760405162461bcd60e51b815260040161041490612f05565b6001600160a01b0382166000908152600760205260409020546113fa5760405162461bcd60e51b815260040161041490613075565b6001600160a01b038216600090815260076020526040812055610cb060056114228484612025565b61203c565b61142f611b69565b6000546001600160a01b0390811691161461145c5760405162461bcd60e51b815260040161041490612f05565b600061148361146a836117e7565b600254600160881b90046001600160601b0316906120ea565b6002549091506001600160601b03600160281b909104811690821610156114bc5760405162461bcd60e51b815260040161041490612db8565b60028054600160881b600160e81b031916600160881b6001600160601b038416021790556114fe6114eb61126d565b6003546001600160a01b0316908461212c565b7ffab782eee98387fe0d957b2964e6da22a6918f525952ccad107ae25db263cc118260405161113191906132ac565b611535611b69565b6000546001600160a01b039081169116146115625760405162461bcd60e51b815260040161041490612f05565b8151815181146115845760405162461bcd60e51b815260040161041490612fd0565b60005b8181101561168457600554600c116115b15760405162461bcd60e51b815260040161041490612d13565b60008382815181106115bf57fe5b602002602001015190508060ff16600014156115ed5760405162461bcd60e51b815260040161041490612f6a565b60008583815181106115fb57fe5b6020026020010151905061160e81611fff565b6001600160a01b038116600090815260076020526040902054156116445760405162461bcd60e51b815260040161041490612fa1565b6001600160a01b038116600052600760205260056116628284612025565b8154600181810184556000938452602090932001559290920191506115879050565b50505050565b6003546001600160a01b031681565b6116a1611b69565b6000546001600160a01b039081169116146116ce5760405162461bcd60e51b815260040161041490612f05565b6002805460ff191690556040517f68c3b30f53252b4a7ebb8cbe118f644313c1c59953a3eb90ba5f43a42d242ae190610e2490600090612bbe565b611711611b69565b6000546001600160a01b0390811691161461173e5760405162461bcd60e51b815260040161041490612f05565b6001600160a01b0381166117645760405162461bcd60e51b815260040161041490612c96565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b60045460009082106117e35760405162461bcd60e51b8152600401610414906131d7565b5090565b6000610eb8826040518060400160405280601b81526020017f536166654d61746839363a206578636565647320393620626974730000000000815250612150565b60008261183757506000610eb8565b8282028284828161184457fe5b04146118625760405162461bcd60e51b815260040161041490612ec4565b9392505050565b600061186283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061217f565b600061186283836040518060400160405280601d81526020017f536166654d61746839363a206164646974696f6e206f766572666c6f770000008152506121b6565b6000660100000000000084106119155760405162461bcd60e51b815260040161041490612d4a565b506001600160601b0319606085901b16603084901b17601083901b178117949350505050565b611684846323b872dd60e01b85858560405160240161195c93929190612b17565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526121f2565b6000610eb8826040518060400160405280601b81526020017f536166654d61746833323a206578636565647320333220626974730000000000815250612281565b600061186283836040518060400160405280601d81526020017f536166654d61746833323a206164646974696f6e206f766572666c6f770000008152506122a9565b6000828152600184016020526040902054600160601b90046001600160601b031615611a545760405162461bcd60e51b8152600401610414906130a5565b60008281526001848101602090815260408084208551815487850151938801516060909801516001600160601b03199091166001600160601b0392831617600160601b600160c01b031916600160601b92909416919091029290921763ffffffff60c01b1916600160c01b63ffffffff97881602176001600160e01b0316600160e01b969092169590950217909355845490810185559381522090910155565b600061186283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506122d9565b6000828201838110156118625760405162461bcd60e51b815260040161041490612cdc565b600881901c60078216915091565b3390565b611b7a8160200151611fff565b60408101516001600160601b031615801590611b9d5750608081015161ffff1615155b8015611bb5575060608101516001600160601b031615155b611bd15760405162461bcd60e51b815260040161041490612e1f565b611bda81612305565b611bf65760405162461bcd60e51b8152600401610414906131a0565b60048054600181018255600082905282517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b60029092029182018054602086015160ff1990911692151592909217610100600160a81b0319166101006001600160a01b039093169283021790556040808501517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19c9093018054606087015160808801516001600160601b03199092166001600160601b0380881691909117600160601b600160c01b031916600160601b918316919091021761ffff60c01b1916600160c01b61ffff8416021790925594549151929460001992909201937fa70d49162b3bad2861a5c78db718eaa0e3bea0c49b5d87e177f963b9bf7fc67e93611d21939192906132f3565b60405180910390a3805115611d5d576004546040517f0e7a48c601b1a627275b6d51f24200a652a0018fafe123b6d2d7c0bfbe54f12490600090a25b50565b801580611d6f575060025460ff165b611d8b5760405162461bcd60e51b815260040161041490613007565b600080611d9784611367565b50503360009081526006602052604090209193509150611db56125ee565b506000858152600182016020908152604091829020825160808101845290546001600160601b038082168352600160601b8204169282019290925263ffffffff600160c01b8304811693820193909352600160e01b90910490911660608201528480611e2b5750806060015163ffffffff164210155b611e475760405162461bcd60e51b815260040161041490612de8565b60208101516001600160601b038116611e725760405162461bcd60e51b8152600401610414906130dc565b6001600160a01b0385166000908152600760205260409020546001811115611ed05760008881526008602052604090205480821115611ece57611ecb611ebb6105468484611af4565b6001600160601b038516906118ab565b92505b505b50600086611ede5781611ee1565b82515b9050611eed848961242e565b600254611f0a90600160281b90046001600160601b0316836120ea565b6002805470ffffffffffffffffffffffff00000000001916600160281b6001600160601b03938416021790819055611f4b91600160881b90910416836120ea565b60028054600160881b600160e81b031916600160881b6001600160601b0393841602179055600354611f8c916001600160a01b03909116903390841661212c565b604051632142170760e11b81526001600160a01b038716906342842e0e90611fbc90309033908a90600401612b17565b600060405180830381600087803b158015611fd657600080fd5b505af1158015611fea573d6000803e3d6000fd5b505050505050505050505050565b60006117e3825b6001600160a01b038116611d5d5760405162461bcd60e51b815260040161041490612c32565b60ff1660089190911b610100600160a81b03161790565b81546000190180156120c557600083828154811061205657fe5b906000526020600020015490508281146120c3575b600081905084600184038154811061207f57fe5b90600052602060002001549150828060019003935050808584815481106120a257fe5b600091825260209091200155508083148015906120be57508115155b61206b575b505b828054806120cf57fe5b60019003818190600052602060002001600090559055505050565b600061186283836040518060400160405280602081526020017f536166654d61746839363a207375627472616374696f6e206f766572666c6f77815250612496565b61214b8363a9059cbb60e01b848460405160240161195c929190612b3b565b505050565b600081600160601b84106121775760405162461bcd60e51b81526004016104149190612bde565b509192915050565b600081836121a05760405162461bcd60e51b81526004016104149190612bde565b5060008385816121ac57fe5b0495945050505050565b6000838301826001600160601b0380871690831610156121e95760405162461bcd60e51b81526004016104149190612bde565b50949350505050565b6060612247826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166124cd9092919063ffffffff16565b80519091501561214b578080602001905181019061226591906129fc565b61214b5760405162461bcd60e51b81526004016104149061311f565b60008164010000000084106121775760405162461bcd60e51b81526004016104149190612bde565b60008383018263ffffffff80871690831610156121e95760405162461bcd60e51b81526004016104149190612bde565b600081848411156122fd5760405162461bcd60e51b81526004016104149190612bde565b505050900390565b6000805b6004548110156124255761231b6125a1565b6004828154811061232857fe5b60009182526020918290206040805160a081018252600293909302909101805460ff81161515845261010090046001600160a01b039081168486018190526001909201546001600160601b0380821694860194909452600160601b81049093166060850152600160c01b90920461ffff16608084015292870151919350161480156123cc575083604001516001600160601b031681604001516001600160601b0316145b80156123e75750836080015161ffff16816080015161ffff16145b801561240c575083606001516001600160601b031681606001516001600160601b0316145b1561241c57600092505050610c46565b50600101612309565b50600192915050565b6000818152600183016020526040902054600160601b90046001600160601b031661246b5760405162461bcd60e51b815260040161041490612f3a565b600081815260018301602052604090208054600160601b600160c01b0319169055610cb0828261203c565b6000836001600160601b0316836001600160601b0316111582906122fd5760405162461bcd60e51b81526004016104149190612bde565b606061124f848460008560606124e28561259b565b6124fe5760405162461bcd60e51b81526004016104149061303e565b60006060866001600160a01b0316858760405161251b9190612ab4565b60006040518083038185875af1925050503d8060008114612558576040519150601f19603f3d011682016040523d82523d6000602084013e61255d565b606091505b5091509150811561257157915061124f9050565b8051156125815780518082602001fd5b8360405162461bcd60e51b81526004016104149190612bde565b3b151590565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915290565b604051806101800160405280600c906020820280368337509192915050565b60408051608081018252600080825260208201819052918101829052606081019190915290565b80356001600160a01b0381168114610eb857600080fd5b600082601f83011261263c578081fd5b813561264f61264a82613341565b61331a565b81815291506020808301908481018184028601820187101561267057600080fd5b60005b848110156126975761268588836126bf565b84529282019290820190600101612673565b505050505092915050565b8035610eb88161338d565b803561ffff81168114610eb857600080fd5b803560ff81168114610eb857600080fd5b80356001600160601b0381168114610eb857600080fd5b6000602082840312156126f8578081fd5b6118628383612615565b600080600080600060808688031215612719578081fd5b6127238787612615565b94506127328760208801612615565b935060408601359250606086013567ffffffffffffffff80821115612755578283fd5b818801915088601f830112612768578283fd5b813581811115612776578384fd5b896020828501011115612787578384fd5b9699959850939650602001949392505050565b600080604083850312156127ac578182fd5b6127b68484612615565b946020939093013593505050565b600080600080608085870312156127d9578384fd5b84356001600160a01b03811681146127ef578485fd5b966020860135965060408601359560600135945092505050565b6000806040838503121561281b578182fd5b6128258484612615565b915061283484602085016126bf565b90509250929050565b6000806040838503121561284f578182fd5b823567ffffffffffffffff80821115612866578384fd5b818501915085601f830112612879578384fd5b813561288761264a82613341565b80828252602080830192508086018a8283870289010111156128a7578889fd5b8896505b848710156128d1576128bd8b82612615565b8452600196909601959281019281016128ab565b5090965087013593505050808211156128e8578283fd5b506128f58582860161262c565b9150509250929050565b60006020808385031215612911578182fd5b823567ffffffffffffffff811115612927578283fd5b8301601f81018513612937578283fd5b803561294561264a82613341565b8181528381019083850160a0808502860187018a1015612963578788fd5b8795505b848610156129ee5780828b03121561297d578788fd5b6129868161331a565b6129908b846126a2565b815261299e8b898501612615565b8882015260406129b08c8286016126d0565b9082015260606129c28c8583016126d0565b9082015260806129d48c8583016126ad565b908201528452600195909501949286019290810190612967565b509098975050505050505050565b600060208284031215612a0d578081fd5b81516118628161338d565b600060208284031215612a29578081fd5b5035919050565b600060208284031215612a41578081fd5b5051919050565b600080600060608486031215612a5c578081fd5b505081359360208301359350604090920135919050565b60008151808452612a8b816020860160208601613361565b601f01601f19169290920160200192915050565b6001600160e01b031991909116815260040190565b60008251612ac6818460208701613361565b9190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090610d2c90830184612a73565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03929092168252602082015260400190565b6001600160a01b0394909416845260208401929092526040830152606082015260800190565b6020808252825182820181905260009190848201906040850190845b81811015612bb257835183529284019291840191600101612b96565b50909695505050505050565b901515815260200190565b6001600160e01b031991909116815260200190565b6000602082526118626020830184612a73565b60208082526021908201527f524465636b3a3a7374616b65486f7572735f455843454544535f31365f4249546040820152605360f81b606082015260800190565b602080825260139082015272524465636b3a3a5a45524f5f4144445245535360681b604082015260600190565b60208082526019908201527f6465706f7369743a20746f6f20736d616c6c20616d6f756e7400000000000000604082015260600190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b6020808252601b908201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604082015260600190565b60208082526017908201527f524465636b3a4d41585f4149525f504f4f4c535f515459000000000000000000604082015260600190565b6020808252601c908201527f524465636b3a3a6e667449645f455843454544535f34385f4249545300000000604082015260600190565b60208082526017908201527f6465706f7369743a207465726d732064697361626c6564000000000000000000604082015260600190565b602080825260169082015275524465636b3a544f4f5f4c4f575f524553455256455360501b604082015260600190565b60208082526019908201527f77697468647261773a207374616b65206973206c6f636b656400000000000000604082015260600190565b6020808252601d908201527f524465636b3a3a6164643a494e56414c49445f5a45524f5f504152414d000000604082015260600190565b60208082526019908201527f6465706f7369743a20746f6f206c6f7720726573657276657300000000000000604082015260600190565b6020808252601c908201527f524465636b3a3a6e667449645f455843454544535f33325f4249545300000000604082015260600190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6040820152607760f81b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526016908201527514911958dace9253959053125117d4d51052d157d25160521b604082015260600190565b60208082526018908201527f524465636b3a494e56414c49445f4149525f5745494748540000000000000000604082015260600190565b602080825260159082015274524465636b3a4149525f504f4f4c5f45584953545360581b604082015260600190565b6020808252601a908201527f524465636b3a494e56414c49445f41525241595f4c454e475448000000000000604082015260600190565b6020808252601c908201527f77697468647261773a20656d657267656e63792064697361626c656400000000604082015260600190565b6020808252601d908201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604082015260600190565b60208082526016908201527514911958dace955392d393d5d397d0525497d413d3d360521b604082015260600190565b60208082526019908201527f524465636b3a4455504c4943415445445f5354414b455f494400000000000000604082015260600190565b60208082526023908201527f77697468647261773a20756e6b6e6f776e206f722072657475726e6564207374604082015262616b6560e81b606082015260800190565b6020808252602a908201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6040820152691bdd081cdd58d8d9595960b21b606082015260800190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b6020808252601b908201527f524465636b3a3a6164643a5445524d535f4455504c4943415445440000000000604082015260600190565b60208082526017908201527f524465636b3a3a494e56414c49445f5445524d535f4944000000000000000000604082015260600190565b60006080820190506001600160601b0380845116835280602085015116602084015250604083015163ffffffff8082166040850152806060860151166060850152505092915050565b8151151581526020808301516001600160a01b0316908201526040808301516001600160601b03908116918301919091526060808401519091169082015260809182015161ffff169181019190915260a00190565b90815260200190565b93845260208401929092526001600160601b0316604083015263ffffffff16606082015260800190565b6001600160601b0391909116815260200190565b6001600160601b03938416815261ffff929092166020830152909116604082015260600190565b60405181810167ffffffffffffffff8111828210171561333957600080fd5b604052919050565b600067ffffffffffffffff821115613357578081fd5b5060209081020190565b60005b8381101561337c578181015183820152602001613364565b838111156116845750506000910152565b8015158114611d5d57600080fdfea2646970667358221220bdc3e2991cec7e80b6eac6a192adc1db51237c2b94d6851d21a727cd9d93584264736f6c634300060c00330000000000000000000000005a731151d6510eb475cc7a0072200cffc9a3bfe5
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101c35760003560e01c8063715018a6116100f9578063a4f53fd111610097578063c74446d311610071578063c74446d3146103bb578063cc181ca8146103ce578063de4e5a45146103d6578063f2fde38b146103de576101c3565b8063a4f53fd114610372578063a5ebac5014610395578063bd112073146103a8576101c3565b80638ac0df3e116100d35780638ac0df3e146103225780638da5cb5b1461032a5780639d782b2a1461033f5780639ef9bc2e14610352576101c3565b8063715018a6146102f25780637369b0c5146102fa57806380e73bde1461030f576101c3565b806343cca29411610166578063570903a211610140578063570903a2146102a25780635747e69f146102b757806359c8bf00146102cc5780636820e8dd146102df576101c3565b806343cca2941461025c5780634d39c9e21461027c5780635312ea8e1461028f576101c3565b806313365374116101a2578063133653741461020e578063150b7a02146102215780632e1a7d4d146102415780633630153314610254576101c3565b8062aeef8a146101c857806307a310aa146101dd5780630febeed9146101e5575b600080fd5b6101db6101d6366004612a48565b6103f1565b005b6101db61081c565b6101f86101f3366004612a18565b610bb1565b6040516102059190613257565b60405180910390f35b6101db61021c3660046128ff565b610c4b565b61023461022f366004612702565b610cb4565b6040516102059190612bc9565b6101db61024f366004612a18565b610d36565b6101db610db1565b61026f61026a36600461279a565b610e2e565b604051610205919061320e565b6101db61028a366004612a18565b610ebe565b6101db61029d366004612a18565b610f55565b6102aa610fc4565b60405161020591906132ac565b6102bf610fca565b6040516102059190612bbe565b6101db6102da366004612a18565b610fd3565b6101db6102ed36600461279a565b61106a565b6101db61113d565b6103026111bc565b60405161020591906132df565b6102aa61031d3660046127c4565b6111d2565b610302611257565b61033261126d565b6040516102059190612ad0565b6102aa61034d366004612a18565b61127c565b6103656103603660046126e7565b6112ed565b6040516102059190612b7a565b610385610380366004612a18565b611367565b6040516102059493929190612b54565b6101db6103a3366004612809565b611390565b6101db6103b6366004612a18565b611427565b6101db6103c936600461283d565b61152d565b61033261168a565b6101db611699565b6101db6103ec3660046126e7565b611709565b6002600154141561041d5760405162461bcd60e51b815260040161041490613169565b60405180910390fd5b600260015561042a6125a1565b6004610435856117bf565b8154811061043f57fe5b60009182526020918290206040805160a081018252600293909302909101805460ff811615158085526101009091046001600160a01b031694840194909452600101546001600160601b0380821692840192909252600160601b81049091166060830152600160c01b900461ffff16608082015291506104d15760405162461bcd60e51b815260040161041490612d81565b60006104dc836117e7565b905081604001516001600160601b0316816001600160601b031610156105145760405162461bcd60e51b815260040161041490612c5f565b600061054b610546620f424061054086606001516001600160601b03168861182890919063ffffffff16565b90611869565b6117e7565b60025490915060009061056e90600160281b90046001600160601b0316836118ab565b60025490915060009061059190600160881b90046001600160601b0316856118ab565b9050816001600160601b0316816001600160601b031610156105c55760405162461bcd60e51b815260040161041490612e56565b60006105df86602001518942896080015161ffff166118ed565b600354909150610603906001600160a01b031633306001600160601b03891661193b565b85602001516001600160a01b031663b88d4fde33308b638adbe13560e01b6040516020016106319190612a9f565b6040516020818303038152906040526040518563ffffffff1660e01b815260040161065f9493929190612ae4565b600060405180830381600087803b15801561067957600080fd5b505af115801561068d573d6000803e3d6000fd5b5050600280546001600160601b03868116600160881b02600160881b600160e81b0319918916600160281b0270ffffffffffffffffffffffff000000000019909316929092171617905550600090506106e542611993565b9050600061070e886080015161ffff16610e10028363ffffffff166119d490919063ffffffff16565b905061078a60066000336001600160a01b03166001600160a01b031681526020019081526020016000208460405180608001604052808b6001600160601b031681526020018a6001600160601b031681526020018663ffffffff16815260200161077d8663ffffffff16611993565b63ffffffff169052611a16565b6020808901516001600160a01b031660009081526007909152604090205460018111156107c35760008481526008602052604090208190555b336001600160a01b03167f7162984403f6c73c8639375d45a9187dfd04602231bd8e587c415718b5f7e5f9858c8a8660405161080294939291906132b5565b60405180910390a250506001805550505050505050505050565b6002600154141561083f5760405162461bcd60e51b815260040161041490613169565b6002600181905554610100900463ffffffff16431161085d57610bab565b61086643611993565b6002805463ffffffff929092166101000264ffffffff001990921691909117908190556003546040516370a0823160e01b81526000926001600160601b03600160881b909104169183916001600160a01b03909116906370a08231906108d0903090600401612ad0565b60206040518083038186803b1580156108e857600080fd5b505afa1580156108fc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109209190612a30565b905081811161093157505050610bab565b61093b8183611af4565b925061094a6105468385611b36565b60028054600160881b600160e81b031916600160881b6001600160601b0393841602179081905561098491600160281b90910416846118ab565b600260056101000a8154816001600160601b0302191690836001600160601b0316021790555050506109b46125cf565b6109bc6125cf565b60055460009081805b82811015610ae9576000806109f0600584815481106109e057fe5b9060005260206000200154611b5b565b60ff16915091506000826001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401610a259190612ad0565b60206040518083038186803b158015610a3d57600080fd5b505afa158015610a51573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a759190612a30565b9050801580610a82575081155b15610a8f57505050610ae1565b828986600c8110610a9c57fe5b6001600160a01b039092166020929092020152818886600c8110610abc57fe5b6020020152600190940193610adb610ad48284611828565b8890611b36565b96505050505b6001016109c5565b5060005b818111610b6c5760008682600c8110610b0257fe5b60200201519050610b4a610b2b866105408986600c8110610b1f57fe5b60200201518c90611828565b6001600160a01b03831660009081526007602052604090205490611b36565b6001600160a01b03909116600090815260076020526040902055600101610aed565b507fd0ecdf4854f39daba34ba0e2c1ed0132a7023a5434bffc90b24f3335fb90e5e386604051610b9c91906132ac565b60405180910390a15050505050505b60018055565b610bb96125a1565b6004610bc4836117bf565b81548110610bce57fe5b60009182526020918290206040805160a081018252600293909302909101805460ff81161515845261010090046001600160a01b0316938301939093526001909201546001600160601b0380821693830193909352600160601b81049092166060820152600160c01b90910461ffff16608082015290505b919050565b610c53611b69565b6000546001600160a01b03908116911614610c805760405162461bcd60e51b815260040161041490612f05565b60005b8151811015610cb057610ca8828281518110610c9b57fe5b6020026020010151611b6d565b600101610c83565b5050565b6000600482148015610ce9575082826000818110610cce57fe5b9050013560f81c60f81b6001600160f81b031916608a60f81b145b8015610d18575082826003818110610cfd57fe5b9050013560f81c60f81b6001600160f81b031916603560f81b145b610d23576000610d2c565b630a85bd0160e11b5b9695505050505050565b60026001541415610d595760405162461bcd60e51b815260040161041490613169565b6002600155610d69816000611d60565b336001600160a01b03167f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a942436482604051610da291906132ac565b60405180910390a25060018055565b610db9611b69565b6000546001600160a01b03908116911614610de65760405162461bcd60e51b815260040161041490612f05565b6002805460ff191660019081179091556040517f68c3b30f53252b4a7ebb8cbe118f644313c1c59953a3eb90ba5f43a42d242ae191610e2491612bbe565b60405180910390a1565b610e366125ee565b60066000610e4385611ff8565b6001600160a01b03168152602080820192909252604090810160009081208582526001018352819020815160808101835290546001600160601b038082168352600160601b8204169382019390935263ffffffff600160c01b8404811692820192909252600160e01b90920416606082015290505b92915050565b610ec6611b69565b6000546001600160a01b03908116911614610ef35760405162461bcd60e51b815260040161041490612f05565b60006004610f00836117bf565b81548110610f0a57fe5b60009182526020822060029190910201805460ff19169215159290921790915560405182917fc87b2d8df2c2fc232146effca27a0c5aa06a9a4677e1014f088b72d45ca01a2f91a250565b60026001541415610f785760405162461bcd60e51b815260040161041490613169565b6002600181905550610f8b816001611d60565b336001600160a01b03167f5fafa99d0643513820be26656b45130b01e1c03062e1266bf36f88cbd3bd969582604051610da291906132ac565b60045490565b60025460ff1681565b610fdb611b69565b6000546001600160a01b039081169116146110085760405162461bcd60e51b815260040161041490612f05565b60016004611015836117bf565b8154811061101f57fe5b60009182526020822060029190910201805460ff19169215159290921790915560405182917f0e7a48c601b1a627275b6d51f24200a652a0018fafe123b6d2d7c0bfbe54f12491a250565b611072611b69565b6000546001600160a01b0390811691161461109f5760405162461bcd60e51b815260040161041490612f05565b6003546110b7906001600160a01b031683308461193b565b6110dc6110c3826117e7565b600254600160881b90046001600160601b0316906118ab565b600260116101000a8154816001600160601b0302191690836001600160601b031602179055507f672216a7a59f7b075c6becc0eebb0ab5404d392281d509c1c1a4a6accd036f498160405161113191906132ac565b60405180910390a15050565b611145611b69565b6000546001600160a01b039081169116146111725760405162461bcd60e51b815260040161041490612f05565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600254600160881b90046001600160601b031681565b6000660100000000000084106111fa5760405162461bcd60e51b815260040161041490612d4a565b640100000000831061121e5760405162461bcd60e51b815260040161041490612e8d565b6201000082106112405760405162461bcd60e51b815260040161041490612bf1565b61124c858585856118ed565b90505b949350505050565b600254600160281b90046001600160601b031681565b6000546001600160a01b031690565b60008061128883611367565b5091925050506001600160a01b038116156112e7576001600160a01b03811660009081526007602052604090205460018111156112e557600084815260086020526040902054808211156112e3576112e08282611af4565b93505b505b505b50919050565b60606112f882611fff565b6001600160a01b038216600090815260066020908152604091829020805483518184028101840190945280845290929183919083018282801561135a57602002820191906000526020600020905b815481526020019060010190808311611346575b5050505050915050919050565b606081901c9165ffffffffffff603083901c169163ffffffff601082901c169161ffff90911690565b611398611b69565b6000546001600160a01b039081169116146113c55760405162461bcd60e51b815260040161041490612f05565b6001600160a01b0382166000908152600760205260409020546113fa5760405162461bcd60e51b815260040161041490613075565b6001600160a01b038216600090815260076020526040812055610cb060056114228484612025565b61203c565b61142f611b69565b6000546001600160a01b0390811691161461145c5760405162461bcd60e51b815260040161041490612f05565b600061148361146a836117e7565b600254600160881b90046001600160601b0316906120ea565b6002549091506001600160601b03600160281b909104811690821610156114bc5760405162461bcd60e51b815260040161041490612db8565b60028054600160881b600160e81b031916600160881b6001600160601b038416021790556114fe6114eb61126d565b6003546001600160a01b0316908461212c565b7ffab782eee98387fe0d957b2964e6da22a6918f525952ccad107ae25db263cc118260405161113191906132ac565b611535611b69565b6000546001600160a01b039081169116146115625760405162461bcd60e51b815260040161041490612f05565b8151815181146115845760405162461bcd60e51b815260040161041490612fd0565b60005b8181101561168457600554600c116115b15760405162461bcd60e51b815260040161041490612d13565b60008382815181106115bf57fe5b602002602001015190508060ff16600014156115ed5760405162461bcd60e51b815260040161041490612f6a565b60008583815181106115fb57fe5b6020026020010151905061160e81611fff565b6001600160a01b038116600090815260076020526040902054156116445760405162461bcd60e51b815260040161041490612fa1565b6001600160a01b038116600052600760205260056116628284612025565b8154600181810184556000938452602090932001559290920191506115879050565b50505050565b6003546001600160a01b031681565b6116a1611b69565b6000546001600160a01b039081169116146116ce5760405162461bcd60e51b815260040161041490612f05565b6002805460ff191690556040517f68c3b30f53252b4a7ebb8cbe118f644313c1c59953a3eb90ba5f43a42d242ae190610e2490600090612bbe565b611711611b69565b6000546001600160a01b0390811691161461173e5760405162461bcd60e51b815260040161041490612f05565b6001600160a01b0381166117645760405162461bcd60e51b815260040161041490612c96565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b60045460009082106117e35760405162461bcd60e51b8152600401610414906131d7565b5090565b6000610eb8826040518060400160405280601b81526020017f536166654d61746839363a206578636565647320393620626974730000000000815250612150565b60008261183757506000610eb8565b8282028284828161184457fe5b04146118625760405162461bcd60e51b815260040161041490612ec4565b9392505050565b600061186283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061217f565b600061186283836040518060400160405280601d81526020017f536166654d61746839363a206164646974696f6e206f766572666c6f770000008152506121b6565b6000660100000000000084106119155760405162461bcd60e51b815260040161041490612d4a565b506001600160601b0319606085901b16603084901b17601083901b178117949350505050565b611684846323b872dd60e01b85858560405160240161195c93929190612b17565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526121f2565b6000610eb8826040518060400160405280601b81526020017f536166654d61746833323a206578636565647320333220626974730000000000815250612281565b600061186283836040518060400160405280601d81526020017f536166654d61746833323a206164646974696f6e206f766572666c6f770000008152506122a9565b6000828152600184016020526040902054600160601b90046001600160601b031615611a545760405162461bcd60e51b8152600401610414906130a5565b60008281526001848101602090815260408084208551815487850151938801516060909801516001600160601b03199091166001600160601b0392831617600160601b600160c01b031916600160601b92909416919091029290921763ffffffff60c01b1916600160c01b63ffffffff97881602176001600160e01b0316600160e01b969092169590950217909355845490810185559381522090910155565b600061186283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506122d9565b6000828201838110156118625760405162461bcd60e51b815260040161041490612cdc565b600881901c60078216915091565b3390565b611b7a8160200151611fff565b60408101516001600160601b031615801590611b9d5750608081015161ffff1615155b8015611bb5575060608101516001600160601b031615155b611bd15760405162461bcd60e51b815260040161041490612e1f565b611bda81612305565b611bf65760405162461bcd60e51b8152600401610414906131a0565b60048054600181018255600082905282517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b60029092029182018054602086015160ff1990911692151592909217610100600160a81b0319166101006001600160a01b039093169283021790556040808501517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19c9093018054606087015160808801516001600160601b03199092166001600160601b0380881691909117600160601b600160c01b031916600160601b918316919091021761ffff60c01b1916600160c01b61ffff8416021790925594549151929460001992909201937fa70d49162b3bad2861a5c78db718eaa0e3bea0c49b5d87e177f963b9bf7fc67e93611d21939192906132f3565b60405180910390a3805115611d5d576004546040517f0e7a48c601b1a627275b6d51f24200a652a0018fafe123b6d2d7c0bfbe54f12490600090a25b50565b801580611d6f575060025460ff165b611d8b5760405162461bcd60e51b815260040161041490613007565b600080611d9784611367565b50503360009081526006602052604090209193509150611db56125ee565b506000858152600182016020908152604091829020825160808101845290546001600160601b038082168352600160601b8204169282019290925263ffffffff600160c01b8304811693820193909352600160e01b90910490911660608201528480611e2b5750806060015163ffffffff164210155b611e475760405162461bcd60e51b815260040161041490612de8565b60208101516001600160601b038116611e725760405162461bcd60e51b8152600401610414906130dc565b6001600160a01b0385166000908152600760205260409020546001811115611ed05760008881526008602052604090205480821115611ece57611ecb611ebb6105468484611af4565b6001600160601b038516906118ab565b92505b505b50600086611ede5781611ee1565b82515b9050611eed848961242e565b600254611f0a90600160281b90046001600160601b0316836120ea565b6002805470ffffffffffffffffffffffff00000000001916600160281b6001600160601b03938416021790819055611f4b91600160881b90910416836120ea565b60028054600160881b600160e81b031916600160881b6001600160601b0393841602179055600354611f8c916001600160a01b03909116903390841661212c565b604051632142170760e11b81526001600160a01b038716906342842e0e90611fbc90309033908a90600401612b17565b600060405180830381600087803b158015611fd657600080fd5b505af1158015611fea573d6000803e3d6000fd5b505050505050505050505050565b60006117e3825b6001600160a01b038116611d5d5760405162461bcd60e51b815260040161041490612c32565b60ff1660089190911b610100600160a81b03161790565b81546000190180156120c557600083828154811061205657fe5b906000526020600020015490508281146120c3575b600081905084600184038154811061207f57fe5b90600052602060002001549150828060019003935050808584815481106120a257fe5b600091825260209091200155508083148015906120be57508115155b61206b575b505b828054806120cf57fe5b60019003818190600052602060002001600090559055505050565b600061186283836040518060400160405280602081526020017f536166654d61746839363a207375627472616374696f6e206f766572666c6f77815250612496565b61214b8363a9059cbb60e01b848460405160240161195c929190612b3b565b505050565b600081600160601b84106121775760405162461bcd60e51b81526004016104149190612bde565b509192915050565b600081836121a05760405162461bcd60e51b81526004016104149190612bde565b5060008385816121ac57fe5b0495945050505050565b6000838301826001600160601b0380871690831610156121e95760405162461bcd60e51b81526004016104149190612bde565b50949350505050565b6060612247826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166124cd9092919063ffffffff16565b80519091501561214b578080602001905181019061226591906129fc565b61214b5760405162461bcd60e51b81526004016104149061311f565b60008164010000000084106121775760405162461bcd60e51b81526004016104149190612bde565b60008383018263ffffffff80871690831610156121e95760405162461bcd60e51b81526004016104149190612bde565b600081848411156122fd5760405162461bcd60e51b81526004016104149190612bde565b505050900390565b6000805b6004548110156124255761231b6125a1565b6004828154811061232857fe5b60009182526020918290206040805160a081018252600293909302909101805460ff81161515845261010090046001600160a01b039081168486018190526001909201546001600160601b0380821694860194909452600160601b81049093166060850152600160c01b90920461ffff16608084015292870151919350161480156123cc575083604001516001600160601b031681604001516001600160601b0316145b80156123e75750836080015161ffff16816080015161ffff16145b801561240c575083606001516001600160601b031681606001516001600160601b0316145b1561241c57600092505050610c46565b50600101612309565b50600192915050565b6000818152600183016020526040902054600160601b90046001600160601b031661246b5760405162461bcd60e51b815260040161041490612f3a565b600081815260018301602052604090208054600160601b600160c01b0319169055610cb0828261203c565b6000836001600160601b0316836001600160601b0316111582906122fd5760405162461bcd60e51b81526004016104149190612bde565b606061124f848460008560606124e28561259b565b6124fe5760405162461bcd60e51b81526004016104149061303e565b60006060866001600160a01b0316858760405161251b9190612ab4565b60006040518083038185875af1925050503d8060008114612558576040519150601f19603f3d011682016040523d82523d6000602084013e61255d565b606091505b5091509150811561257157915061124f9050565b8051156125815780518082602001fd5b8360405162461bcd60e51b81526004016104149190612bde565b3b151590565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915290565b604051806101800160405280600c906020820280368337509192915050565b60408051608081018252600080825260208201819052918101829052606081019190915290565b80356001600160a01b0381168114610eb857600080fd5b600082601f83011261263c578081fd5b813561264f61264a82613341565b61331a565b81815291506020808301908481018184028601820187101561267057600080fd5b60005b848110156126975761268588836126bf565b84529282019290820190600101612673565b505050505092915050565b8035610eb88161338d565b803561ffff81168114610eb857600080fd5b803560ff81168114610eb857600080fd5b80356001600160601b0381168114610eb857600080fd5b6000602082840312156126f8578081fd5b6118628383612615565b600080600080600060808688031215612719578081fd5b6127238787612615565b94506127328760208801612615565b935060408601359250606086013567ffffffffffffffff80821115612755578283fd5b818801915088601f830112612768578283fd5b813581811115612776578384fd5b896020828501011115612787578384fd5b9699959850939650602001949392505050565b600080604083850312156127ac578182fd5b6127b68484612615565b946020939093013593505050565b600080600080608085870312156127d9578384fd5b84356001600160a01b03811681146127ef578485fd5b966020860135965060408601359560600135945092505050565b6000806040838503121561281b578182fd5b6128258484612615565b915061283484602085016126bf565b90509250929050565b6000806040838503121561284f578182fd5b823567ffffffffffffffff80821115612866578384fd5b818501915085601f830112612879578384fd5b813561288761264a82613341565b80828252602080830192508086018a8283870289010111156128a7578889fd5b8896505b848710156128d1576128bd8b82612615565b8452600196909601959281019281016128ab565b5090965087013593505050808211156128e8578283fd5b506128f58582860161262c565b9150509250929050565b60006020808385031215612911578182fd5b823567ffffffffffffffff811115612927578283fd5b8301601f81018513612937578283fd5b803561294561264a82613341565b8181528381019083850160a0808502860187018a1015612963578788fd5b8795505b848610156129ee5780828b03121561297d578788fd5b6129868161331a565b6129908b846126a2565b815261299e8b898501612615565b8882015260406129b08c8286016126d0565b9082015260606129c28c8583016126d0565b9082015260806129d48c8583016126ad565b908201528452600195909501949286019290810190612967565b509098975050505050505050565b600060208284031215612a0d578081fd5b81516118628161338d565b600060208284031215612a29578081fd5b5035919050565b600060208284031215612a41578081fd5b5051919050565b600080600060608486031215612a5c578081fd5b505081359360208301359350604090920135919050565b60008151808452612a8b816020860160208601613361565b601f01601f19169290920160200192915050565b6001600160e01b031991909116815260040190565b60008251612ac6818460208701613361565b9190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090610d2c90830184612a73565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03929092168252602082015260400190565b6001600160a01b0394909416845260208401929092526040830152606082015260800190565b6020808252825182820181905260009190848201906040850190845b81811015612bb257835183529284019291840191600101612b96565b50909695505050505050565b901515815260200190565b6001600160e01b031991909116815260200190565b6000602082526118626020830184612a73565b60208082526021908201527f524465636b3a3a7374616b65486f7572735f455843454544535f31365f4249546040820152605360f81b606082015260800190565b602080825260139082015272524465636b3a3a5a45524f5f4144445245535360681b604082015260600190565b60208082526019908201527f6465706f7369743a20746f6f20736d616c6c20616d6f756e7400000000000000604082015260600190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b6020808252601b908201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604082015260600190565b60208082526017908201527f524465636b3a4d41585f4149525f504f4f4c535f515459000000000000000000604082015260600190565b6020808252601c908201527f524465636b3a3a6e667449645f455843454544535f34385f4249545300000000604082015260600190565b60208082526017908201527f6465706f7369743a207465726d732064697361626c6564000000000000000000604082015260600190565b602080825260169082015275524465636b3a544f4f5f4c4f575f524553455256455360501b604082015260600190565b60208082526019908201527f77697468647261773a207374616b65206973206c6f636b656400000000000000604082015260600190565b6020808252601d908201527f524465636b3a3a6164643a494e56414c49445f5a45524f5f504152414d000000604082015260600190565b60208082526019908201527f6465706f7369743a20746f6f206c6f7720726573657276657300000000000000604082015260600190565b6020808252601c908201527f524465636b3a3a6e667449645f455843454544535f33325f4249545300000000604082015260600190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6040820152607760f81b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526016908201527514911958dace9253959053125117d4d51052d157d25160521b604082015260600190565b60208082526018908201527f524465636b3a494e56414c49445f4149525f5745494748540000000000000000604082015260600190565b602080825260159082015274524465636b3a4149525f504f4f4c5f45584953545360581b604082015260600190565b6020808252601a908201527f524465636b3a494e56414c49445f41525241595f4c454e475448000000000000604082015260600190565b6020808252601c908201527f77697468647261773a20656d657267656e63792064697361626c656400000000604082015260600190565b6020808252601d908201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604082015260600190565b60208082526016908201527514911958dace955392d393d5d397d0525497d413d3d360521b604082015260600190565b60208082526019908201527f524465636b3a4455504c4943415445445f5354414b455f494400000000000000604082015260600190565b60208082526023908201527f77697468647261773a20756e6b6e6f776e206f722072657475726e6564207374604082015262616b6560e81b606082015260800190565b6020808252602a908201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6040820152691bdd081cdd58d8d9595960b21b606082015260800190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b6020808252601b908201527f524465636b3a3a6164643a5445524d535f4455504c4943415445440000000000604082015260600190565b60208082526017908201527f524465636b3a3a494e56414c49445f5445524d535f4944000000000000000000604082015260600190565b60006080820190506001600160601b0380845116835280602085015116602084015250604083015163ffffffff8082166040850152806060860151166060850152505092915050565b8151151581526020808301516001600160a01b0316908201526040808301516001600160601b03908116918301919091526060808401519091169082015260809182015161ffff169181019190915260a00190565b90815260200190565b93845260208401929092526001600160601b0316604083015263ffffffff16606082015260800190565b6001600160601b0391909116815260200190565b6001600160601b03938416815261ffff929092166020830152909116604082015260600190565b60405181810167ffffffffffffffff8111828210171561333957600080fd5b604052919050565b600067ffffffffffffffff821115613357578081fd5b5060209081020190565b60005b8381101561337c578181015183820152602001613364565b838111156116845750506000910152565b8015158114611d5d57600080fdfea2646970667358221220bdc3e2991cec7e80b6eac6a192adc1db51237c2b94d6851d21a727cd9d93584264736f6c634300060c0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000005a731151d6510eb475cc7a0072200cffc9a3bfe5
-----Decoded View---------------
Arg [0] : _king (address): 0x5a731151d6510Eb475cc7a0072200cFfC9a3bFe5
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000005a731151d6510eb475cc7a0072200cffc9a3bfe5
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 31 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|---|---|---|---|---|
ETH | 100.00% | $0.001876 | 762,837.4454 | $1,431.12 |
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.