More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 6,624 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Withdraw | 21418739 | 7 days ago | IN | 0 ETH | 0.00101147 | ||||
Exit | 21406345 | 8 days ago | IN | 0 ETH | 0.00050241 | ||||
Withdraw | 21305127 | 22 days ago | IN | 0 ETH | 0.00064597 | ||||
Withdraw | 21237814 | 32 days ago | IN | 0 ETH | 0.00211661 | ||||
Withdraw | 21152574 | 44 days ago | IN | 0 ETH | 0.00030261 | ||||
Withdraw | 21152574 | 44 days ago | IN | 0 ETH | 0.00078814 | ||||
Withdraw | 20661591 | 112 days ago | IN | 0 ETH | 0.00032108 | ||||
Withdraw | 20642677 | 115 days ago | IN | 0 ETH | 0.00041502 | ||||
Withdraw | 20304283 | 162 days ago | IN | 0 ETH | 0.00039633 | ||||
Withdraw | 19995857 | 205 days ago | IN | 0 ETH | 0.00048103 | ||||
Withdraw | 19856365 | 225 days ago | IN | 0 ETH | 0.00034208 | ||||
Withdraw | 19757381 | 239 days ago | IN | 0 ETH | 0.00054369 | ||||
Withdraw | 19730925 | 242 days ago | IN | 0 ETH | 0.00102273 | ||||
Withdraw | 19667798 | 251 days ago | IN | 0 ETH | 0.0007556 | ||||
Withdraw | 19599810 | 261 days ago | IN | 0 ETH | 0.00070615 | ||||
Withdraw | 19576492 | 264 days ago | IN | 0 ETH | 0.00436762 | ||||
Withdraw | 19526002 | 271 days ago | IN | 0 ETH | 0.00428143 | ||||
Withdraw | 19439918 | 283 days ago | IN | 0 ETH | 0.00417815 | ||||
Withdraw | 19357112 | 295 days ago | IN | 0 ETH | 0.00599349 | ||||
Withdraw | 19202676 | 316 days ago | IN | 0 ETH | 0.0025754 | ||||
Withdraw | 19050872 | 338 days ago | IN | 0 ETH | 0.0012982 | ||||
Withdraw | 19042615 | 339 days ago | IN | 0 ETH | 0.00323048 | ||||
Withdraw | 18988015 | 347 days ago | IN | 0 ETH | 0.00158969 | ||||
Withdraw | 18947485 | 352 days ago | IN | 0 ETH | 0.00070753 | ||||
Withdraw | 18947470 | 352 days ago | IN | 0 ETH | 0.00095441 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
StakeDaoNFTPalace
Compiler Version
v0.5.17+commit.d19bba13
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2021-04-16 */ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.5.17; // Part: ERC1155Metadata /** * @notice Contract that handles metadata related methods. * @dev Methods assume a deterministic generation of URI based on token IDs. * Methods also assume that URI uses hex representation of token IDs. */ contract ERC1155Metadata { // URI's default URI prefix string internal baseMetadataURI; event URI(string _uri, uint256 indexed _id); /***********************************| | Metadata Public Function s | |__________________________________*/ /** * @notice A distinct Uniform Resource Identifier (URI) for a given token. * @dev URIs are defined in RFC 3986. * URIs are assumed to be deterministically generated based on token ID * Token IDs are assumed to be represented in their hex format in URIs * @return URI string */ function uri(uint256 _id) public view returns (string memory) { return string(abi.encodePacked(baseMetadataURI, _uint2str(_id), ".json")); } /***********************************| | Metadata Internal Functions | |__________________________________*/ /** * @notice Will emit default URI log event for corresponding token _id * @param _tokenIDs Array of IDs of tokens to log default URI */ function _logURIs(uint256[] memory _tokenIDs) internal { string memory baseURL = baseMetadataURI; string memory tokenURI; for (uint256 i = 0; i < _tokenIDs.length; i++) { tokenURI = string( abi.encodePacked(baseURL, _uint2str(_tokenIDs[i]), ".json") ); emit URI(tokenURI, _tokenIDs[i]); } } /** * @notice Will emit a specific URI log event for corresponding token * @param _tokenIDs IDs of the token corresponding to the _uris logged * @param _URIs The URIs of the specified _tokenIDs */ function _logURIs(uint256[] memory _tokenIDs, string[] memory _URIs) internal { require( _tokenIDs.length == _URIs.length, "ERC1155Metadata#_logURIs: INVALID_ARRAYS_LENGTH" ); for (uint256 i = 0; i < _tokenIDs.length; i++) { emit URI(_URIs[i], _tokenIDs[i]); } } /** * @notice Will update the base URL of token's URI * @param _newBaseMetadataURI New base URL of token's URI */ function _setBaseMetadataURI(string memory _newBaseMetadataURI) internal { baseMetadataURI = _newBaseMetadataURI; } /***********************************| | Utility Internal Functions | |__________________________________*/ /** * @notice Convert uint256 to string * @param _i Unsigned integer to convert to string */ function _uint2str(uint256 _i) internal pure returns (string memory _uintAsString) { if (_i == 0) { return "0"; } uint256 j = _i; uint256 ii = _i; uint256 len; // Get number of bytes while (j != 0) { len++; j /= 10; } bytes memory bstr = new bytes(len); uint256 k = len - 1; // Get each individual ASCII while (ii != 0) { bstr[k--] = bytes1(uint8(48 + (ii % 10))); ii /= 10; } // Convert to string return string(bstr); } } // Part: IERC1155TokenReceiver /** * @dev ERC-1155 interface for accepting safe transfers. */ interface IERC1155TokenReceiver { /** * @notice Handle the receipt of a single ERC1155 token type * @dev An ERC1155-compliant smart contract MUST call this function on the token recipient contract, at the end of a `safeTransferFrom` after the balance has been updated * This function MAY throw to revert and reject the transfer * Return of other amount than the magic value MUST result in the transaction being reverted * Note: The token contract address is always the message sender * @param _operator The address which called the `safeTransferFrom` function * @param _from The address which previously owned the token * @param _id The id of the token being transferred * @param _amount The amount of tokens being transferred * @param _data Additional data with no specified format * @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` */ function onERC1155Received( address _operator, address _from, uint256 _id, uint256 _amount, bytes calldata _data ) external returns (bytes4); /** * @notice Handle the receipt of multiple ERC1155 token types * @dev An ERC1155-compliant smart contract MUST call this function on the token recipient contract, at the end of a `safeBatchTransferFrom` after the balances have been updated * This function MAY throw to revert and reject the transfer * Return of other amount than the magic value WILL result in the transaction being reverted * Note: The token contract address is always the message sender * @param _operator The address which called the `safeBatchTransferFrom` function * @param _from The address which previously owned the token * @param _ids An array containing ids of each token being transferred * @param _amounts An array containing amounts of each token being transferred * @param _data Additional data with no specified format * @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` */ function onERC1155BatchReceived( address _operator, address _from, uint256[] calldata _ids, uint256[] calldata _amounts, bytes calldata _data ) external returns (bytes4); /** * @notice Indicates whether a contract implements the `ERC1155TokenReceiver` functions and so can accept ERC1155 token types. * @param interfaceID The ERC-165 interface ID that is queried for support.s * @dev This function MUST return true if it implements the ERC1155TokenReceiver interface and ERC-165 interface. * This function MUST NOT consume more than 5,000 gas. * @return Wheter ERC-165 or ERC1155TokenReceiver interfaces are supported. */ function supportsInterface(bytes4 interfaceID) external view returns (bool); } // Part: IERC165 /** * @title ERC165 * @dev https://github.com/ethereum/EIPs/blob/master/EIPS/eip-165.md */ interface IERC165 { /** * @notice Query if a contract implements an interface * @dev Interface identification is specified in ERC-165. This function * uses less than 30,000 gas * @param _interfaceId The interface identifier, as specified in ERC-165 */ function supportsInterface(bytes4 _interfaceId) external view returns (bool); } // Part: OpenZeppelin/[email protected]/Address /** * @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) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } /** * @dev Converts an `address` into `address payable`. Note that this is * simply a type cast: the actual underlying value is not changed. * * _Available since v2.4.0._ */ function toPayable(address account) internal pure returns (address payable) { return address(uint160(account)); } /** * @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]. * * _Available since v2.4.0._ */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-call-value (bool success, ) = recipient.call.value(amount)(""); require(success, "Address: unable to send value, recipient may have reverted"); } } // Part: OpenZeppelin/[email protected]/Context /* * @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. */ contract Context { // Empty internal constructor, to prevent people from mistakenly deploying // an instance of this contract, which should be used via inheritance. constructor () internal { } // solhint-disable-previous-line no-empty-blocks function _msgSender() internal view returns (address payable) { return msg.sender; } function _msgData() internal view returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } // Part: OpenZeppelin/[email protected]/IERC20 /** * @dev Interface of the ERC20 standard as defined in the EIP. Does not include * the optional functions; to access them see {ERC20Detailed}. */ 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); } // Part: OpenZeppelin/[email protected]/SafeMath /** * @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. * * _Available since v2.4.0._ */ 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. * * _Available since v2.4.0._ */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 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. * * _Available since v2.4.0._ */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } // Part: OwnableDelegateProxy contract OwnableDelegateProxy {} // Part: Roles /** * @title Roles * @dev Library for managing addresses assigned to a Role. */ library Roles { struct Role { mapping(address => bool) bearer; } /** * @dev Give an account access to this role. */ function add(Role storage role, address account) internal { require(!has(role, account), "Roles: account already has role"); role.bearer[account] = true; } /** * @dev Remove an account's access to this role. */ function remove(Role storage role, address account) internal { require(has(role, account), "Roles: account does not have role"); role.bearer[account] = false; } /** * @dev Check if an account has this role. * @return bool */ function has(Role storage role, address account) internal view returns (bool) { require(account != address(0), "Roles: account is the zero address"); return role.bearer[account]; } } // Part: Strings library Strings { // via https://github.com/oraclize/ethereum-api/blob/master/oraclizeAPI_0.5.sol function strConcat( string memory _a, string memory _b, string memory _c, string memory _d, string memory _e ) internal pure returns (string memory) { bytes memory _ba = bytes(_a); bytes memory _bb = bytes(_b); bytes memory _bc = bytes(_c); bytes memory _bd = bytes(_d); bytes memory _be = bytes(_e); string memory abcde = new string( _ba.length + _bb.length + _bc.length + _bd.length + _be.length ); bytes memory babcde = bytes(abcde); uint256 k = 0; for (uint256 i = 0; i < _ba.length; i++) babcde[k++] = _ba[i]; for (uint256 i = 0; i < _bb.length; i++) babcde[k++] = _bb[i]; for (uint256 i = 0; i < _bc.length; i++) babcde[k++] = _bc[i]; for (uint256 i = 0; i < _bd.length; i++) babcde[k++] = _bd[i]; for (uint256 i = 0; i < _be.length; i++) babcde[k++] = _be[i]; return string(babcde); } function strConcat( string memory _a, string memory _b, string memory _c, string memory _d ) internal pure returns (string memory) { return strConcat(_a, _b, _c, _d, ""); } function strConcat( string memory _a, string memory _b, string memory _c ) internal pure returns (string memory) { return strConcat(_a, _b, _c, "", ""); } function strConcat(string memory _a, string memory _b) internal pure returns (string memory) { return strConcat(_a, _b, "", "", ""); } function uint2str(uint256 _i) internal pure returns (string memory _uintAsString) { if (_i == 0) { return "0"; } uint256 j = _i; uint256 len; while (j != 0) { len++; j /= 10; } bytes memory bstr = new bytes(len); uint256 k = len - 1; while (_i != 0) { bstr[k--] = bytes1(uint8(48 + (_i % 10))); _i /= 10; } return string(bstr); } } // Part: ERC1155 /** * @dev Implementation of Multi-Token Standard contract */ contract ERC1155 is IERC165 { using SafeMath for uint256; using Address for address; /***********************************| | Variables and Events | |__________________________________*/ // onReceive function signatures bytes4 internal constant ERC1155_RECEIVED_VALUE = 0xf23a6e61; bytes4 internal constant ERC1155_BATCH_RECEIVED_VALUE = 0xbc197c81; // Objects balances mapping(address => mapping(uint256 => uint256)) internal balances; // Operator Functions mapping(address => mapping(address => bool)) internal operators; // Events event TransferSingle( address indexed _operator, address indexed _from, address indexed _to, uint256 _id, uint256 _amount ); event TransferBatch( address indexed _operator, address indexed _from, address indexed _to, uint256[] _ids, uint256[] _amounts ); event ApprovalForAll( address indexed _owner, address indexed _operator, bool _approved ); event URI(string _uri, uint256 indexed _id); /***********************************| | Public Transfer Functions | |__________________________________*/ /** * @notice Transfers amount amount of an _id from the _from address to the _to address specified * @param _from Source address * @param _to Target address * @param _id ID of the token type * @param _amount Transfered amount * @param _data Additional data with no specified format, sent in call to `_to` */ function safeTransferFrom( address _from, address _to, uint256 _id, uint256 _amount, bytes memory _data ) public { require( (msg.sender == _from) || isApprovedForAll(_from, msg.sender), "ERC1155#safeTransferFrom: INVALID_OPERATOR" ); require( _to != address(0), "ERC1155#safeTransferFrom: INVALID_RECIPIENT" ); // require(_amount >= balances[_from][_id]) is not necessary since checked with safemath operations _safeTransferFrom(_from, _to, _id, _amount); _callonERC1155Received(_from, _to, _id, _amount, _data); } /** * @notice Send multiple types of Tokens from the _from address to the _to address (with safety call) * @param _from Source addresses * @param _to Target addresses * @param _ids IDs of each token type * @param _amounts Transfer amounts per token type * @param _data Additional data with no specified format, sent in call to `_to` */ function safeBatchTransferFrom( address _from, address _to, uint256[] memory _ids, uint256[] memory _amounts, bytes memory _data ) public { // Requirements require( (msg.sender == _from) || isApprovedForAll(_from, msg.sender), "ERC1155#safeBatchTransferFrom: INVALID_OPERATOR" ); require( _to != address(0), "ERC1155#safeBatchTransferFrom: INVALID_RECIPIENT" ); _safeBatchTransferFrom(_from, _to, _ids, _amounts); _callonERC1155BatchReceived(_from, _to, _ids, _amounts, _data); } /***********************************| | Internal Transfer Functions | |__________________________________*/ /** * @notice Transfers amount amount of an _id from the _from address to the _to address specified * @param _from Source address * @param _to Target address * @param _id ID of the token type * @param _amount Transfered amount */ function _safeTransferFrom( address _from, address _to, uint256 _id, uint256 _amount ) internal { // Update balances balances[_from][_id] = balances[_from][_id].sub(_amount); // Subtract amount balances[_to][_id] = balances[_to][_id].add(_amount); // Add amount // Emit event emit TransferSingle(msg.sender, _from, _to, _id, _amount); } /** * @notice Verifies if receiver is contract and if so, calls (_to).onERC1155Received(...) */ function _callonERC1155Received( address _from, address _to, uint256 _id, uint256 _amount, bytes memory _data ) internal { // Check if recipient is contract if (_to.isContract()) { bytes4 retval = IERC1155TokenReceiver(_to).onERC1155Received( msg.sender, _from, _id, _amount, _data ); require( retval == ERC1155_RECEIVED_VALUE, "ERC1155#_callonERC1155Received: INVALID_ON_RECEIVE_MESSAGE" ); } } /** * @notice Send multiple types of Tokens from the _from address to the _to address (with safety call) * @param _from Source addresses * @param _to Target addresses * @param _ids IDs of each token type * @param _amounts Transfer amounts per token type */ function _safeBatchTransferFrom( address _from, address _to, uint256[] memory _ids, uint256[] memory _amounts ) internal { require( _ids.length == _amounts.length, "ERC1155#_safeBatchTransferFrom: INVALID_ARRAYS_LENGTH" ); // Number of transfer to execute uint256 nTransfer = _ids.length; // Executing all transfers for (uint256 i = 0; i < nTransfer; i++) { // Update storage balance of previous bin balances[_from][_ids[i]] = balances[_from][_ids[i]].sub( _amounts[i] ); balances[_to][_ids[i]] = balances[_to][_ids[i]].add(_amounts[i]); } // Emit event emit TransferBatch(msg.sender, _from, _to, _ids, _amounts); } /** * @notice Verifies if receiver is contract and if so, calls (_to).onERC1155BatchReceived(...) */ function _callonERC1155BatchReceived( address _from, address _to, uint256[] memory _ids, uint256[] memory _amounts, bytes memory _data ) internal { // Pass data if recipient is contract if (_to.isContract()) { bytes4 retval = IERC1155TokenReceiver(_to).onERC1155BatchReceived( msg.sender, _from, _ids, _amounts, _data ); require( retval == ERC1155_BATCH_RECEIVED_VALUE, "ERC1155#_callonERC1155BatchReceived: INVALID_ON_RECEIVE_MESSAGE" ); } } /***********************************| | Operator Functions | |__________________________________*/ /** * @notice Enable or disable approval for a third party ("operator") to manage all of caller's tokens * @param _operator Address to add to the set of authorized operators * @param _approved True if the operator is approved, false to revoke approval */ function setApprovalForAll(address _operator, bool _approved) external { // Update operator status operators[msg.sender][_operator] = _approved; emit ApprovalForAll(msg.sender, _operator, _approved); } /** * @notice Queries the approval status of an operator for a given owner * @param _owner The owner of the Tokens * @param _operator Address of authorized operator * @return True if the operator is approved, false if not */ function isApprovedForAll(address _owner, address _operator) public view returns (bool isOperator) { return operators[_owner][_operator]; } /***********************************| | Balance Functions | |__________________________________*/ /** * @notice Get the balance of an account's Tokens * @param _owner The address of the token holder * @param _id ID of the Token * @return The _owner's balance of the Token type requested */ function balanceOf(address _owner, uint256 _id) public view returns (uint256) { return balances[_owner][_id]; } /** * @notice Get the balance of multiple account/token pairs * @param _owners The addresses of the token holders * @param _ids ID of the Tokens * @return The _owner's balance of the Token types requested (i.e. balance for each (owner, id) pair) */ function balanceOfBatch(address[] memory _owners, uint256[] memory _ids) public view returns (uint256[] memory) { require( _owners.length == _ids.length, "ERC1155#balanceOfBatch: INVALID_ARRAY_LENGTH" ); // Variables uint256[] memory batchBalances = new uint256[](_owners.length); // Iterate over each owner and token ID for (uint256 i = 0; i < _owners.length; i++) { batchBalances[i] = balances[_owners[i]][_ids[i]]; } return batchBalances; } /***********************************| | ERC165 Functions | |__________________________________*/ /** * INTERFACE_SIGNATURE_ERC165 = bytes4(keccak256("supportsInterface(bytes4)")); */ bytes4 private constant INTERFACE_SIGNATURE_ERC165 = 0x01ffc9a7; /** * INTERFACE_SIGNATURE_ERC1155 = * bytes4(keccak256("safeTransferFrom(address,address,uint256,uint256,bytes)")) ^ * bytes4(keccak256("safeBatchTransferFrom(address,address,uint256[],uint256[],bytes)")) ^ * bytes4(keccak256("balanceOf(address,uint256)")) ^ * bytes4(keccak256("balanceOfBatch(address[],uint256[])")) ^ * bytes4(keccak256("setApprovalForAll(address,bool)")) ^ * bytes4(keccak256("isApprovedForAll(address,address)")); */ bytes4 private constant INTERFACE_SIGNATURE_ERC1155 = 0xd9b67a26; /** * @notice Query if a contract implements an interface * @param _interfaceID The interface identifier, as specified in ERC-165 * @return `true` if the contract implements `_interfaceID` and */ function supportsInterface(bytes4 _interfaceID) external view returns (bool) { if ( _interfaceID == INTERFACE_SIGNATURE_ERC165 || _interfaceID == INTERFACE_SIGNATURE_ERC1155 ) { return true; } return false; } } // Part: MinterRole contract MinterRole is Context { using Roles for Roles.Role; event MinterAdded(address indexed account); event MinterRemoved(address indexed account); Roles.Role private _minters; constructor() internal { _addMinter(_msgSender()); } modifier onlyMinter() { require( isMinter(_msgSender()), "MinterRole: caller does not have the Minter role" ); _; } function isMinter(address account) public view returns (bool) { return _minters.has(account); } function addMinter(address account) public onlyMinter { _addMinter(account); } function renounceMinter() public { _removeMinter(_msgSender()); } function _addMinter(address account) internal { _minters.add(account); emit MinterAdded(account); } function _removeMinter(address account) internal { _minters.remove(account); emit MinterRemoved(account); } } // Part: OpenZeppelin/[email protected]/Ownable /** * @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. * * 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(isOwner(), "Ownable: caller is not the owner"); _; } /** * @dev Returns true if the caller is the current owner. */ function isOwner() public view returns (bool) { return _msgSender() == _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 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 onlyOwner { _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). */ function _transferOwnership(address newOwner) internal { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } // Part: ProxyRegistry contract ProxyRegistry { mapping(address => OwnableDelegateProxy) public proxies; } // Part: StakeTokenWrapper contract StakeTokenWrapper { using SafeMath for uint256; IERC20 public xsdt; constructor(IERC20 _xsdt) public { xsdt = IERC20(_xsdt); } uint256 private _totalSupply; mapping(address => uint256) private _balances; function totalSupply() public view returns (uint256) { return _totalSupply; } function balanceOf(address account) public view returns (uint256) { return _balances[account]; } function stake(uint256 amount) public { _totalSupply = _totalSupply.add(amount); _balances[msg.sender] = _balances[msg.sender].add(amount); xsdt.transferFrom(msg.sender, address(this), amount); } function withdraw(uint256 amount) public { _totalSupply = _totalSupply.sub(amount); _balances[msg.sender] = _balances[msg.sender].sub(amount); xsdt.transfer(msg.sender, amount); } } // Part: WhitelistAdminRole /** * @title WhitelistAdminRole * @dev WhitelistAdmins are responsible for assigning and removing Whitelisted accounts. */ contract WhitelistAdminRole is Context { using Roles for Roles.Role; event WhitelistAdminAdded(address indexed account); event WhitelistAdminRemoved(address indexed account); Roles.Role private _whitelistAdmins; constructor() internal { _addWhitelistAdmin(_msgSender()); } modifier onlyWhitelistAdmin() { require( isWhitelistAdmin(_msgSender()), "WhitelistAdminRole: caller does not have the WhitelistAdmin role" ); _; } function isWhitelistAdmin(address account) public view returns (bool) { return _whitelistAdmins.has(account); } function addWhitelistAdmin(address account) public onlyWhitelistAdmin { _addWhitelistAdmin(account); } function renounceWhitelistAdmin() public { _removeWhitelistAdmin(_msgSender()); } function _addWhitelistAdmin(address account) internal { _whitelistAdmins.add(account); emit WhitelistAdminAdded(account); } function _removeWhitelistAdmin(address account) internal { _whitelistAdmins.remove(account); emit WhitelistAdminRemoved(account); } } // Part: ERC1155MintBurn /** * @dev Multi-Fungible Tokens with minting and burning methods. These methods assume * a parent contract to be executed as they are `internal` functions */ contract ERC1155MintBurn is ERC1155 { /****************************************| | Minting Functions | |_______________________________________*/ /** * @notice Mint _amount of tokens of a given id * @param _to The address to mint tokens to * @param _id Token id to mint * @param _amount The amount to be minted * @param _data Data to pass if receiver is contract */ function _mint( address _to, uint256 _id, uint256 _amount, bytes memory _data ) internal { // Add _amount balances[_to][_id] = balances[_to][_id].add(_amount); // Emit event emit TransferSingle(msg.sender, address(0x0), _to, _id, _amount); // Calling onReceive method if recipient is contract _callonERC1155Received(address(0x0), _to, _id, _amount, _data); } /** * @notice Mint tokens for each ids in _ids * @param _to The address to mint tokens to * @param _ids Array of ids to mint * @param _amounts Array of amount of tokens to mint per id * @param _data Data to pass if receiver is contract */ function _batchMint( address _to, uint256[] memory _ids, uint256[] memory _amounts, bytes memory _data ) internal { require( _ids.length == _amounts.length, "ERC1155MintBurn#batchMint: INVALID_ARRAYS_LENGTH" ); // Number of mints to execute uint256 nMint = _ids.length; // Executing all minting for (uint256 i = 0; i < nMint; i++) { // Update storage balance balances[_to][_ids[i]] = balances[_to][_ids[i]].add(_amounts[i]); } // Emit batch mint event emit TransferBatch(msg.sender, address(0x0), _to, _ids, _amounts); // Calling onReceive method if recipient is contract _callonERC1155BatchReceived(address(0x0), _to, _ids, _amounts, _data); } /****************************************| | Burning Functions | |_______________________________________*/ /** * @notice Burn _amount of tokens of a given token id * @param _from The address to burn tokens from * @param _id Token id to burn * @param _amount The amount to be burned */ function _burn( address _from, uint256 _id, uint256 _amount ) internal { //Substract _amount balances[_from][_id] = balances[_from][_id].sub(_amount); // Emit event emit TransferSingle(msg.sender, _from, address(0x0), _id, _amount); } /** * @notice Burn tokens of given token id for each (_ids[i], _amounts[i]) pair * @param _from The address to burn tokens from * @param _ids Array of token ids to burn * @param _amounts Array of the amount to be burned */ function _batchBurn( address _from, uint256[] memory _ids, uint256[] memory _amounts ) internal { require( _ids.length == _amounts.length, "ERC1155MintBurn#batchBurn: INVALID_ARRAYS_LENGTH" ); // Number of mints to execute uint256 nBurn = _ids.length; // Executing all minting for (uint256 i = 0; i < nBurn; i++) { // Update storage balance balances[_from][_ids[i]] = balances[_from][_ids[i]].sub( _amounts[i] ); } // Emit batch mint event emit TransferBatch(msg.sender, _from, address(0x0), _ids, _amounts); } } // Part: ERC1155Tradable /** * @title ERC1155Tradable * ERC1155Tradable - ERC1155 contract that whitelists an operator address, * has create and mint functionality, and supports useful standards from OpenZeppelin, like _exists(), name(), symbol(), and totalSupply() */ contract ERC1155Tradable is ERC1155, ERC1155MintBurn, ERC1155Metadata, Ownable, MinterRole, WhitelistAdminRole { using Strings for string; address proxyRegistryAddress; uint256 private _currentTokenID = 0; mapping(uint256 => address) public creators; mapping(uint256 => uint256) public tokenSupply; mapping(uint256 => uint256) public tokenMaxSupply; // Contract name string public name; // Contract symbol string public symbol; constructor( string memory _name, string memory _symbol, address _proxyRegistryAddress ) public { name = _name; symbol = _symbol; proxyRegistryAddress = _proxyRegistryAddress; } function removeWhitelistAdmin(address account) public onlyOwner { _removeWhitelistAdmin(account); } function removeMinter(address account) public onlyOwner { _removeMinter(account); } function uri(uint256 _id) public view returns (string memory) { require(_exists(_id), "ERC721Tradable#uri: NONEXISTENT_TOKEN"); return Strings.strConcat(baseMetadataURI, Strings.uint2str(_id)); } /** * @dev Returns the total quantity for a token ID * @param _id uint256 ID of the token to query * @return amount of token in existence */ function totalSupply(uint256 _id) public view returns (uint256) { return tokenSupply[_id]; } /** * @dev Returns the max quantity for a token ID * @param _id uint256 ID of the token to query * @return amount of token in existence */ function maxSupply(uint256 _id) public view returns (uint256) { return tokenMaxSupply[_id]; } /** * @dev Will update the base URL of token's URI * @param _newBaseMetadataURI New base URL of token's URI */ function setBaseMetadataURI(string memory _newBaseMetadataURI) public onlyWhitelistAdmin { _setBaseMetadataURI(_newBaseMetadataURI); } /** * @dev Creates a new token type and assigns _initialSupply to an address * @param _maxSupply max supply allowed * @param _initialSupply Optional amount to supply the first owner * @param _uri Optional URI for this token type * @param _data Optional data to pass if receiver is contract * @return The newly created token ID */ function create( uint256 _maxSupply, uint256 _initialSupply, string calldata _uri, bytes calldata _data ) external onlyWhitelistAdmin returns (uint256 tokenId) { require( _initialSupply <= _maxSupply, "Initial supply cannot be more than max supply" ); uint256 _id = _getNextTokenID(); _incrementTokenTypeId(); creators[_id] = msg.sender; if (bytes(_uri).length > 0) { emit URI(_uri, _id); } if (_initialSupply != 0) _mint(msg.sender, _id, _initialSupply, _data); tokenSupply[_id] = _initialSupply; tokenMaxSupply[_id] = _maxSupply; return _id; } /** * @dev Mints some amount of tokens to an address * @param _to Address of the future owner of the token * @param _id Token ID to mint * @param _quantity Amount of tokens to mint * @param _data Data to pass if receiver is contract */ function mint( address _to, uint256 _id, uint256 _quantity, bytes memory _data ) public onlyMinter { uint256 tokenId = _id; require( tokenSupply[tokenId] < tokenMaxSupply[tokenId], "Max supply reached" ); _mint(_to, _id, _quantity, _data); tokenSupply[_id] = tokenSupply[_id].add(_quantity); } /** * Override isApprovedForAll to whitelist user's OpenSea proxy accounts to enable gas-free listings. */ function isApprovedForAll(address _owner, address _operator) public view returns (bool isOperator) { // Whitelist OpenSea proxy contract for easy trading. ProxyRegistry proxyRegistry = ProxyRegistry(proxyRegistryAddress); if (address(proxyRegistry.proxies(_owner)) == _operator) { return true; } return ERC1155.isApprovedForAll(_owner, _operator); } /** * @dev Returns whether the specified token exists by checking to see if it has a creator * @param _id uint256 ID of the token to query the existence of * @return bool whether the token exists */ function _exists(uint256 _id) internal view returns (bool) { return creators[_id] != address(0); } /** * @dev calculates the next token ID based on value of _currentTokenID * @return uint256 for the next token ID */ function _getNextTokenID() private view returns (uint256) { return _currentTokenID.add(1); } /** * @dev increments the value of _currentTokenID */ function _incrementTokenTypeId() private { _currentTokenID++; } } // File: StakedaoNFTPalace.sol contract StakeDaoNFTPalace is StakeTokenWrapper, Ownable { ERC1155Tradable public nft; mapping(address => uint256) public lastUpdateTime; mapping(address => uint256) public points; mapping(uint256 => uint256) public cards; event CardAdded(uint256 card, uint256 points); event Staked(address indexed user, uint256 amount); event Withdrawn(address indexed user, uint256 amount); event Redeemed(address indexed user, uint256 id); event NFTSet(ERC1155Tradable indexed newNFT); modifier updateReward(address account) { if (account != address(0)) { points[account] = earned(account); lastUpdateTime[account] = block.timestamp; } _; } constructor(ERC1155Tradable _nftAddress, IERC20 _xsdt) public StakeTokenWrapper(_xsdt) { nft = _nftAddress; } function setNFT(ERC1155Tradable _nftAddress) public onlyOwner { nft = _nftAddress; emit NFTSet(_nftAddress); } function addCard(uint256 cardId, uint256 amount) public onlyOwner { cards[cardId] = amount; emit CardAdded(cardId, amount); } function earned(address account) public view returns (uint256) { uint256 timeDifference = block.timestamp.sub(lastUpdateTime[account]); uint256 balance = balanceOf(account); uint256 decimals = 1e18; uint256 x = balance / decimals; uint256 ratePerMin = decimals.mul(x).div(x.add(12000)).div(240); return points[account].add(ratePerMin.mul(timeDifference)); } // stake visibility is public as overriding StakeTokenWrapper's stake() function function stake(uint256 amount) public updateReward(msg.sender) { require(amount > 0, "Invalid amount"); super.stake(amount); emit Staked(msg.sender, amount); } function withdraw(uint256 amount) public updateReward(msg.sender) { require(amount > 0, "Cannot withdraw 0"); super.withdraw(amount); emit Withdrawn(msg.sender, amount); } function exit() external { withdraw(balanceOf(msg.sender)); } function redeem(uint256 card) public updateReward(msg.sender) { require(cards[card] != 0, "Card not found"); require( points[msg.sender] >= cards[card], "Not enough points to redeem for card" ); require( nft.totalSupply(card) < nft.maxSupply(card), "Max cards minted" ); points[msg.sender] = points[msg.sender].sub(cards[card]); nft.mint(msg.sender, card, 1, ""); emit Redeemed(msg.sender, card); } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"contract ERC1155Tradable","name":"_nftAddress","type":"address"},{"internalType":"contract IERC20","name":"_xsdt","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"card","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"points","type":"uint256"}],"name":"CardAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract ERC1155Tradable","name":"newNFT","type":"address"}],"name":"NFTSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"}],"name":"Redeemed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Staked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdrawn","type":"event"},{"constant":false,"inputs":[{"internalType":"uint256","name":"cardId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"addCard","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"cards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"earned","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"exit","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"isOwner","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"lastUpdateTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"nft","outputs":[{"internalType":"contract ERC1155Tradable","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"points","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"card","type":"uint256"}],"name":"redeem","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"renounceOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"contract ERC1155Tradable","name":"_nftAddress","type":"address"}],"name":"setNFT","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"stake","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"xsdt","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b506040516111193803806111198339818101604052604081101561003357600080fd5b508051602090910151600080546001600160a01b0319166001600160a01b03831617815561005f6100d3565b600380546001600160a01b0319166001600160a01b038316908117909155604051919250906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a35050600480546001600160a01b0319166001600160a01b03929092169190911790556100d7565b3390565b611033806100e66000396000f3fe608060405234801561001057600080fd5b50600436106101155760003560e01c80638dc10768116100a2578063db006a7511610071578063db006a751461027d578063e9fad8ee1461029a578063ea4a294f146102a2578063f2fde38b146102c5578063f56e9c66146102eb57610115565b80638dc107681461021f5780638f32d59b1461023c5780639ed3c04d14610258578063a694fc3a1461026057610115565b8063358b8166116100e9578063358b81661461019f57806347ccca02146101c557806370a08231146101e9578063715018a61461020f5780638da5cb5b1461021757610115565b80628cc2621461011a57806318160ddd146101525780632ce9aead1461015a5780632e1a7d4d14610180575b600080fd5b6101406004803603602081101561013057600080fd5b50356001600160a01b0316610311565b60408051918252519081900360200190f35b6101406103cf565b6101406004803603602081101561017057600080fd5b50356001600160a01b03166103d5565b61019d6004803603602081101561019657600080fd5b50356103e7565b005b610140600480360360208110156101b557600080fd5b50356001600160a01b03166104ab565b6101cd6104bd565b604080516001600160a01b039092168252519081900360200190f35b610140600480360360208110156101ff57600080fd5b50356001600160a01b03166104cc565b61019d6104e7565b6101cd610578565b6101406004803603602081101561023557600080fd5b5035610587565b610244610599565b604080519115158252519081900360200190f35b6101cd6105bf565b61019d6004803603602081101561027657600080fd5b50356105ce565b61019d6004803603602081101561029357600080fd5b503561068f565b61019d61099a565b61019d600480360360408110156102b857600080fd5b50803590602001356109ad565b61019d600480360360208110156102db57600080fd5b50356001600160a01b0316610a45565b61019d6004803603602081101561030157600080fd5b50356001600160a01b0316610a98565b6001600160a01b038116600090815260056020526040812054819061033d90429063ffffffff610b2916565b9050600061034a846104cc565b9050670de0b6b3a7640000808204600061038a60f061037e61036e85612ee0610b74565b61037e878763ffffffff610bce16565b9063ffffffff610c2716565b90506103c461039f828763ffffffff610bce16565b6001600160a01b0389166000908152600660205260409020549063ffffffff610b7416565b979650505050505050565b60015490565b60056020526000908152604090205481565b33801561041f576103f781610311565b6001600160a01b03821660009081526006602090815260408083209390935560059052204290555b60008211610468576040805162461bcd60e51b8152602060048201526011602482015270043616e6e6f74207769746864726177203607c1b604482015290519081900360640190fd5b61047182610c69565b60408051838152905133917f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5919081900360200190a25050565b60066020526000908152604090205481565b6004546001600160a01b031681565b6001600160a01b031660009081526002602052604090205490565b6104ef610599565b61052e576040805162461bcd60e51b81526020600482018190526024820152600080516020610fdf833981519152604482015290519081900360640190fd5b6003546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600380546001600160a01b0319169055565b6003546001600160a01b031690565b60076020526000908152604090205481565b6003546000906001600160a01b03166105b0610d32565b6001600160a01b031614905090565b6000546001600160a01b031681565b338015610606576105de81610311565b6001600160a01b03821660009081526006602090815260408083209390935560059052204290555b6000821161064c576040805162461bcd60e51b815260206004820152600e60248201526d125b9d985b1a5908185b5bdd5b9d60921b604482015290519081900360640190fd5b61065582610d36565b60408051838152905133917f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d919081900360200190a25050565b3380156106c75761069f81610311565b6001600160a01b03821660009081526006602090815260408083209390935560059052204290555b600082815260076020526040902054610718576040805162461bcd60e51b815260206004820152600e60248201526d10d85c99081b9bdd08199bdd5b9960921b604482015290519081900360640190fd5b60008281526007602090815260408083205433845260069092529091205410156107735760405162461bcd60e51b8152600401808060200182810382526024815260200180610f746024913960400191505060405180910390fd5b60048054604080516321a7dd6560e21b8152928301859052516001600160a01b039091169163869f7594916024808301926020929190829003018186803b1580156107bd57600080fd5b505afa1580156107d1573d6000803e3d6000fd5b505050506040513d60208110156107e757600080fd5b5051600480546040805163bd85b03960e01b8152928301869052516001600160a01b039091169163bd85b039916024808301926020929190829003018186803b15801561083357600080fd5b505afa158015610847573d6000803e3d6000fd5b505050506040513d602081101561085d57600080fd5b5051106108a4576040805162461bcd60e51b815260206004820152601060248201526f13585e0818d85c991cc81b5a5b9d195960821b604482015290519081900360640190fd5b6000828152600760209081526040808320543384526006909252909120546108d19163ffffffff610b2916565b336000818152600660205260408082209390935560048054845163731133e960e01b8152918201939093526024810186905260016044820152608060648201526084810182905292516001600160a01b039092169263731133e99260c4808301939282900301818387803b15801561094857600080fd5b505af115801561095c573d6000803e3d6000fd5b50506040805185815290513393507f4896181ff8f4543cc00db9fe9b6fb7e6f032b7eb772c72ab1ec1b4d2e03b936992509081900360200190a25050565b6109ab6109a6336104cc565b6103e7565b565b6109b5610599565b6109f4576040805162461bcd60e51b81526020600482018190526024820152600080516020610fdf833981519152604482015290519081900360640190fd5b600082815260076020908152604091829020839055815184815290810183905281517f62399d91d89d6e694d41e47f3e6010c0e0b4ec78ecdddb1c02d0e321780859b0929181900390910190a15050565b610a4d610599565b610a8c576040805162461bcd60e51b81526020600482018190526024820152600080516020610fdf833981519152604482015290519081900360640190fd5b610a9581610dd6565b50565b610aa0610599565b610adf576040805162461bcd60e51b81526020600482018190526024820152600080516020610fdf833981519152604482015290519081900360640190fd5b600480546001600160a01b0319166001600160a01b0383169081179091556040517f75fc4fdf6d5e94402ecc584683c37c192cfde2ea99b612d59a6864204919c7e490600090a250565b6000610b6b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610e77565b90505b92915050565b600082820183811015610b6b576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600082610bdd57506000610b6e565b82820282848281610bea57fe5b0414610b6b5760405162461bcd60e51b8152600401808060200182810382526021815260200180610fbe6021913960400191505060405180910390fd5b6000610b6b83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610f0e565b600154610c7c908263ffffffff610b2916565b60015533600090815260026020526040902054610c9f908263ffffffff610b2916565b336000818152600260209081526040808320949094558154845163a9059cbb60e01b815260048101949094526024840186905293516001600160a01b039094169363a9059cbb93604480820194918390030190829087803b158015610d0357600080fd5b505af1158015610d17573d6000803e3d6000fd5b505050506040513d6020811015610d2d57600080fd5b505050565b3390565b600154610d49908263ffffffff610b7416565b60015533600090815260026020526040902054610d6c908263ffffffff610b7416565b33600081815260026020908152604080832094909455815484516323b872dd60e01b815260048101949094523060248501526044840186905293516001600160a01b03909416936323b872dd93606480820194918390030190829087803b158015610d0357600080fd5b6001600160a01b038116610e1b5760405162461bcd60e51b8152600401808060200182810382526026815260200180610f986026913960400191505060405180910390fd5b6003546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600380546001600160a01b0319166001600160a01b0392909216919091179055565b60008184841115610f065760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610ecb578181015183820152602001610eb3565b50505050905090810190601f168015610ef85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b60008183610f5d5760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315610ecb578181015183820152602001610eb3565b506000838581610f6957fe5b049594505050505056fe4e6f7420656e6f75676820706f696e747320746f2072656465656d20666f7220636172644f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a265627a7a72315820f39f8f71912a3f2a0eb99dedb5d96e4179975f70f1d62d9795227bf13c2973fb64736f6c63430005110032000000000000000000000000dd4f84e4f3cd31d6c91d80122b5a26cb4ae66bd5000000000000000000000000ac14864ce5a98af3248ffbf549441b04421247d3
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101155760003560e01c80638dc10768116100a2578063db006a7511610071578063db006a751461027d578063e9fad8ee1461029a578063ea4a294f146102a2578063f2fde38b146102c5578063f56e9c66146102eb57610115565b80638dc107681461021f5780638f32d59b1461023c5780639ed3c04d14610258578063a694fc3a1461026057610115565b8063358b8166116100e9578063358b81661461019f57806347ccca02146101c557806370a08231146101e9578063715018a61461020f5780638da5cb5b1461021757610115565b80628cc2621461011a57806318160ddd146101525780632ce9aead1461015a5780632e1a7d4d14610180575b600080fd5b6101406004803603602081101561013057600080fd5b50356001600160a01b0316610311565b60408051918252519081900360200190f35b6101406103cf565b6101406004803603602081101561017057600080fd5b50356001600160a01b03166103d5565b61019d6004803603602081101561019657600080fd5b50356103e7565b005b610140600480360360208110156101b557600080fd5b50356001600160a01b03166104ab565b6101cd6104bd565b604080516001600160a01b039092168252519081900360200190f35b610140600480360360208110156101ff57600080fd5b50356001600160a01b03166104cc565b61019d6104e7565b6101cd610578565b6101406004803603602081101561023557600080fd5b5035610587565b610244610599565b604080519115158252519081900360200190f35b6101cd6105bf565b61019d6004803603602081101561027657600080fd5b50356105ce565b61019d6004803603602081101561029357600080fd5b503561068f565b61019d61099a565b61019d600480360360408110156102b857600080fd5b50803590602001356109ad565b61019d600480360360208110156102db57600080fd5b50356001600160a01b0316610a45565b61019d6004803603602081101561030157600080fd5b50356001600160a01b0316610a98565b6001600160a01b038116600090815260056020526040812054819061033d90429063ffffffff610b2916565b9050600061034a846104cc565b9050670de0b6b3a7640000808204600061038a60f061037e61036e85612ee0610b74565b61037e878763ffffffff610bce16565b9063ffffffff610c2716565b90506103c461039f828763ffffffff610bce16565b6001600160a01b0389166000908152600660205260409020549063ffffffff610b7416565b979650505050505050565b60015490565b60056020526000908152604090205481565b33801561041f576103f781610311565b6001600160a01b03821660009081526006602090815260408083209390935560059052204290555b60008211610468576040805162461bcd60e51b8152602060048201526011602482015270043616e6e6f74207769746864726177203607c1b604482015290519081900360640190fd5b61047182610c69565b60408051838152905133917f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5919081900360200190a25050565b60066020526000908152604090205481565b6004546001600160a01b031681565b6001600160a01b031660009081526002602052604090205490565b6104ef610599565b61052e576040805162461bcd60e51b81526020600482018190526024820152600080516020610fdf833981519152604482015290519081900360640190fd5b6003546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600380546001600160a01b0319169055565b6003546001600160a01b031690565b60076020526000908152604090205481565b6003546000906001600160a01b03166105b0610d32565b6001600160a01b031614905090565b6000546001600160a01b031681565b338015610606576105de81610311565b6001600160a01b03821660009081526006602090815260408083209390935560059052204290555b6000821161064c576040805162461bcd60e51b815260206004820152600e60248201526d125b9d985b1a5908185b5bdd5b9d60921b604482015290519081900360640190fd5b61065582610d36565b60408051838152905133917f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d919081900360200190a25050565b3380156106c75761069f81610311565b6001600160a01b03821660009081526006602090815260408083209390935560059052204290555b600082815260076020526040902054610718576040805162461bcd60e51b815260206004820152600e60248201526d10d85c99081b9bdd08199bdd5b9960921b604482015290519081900360640190fd5b60008281526007602090815260408083205433845260069092529091205410156107735760405162461bcd60e51b8152600401808060200182810382526024815260200180610f746024913960400191505060405180910390fd5b60048054604080516321a7dd6560e21b8152928301859052516001600160a01b039091169163869f7594916024808301926020929190829003018186803b1580156107bd57600080fd5b505afa1580156107d1573d6000803e3d6000fd5b505050506040513d60208110156107e757600080fd5b5051600480546040805163bd85b03960e01b8152928301869052516001600160a01b039091169163bd85b039916024808301926020929190829003018186803b15801561083357600080fd5b505afa158015610847573d6000803e3d6000fd5b505050506040513d602081101561085d57600080fd5b5051106108a4576040805162461bcd60e51b815260206004820152601060248201526f13585e0818d85c991cc81b5a5b9d195960821b604482015290519081900360640190fd5b6000828152600760209081526040808320543384526006909252909120546108d19163ffffffff610b2916565b336000818152600660205260408082209390935560048054845163731133e960e01b8152918201939093526024810186905260016044820152608060648201526084810182905292516001600160a01b039092169263731133e99260c4808301939282900301818387803b15801561094857600080fd5b505af115801561095c573d6000803e3d6000fd5b50506040805185815290513393507f4896181ff8f4543cc00db9fe9b6fb7e6f032b7eb772c72ab1ec1b4d2e03b936992509081900360200190a25050565b6109ab6109a6336104cc565b6103e7565b565b6109b5610599565b6109f4576040805162461bcd60e51b81526020600482018190526024820152600080516020610fdf833981519152604482015290519081900360640190fd5b600082815260076020908152604091829020839055815184815290810183905281517f62399d91d89d6e694d41e47f3e6010c0e0b4ec78ecdddb1c02d0e321780859b0929181900390910190a15050565b610a4d610599565b610a8c576040805162461bcd60e51b81526020600482018190526024820152600080516020610fdf833981519152604482015290519081900360640190fd5b610a9581610dd6565b50565b610aa0610599565b610adf576040805162461bcd60e51b81526020600482018190526024820152600080516020610fdf833981519152604482015290519081900360640190fd5b600480546001600160a01b0319166001600160a01b0383169081179091556040517f75fc4fdf6d5e94402ecc584683c37c192cfde2ea99b612d59a6864204919c7e490600090a250565b6000610b6b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610e77565b90505b92915050565b600082820183811015610b6b576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600082610bdd57506000610b6e565b82820282848281610bea57fe5b0414610b6b5760405162461bcd60e51b8152600401808060200182810382526021815260200180610fbe6021913960400191505060405180910390fd5b6000610b6b83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610f0e565b600154610c7c908263ffffffff610b2916565b60015533600090815260026020526040902054610c9f908263ffffffff610b2916565b336000818152600260209081526040808320949094558154845163a9059cbb60e01b815260048101949094526024840186905293516001600160a01b039094169363a9059cbb93604480820194918390030190829087803b158015610d0357600080fd5b505af1158015610d17573d6000803e3d6000fd5b505050506040513d6020811015610d2d57600080fd5b505050565b3390565b600154610d49908263ffffffff610b7416565b60015533600090815260026020526040902054610d6c908263ffffffff610b7416565b33600081815260026020908152604080832094909455815484516323b872dd60e01b815260048101949094523060248501526044840186905293516001600160a01b03909416936323b872dd93606480820194918390030190829087803b158015610d0357600080fd5b6001600160a01b038116610e1b5760405162461bcd60e51b8152600401808060200182810382526026815260200180610f986026913960400191505060405180910390fd5b6003546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600380546001600160a01b0319166001600160a01b0392909216919091179055565b60008184841115610f065760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610ecb578181015183820152602001610eb3565b50505050905090810190601f168015610ef85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b60008183610f5d5760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315610ecb578181015183820152602001610eb3565b506000838581610f6957fe5b049594505050505056fe4e6f7420656e6f75676820706f696e747320746f2072656465656d20666f7220636172644f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a265627a7a72315820f39f8f71912a3f2a0eb99dedb5d96e4179975f70f1d62d9795227bf13c2973fb64736f6c63430005110032
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000dd4f84e4f3cd31d6c91d80122b5a26cb4ae66bd5000000000000000000000000ac14864ce5a98af3248ffbf549441b04421247d3
-----Decoded View---------------
Arg [0] : _nftAddress (address): 0xDD4f84e4f3cd31d6c91d80122b5a26Cb4ae66BD5
Arg [1] : _xsdt (address): 0xaC14864ce5A98aF3248Ffbf549441b04421247D3
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000dd4f84e4f3cd31d6c91d80122b5a26cb4ae66bd5
Arg [1] : 000000000000000000000000ac14864ce5a98af3248ffbf549441b04421247d3
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|---|---|---|---|---|
ETH | 100.00% | $0.595635 | 1,571.6817 | $936.15 |
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.