Contract 0xd300322832765fee6b910d314f2c2d879427226f 8
Contract Overview
My Name Tag:
Not Available
[ Download CSV Export ]
Latest 25 internal transaction
[ Download CSV Export ]
Contract Name:
TreasuryStake
Compiler Version
v0.8.7+commit.e28d00a7
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC1155 compliant contract, as defined in the * https://eips.ethereum.org/EIPS/eip-1155[EIP]. * * _Available since v3.1._ */ interface IERC1155 is IERC165 { /** * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`. */ event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value); /** * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all * transfers. */ event TransferBatch( address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values ); /** * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to * `approved`. */ event ApprovalForAll(address indexed account, address indexed operator, bool approved); /** * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI. * * If an {URI} event was emitted for `id`, the standard * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value * returned by {IERC1155MetadataURI-uri}. */ event URI(string value, uint256 indexed id); /** * @dev Returns the amount of tokens of token type `id` owned by `account`. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) external view returns (uint256); /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids) external view returns (uint256[] memory); /** * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`, * * Emits an {ApprovalForAll} event. * * Requirements: * * - `operator` cannot be the caller. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns true if `operator` is approved to transfer ``account``'s tokens. * * See {setApprovalForAll}. */ function isApprovedForAll(address account, address operator) external view returns (bool); /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If the caller is not `from`, it must be have been approved to spend ``from``'s tokens via {setApprovalForAll}. * - `from` must have a balance of tokens of type `id` of at least `amount`. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes calldata data ) external; /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `amounts` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function safeBatchTransferFrom( address from, address to, uint256[] calldata ids, uint256[] calldata amounts, bytes calldata data ) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev _Available since v3.1._ */ interface IERC1155Receiver is IERC165 { /** @dev Handles the receipt of a single ERC1155 token type. This function is called at the end of a `safeTransferFrom` after the balance has been updated. To accept the transfer, this must return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` (i.e. 0xf23a6e61, or its own function selector). @param operator The address which initiated the transfer (i.e. msg.sender) @param from The address which previously owned the token @param id The ID of the token being transferred @param value The amount of tokens being transferred @param data Additional data with no specified format @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed */ function onERC1155Received( address operator, address from, uint256 id, uint256 value, bytes calldata data ) external returns (bytes4); /** @dev Handles the receipt of a multiple ERC1155 token types. This function is called at the end of a `safeBatchTransferFrom` after the balances have been updated. To accept the transfer(s), this must return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` (i.e. 0xbc197c81, or its own function selector). @param operator The address which initiated the batch transfer (i.e. msg.sender) @param from The address which previously owned the token @param ids An array containing ids of each token being transferred (order and length must match values array) @param values An array containing amounts of each token being transferred (order and length must match ids array) @param data Additional data with no specified format @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed */ function onERC1155BatchReceived( address operator, address from, uint256[] calldata ids, uint256[] calldata values, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./ERC1155Receiver.sol"; /** * @dev _Available since v3.1._ */ contract ERC1155Holder is ERC1155Receiver { function onERC1155Received( address, address, uint256, uint256, bytes memory ) public virtual override returns (bytes4) { return this.onERC1155Received.selector; } function onERC1155BatchReceived( address, address, uint256[] memory, uint256[] memory, bytes memory ) public virtual override returns (bytes4) { return this.onERC1155BatchReceived.selector; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../IERC1155Receiver.sol"; import "../../../utils/introspection/ERC165.sol"; /** * @dev _Available since v3.1._ */ abstract contract ERC1155Receiver is ERC165, IERC1155Receiver { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC1155Receiver).interfaceId || super.supportsInterface(interfaceId); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IERC20.sol"; import "./extensions/IERC20Metadata.sol"; import "../../utils/Context.sol"; /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin Contracts guidelines: functions revert * instead returning `false` on failure. This behavior is nonetheless * conventional and does not conflict with the expectations of ERC20 * applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20 is Context, IERC20, IERC20Metadata { mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * The default value of {decimals} is 18. To select a different value for * {decimals} you should overload it. * * All two of these values are immutable: they can only be set once during * construction. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev Returns the name of the token. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5.05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless this function is * overridden; * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual override returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * Requirements: * * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. * - the caller must have allowance for ``sender``'s tokens of at least * `amount`. */ function transferFrom( address sender, address recipient, uint256 amount ) public virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); unchecked { _approve(sender, _msgSender(), currentAllowance - amount); } return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { uint256 currentAllowance = _allowances[_msgSender()][spender]; require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); unchecked { _approve(_msgSender(), spender, currentAllowance - subtractedValue); } return true; } /** * @dev Moves `amount` of tokens from `sender` to `recipient`. * * This internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer( address sender, address recipient, uint256 amount ) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[sender] = senderBalance - amount; } _balances[recipient] += amount; emit Transfer(sender, recipient, amount); _afterTokenTransfer(sender, recipient, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); _afterTokenTransfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); unchecked { _balances[account] = accountBalance - amount; } _totalSupply -= amount; emit Transfer(account, address(0), amount); _afterTokenTransfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve( address owner, address spender, uint256 amount ) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 amount ) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * has been transferred to `to`. * - when `from` is zero, `amount` tokens have been minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens have been burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 amount ) internal virtual {} }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.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.8.0; import "../IERC20.sol"; /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../IERC20.sol"; import "../../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; function safeTransfer( IERC20 token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom( IERC20 token, address from, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove( IERC20 token, address spender, uint256 value ) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance( IERC20 token, address spender, uint256 value ) internal { uint256 newAllowance = token.allowance(address(this), spender) + value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance( IERC20 token, address spender, uint256 value ) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); uint256 newAllowance = oldAllowance - value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @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 on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; 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"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Wrappers over Solidity's uintXX/intXX casting operators with added overflow * checks. * * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can * easily result in undesired exploitation or bugs, since developers usually * assume that overflows raise errors. `SafeCast` restores this intuition by * reverting the transaction when such 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. * * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing * all math on `uint256` and `int256` and then downcasting. */ library SafeCast { /** * @dev Returns the downcasted uint224 from uint256, reverting on * overflow (when the input is greater than largest uint224). * * Counterpart to Solidity's `uint224` operator. * * Requirements: * * - input must fit into 224 bits */ function toUint224(uint256 value) internal pure returns (uint224) { require(value <= type(uint224).max, "SafeCast: value doesn't fit in 224 bits"); return uint224(value); } /** * @dev Returns the downcasted uint128 from uint256, reverting on * overflow (when the input is greater than largest uint128). * * Counterpart to Solidity's `uint128` operator. * * Requirements: * * - input must fit into 128 bits */ function toUint128(uint256 value) internal pure returns (uint128) { require(value <= type(uint128).max, "SafeCast: value doesn't fit in 128 bits"); return uint128(value); } /** * @dev Returns the downcasted uint96 from uint256, reverting on * overflow (when the input is greater than largest uint96). * * Counterpart to Solidity's `uint96` operator. * * Requirements: * * - input must fit into 96 bits */ function toUint96(uint256 value) internal pure returns (uint96) { require(value <= type(uint96).max, "SafeCast: value doesn't fit in 96 bits"); return uint96(value); } /** * @dev Returns the downcasted uint64 from uint256, reverting on * overflow (when the input is greater than largest uint64). * * Counterpart to Solidity's `uint64` operator. * * Requirements: * * - input must fit into 64 bits */ function toUint64(uint256 value) internal pure returns (uint64) { require(value <= type(uint64).max, "SafeCast: value doesn't fit in 64 bits"); return uint64(value); } /** * @dev Returns the downcasted uint32 from uint256, reverting on * overflow (when the input is greater than largest uint32). * * Counterpart to Solidity's `uint32` operator. * * Requirements: * * - input must fit into 32 bits */ function toUint32(uint256 value) internal pure returns (uint32) { require(value <= type(uint32).max, "SafeCast: value doesn't fit in 32 bits"); return uint32(value); } /** * @dev Returns the downcasted uint16 from uint256, reverting on * overflow (when the input is greater than largest uint16). * * Counterpart to Solidity's `uint16` operator. * * Requirements: * * - input must fit into 16 bits */ function toUint16(uint256 value) internal pure returns (uint16) { require(value <= type(uint16).max, "SafeCast: value doesn't fit in 16 bits"); return uint16(value); } /** * @dev Returns the downcasted uint8 from uint256, reverting on * overflow (when the input is greater than largest uint8). * * Counterpart to Solidity's `uint8` operator. * * Requirements: * * - input must fit into 8 bits. */ function toUint8(uint256 value) internal pure returns (uint8) { require(value <= type(uint8).max, "SafeCast: value doesn't fit in 8 bits"); return uint8(value); } /** * @dev Converts a signed int256 into an unsigned uint256. * * Requirements: * * - input must be greater than or equal to 0. */ function toUint256(int256 value) internal pure returns (uint256) { require(value >= 0, "SafeCast: value must be positive"); return uint256(value); } /** * @dev Returns the downcasted int128 from int256, reverting on * overflow (when the input is less than smallest int128 or * greater than largest int128). * * Counterpart to Solidity's `int128` operator. * * Requirements: * * - input must fit into 128 bits * * _Available since v3.1._ */ function toInt128(int256 value) internal pure returns (int128) { require(value >= type(int128).min && value <= type(int128).max, "SafeCast: value doesn't fit in 128 bits"); return int128(value); } /** * @dev Returns the downcasted int64 from int256, reverting on * overflow (when the input is less than smallest int64 or * greater than largest int64). * * Counterpart to Solidity's `int64` operator. * * Requirements: * * - input must fit into 64 bits * * _Available since v3.1._ */ function toInt64(int256 value) internal pure returns (int64) { require(value >= type(int64).min && value <= type(int64).max, "SafeCast: value doesn't fit in 64 bits"); return int64(value); } /** * @dev Returns the downcasted int32 from int256, reverting on * overflow (when the input is less than smallest int32 or * greater than largest int32). * * Counterpart to Solidity's `int32` operator. * * Requirements: * * - input must fit into 32 bits * * _Available since v3.1._ */ function toInt32(int256 value) internal pure returns (int32) { require(value >= type(int32).min && value <= type(int32).max, "SafeCast: value doesn't fit in 32 bits"); return int32(value); } /** * @dev Returns the downcasted int16 from int256, reverting on * overflow (when the input is less than smallest int16 or * greater than largest int16). * * Counterpart to Solidity's `int16` operator. * * Requirements: * * - input must fit into 16 bits * * _Available since v3.1._ */ function toInt16(int256 value) internal pure returns (int16) { require(value >= type(int16).min && value <= type(int16).max, "SafeCast: value doesn't fit in 16 bits"); return int16(value); } /** * @dev Returns the downcasted int8 from int256, reverting on * overflow (when the input is less than smallest int8 or * greater than largest int8). * * Counterpart to Solidity's `int8` operator. * * Requirements: * * - input must fit into 8 bits. * * _Available since v3.1._ */ function toInt8(int256 value) internal pure returns (int8) { require(value >= type(int8).min && value <= type(int8).max, "SafeCast: value doesn't fit in 8 bits"); return int8(value); } /** * @dev Converts an unsigned uint256 into a signed int256. * * Requirements: * * - input must be less than or equal to maxInt256. */ function toInt256(uint256 value) internal pure returns (int256) { // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive require(value <= uint256(type(int256).max), "SafeCast: value doesn't fit in an int256"); return int256(value); } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.7; import '@openzeppelin/contracts/token/ERC20/ERC20.sol'; import '@openzeppelin/contracts/token/ERC1155/IERC1155.sol'; import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol'; import '@openzeppelin/contracts/utils/math/SafeCast.sol'; import '@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol'; contract TreasuryStake is ERC1155Holder { using SafeERC20 for ERC20; using SafeCast for uint256; using SafeCast for int256; uint256 public constant DAY = 60 * 60 * 24; uint256 public constant ONE_WEEK = DAY * 7; uint256 public constant TWO_WEEKS = ONE_WEEK * 2; uint256 public constant ONE_MONTH = DAY * 30; uint256 public constant THREE_MONTHS = ONE_MONTH * 3; uint256 public constant LIFECYCLE = THREE_MONTHS; uint256 public constant ONE = 1e18; // Magic token addr ERC20 public immutable magic; IERC1155 public immutable lpToken; uint256 public totalRewardsEarned; uint256 public accMagicPerShare; uint256 public totalLpToken; uint256 public undistributedRewards; struct UserInfo { uint256 depositAmount; uint256 tokenId; uint256 lpAmount; int256 rewardDebt; } /// @notice user => tokenId => UserInfo mapping (address => mapping (uint256 => UserInfo)) public userInfo; /// @notice user => tokenId[] mapping (address => uint256[]) public allUserTokenIds; // @notice user => tokenId => index in allUserIndex mapping (address => mapping(uint256 => uint256)) public tokenIdIndex; event Deposit(address indexed user, uint256 lpAmount, uint256 tokenId, uint256 depositAmount); event Withdraw(address indexed user, uint256 tokenId, uint256 withdrawAmount); event Harvest(address indexed user, uint256 indexed index, uint256 amount); event LogUpdateRewards(uint256 lpSupply, uint256 accMagicPerShare); constructor(address _magic, address _lpToken) { magic = ERC20(_magic); lpToken = IERC1155(_lpToken); } function getLpAmount(uint256 _tokenId, uint256 _amount) public pure returns (uint256) { uint256 boost; uint256 boostDecimal = 100; if (_tokenId == 39) { // Ancient Relic 10.03 boost = 1003; } else if (_tokenId == 46) { // Bag of Rare Mushrooms 8.21 boost = 821; } else if (_tokenId == 47) { // Bait for Monsters 9.73 boost = 973; } else if (_tokenId == 48) { // Beetle-wing 1.00 boost = 100; } else if (_tokenId == 49) { // Blue Rupee 2.04 boost = 204; } else if (_tokenId == 51) { // Bottomless Elixir 10.15 boost = 1015; } else if (_tokenId == 52) { // Cap of Invisibility 10.15 boost = 1015; } else if (_tokenId == 53) { // Carriage 8.09 boost = 809; } else if (_tokenId == 54) { // Castle 9.77 boost = 977; } else if (_tokenId == 68) { // Common Bead 7.52 boost = 752; } else if (_tokenId == 69) { // Common Feather 4.50 boost = 450; } else if (_tokenId == 71) { // Common Relic 2.87 boost = 287; } else if (_tokenId == 72) { // Cow 7.74 boost = 774; } else if (_tokenId == 73) { // Diamond 1.04 boost = 104; } else if (_tokenId == 74) { // Divine Hourglass 8.46 boost = 846; } else if (_tokenId == 75) { // Divine Mask 7.62 boost = 762; } else if (_tokenId == 76) { // Donkey 1.62 boost = 162; } else if (_tokenId == 77) { // Dragon Tail 1.03 boost = 103; } else if (_tokenId == 79) { // Emerald 1.01 boost = 101; } else if (_tokenId == 82) { // Favor from the Gods 7.39 boost = 739; } else if (_tokenId == 91) { // Framed Butterfly 7.79 boost = 779; } else if (_tokenId == 92) { // Gold Coin 1.03 boost = 103; } else if (_tokenId == 93) { // Grain 4.29 boost = 429; } else if (_tokenId == 94) { // Green Rupee 4.36 boost = 436; } else if (_tokenId == 95) { // Grin 10.47 boost = 1047; } else if (_tokenId == 96) { // Half-Penny 1.05 boost = 105; } else if (_tokenId == 97) { // Honeycomb 10.52 boost = 1052; } else if (_tokenId == 98) { // Immovable Stone 9.65 boost = 965; } else if (_tokenId == 99) { // Ivory Breastpin 8.49 boost = 849; } else if (_tokenId == 100) { // Jar of Fairies 7.10 boost = 710; } else if (_tokenId == 103) { // Lumber 4.02 boost = 402; } else if (_tokenId == 104) { // Military Stipend 8.30 boost = 830; } else if (_tokenId == 105) { // Mollusk Shell 8.96 boost = 896; } else if (_tokenId == 114) { // Ox 2.12 boost = 212; } else if (_tokenId == 115) { // Pearl 1.03 boost = 103; } else if (_tokenId == 116) { // Pot of Gold 7.72 boost = 772; } else if (_tokenId == 117) { // Quarter-Penny 1.00 boost = 100; } else if (_tokenId == 132) { // Red Feather 8.51 boost = 851; } else if (_tokenId == 133) { // Red Rupee 1.03 boost = 103; } else if (_tokenId == 141) { // Score of Ivory 7.94 boost = 794; } else if (_tokenId == 151) { // Silver Coin 1.05 boost = 105; } else if (_tokenId == 152) { // Small Bird 7.98 boost = 798; } else if (_tokenId == 153) { // Snow White Feather 8.54 boost = 854; } else if (_tokenId == 161) { // Thread of Divine Silk 9.77 boost = 977; } else if (_tokenId == 162) { // Unbreakable Pocketwatch 7.91 boost = 791; } else if (_tokenId == 164) { // Witches Broom 6.76 boost = 676; } else { boost = 0; } _amount = addDecimals(_amount); return _amount + _amount * boost / boostDecimal; } function addDecimals(uint256 _amount) public pure returns (uint256) { return _amount * ONE; } function getAllUserTokenIds(address _user) public view returns (uint256[] memory) { return allUserTokenIds[_user]; } function pendingRewardsPosition(address _user, uint256 _tokenId) public view returns (uint256 pending) { UserInfo storage user = userInfo[_user][_tokenId]; pending = ((user.lpAmount * accMagicPerShare / ONE).toInt256() - user.rewardDebt).toUint256(); } function pendingRewardsAll(address _user) external view returns (uint256 pending) { uint256 len = allUserTokenIds[_user].length; for (uint256 i = 0; i < len; ++i) { uint256 tokenId = allUserTokenIds[_user][i]; pending += pendingRewardsPosition(_user, tokenId); } } function deposit(uint256 _tokenId, uint256 _amount) public { UserInfo storage user = _addDeposit(msg.sender, _tokenId); uint256 lpAmount = getLpAmount(_tokenId, _amount); totalLpToken += lpAmount; user.tokenId = _tokenId; user.depositAmount += _amount; user.lpAmount += lpAmount; user.rewardDebt += (lpAmount * accMagicPerShare / ONE).toInt256(); lpToken.safeTransferFrom(msg.sender, address(this), _tokenId, _amount, bytes("")); emit Deposit(msg.sender, lpAmount, _tokenId, _amount); } function withdrawPosition(uint256 _tokenId, uint256 _amount) public { UserInfo storage user = userInfo[msg.sender][_tokenId]; uint256 lpAmount = user.lpAmount; uint256 depositAmount = user.depositAmount; require(depositAmount > 0, "Position does not exists"); if (_amount > depositAmount) { _amount = depositAmount; } // Effects uint256 ratio = _amount * ONE / depositAmount; lpAmount = lpAmount * ratio / ONE; totalLpToken -= lpAmount; user.depositAmount -= _amount; user.lpAmount -= lpAmount; user.rewardDebt -= (lpAmount * accMagicPerShare / ONE).toInt256(); // Interactions lpToken.safeTransferFrom(address(this), msg.sender, _tokenId, _amount, bytes("")); emit Withdraw(msg.sender, _tokenId, _amount); } function withdrawAll() public { uint256[] memory tokenIds = allUserTokenIds[msg.sender]; uint256 len = tokenIds.length; for (uint256 i = 0; i < len; ++i) { uint256 tokenId = tokenIds[i]; withdrawPosition(tokenId, type(uint256).max); } } function harvestPosition(uint256 _tokenId) public { UserInfo storage user = userInfo[msg.sender][_tokenId]; int256 accumulatedMagic = (user.lpAmount * accMagicPerShare / ONE).toInt256(); uint256 _pendingMagic = (accumulatedMagic - user.rewardDebt).toUint256(); // Effects user.rewardDebt = accumulatedMagic; if (user.lpAmount == 0) { _removeDeposit(msg.sender, _tokenId); } // Interactions if (_pendingMagic != 0) { magic.safeTransfer(msg.sender, _pendingMagic); } emit Harvest(msg.sender, _tokenId, _pendingMagic); } function harvestAll() public { uint256[] memory tokenIds = allUserTokenIds[msg.sender]; uint256 len = tokenIds.length; for (uint256 i = 0; i < len; ++i) { uint256 tokenId = tokenIds[i]; harvestPosition(tokenId); } } function withdrawAndHarvestPosition(uint256 _tokenId, uint256 _amount) public { withdrawPosition(_tokenId, _amount); harvestPosition(_tokenId); } function withdrawAndHarvestAll() public { uint256[] memory tokenIds = allUserTokenIds[msg.sender]; uint256 len = tokenIds.length; for (uint256 i = 0; i < len; ++i) { uint256 tokenId = tokenIds[i]; withdrawAndHarvestPosition(tokenId, type(uint256).max); } } function notifyRewards(uint256 _amount) external { if (_amount != 0) magic.safeTransferFrom(msg.sender, address(this), _amount); _updateRewards(_amount); } function _updateRewards(uint256 _amount) internal { uint256 lpSupply = totalLpToken; if (lpSupply > 0) { uint256 magicReward = _amount + undistributedRewards; accMagicPerShare += magicReward * ONE / lpSupply; undistributedRewards = 0; } else { undistributedRewards += _amount; } emit LogUpdateRewards(lpSupply, accMagicPerShare); } function _addDeposit(address _user, uint256 _tokenId) internal returns (UserInfo storage user) { user = userInfo[_user][_tokenId]; uint256 tokenIndex = tokenIdIndex[_user][_tokenId]; if (allUserTokenIds[_user].length == 0 || allUserTokenIds[_user][tokenIndex] != _tokenId) { tokenIdIndex[_user][_tokenId] = allUserTokenIds[_user].length; allUserTokenIds[_user].push(_tokenId); } } function _removeDeposit(address _user, uint256 _tokenId) internal { uint256 tokenIndex = tokenIdIndex[_user][_tokenId]; require(allUserTokenIds[_user][tokenIndex] == _tokenId, 'tokenId !exists'); uint256 lastDepositIndex = allUserTokenIds[_user].length - 1; if (tokenIndex != lastDepositIndex) { uint256 lastDepositId = allUserTokenIds[_user][lastDepositIndex]; allUserTokenIds[_user][tokenIndex] = lastDepositId; tokenIdIndex[_user][lastDepositId] = tokenIndex; } allUserTokenIds[_user].pop(); delete tokenIdIndex[_user][_tokenId]; } }
{ "evmVersion": "london", "libraries": {}, "metadata": { "bytecodeHash": "ipfs", "useLiteralContent": true }, "optimizer": { "enabled": true, "runs": 200 }, "remappings": [], "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "abi" ] } } }
[{"inputs":[{"internalType":"address","name":"_magic","type":"address"},{"internalType":"address","name":"_lpToken","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"lpAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"depositAmount","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"index","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Harvest","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"lpSupply","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"accMagicPerShare","type":"uint256"}],"name":"LogUpdateRewards","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"withdrawAmount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"DAY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"LIFECYCLE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ONE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ONE_MONTH","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ONE_WEEK","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"THREE_MONTHS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TWO_WEEKS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"accMagicPerShare","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"addDecimals","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"allUserTokenIds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getAllUserTokenIds","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"getLpAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"harvestAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"harvestPosition","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lpToken","outputs":[{"internalType":"contract IERC1155","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"magic","outputs":[{"internalType":"contract ERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"notifyRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155BatchReceived","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"pendingRewardsAll","outputs":[{"internalType":"uint256","name":"pending","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"pendingRewardsPosition","outputs":[{"internalType":"uint256","name":"pending","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenIdIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalLpToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalRewardsEarned","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"undistributedRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"userInfo","outputs":[{"internalType":"uint256","name":"depositAmount","type":"uint256"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"lpAmount","type":"uint256"},{"internalType":"int256","name":"rewardDebt","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdrawAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawAndHarvestAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawAndHarvestPosition","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawPosition","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60c06040523480156200001157600080fd5b5060405162001f0638038062001f06833981016040819052620000349162000070565b6001600160601b0319606092831b8116608052911b1660a052620000a8565b80516001600160a01b03811681146200006b57600080fd5b919050565b600080604083850312156200008457600080fd5b6200008f8362000053565b91506200009f6020840162000053565b90509250929050565b60805160601c60a05160601c611e16620000f06000396000818161033801528181610ec00152611036015260008181610222015281816109560152610d2b0152611e166000f3fe608060405234801561001057600080fd5b50600436106101f05760003560e01c80638ed955b91161010f578063d3512cef116100a2578063ecbefab711610071578063ecbefab714610485578063f15576a61461048d578063f23a6e6114610496578063fd90904c146104b557600080fd5b8063d3512cef1461044c578063d82b99d71461045f578063e2bbb15814610472578063e8622e671461048557600080fd5b8063b32ea1d3116100de578063b32ea1d3146103d1578063bc168ecb146103fc578063bc197c8114610405578063c2ee3a081461043d57600080fd5b80638ed955b91461039b578063934d1fa4146103a35780639786608f146103ab578063a7e69fb4146103be57600080fd5b8063319ce2bb1161018757806373503857116101565780637350385714610363578063772920261461036b578063853828b61461038b5780638e6f6b771461039357600080fd5b8063319ce2bb1461031757806359fe213b146103205780635fcbd28514610333578063620572071461035a57600080fd5b806320988cef116101c357806320988cef1461029057806320f8e94e1461029857806321ce919d146102ad57806327cfe8561461030d57600080fd5b806301ffc9a7146101f55780630d8546461461021d5780631951b6981461025c578063207f10541461027d575b600080fd5b610208610203366004611ae2565b6104c8565b60405190151581526020015b60405180910390f35b6102447f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610214565b61026f61026a366004611b0c565b6104ff565b604051908152602001610214565b61026f61028b366004611b25565b610513565b61026f6108ad565b6102ab6102a6366004611b0c565b6108be565b005b6102ed6102bb366004611a96565b600460209081526000928352604080842090915290825290208054600182015460028301546003909301549192909184565b604080519485526020850193909352918301526060820152608001610214565b61026f6201518081565b61026f60035481565b61026f61032e36600461196c565b6109ba565b6102447f000000000000000000000000000000000000000000000000000000000000000081565b61026f60015481565b6102ab610a43565b61037e61037936600461196c565b610af0565b6040516102149190611bc9565b6102ab610b5c565b61026f610c04565b6102ab610c12565b61026f610cb7565b61026f6103b9366004611a96565b610cd0565b6102ab6103cc366004611b25565b610d01565b61026f6103df366004611a96565b600660209081526000928352604080842090915290825290205481565b61026f60025481565b610424610413366004611987565b63bc197c8160e01b95945050505050565b6040516001600160e01b03199091168152602001610214565b61026f670de0b6b3a764000081565b6102ab61045a366004611b0c565b610d18565b6102ab61046d366004611b25565b610d5f565b6102ab610480366004611b25565b610f71565b61026f6110ed565b61026f60005481565b6104246104a4366004611a31565b63f23a6e6160e01b95945050505050565b61026f6104c3366004611a96565b611106565b60006001600160e01b03198216630271189760e51b14806104f957506301ffc9a760e01b6001600160e01b03198316145b92915050565b60006104f9670de0b6b3a764000083611ccc565b6000806064602785141561052b576103eb915061087a565b84602e141561053e57610335915061087a565b84602f1415610551576103cd915061087a565b8460301415610563576064915061087a565b84603114156105755760cc915061087a565b8460331415610588576103f7915061087a565b846034141561059b576103f7915061087a565b84603514156105ae57610329915061087a565b84603614156105c1576103d1915061087a565b84604414156105d4576102f0915061087a565b84604514156105e7576101c2915061087a565b84604714156105fa5761011f915061087a565b846048141561060d57610306915061087a565b846049141561061f576068915061087a565b84604a14156106325761034e915061087a565b84604b1415610645576102fa915061087a565b84604c14156106575760a2915061087a565b84604d1415610669576067915061087a565b84604f141561067b576065915061087a565b846052141561068e576102e3915061087a565b84605b14156106a15761030b915061087a565b84605c14156106b3576067915061087a565b84605d14156106c6576101ad915061087a565b84605e14156106d9576101b4915061087a565b84605f14156106ec57610417915061087a565b84606014156106fe576069915061087a565b84606114156107115761041c915061087a565b8460621415610724576103c5915061087a565b846063141561073757610351915061087a565b846064141561074a576102c6915061087a565b846067141561075d57610192915061087a565b84606814156107705761033e915061087a565b846069141561078357610380915061087a565b84607214156107955760d4915061087a565b84607314156107a7576067915061087a565b84607414156107ba57610304915061087a565b84607514156107cc576064915061087a565b84608414156107df57610353915061087a565b84608514156107f1576067915061087a565b84608d14156108045761031a915061087a565b8460971415610816576069915061087a565b84609814156108295761031e915061087a565b846099141561083c57610356915061087a565b8460a1141561084f576103d1915061087a565b8460a2141561086257610317915061087a565b8460a41415610875576102a4915061087a565b600091505b610883846104ff565b9350806108908386611ccc565b61089a9190611caa565b6108a49085611c92565b95945050505050565b6108bb62015180601e611ccc565b81565b3360009081526004602090815260408083208484529091528120600154600282015491929161090a91670de0b6b3a7640000916108fb9190611ccc565b6109059190611caa565b611164565b905060006109268360030154836109219190611ceb565b6111d2565b600384018390556002840154909150610943576109433385611224565b801561097d5761097d6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633836113e5565b604051818152849033907f71bab65ced2e5750775a0613be067df48ef06cf92a496ebf7663ae06609249549060200160405180910390a350505050565b6001600160a01b038116600090815260056020526040812054815b81811015610a3c576001600160a01b0384166000908152600560205260408120805483908110610a0757610a07611db4565b90600052602060002001549050610a1e8582611106565b610a289085611c92565b93505080610a3590611d6d565b90506109d5565b5050919050565b33600090815260056020908152604080832080548251818502810185019093528083529192909190830182828015610a9a57602002820191906000526020600020905b815481526020019060010190808311610a86575b505083519394506000925050505b81811015610aeb576000838281518110610ac457610ac4611db4565b60200260200101519050610ada81600019610d01565b50610ae481611d6d565b9050610aa8565b505050565b6001600160a01b038116600090815260056020908152604091829020805483518184028101840190945280845260609392830182828015610b5057602002820191906000526020600020905b815481526020019060010190808311610b3c575b50505050509050919050565b33600090815260056020908152604080832080548251818502810185019093528083529192909190830182828015610bb357602002820191906000526020600020905b815481526020019060010190808311610b9f575b505083519394506000925050505b81811015610aeb576000838281518110610bdd57610bdd611db4565b60200260200101519050610bf381600019610d5f565b50610bfd81611d6d565b9050610bc1565b6108bb620151806007611ccc565b33600090815260056020908152604080832080548251818502810185019093528083529192909190830182828015610c6957602002820191906000526020600020905b815481526020019060010190808311610c55575b505083519394506000925050505b81811015610aeb576000838281518110610c9357610c93611db4565b60200260200101519050610ca6816108be565b50610cb081611d6d565b9050610c77565b610cc5620151806007611ccc565b6108bb906002611ccc565b60056020528160005260406000208181548110610cec57600080fd5b90600052602060002001600091509150505481565b610d0b8282610d5f565b610d14826108be565b5050565b8015610d5357610d536001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016333084611448565b610d5c81611486565b50565b33600090815260046020908152604080832085845290915290206002810154815480610dd25760405162461bcd60e51b815260206004820152601860248201527f506f736974696f6e20646f6573206e6f7420657869737473000000000000000060448201526064015b60405180910390fd5b80841115610dde578093505b600081610df3670de0b6b3a764000087611ccc565b610dfd9190611caa565b9050670de0b6b3a7640000610e128285611ccc565b610e1c9190611caa565b92508260026000828254610e309190611d2a565b9091555050835485908590600090610e49908490611d2a565b9250508190555082846002016000828254610e649190611d2a565b9091555050600154610e8490670de0b6b3a7640000906108fb9086611ccc565b846003016000828254610e979190611ceb565b909155505060408051602081018252600081529051637921219560e11b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169163f242432a91610efc91309133918c918c9190600401611b8f565b600060405180830381600087803b158015610f1657600080fd5b505af1158015610f2a573d6000803e3d6000fd5b505060408051898152602081018990523393507ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b56892500160405180910390a2505050505050565b6000610f7d3384611538565b90506000610f8b8484610513565b90508060026000828254610f9f9190611c92565b909155505060018201849055815483908390600090610fbf908490611c92565b9250508190555080826002016000828254610fda9190611c92565b9091555050600154610ffa90670de0b6b3a7640000906108fb9084611ccc565b82600301600082825461100d9190611c51565b909155505060408051602081018252600081529051637921219560e11b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169163f242432a9161107291339130918a918a9190600401611b8f565b600060405180830381600087803b15801561108c57600080fd5b505af11580156110a0573d6000803e3d6000fd5b505060408051848152602081018890529081018690523392507f36af321ec8d3c75236829c5317affd40ddb308863a1236d2d277a4025cccee1e915060600160405180910390a250505050565b6110fb62015180601e611ccc565b6108bb906003611ccc565b6001600160a01b038216600090815260046020908152604080832084845290915281206003810154600154600283015461115c929161115291670de0b6b3a7640000916108fb91611ccc565b6109219190611ceb565b949350505050565b60006001600160ff1b038211156111ce5760405162461bcd60e51b815260206004820152602860248201527f53616665436173743a2076616c756520646f65736e27742066697420696e2061604482015267371034b73a191a9b60c11b6064820152608401610dc9565b5090565b6000808212156111ce5760405162461bcd60e51b815260206004820181905260248201527f53616665436173743a2076616c7565206d75737420626520706f7369746976656044820152606401610dc9565b6001600160a01b03821660008181526006602090815260408083208584528252808320549383526005909152902080548391908390811061126757611267611db4565b9060005260206000200154146112b15760405162461bcd60e51b815260206004820152600f60248201526e746f6b656e4964202165786973747360881b6044820152606401610dc9565b6001600160a01b0383166000908152600560205260408120546112d690600190611d2a565b905080821461137f576001600160a01b038416600090815260056020526040812080548390811061130957611309611db4565b906000526020600020015490508060056000876001600160a01b03166001600160a01b03168152602001908152602001600020848154811061134d5761134d611db4565b60009182526020808320909101929092556001600160a01b038716815260068252604080822093825292909152208290555b6001600160a01b03841660009081526005602052604090208054806113a6576113a6611d9e565b6000828152602080822083016000199081018390559092019092556001600160a01b039095168152600685526040808220948252939094525050812055565b6040516001600160a01b038316602482015260448101829052610aeb90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261160e565b6040516001600160a01b03808516602483015283166044820152606481018290526114809085906323b872dd60e01b90608401611411565b50505050565b60025480156114df5760006003548361149f9190611c92565b9050816114b4670de0b6b3a764000083611ccc565b6114be9190611caa565b600160008282546114cf9190611c92565b90915550506000600355506114f7565b81600360008282546114f19190611c92565b90915550505b6001546040805183815260208101929092527fa28c80ccb32d654cc1348628c4d98f22ace56533089b2e0f72d46b6f9fb41de8910160405180910390a15050565b6001600160a01b038216600081815260046020908152604080832085845282528083208484526006835281842086855283528184205494845260059092529091205490919015806115bf57506001600160a01b03841660009081526005602052604090208054849190839081106115b1576115b1611db4565b906000526020600020015414155b15611607576001600160a01b03841660009081526005602081815260408084208054600684528286208987528452918520829055928252600181018355918352909120018390555b5092915050565b6000611663826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166116e09092919063ffffffff16565b805190915015610aeb57808060200190518101906116819190611ac0565b610aeb5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610dc9565b60606116ef84846000856116f9565b90505b9392505050565b60608247101561175a5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610dc9565b843b6117a85760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610dc9565b600080866001600160a01b031685876040516117c49190611b73565b60006040518083038185875af1925050503d8060008114611801576040519150601f19603f3d011682016040523d82523d6000602084013e611806565b606091505b5091509150611816828286611821565b979650505050505050565b606083156118305750816116f2565b8251156118405782518084602001fd5b8160405162461bcd60e51b8152600401610dc99190611c0d565b80356001600160a01b038116811461187157600080fd5b919050565b600082601f83011261188757600080fd5b8135602067ffffffffffffffff8211156118a3576118a3611dca565b8160051b6118b2828201611c20565b8381528281019086840183880185018910156118cd57600080fd5b600093505b858410156118f05780358352600193909301929184019184016118d2565b50979650505050505050565b600082601f83011261190d57600080fd5b813567ffffffffffffffff81111561192757611927611dca565b61193a601f8201601f1916602001611c20565b81815284602083860101111561194f57600080fd5b816020850160208301376000918101602001919091529392505050565b60006020828403121561197e57600080fd5b6116f28261185a565b600080600080600060a0868803121561199f57600080fd5b6119a88661185a565b94506119b66020870161185a565b9350604086013567ffffffffffffffff808211156119d357600080fd5b6119df89838a01611876565b945060608801359150808211156119f557600080fd5b611a0189838a01611876565b93506080880135915080821115611a1757600080fd5b50611a24888289016118fc565b9150509295509295909350565b600080600080600060a08688031215611a4957600080fd5b611a528661185a565b9450611a606020870161185a565b93506040860135925060608601359150608086013567ffffffffffffffff811115611a8a57600080fd5b611a24888289016118fc565b60008060408385031215611aa957600080fd5b611ab28361185a565b946020939093013593505050565b600060208284031215611ad257600080fd5b815180151581146116f257600080fd5b600060208284031215611af457600080fd5b81356001600160e01b0319811681146116f257600080fd5b600060208284031215611b1e57600080fd5b5035919050565b60008060408385031215611b3857600080fd5b50508035926020909101359150565b60008151808452611b5f816020860160208601611d41565b601f01601f19169290920160200192915050565b60008251611b85818460208701611d41565b9190910192915050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a06080820181905260009061181690830184611b47565b6020808252825182820181905260009190848201906040850190845b81811015611c0157835183529284019291840191600101611be5565b50909695505050505050565b6020815260006116f26020830184611b47565b604051601f8201601f1916810167ffffffffffffffff81118282101715611c4957611c49611dca565b604052919050565b600080821280156001600160ff1b0384900385131615611c7357611c73611d88565b600160ff1b8390038412811615611c8c57611c8c611d88565b50500190565b60008219821115611ca557611ca5611d88565b500190565b600082611cc757634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611ce657611ce6611d88565b500290565b60008083128015600160ff1b850184121615611d0957611d09611d88565b6001600160ff1b0384018313811615611d2457611d24611d88565b50500390565b600082821015611d3c57611d3c611d88565b500390565b60005b83811015611d5c578181015183820152602001611d44565b838111156114805750506000910152565b6000600019821415611d8157611d81611d88565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fdfea2646970667358221220cec7b62a61cea2e4ff760713a9ee849f0fa055cbcb40d58efecab666d94a346c64736f6c63430008070033000000000000000000000000539bde0d7dbd336b79148aa742883198bbf60342000000000000000000000000ebba467ecb6b21239178033189ceae27ca12eadf
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101f05760003560e01c80638ed955b91161010f578063d3512cef116100a2578063ecbefab711610071578063ecbefab714610485578063f15576a61461048d578063f23a6e6114610496578063fd90904c146104b557600080fd5b8063d3512cef1461044c578063d82b99d71461045f578063e2bbb15814610472578063e8622e671461048557600080fd5b8063b32ea1d3116100de578063b32ea1d3146103d1578063bc168ecb146103fc578063bc197c8114610405578063c2ee3a081461043d57600080fd5b80638ed955b91461039b578063934d1fa4146103a35780639786608f146103ab578063a7e69fb4146103be57600080fd5b8063319ce2bb1161018757806373503857116101565780637350385714610363578063772920261461036b578063853828b61461038b5780638e6f6b771461039357600080fd5b8063319ce2bb1461031757806359fe213b146103205780635fcbd28514610333578063620572071461035a57600080fd5b806320988cef116101c357806320988cef1461029057806320f8e94e1461029857806321ce919d146102ad57806327cfe8561461030d57600080fd5b806301ffc9a7146101f55780630d8546461461021d5780631951b6981461025c578063207f10541461027d575b600080fd5b610208610203366004611ae2565b6104c8565b60405190151581526020015b60405180910390f35b6102447f000000000000000000000000539bde0d7dbd336b79148aa742883198bbf6034281565b6040516001600160a01b039091168152602001610214565b61026f61026a366004611b0c565b6104ff565b604051908152602001610214565b61026f61028b366004611b25565b610513565b61026f6108ad565b6102ab6102a6366004611b0c565b6108be565b005b6102ed6102bb366004611a96565b600460209081526000928352604080842090915290825290208054600182015460028301546003909301549192909184565b604080519485526020850193909352918301526060820152608001610214565b61026f6201518081565b61026f60035481565b61026f61032e36600461196c565b6109ba565b6102447f000000000000000000000000ebba467ecb6b21239178033189ceae27ca12eadf81565b61026f60015481565b6102ab610a43565b61037e61037936600461196c565b610af0565b6040516102149190611bc9565b6102ab610b5c565b61026f610c04565b6102ab610c12565b61026f610cb7565b61026f6103b9366004611a96565b610cd0565b6102ab6103cc366004611b25565b610d01565b61026f6103df366004611a96565b600660209081526000928352604080842090915290825290205481565b61026f60025481565b610424610413366004611987565b63bc197c8160e01b95945050505050565b6040516001600160e01b03199091168152602001610214565b61026f670de0b6b3a764000081565b6102ab61045a366004611b0c565b610d18565b6102ab61046d366004611b25565b610d5f565b6102ab610480366004611b25565b610f71565b61026f6110ed565b61026f60005481565b6104246104a4366004611a31565b63f23a6e6160e01b95945050505050565b61026f6104c3366004611a96565b611106565b60006001600160e01b03198216630271189760e51b14806104f957506301ffc9a760e01b6001600160e01b03198316145b92915050565b60006104f9670de0b6b3a764000083611ccc565b6000806064602785141561052b576103eb915061087a565b84602e141561053e57610335915061087a565b84602f1415610551576103cd915061087a565b8460301415610563576064915061087a565b84603114156105755760cc915061087a565b8460331415610588576103f7915061087a565b846034141561059b576103f7915061087a565b84603514156105ae57610329915061087a565b84603614156105c1576103d1915061087a565b84604414156105d4576102f0915061087a565b84604514156105e7576101c2915061087a565b84604714156105fa5761011f915061087a565b846048141561060d57610306915061087a565b846049141561061f576068915061087a565b84604a14156106325761034e915061087a565b84604b1415610645576102fa915061087a565b84604c14156106575760a2915061087a565b84604d1415610669576067915061087a565b84604f141561067b576065915061087a565b846052141561068e576102e3915061087a565b84605b14156106a15761030b915061087a565b84605c14156106b3576067915061087a565b84605d14156106c6576101ad915061087a565b84605e14156106d9576101b4915061087a565b84605f14156106ec57610417915061087a565b84606014156106fe576069915061087a565b84606114156107115761041c915061087a565b8460621415610724576103c5915061087a565b846063141561073757610351915061087a565b846064141561074a576102c6915061087a565b846067141561075d57610192915061087a565b84606814156107705761033e915061087a565b846069141561078357610380915061087a565b84607214156107955760d4915061087a565b84607314156107a7576067915061087a565b84607414156107ba57610304915061087a565b84607514156107cc576064915061087a565b84608414156107df57610353915061087a565b84608514156107f1576067915061087a565b84608d14156108045761031a915061087a565b8460971415610816576069915061087a565b84609814156108295761031e915061087a565b846099141561083c57610356915061087a565b8460a1141561084f576103d1915061087a565b8460a2141561086257610317915061087a565b8460a41415610875576102a4915061087a565b600091505b610883846104ff565b9350806108908386611ccc565b61089a9190611caa565b6108a49085611c92565b95945050505050565b6108bb62015180601e611ccc565b81565b3360009081526004602090815260408083208484529091528120600154600282015491929161090a91670de0b6b3a7640000916108fb9190611ccc565b6109059190611caa565b611164565b905060006109268360030154836109219190611ceb565b6111d2565b600384018390556002840154909150610943576109433385611224565b801561097d5761097d6001600160a01b037f000000000000000000000000539bde0d7dbd336b79148aa742883198bbf603421633836113e5565b604051818152849033907f71bab65ced2e5750775a0613be067df48ef06cf92a496ebf7663ae06609249549060200160405180910390a350505050565b6001600160a01b038116600090815260056020526040812054815b81811015610a3c576001600160a01b0384166000908152600560205260408120805483908110610a0757610a07611db4565b90600052602060002001549050610a1e8582611106565b610a289085611c92565b93505080610a3590611d6d565b90506109d5565b5050919050565b33600090815260056020908152604080832080548251818502810185019093528083529192909190830182828015610a9a57602002820191906000526020600020905b815481526020019060010190808311610a86575b505083519394506000925050505b81811015610aeb576000838281518110610ac457610ac4611db4565b60200260200101519050610ada81600019610d01565b50610ae481611d6d565b9050610aa8565b505050565b6001600160a01b038116600090815260056020908152604091829020805483518184028101840190945280845260609392830182828015610b5057602002820191906000526020600020905b815481526020019060010190808311610b3c575b50505050509050919050565b33600090815260056020908152604080832080548251818502810185019093528083529192909190830182828015610bb357602002820191906000526020600020905b815481526020019060010190808311610b9f575b505083519394506000925050505b81811015610aeb576000838281518110610bdd57610bdd611db4565b60200260200101519050610bf381600019610d5f565b50610bfd81611d6d565b9050610bc1565b6108bb620151806007611ccc565b33600090815260056020908152604080832080548251818502810185019093528083529192909190830182828015610c6957602002820191906000526020600020905b815481526020019060010190808311610c55575b505083519394506000925050505b81811015610aeb576000838281518110610c9357610c93611db4565b60200260200101519050610ca6816108be565b50610cb081611d6d565b9050610c77565b610cc5620151806007611ccc565b6108bb906002611ccc565b60056020528160005260406000208181548110610cec57600080fd5b90600052602060002001600091509150505481565b610d0b8282610d5f565b610d14826108be565b5050565b8015610d5357610d536001600160a01b037f000000000000000000000000539bde0d7dbd336b79148aa742883198bbf6034216333084611448565b610d5c81611486565b50565b33600090815260046020908152604080832085845290915290206002810154815480610dd25760405162461bcd60e51b815260206004820152601860248201527f506f736974696f6e20646f6573206e6f7420657869737473000000000000000060448201526064015b60405180910390fd5b80841115610dde578093505b600081610df3670de0b6b3a764000087611ccc565b610dfd9190611caa565b9050670de0b6b3a7640000610e128285611ccc565b610e1c9190611caa565b92508260026000828254610e309190611d2a565b9091555050835485908590600090610e49908490611d2a565b9250508190555082846002016000828254610e649190611d2a565b9091555050600154610e8490670de0b6b3a7640000906108fb9086611ccc565b846003016000828254610e979190611ceb565b909155505060408051602081018252600081529051637921219560e11b81526001600160a01b037f000000000000000000000000ebba467ecb6b21239178033189ceae27ca12eadf169163f242432a91610efc91309133918c918c9190600401611b8f565b600060405180830381600087803b158015610f1657600080fd5b505af1158015610f2a573d6000803e3d6000fd5b505060408051898152602081018990523393507ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b56892500160405180910390a2505050505050565b6000610f7d3384611538565b90506000610f8b8484610513565b90508060026000828254610f9f9190611c92565b909155505060018201849055815483908390600090610fbf908490611c92565b9250508190555080826002016000828254610fda9190611c92565b9091555050600154610ffa90670de0b6b3a7640000906108fb9084611ccc565b82600301600082825461100d9190611c51565b909155505060408051602081018252600081529051637921219560e11b81526001600160a01b037f000000000000000000000000ebba467ecb6b21239178033189ceae27ca12eadf169163f242432a9161107291339130918a918a9190600401611b8f565b600060405180830381600087803b15801561108c57600080fd5b505af11580156110a0573d6000803e3d6000fd5b505060408051848152602081018890529081018690523392507f36af321ec8d3c75236829c5317affd40ddb308863a1236d2d277a4025cccee1e915060600160405180910390a250505050565b6110fb62015180601e611ccc565b6108bb906003611ccc565b6001600160a01b038216600090815260046020908152604080832084845290915281206003810154600154600283015461115c929161115291670de0b6b3a7640000916108fb91611ccc565b6109219190611ceb565b949350505050565b60006001600160ff1b038211156111ce5760405162461bcd60e51b815260206004820152602860248201527f53616665436173743a2076616c756520646f65736e27742066697420696e2061604482015267371034b73a191a9b60c11b6064820152608401610dc9565b5090565b6000808212156111ce5760405162461bcd60e51b815260206004820181905260248201527f53616665436173743a2076616c7565206d75737420626520706f7369746976656044820152606401610dc9565b6001600160a01b03821660008181526006602090815260408083208584528252808320549383526005909152902080548391908390811061126757611267611db4565b9060005260206000200154146112b15760405162461bcd60e51b815260206004820152600f60248201526e746f6b656e4964202165786973747360881b6044820152606401610dc9565b6001600160a01b0383166000908152600560205260408120546112d690600190611d2a565b905080821461137f576001600160a01b038416600090815260056020526040812080548390811061130957611309611db4565b906000526020600020015490508060056000876001600160a01b03166001600160a01b03168152602001908152602001600020848154811061134d5761134d611db4565b60009182526020808320909101929092556001600160a01b038716815260068252604080822093825292909152208290555b6001600160a01b03841660009081526005602052604090208054806113a6576113a6611d9e565b6000828152602080822083016000199081018390559092019092556001600160a01b039095168152600685526040808220948252939094525050812055565b6040516001600160a01b038316602482015260448101829052610aeb90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261160e565b6040516001600160a01b03808516602483015283166044820152606481018290526114809085906323b872dd60e01b90608401611411565b50505050565b60025480156114df5760006003548361149f9190611c92565b9050816114b4670de0b6b3a764000083611ccc565b6114be9190611caa565b600160008282546114cf9190611c92565b90915550506000600355506114f7565b81600360008282546114f19190611c92565b90915550505b6001546040805183815260208101929092527fa28c80ccb32d654cc1348628c4d98f22ace56533089b2e0f72d46b6f9fb41de8910160405180910390a15050565b6001600160a01b038216600081815260046020908152604080832085845282528083208484526006835281842086855283528184205494845260059092529091205490919015806115bf57506001600160a01b03841660009081526005602052604090208054849190839081106115b1576115b1611db4565b906000526020600020015414155b15611607576001600160a01b03841660009081526005602081815260408084208054600684528286208987528452918520829055928252600181018355918352909120018390555b5092915050565b6000611663826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166116e09092919063ffffffff16565b805190915015610aeb57808060200190518101906116819190611ac0565b610aeb5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610dc9565b60606116ef84846000856116f9565b90505b9392505050565b60608247101561175a5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610dc9565b843b6117a85760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610dc9565b600080866001600160a01b031685876040516117c49190611b73565b60006040518083038185875af1925050503d8060008114611801576040519150601f19603f3d011682016040523d82523d6000602084013e611806565b606091505b5091509150611816828286611821565b979650505050505050565b606083156118305750816116f2565b8251156118405782518084602001fd5b8160405162461bcd60e51b8152600401610dc99190611c0d565b80356001600160a01b038116811461187157600080fd5b919050565b600082601f83011261188757600080fd5b8135602067ffffffffffffffff8211156118a3576118a3611dca565b8160051b6118b2828201611c20565b8381528281019086840183880185018910156118cd57600080fd5b600093505b858410156118f05780358352600193909301929184019184016118d2565b50979650505050505050565b600082601f83011261190d57600080fd5b813567ffffffffffffffff81111561192757611927611dca565b61193a601f8201601f1916602001611c20565b81815284602083860101111561194f57600080fd5b816020850160208301376000918101602001919091529392505050565b60006020828403121561197e57600080fd5b6116f28261185a565b600080600080600060a0868803121561199f57600080fd5b6119a88661185a565b94506119b66020870161185a565b9350604086013567ffffffffffffffff808211156119d357600080fd5b6119df89838a01611876565b945060608801359150808211156119f557600080fd5b611a0189838a01611876565b93506080880135915080821115611a1757600080fd5b50611a24888289016118fc565b9150509295509295909350565b600080600080600060a08688031215611a4957600080fd5b611a528661185a565b9450611a606020870161185a565b93506040860135925060608601359150608086013567ffffffffffffffff811115611a8a57600080fd5b611a24888289016118fc565b60008060408385031215611aa957600080fd5b611ab28361185a565b946020939093013593505050565b600060208284031215611ad257600080fd5b815180151581146116f257600080fd5b600060208284031215611af457600080fd5b81356001600160e01b0319811681146116f257600080fd5b600060208284031215611b1e57600080fd5b5035919050565b60008060408385031215611b3857600080fd5b50508035926020909101359150565b60008151808452611b5f816020860160208601611d41565b601f01601f19169290920160200192915050565b60008251611b85818460208701611d41565b9190910192915050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a06080820181905260009061181690830184611b47565b6020808252825182820181905260009190848201906040850190845b81811015611c0157835183529284019291840191600101611be5565b50909695505050505050565b6020815260006116f26020830184611b47565b604051601f8201601f1916810167ffffffffffffffff81118282101715611c4957611c49611dca565b604052919050565b600080821280156001600160ff1b0384900385131615611c7357611c73611d88565b600160ff1b8390038412811615611c8c57611c8c611d88565b50500190565b60008219821115611ca557611ca5611d88565b500190565b600082611cc757634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611ce657611ce6611d88565b500290565b60008083128015600160ff1b850184121615611d0957611d09611d88565b6001600160ff1b0384018313811615611d2457611d24611d88565b50500390565b600082821015611d3c57611d3c611d88565b500390565b60005b83811015611d5c578181015183820152602001611d44565b838111156114805750506000910152565b6000600019821415611d8157611d81611d88565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fdfea2646970667358221220cec7b62a61cea2e4ff760713a9ee849f0fa055cbcb40d58efecab666d94a346c64736f6c63430008070033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000539bde0d7dbd336b79148aa742883198bbf60342000000000000000000000000ebba467ecb6b21239178033189ceae27ca12eadf
-----Decoded View---------------
Arg [0] : _magic (address): 0x539bdE0d7Dbd336b79148AA742883198BBF60342
Arg [1] : _lpToken (address): 0xEBba467eCB6b21239178033189CeAE27CA12EaDf
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000539bde0d7dbd336b79148aa742883198bbf60342
Arg [1] : 000000000000000000000000ebba467ecb6b21239178033189ceae27ca12eadf
Age | Block | Fee Address | BC Fee Address | Voting Power | Jailed | Incoming |
---|
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.