Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
OCY_Convex_C
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 10 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.17;
import "../../ZivoeLocker.sol";
import "../../../lib/openzeppelin-contracts/contracts/security/ReentrancyGuard.sol";
interface IBasePool_OCY_Convex_C {
function add_liquidity(uint256[] memory _amounts, uint256 _min_mint_amount) external;
function remove_liquidity(uint256 _amount, uint256[] memory min_amounts) external;
}
interface IBaseRewardPool_OCY_Convex_C {
function extraRewards(uint256 index) external view returns(address);
function extraRewardsLength() external view returns(uint256);
function rewardToken() external view returns(address);
function getReward() external returns(bool);
function withdrawAndUnwrap(uint256 _amount, bool _claim) external returns(bool);
}
interface IRewardToken_OCY_Convex_C {
function token() external view returns(address);
}
interface IBooster_OCY_Convex_C {
function deposit(uint256 _pid, uint256 _amount, bool _stake) external returns(bool);
function withdraw(uint256 _pid, uint256 _amount) external returns(bool);
}
interface IZivoeGlobals_OCY_Convex_C {
/// @notice Returns the address of the Zivoe Laboratory.
function ZVL() external view returns (address);
}
/// @notice This contract allocates stablecoins to the PYUSD/USDC base-pool and stakes the LP tokens on Convex.
contract OCY_Convex_C is ZivoeLocker, ReentrancyGuard {
using SafeERC20 for IERC20;
// ---------------------
// State Variables
// ---------------------
address public immutable GBL; /// @dev The ZivoeGlobals contract.
address public OCT_YDL; /// @dev The OCT_YDL contract.
/// @dev Tokens.
address public constant PYUSD = 0x6c3ea9036406852006290770BEdFcAbA0e23A0e8; /// @dev Index 0, BasePool
address public constant USDC = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48; /// @dev Index 1, BasePool
address public constant CRV = 0xD533a949740bb3306d119CC777fa900bA034cd52; /// @dev Native Reward #1
address public constant CVX = 0x4e3FBD56CD56c3e72c1403e103b45Db9da5B9D2B; /// @dev Native Reward #2
/// @dev Convex information.
address public convexDeposit = 0xF403C135812408BFbE8713b5A23a04b3D48AAE31;
address public convexPoolToken = 0x383E6b4437b59fff47B619CBA855CA29342A8559;
address public convexRewards = 0xc583e81bB36A1F620A804D8AF642B63b0ceEb5c0;
uint256 public convexPoolID = 270;
/// @dev Curve information.
address public curveBasePool = 0x383E6b4437b59fff47B619CBA855CA29342A8559;
address public curveBasePoolToken = 0x383E6b4437b59fff47B619CBA855CA29342A8559;
// -----------------
// Constructor
// -----------------
/// @notice Initializes the OCY_OUSD contract.
/// @param DAO The administrator of this contract (intended to be ZivoeDAO).
/// @param _GBL The ZivoeGlobals contract.
/// @param _OCT_YDL The OCT_YDL (Treasury and ZivoeSwapper) contract.
constructor(address DAO, address _GBL, address _OCT_YDL) {
transferOwnershipAndLock(DAO);
GBL = _GBL;
OCT_YDL = _OCT_YDL;
}
// ------------
// Events
// ------------
/// @notice Emitted during updateOCTYDL().
/// @param newOCT The new OCT_YDL contract.
/// @param oldOCT The old OCT_YDL contract.
event UpdatedOCTYDL(address indexed newOCT, address indexed oldOCT);
// ---------------
// Functions
// ---------------
/// @notice Permission for owner to call pushToLocker().
function canPush() public pure override returns (bool) { return true; }
/// @notice Permission for owner to call pullFromLocker().
function canPull() public pure override returns (bool) { return true; }
/// @notice Permission for owner to call pullFromLockerMulti().
function canPullMulti() public override pure returns (bool) { return true; }
/// @notice Permission for owner to call pushToLockerPartial().
function canPullPartial() public override pure returns (bool) { return true; }
/// @notice Migrates specific amount of ERC20 from owner() to locker.
/// @param asset The asset to migrate.
/// @param amount The amount of "asset" to migrate.
/// @param data Accompanying transaction data.
function pushToLocker(address asset, uint256 amount, bytes calldata data) external override onlyOwner {
require(
asset == PYUSD || asset == USDC,
"OCY_Convex_C::pushToLocker() asset != PYUSD && asset != USDC"
);
IERC20(asset).safeTransferFrom(owner(), address(this), amount);
(uint _min_mint_amountBP) = abi.decode(data, (uint));
if (asset == PYUSD) {
// Allocate PYUSD to Curve BasePool
IERC20(PYUSD).safeIncreaseAllowance(curveBasePool, amount);
uint256[] memory _amounts = new uint[](2);
_amounts[0] = amount;
IBasePool_OCY_Convex_C(curveBasePool).add_liquidity(_amounts, _min_mint_amountBP);
assert(IERC20(PYUSD).allowance(address(this), curveBasePool) == 0);
}
else {
// Allocate USDC to Curve BasePool
IERC20(USDC).safeIncreaseAllowance(curveBasePool, amount);
uint256[] memory _amounts = new uint[](2);
_amounts[1] = amount;
IBasePool_OCY_Convex_C(curveBasePool).add_liquidity(_amounts, _min_mint_amountBP);
assert(IERC20(USDC).allowance(address(this), curveBasePool) == 0);
}
// Stake CurveLP tokens to Convex
uint balCurveBasePoolToken = IERC20(curveBasePoolToken).balanceOf(address(this));
IERC20(curveBasePoolToken).safeIncreaseAllowance(convexDeposit, balCurveBasePoolToken);
IBooster_OCY_Convex_C(convexDeposit).deposit(convexPoolID, balCurveBasePoolToken, true);
assert(IERC20(curveBasePoolToken).allowance(address(this), convexDeposit) == 0);
}
/// @notice Migrates entire ERC20 balance from locker to owner().
/// @param asset The asset to migrate.
/// @param data Accompanying transaction data.
function pullFromLocker(address asset, bytes calldata data) external override onlyOwner {
require(asset == convexPoolToken, "OCY_Convex_C::pullFromLocker() asset != convexPoolToken");
claimRewards(false);
// Withdraw from ConvexRewards and unstake CurveLP tokens from ConvexBooster
IBaseRewardPool_OCY_Convex_C(convexRewards).withdrawAndUnwrap(
IERC20(convexRewards).balanceOf(address(this)), false
);
(uint _bp_min0, uint _bp_min1) = abi.decode(data, (uint, uint));
// Burn BasePool Tokens
uint256[] memory _min_amounts_bp = new uint[](2);
_min_amounts_bp[0] = _bp_min0;
_min_amounts_bp[1] = _bp_min1;
IBasePool_OCY_Convex_C(curveBasePool).remove_liquidity(
IERC20(curveBasePoolToken).balanceOf(address(this)), _min_amounts_bp
);
// Return tokens to DAO
IERC20(PYUSD).safeTransfer(owner(), IERC20(PYUSD).balanceOf(address(this)));
IERC20(USDC).safeTransfer(owner(), IERC20(USDC).balanceOf(address(this)));
}
/// @notice Migrates specific amount of ERC20 from locker to owner().
/// @param asset The asset to migrate.
/// @param amount The amount of "asset" to migrate.
/// @param data Accompanying transaction data.
function pullFromLockerPartial(address asset, uint256 amount, bytes calldata data) external override onlyOwner {
require(asset == convexPoolToken, "OCY_Convex_C::pullFromLockerPartial() asset != convexPoolToken");
claimRewards(false);
// Withdraw from ConvexRewards and unstake CurveLP tokens from ConvexBooster
IBaseRewardPool_OCY_Convex_C(convexRewards).withdrawAndUnwrap(amount, false);
(uint _bp_min0, uint _bp_min1) = abi.decode(data, (uint, uint));
// Burn BasePool Tokens
uint256[] memory _min_amounts_bp = new uint[](2);
_min_amounts_bp[0] = _bp_min0;
_min_amounts_bp[1] = _bp_min1;
IBasePool_OCY_Convex_C(curveBasePool).remove_liquidity(
IERC20(curveBasePoolToken).balanceOf(address(this)), _min_amounts_bp
);
// Return tokens to DAO
IERC20(PYUSD).safeTransfer(owner(), IERC20(PYUSD).balanceOf(address(this)));
IERC20(USDC).safeTransfer(owner(), IERC20(USDC).balanceOf(address(this)));
}
/// @notice Claims rewards and forward them to the OCT_YDL.
/// @param extra Flag for claiming extra rewards.
function claimRewards(bool extra) public nonReentrant {
IBaseRewardPool_OCY_Convex_C(convexRewards).getReward();
// Native Rewards (CRV, CVX)
uint256 rewardsCRV = IERC20(CRV).balanceOf(address(this));
uint256 rewardsCVX = IERC20(CVX).balanceOf(address(this));
if (rewardsCRV > 0) { IERC20(CRV).safeTransfer(OCT_YDL, rewardsCRV); }
if (rewardsCVX > 0) { IERC20(CVX).safeTransfer(OCT_YDL, rewardsCVX); }
// Extra Rewards
if (extra) {
uint256 extraRewardsLength = IBaseRewardPool_OCY_Convex_C(convexRewards).extraRewardsLength();
for (uint256 i = 0; i < extraRewardsLength; i++) {
address rewardContract = IBaseRewardPool_OCY_Convex_C(convexRewards).extraRewards(i);
address rewardToken = IRewardToken_OCY_Convex_C(
IBaseRewardPool_OCY_Convex_C(rewardContract).rewardToken()
).token();
uint256 rewardAmount = IERC20(rewardToken).balanceOf(address(this));
if (rewardAmount > 0) { IERC20(rewardToken).safeTransfer(OCT_YDL, rewardAmount); }
}
}
}
/// @notice Update the OCT_YDL endpoint.
/// @dev This function MUST only be called by ZVL().
/// @param _OCT_YDL The new address for OCT_YDL.
function updateOCTYDL(address _OCT_YDL) external {
require(
_msgSender() == IZivoeGlobals_OCY_Convex_C(GBL).ZVL(),
"OCY_Convex_C::updateOCTYDL() _msgSender() != IZivoeGlobals_OCY_Convex_C(GBL).ZVL()"
);
require(_OCT_YDL != address(0), "OCY_Convex_C::updateOCTYDL() _OCT_YDL == address(0)");
emit UpdatedOCTYDL(_OCT_YDL, OCT_YDL);
OCT_YDL = _OCT_YDL;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be _NOT_ENTERED
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC1155 compliant contract, as defined in the
* https://eips.ethereum.org/EIPS/eip-1155[EIP].
*
* _Available since v3.1._
*/
interface IERC1155 is IERC165 {
/**
* @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.
*/
event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);
/**
* @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all
* transfers.
*/
event TransferBatch(
address indexed operator,
address indexed from,
address indexed to,
uint256[] ids,
uint256[] values
);
/**
* @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to
* `approved`.
*/
event ApprovalForAll(address indexed account, address indexed operator, bool approved);
/**
* @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.
*
* If an {URI} event was emitted for `id`, the standard
* https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value
* returned by {IERC1155MetadataURI-uri}.
*/
event URI(string value, uint256 indexed id);
/**
* @dev Returns the amount of tokens of token type `id` owned by `account`.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function balanceOf(address account, uint256 id) external view returns (uint256);
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
*
* Requirements:
*
* - `accounts` and `ids` must have the same length.
*/
function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)
external
view
returns (uint256[] memory);
/**
* @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,
*
* Emits an {ApprovalForAll} event.
*
* Requirements:
*
* - `operator` cannot be the caller.
*/
function setApprovalForAll(address operator, bool approved) external;
/**
* @dev Returns true if `operator` is approved to transfer ``account``'s tokens.
*
* See {setApprovalForAll}.
*/
function isApprovedForAll(address account, address operator) external view returns (bool);
/**
* @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.
* - `from` must have a balance of tokens of type `id` of at least `amount`.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
* acceptance magic value.
*/
function safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes calldata data
) external;
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
*
* Emits a {TransferBatch} event.
*
* Requirements:
*
* - `ids` and `amounts` must have the same length.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
* acceptance magic value.
*/
function safeBatchTransferFrom(
address from,
address to,
uint256[] calldata ids,
uint256[] calldata amounts,
bytes calldata data
) external;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev _Available since v3.1._
*/
interface IERC1155Receiver is IERC165 {
/**
* @dev Handles the receipt of a single ERC1155 token type. This function is
* called at the end of a `safeTransferFrom` after the balance has been updated.
*
* NOTE: To accept the transfer, this must return
* `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`
* (i.e. 0xf23a6e61, or its own function selector).
*
* @param operator The address which initiated the transfer (i.e. msg.sender)
* @param from The address which previously owned the token
* @param id The ID of the token being transferred
* @param value The amount of tokens being transferred
* @param data Additional data with no specified format
* @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed
*/
function onERC1155Received(
address operator,
address from,
uint256 id,
uint256 value,
bytes calldata data
) external returns (bytes4);
/**
* @dev Handles the receipt of a multiple ERC1155 token types. This function
* is called at the end of a `safeBatchTransferFrom` after the balances have
* been updated.
*
* NOTE: To accept the transfer(s), this must return
* `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`
* (i.e. 0xbc197c81, or its own function selector).
*
* @param operator The address which initiated the batch transfer (i.e. msg.sender)
* @param from The address which previously owned the token
* @param ids An array containing ids of each token being transferred (order and length must match values array)
* @param values An array containing amounts of each token being transferred (order and length must match ids array)
* @param data Additional data with no specified format
* @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed
*/
function onERC1155BatchReceived(
address operator,
address from,
uint256[] calldata ids,
uint256[] calldata values,
bytes calldata data
) external returns (bytes4);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/utils/ERC1155Holder.sol)
pragma solidity ^0.8.0;
import "./ERC1155Receiver.sol";
/**
* Simple implementation of `ERC1155Receiver` that will allow a contract to hold ERC1155 tokens.
*
* IMPORTANT: When inheriting this contract, you must include a way to use the received tokens, otherwise they will be
* stuck.
*
* @dev _Available since v3.1._
*/
contract ERC1155Holder is ERC1155Receiver {
function onERC1155Received(
address,
address,
uint256,
uint256,
bytes memory
) public virtual override returns (bytes4) {
return this.onERC1155Received.selector;
}
function onERC1155BatchReceived(
address,
address,
uint256[] memory,
uint256[] memory,
bytes memory
) public virtual override returns (bytes4) {
return this.onERC1155BatchReceived.selector;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/utils/ERC1155Receiver.sol)
pragma solidity ^0.8.0;
import "../IERC1155Receiver.sol";
import "../../../utils/introspection/ERC165.sol";
/**
* @dev _Available since v3.1._
*/
abstract contract ERC1155Receiver is ERC165, IERC1155Receiver {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
return interfaceId == type(IERC1155Receiver).interfaceId || super.supportsInterface(interfaceId);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
* need to send a transaction, and thus is not required to hold Ether at all.
*/
interface IERC20Permit {
/**
* @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
* given ``owner``'s signed approval.
*
* IMPORTANT: The same issues {IERC20-approve} has related to transaction
* ordering also apply here.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `deadline` must be a timestamp in the future.
* - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
* over the EIP712-formatted function arguments.
* - the signature must use ``owner``'s current nonce (see {nonces}).
*
* For more information on the signature format, see the
* https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
* section].
*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
/**
* @dev Returns the current nonce for `owner`. This value must be
* included whenever a signature is generated for {permit}.
*
* Every successful call to {permit} increases ``owner``'s nonce by one. This
* prevents a signature from being used multiple times.
*/
function nonces(address owner) external view returns (uint256);
/**
* @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
*/
// solhint-disable-next-line func-name-mixedcase
function DOMAIN_SEPARATOR() external view returns (bytes32);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 amount
) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.0;
import "../IERC20.sol";
import "../extensions/draft-IERC20Permit.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));
}
}
function safePermit(
IERC20Permit token,
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) internal {
uint256 nonceBefore = token.nonces(owner);
token.permit(owner, spender, value, deadline, v, r, s);
uint256 nonceAfter = token.nonces(owner);
require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
}
/**
* @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
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
* or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
* understand this adds an external call which potentially creates a reentrancy vulnerability.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool _approved) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)
pragma solidity ^0.8.0;
/**
* @title ERC721 token receiver interface
* @dev Interface for any contract that wants to support safeTransfers
* from ERC721 asset contracts.
*/
interface IERC721Receiver {
/**
* @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
* by `operator` from `from`, this function is called.
*
* It must return its Solidity selector to confirm the token transfer.
* If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
*
* The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.
*/
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/utils/ERC721Holder.sol)
pragma solidity ^0.8.0;
import "../IERC721Receiver.sol";
/**
* @dev Implementation of the {IERC721Receiver} interface.
*
* Accepts all token transfers.
* Make sure the contract is able to use its token with {IERC721-safeTransferFrom}, {IERC721-approve} or {IERC721-setApprovalForAll}.
*/
contract ERC721Holder is IERC721Receiver {
/**
* @dev See {IERC721Receiver-onERC721Received}.
*
* Always returns `IERC721Receiver.onERC721Received.selector`.
*/
function onERC721Received(
address,
address,
uint256,
bytes memory
) public virtual override returns (bytes4) {
return this.onERC721Received.selector;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, "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");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, 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) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, 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) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or 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 {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
// 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
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
import "./IERC165.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.17;
import "../../lib/openzeppelin-contracts/contracts/access/Ownable.sol";
abstract contract OwnableLocked is Ownable {
bool public locked; /// @dev A variable "locked" that prevents future ownership transfer.
/**
* @dev Throws if called by any account other than the owner.
*/
modifier unlocked() {
require(!locked, "OwnableLocked::unlocked() locked");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner and if !locked.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public override(Ownable) onlyOwner unlocked { _transferOwnership(address(0)); }
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner and if !locked.
*/
function transferOwnership(address newOwner) public override(Ownable) onlyOwner unlocked {
require(newOwner != address(0), "OwnableLocked::transferOwnership() newOwner == address(0)");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner and if !locked.
*/
function transferOwnershipAndLock(address newOwner) public onlyOwner unlocked {
require(newOwner != address(0), "OwnableLocked::transferOwnershipAndLock() newOwner == address(0)");
locked = true;
_transferOwnership(newOwner);
}
}// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.17;
import "./libraries/OwnableLocked.sol";
import "../lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol";
import "../lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol";
import "../lib/openzeppelin-contracts/contracts/token/ERC721/IERC721.sol";
import "../lib/openzeppelin-contracts/contracts/token/ERC721/utils/ERC721Holder.sol";
import "../lib/openzeppelin-contracts/contracts/token/ERC1155/IERC1155.sol";
import "../lib/openzeppelin-contracts/contracts/token/ERC1155/utils/ERC1155Holder.sol";
/// @notice This contract standardizes communication between the DAO and lockers.
abstract contract ZivoeLocker is OwnableLocked, ERC1155Holder, ERC721Holder {
using SafeERC20 for IERC20;
// -----------------
// Constructor
// -----------------
/// @notice Initializes the ZivoeLocker contract.
constructor() {}
// ---------------
// Functions
// ---------------
/// @notice Permission for calling pushToLocker().
function canPush() public virtual view returns (bool) { return false; }
/// @notice Permission for calling pullFromLocker().
function canPull() public virtual view returns (bool) { return false; }
/// @notice Permission for calling pullFromLockerPartial().
function canPullPartial() public virtual view returns (bool) { return false; }
/// @notice Permission for calling pushToLockerMulti().
function canPushMulti() public virtual view returns (bool) { return false; }
/// @notice Permission for calling pullFromLockerMulti().
function canPullMulti() public virtual view returns (bool) { return false; }
/// @notice Permission for calling pullFromLockerMultiPartial().
function canPullMultiPartial() public virtual view returns (bool) { return false; }
/// @notice Permission for calling pushToLockerERC721().
function canPushERC721() public virtual view returns (bool) { return false; }
/// @notice Permission for calling pullFromLockerERC721().
function canPullERC721() public virtual view returns (bool) { return false; }
/// @notice Permission for calling pushToLockerMultiERC721().
function canPushMultiERC721() public virtual view returns (bool) { return false; }
/// @notice Permission for calling pullFromLockerMultiERC721().
function canPullMultiERC721() public virtual view returns (bool) { return false; }
/// @notice Permission for calling pushToLockerERC1155().
function canPushERC1155() public virtual view returns (bool) { return false; }
/// @notice Permission for calling pullFromLockerERC1155().
function canPullERC1155() public virtual view returns (bool) { return false; }
/// @notice Migrates specific amount of ERC20 from owner() to locker.
/// @param asset The asset to migrate.
/// @param amount The amount of "asset" to migrate.
/// @param data Accompanying transaction data.
function pushToLocker(address asset, uint256 amount, bytes calldata data) external virtual onlyOwner {
require(canPush(), "ZivoeLocker::pushToLocker() !canPush()");
IERC20(asset).safeTransferFrom(owner(), address(this), amount);
}
/// @notice Migrates entire ERC20 balance from locker to owner().
/// @param asset The asset to migrate.
/// @param data Accompanying transaction data.
function pullFromLocker(address asset, bytes calldata data) external virtual onlyOwner {
require(canPull(), "ZivoeLocker::pullFromLocker() !canPull()");
IERC20(asset).safeTransfer(owner(), IERC20(asset).balanceOf(address(this)));
}
/// @notice Migrates specific amount of ERC20 from locker to owner().
/// @param asset The asset to migrate.
/// @param amount The amount of "asset" to migrate.
/// @param data Accompanying transaction data.
function pullFromLockerPartial(address asset, uint256 amount, bytes calldata data) external virtual onlyOwner {
require(canPullPartial(), "ZivoeLocker::pullFromLockerPartial() !canPullPartial()");
IERC20(asset).safeTransfer(owner(), amount);
}
/// @notice Migrates specific amounts of ERC20s from owner() to locker.
/// @param assets The assets to migrate.
/// @param amounts The amounts of "assets" to migrate, corresponds to "assets" by position in array.
/// @param data Accompanying transaction data.
function pushToLockerMulti(
address[] calldata assets, uint256[] calldata amounts, bytes[] calldata data
) external virtual onlyOwner {
require(canPushMulti(), "ZivoeLocker::pushToLockerMulti() !canPushMulti()");
for (uint256 i = 0; i < assets.length; i++) {
IERC20(assets[i]).safeTransferFrom(owner(), address(this), amounts[i]);
}
}
/// @notice Migrates full amount of ERC20s from locker to owner().
/// @param assets The assets to migrate.
/// @param data Accompanying transaction data.
function pullFromLockerMulti(address[] calldata assets, bytes[] calldata data) external virtual onlyOwner {
require(canPullMulti(), "ZivoeLocker::pullFromLockerMulti() !canPullMulti()");
for (uint256 i = 0; i < assets.length; i++) {
IERC20(assets[i]).safeTransfer(owner(), IERC20(assets[i]).balanceOf(address(this)));
}
}
/// @notice Migrates specific amounts of ERC20s from locker to owner().
/// @param assets The assets to migrate.
/// @param amounts The amounts of "assets" to migrate, corresponds to "assets" by position in array.
/// @param data Accompanying transaction data.
function pullFromLockerMultiPartial(
address[] calldata assets, uint256[] calldata amounts, bytes[] calldata data
) external virtual onlyOwner {
require(canPullMultiPartial(), "ZivoeLocker::pullFromLockerMultiPartial() !canPullMultiPartial()");
for (uint256 i = 0; i < assets.length; i++) {
IERC20(assets[i]).safeTransfer(owner(), amounts[i]);
}
}
/// @notice Migrates an ERC721 from owner() to locker.
/// @param asset The NFT contract.
/// @param tokenId The ID of the NFT to migrate.
/// @param data Accompanying transaction data.
function pushToLockerERC721(address asset, uint256 tokenId, bytes calldata data) external virtual onlyOwner {
require(canPushERC721(), "ZivoeLocker::pushToLockerERC721() !canPushERC721()");
IERC721(asset).safeTransferFrom(owner(), address(this), tokenId, data);
}
/// @notice Migrates an ERC721 from locker to owner().
/// @param asset The NFT contract.
/// @param tokenId The ID of the NFT to migrate.
/// @param data Accompanying transaction data.
function pullFromLockerERC721(address asset, uint256 tokenId, bytes calldata data) external virtual onlyOwner {
require(canPullERC721(), "ZivoeLocker::pullFromLockerERC721() !canPullERC721()");
IERC721(asset).safeTransferFrom(address(this), owner(), tokenId, data);
}
/// @notice Migrates ERC721s from owner() to locker.
/// @param assets The NFT contracts.
/// @param tokenIds The IDs of the NFTs to migrate.
/// @param data Accompanying transaction data.
function pushToLockerMultiERC721(
address[] calldata assets, uint256[] calldata tokenIds, bytes[] calldata data
) external virtual onlyOwner {
require(canPushMultiERC721(), "ZivoeLocker::pushToLockerMultiERC721() !canPushMultiERC721()");
for (uint256 i = 0; i < assets.length; i++) {
IERC721(assets[i]).safeTransferFrom(owner(), address(this), tokenIds[i], data[i]);
}
}
/// @notice Migrates ERC721s from locker to owner().
/// @param assets The NFT contracts.
/// @param tokenIds The IDs of the NFTs to migrate.
/// @param data Accompanying transaction data.
function pullFromLockerMultiERC721(
address[] calldata assets, uint256[] calldata tokenIds, bytes[] calldata data
) external virtual onlyOwner {
require(canPullMultiERC721(), "ZivoeLocker::pullFromLockerMultiERC721() !canPullMultiERC721()");
for (uint256 i = 0; i < assets.length; i++) {
IERC721(assets[i]).safeTransferFrom(address(this), owner(), tokenIds[i], data[i]);
}
}
/// @notice Migrates ERC1155 assets from owner() to locker.
/// @param asset The ERC1155 contract.
/// @param ids The IDs of the assets within the ERC1155 to migrate.
/// @param amounts The amounts to migrate.
/// @param data Accompanying transaction data.
function pushToLockerERC1155(
address asset, uint256[] calldata ids, uint256[] calldata amounts, bytes calldata data
) external virtual onlyOwner {
require(canPushERC1155(), "ZivoeLocker::pushToLockerERC1155() !canPushERC1155()");
IERC1155(asset).safeBatchTransferFrom(owner(), address(this), ids, amounts, data);
}
/// @notice Migrates ERC1155 assets from locker to owner().
/// @param asset The ERC1155 contract.
/// @param ids The IDs of the assets within the ERC1155 to migrate.
/// @param amounts The amounts to migrate.
/// @param data Accompanying transaction data.
function pullFromLockerERC1155(
address asset, uint256[] calldata ids, uint256[] calldata amounts, bytes calldata data
) external virtual onlyOwner {
require(canPullERC1155(), "ZivoeLocker::pullFromLockerERC1155() !canPullERC1155()");
IERC1155(asset).safeBatchTransferFrom(address(this), owner(), ids, amounts, data);
}
}{
"optimizer": {
"enabled": true,
"runs": 10
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"DAO","type":"address"},{"internalType":"address","name":"_GBL","type":"address"},{"internalType":"address","name":"_OCT_YDL","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"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":"newOCT","type":"address"},{"indexed":true,"internalType":"address","name":"oldOCT","type":"address"}],"name":"UpdatedOCTYDL","type":"event"},{"inputs":[],"name":"CRV","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CVX","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"GBL","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OCT_YDL","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PYUSD","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"USDC","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"canPull","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"canPullERC1155","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"canPullERC721","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"canPullMulti","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"canPullMultiERC721","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"canPullMultiPartial","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"canPullPartial","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"canPush","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"canPushERC1155","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"canPushERC721","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"canPushMulti","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"canPushMultiERC721","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"extra","type":"bool"}],"name":"claimRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"convexDeposit","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"convexPoolID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"convexPoolToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"convexRewards","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"curveBasePool","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"curveBasePoolToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"locked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155BatchReceived","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"pullFromLocker","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"pullFromLockerERC1155","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"pullFromLockerERC721","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"assets","type":"address[]"},{"internalType":"bytes[]","name":"data","type":"bytes[]"}],"name":"pullFromLockerMulti","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"assets","type":"address[]"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"bytes[]","name":"data","type":"bytes[]"}],"name":"pullFromLockerMultiERC721","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"assets","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes[]","name":"data","type":"bytes[]"}],"name":"pullFromLockerMultiPartial","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"pullFromLockerPartial","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"pushToLocker","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"pushToLockerERC1155","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"pushToLockerERC721","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"assets","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes[]","name":"data","type":"bytes[]"}],"name":"pushToLockerMulti","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"assets","type":"address[]"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"bytes[]","name":"data","type":"bytes[]"}],"name":"pushToLockerMultiERC721","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnershipAndLock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_OCT_YDL","type":"address"}],"name":"updateOCTYDL","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
60a0604052600380546001600160a01b031990811673f403c135812408bfbe8713b5a23a04b3d48aae311790915560048054821673383e6b4437b59fff47b619cba855ca29342a855990811790915560058054831673c583e81bb36a1f620a804d8af642b63b0ceeb5c017905561010e60065560078054831682179055600880549092161790553480156200009357600080fd5b506040516200315638038062003156833981016040819052620000b691620002d0565b620000c133620000fa565b60018055620000d0836200014a565b6001600160a01b03918216608052600280546001600160a01b03191691909216179055506200031a565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6200015462000255565b600054600160a01b900460ff1615620001b45760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c654c6f636b65643a3a756e6c6f636b65642829206c6f636b656460448201526064015b60405180910390fd5b6001600160a01b03811662000234576040805162461bcd60e51b81526020600482015260248101919091527f4f776e61626c654c6f636b65643a3a7472616e736665724f776e65727368697060448201527f416e644c6f636b2829206e65774f776e6572203d3d20616464726573732830296064820152608401620001ab565b6000805460ff60a01b1916600160a01b1790556200025281620000fa565b50565b6000546001600160a01b03163314620002b15760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401620001ab565b565b80516001600160a01b0381168114620002cb57600080fd5b919050565b600080600060608486031215620002e657600080fd5b620002f184620002b3565b92506200030160208501620002b3565b91506200031160408501620002b3565b90509250925092565b608051612e196200033d6000396000818161031201526114f00152612e196000f3fe608060405234801561001057600080fd5b50600436106102255760003560e01c806301ffc9a71461022a5780630b9c91fa146102525780630e6878a3146102725780631205217614610287578063150b7a021461029a57806315e98744146102c65780631852b383146102d957806319165874146102e05780631d9389e9146102f3578063215cccdd146103065780632f08d48b146102d95780633c117244146102d95780633ce8d4321461030d5780633eda81ad14610306578063422b201814610334578063423156321461034757806349a5e73b1461035a57806358289c7e1461037157806364c77735146103065780636a7ab9af14610384578063715018a614610397578063759cb53b1461039f57806379054cc9146103ba578063885d37e9146103cd57806389a30271146103e05780638b648ee2146102d95780638da5cb5b146103fb578063945c9142146104035780639e19789d1461041e578063a4a3e79d146102d9578063a785a3a814610439578063a891c6841461044c578063b0607cf8146102d9578063b892bcc01461045f578063bc197c8114610472578063c70ecd5614610491578063cd45e1fb146104a4578063cf10b7ab146102d9578063cf309012146104b7578063d284af94146104cb578063d8f2a78b146104de578063dd913bdb146102d9578063e7f4462914610306578063f1641cbe146104f1578063f23a6e6114610504578063f2fde38b14610523578063fd76f59d14610536575b600080fd5b61023d610238366004612489565b610549565b60405190151581526020015b60405180910390f35b600354610265906001600160a01b031681565b60405161024991906124ba565b6102856102803660046124dc565b610580565b005b610285610295366004612556565b6109d1565b6102ad6102a8366004612666565b610a43565b6040516001600160e01b03199091168152602001610249565b6102856102d4366004612715565b610a54565b600061023d565b6102856102ee3660046127ae565b610ba9565b610285610301366004612556565b610caa565b600161023d565b6102657f000000000000000000000000000000000000000000000000000000000000000081565b61028561034236600461280d565b610d15565b610285610355366004612556565b610d84565b61036360065481565b604051908152602001610249565b61028561037f3660046128b9565b611307565b610285610392366004612715565b6113c1565b6102856114a1565b610265734e3fbd56cd56c3e72c1403e103b45db9da5b9d2b81565b600554610265906001600160a01b031681565b600454610265906001600160a01b031681565b61026573a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4881565b6102656114df565b61026573d533a949740bb3306d119cc777fa900ba034cd5281565b610265736c3ea9036406852006290770bedfcaba0e23a0e881565b6102856104473660046128b9565b6114ee565b600754610265906001600160a01b031681565b61028561046d366004612715565b6116df565b6102ad61048036600461294a565b63bc197c8160e01b95945050505050565b600854610265906001600160a01b031681565b6102856104b23660046129f7565b61183c565b60005461023d90600160a01b900460ff1681565b6102856104d9366004612715565b611c2e565b6102856104ec366004612556565b611ce4565b600254610265906001600160a01b031681565b6102ad610512366004612a4b565b63f23a6e6160e01b95945050505050565b6102856105313660046128b9565b611f48565b61028561054436600461280d565b611fe9565b60006001600160e01b03198216630271189760e51b148061057a57506301ffc9a760e01b6001600160e01b03198316145b92915050565b610588612056565b600560009054906101000a90046001600160a01b03166001600160a01b0316633d18b9126040518163ffffffff1660e01b81526004016020604051808303816000875af11580156105dd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106019190612ab3565b506040516370a0823160e01b815260009073d533a949740bb3306d119cc777fa900ba034cd52906370a082319061063c9030906004016124ba565b602060405180830381865afa158015610659573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061067d9190612ad0565b6040516370a0823160e01b8152909150600090734e3fbd56cd56c3e72c1403e103b45db9da5b9d2b906370a08231906106ba9030906004016124ba565b602060405180830381865afa1580156106d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106fb9190612ad0565b9050811561072f5760025461072f9073d533a949740bb3306d119cc777fa900ba034cd52906001600160a01b0316846120af565b80156107615760025461076190734e3fbd56cd56c3e72c1403e103b45db9da5b9d2b906001600160a01b0316836120af565b82156109c3576005546040805163355688fd60e21b815290516000926001600160a01b03169163d55a23f49160048083019260209291908290030181865afa1580156107b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107d59190612ad0565b905060005b818110156109c057600554604051632061aa2360e11b8152600481018390526000916001600160a01b0316906340c3544690602401602060405180830381865afa15801561082c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108509190612ae9565b90506000816001600160a01b031663f7c618c16040518163ffffffff1660e01b8152600401602060405180830381865afa158015610892573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108b69190612ae9565b6001600160a01b031663fc0c546a6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108f3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109179190612ae9565b90506000816001600160a01b03166370a08231306040518263ffffffff1660e01b815260040161094791906124ba565b602060405180830381865afa158015610964573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109889190612ad0565b905080156109aa576002546109aa906001600160a01b038481169116836120af565b50505080806109b890612b1c565b9150506107da565b50505b50506109ce60018055565b50565b6109d961210a565b60405162461bcd60e51b815260206004820152603460248201527f5a69766f654c6f636b65723a3a70756c6c46726f6d4c6f636b65724552433732604482015273312829202163616e50756c6c455243373231282960601b60648201526084015b60405180910390fd5b630a85bd0160e11b5b949350505050565b610a5c61210a565b60405162461bcd60e51b815260206004820152603e6024820152600080516020612da483398151915260448201527f4552433732312829202163616e50756c6c4d756c7469455243373231282900006064820152608401610a3a565b85811015610ba057868682818110610ad257610ad2612b92565b9050602002016020810190610ae791906128b9565b6001600160a01b031663b88d4fde30610afe6114df565b888886818110610b1057610b10612b92565b90506020020135878787818110610b2957610b29612b92565b9050602002810190610b3b9190612ba8565b6040518663ffffffff1660e01b8152600401610b5b959493929190612b5e565b600060405180830381600087803b158015610b7557600080fd5b505af1158015610b89573d6000803e3d6000fd5b505050508080610b9890612b1c565b915050610ab8565b50505050505050565b610bb161210a565b60005b83811015610ca357610c91610bc76114df565b868684818110610bd957610bd9612b92565b9050602002016020810190610bee91906128b9565b6001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401610c1991906124ba565b602060405180830381865afa158015610c36573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c5a9190612ad0565b878785818110610c6c57610c6c612b92565b9050602002016020810190610c8191906128b9565b6001600160a01b031691906120af565b80610c9b81612b1c565b915050610bb4565b5050505050565b610cb261210a565b60405162461bcd60e51b815260206004820152603260248201527f5a69766f654c6f636b65723a3a70757368546f4c6f636b65724552433732312860448201527129202163616e50757368455243373231282960701b6064820152608401610a3a565b610d1d61210a565b60405162461bcd60e51b815260206004820152603660248201527f5a69766f654c6f636b65723a3a70756c6c46726f6d4c6f636b6572455243313160448201527535352829202163616e50756c6c45524331313535282960501b6064820152608401610a3a565b610d8c61210a565b6001600160a01b038416736c3ea9036406852006290770bedfcaba0e23a0e81480610dd357506001600160a01b03841673a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48145b610e445760405162461bcd60e51b815260206004820152603c60248201527f4f43595f436f6e7665785f433a3a70757368546f4c6f636b657228292061737360448201527b657420213d20505955534420262620617373657420213d205553444360201b6064820152608401610a3a565b610e61610e4f6114df565b6001600160a01b038616903086612169565b6000610e6f82840184612bee565b9050736c3ea9036406852006290770bedfcaba0e23a0e7196001600160a01b0386160161100057600754610ec290736c3ea9036406852006290770bedfcaba0e23a0e8906001600160a01b0316866121a7565b6040805160028082526060820183526000926020830190803683370190505090508481600081518110610ef757610ef7612b92565b6020908102919091010152600754604051635b96faef60e11b81526001600160a01b039091169063b72df5de90610f349084908690600401612c42565b600060405180830381600087803b158015610f4e57600080fd5b505af1158015610f62573d6000803e3d6000fd5b5050600754604051636eb1769f60e11b8152736c3ea9036406852006290770bedfcaba0e23a0e8935063dd62ed3e9250610fac9130916001600160a01b0390911690600401612c64565b602060405180830381865afa158015610fc9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fed9190612ad0565b15610ffa57610ffa612c7e565b50611166565b60075461102c9073a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48906001600160a01b0316866121a7565b604080516002808252606082018352600092602083019080368337019050509050848160018151811061106157611061612b92565b6020908102919091010152600754604051635b96faef60e11b81526001600160a01b039091169063b72df5de9061109e9084908690600401612c42565b600060405180830381600087803b1580156110b857600080fd5b505af11580156110cc573d6000803e3d6000fd5b5050600754604051636eb1769f60e11b815273a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48935063dd62ed3e92506111169130916001600160a01b0390911690600401612c64565b602060405180830381865afa158015611133573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111579190612ad0565b1561116457611164612c7e565b505b6008546040516370a0823160e01b81526000916001600160a01b0316906370a08231906111979030906004016124ba565b602060405180830381865afa1580156111b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111d89190612ad0565b6003546008549192506111f8916001600160a01b039081169116836121a7565b6003546006546040516321d0683360e11b8152600481019190915260248101839052600160448201526001600160a01b03909116906343a0d066906064016020604051808303816000875af1158015611255573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112799190612ab3565b50600854600354604051636eb1769f60e11b81526001600160a01b039283169263dd62ed3e926112b192309290911690600401612c64565b602060405180830381865afa1580156112ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112f29190612ad0565b156112ff576112ff612c7e565b505050505050565b61130f61210a565b600054600160a01b900460ff16156113395760405162461bcd60e51b8152600401610a3a90612c94565b6001600160a01b0381166113a5576040805162461bcd60e51b8152602060048201526024810191909152600080516020612dc483398151915260448201527f416e644c6f636b2829206e65774f776e6572203d3d20616464726573732830296064820152608401610a3a565b6000805460ff60a01b1916600160a01b1790556109ce81612244565b6113c961210a565b60405162461bcd60e51b815260206004820152603060248201527f5a69766f654c6f636b65723a3a70757368546f4c6f636b65724d756c7469282960448201526f202163616e507573684d756c7469282960801b6064820152608401610a3a565b85811015610ba05761148f61143d6114df565b3087878581811061145057611450612b92565b905060200201358a8a8681811061146957611469612b92565b905060200201602081019061147e91906128b9565b6001600160a01b0316929190612169565b8061149981612b1c565b91505061142a565b6114a961210a565b600054600160a01b900460ff16156114d35760405162461bcd60e51b8152600401610a3a90612c94565b6114dd6000612244565b565b6000546001600160a01b031690565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316620960456040518163ffffffff1660e01b8152600401602060405180830381865afa15801561154b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061156f9190612ae9565b6001600160a01b0316336001600160a01b0316146116105760405162461bcd60e51b815260206004820152605260248201527f4f43595f436f6e7665785f433a3a7570646174654f435459444c2829205f6d7360448201527f6753656e646572282920213d20495a69766f65476c6f62616c735f4f43595f436064820152716f6e7665785f432847424c292e5a564c282960701b608482015260a401610a3a565b6001600160a01b0381166116825760405162461bcd60e51b815260206004820152603360248201527f4f43595f436f6e7665785f433a3a7570646174654f435459444c2829205f4f43604482015272545f59444c203d3d206164647265737328302960681b6064820152608401610a3a565b6002546040516001600160a01b03918216918316907f82f2be5c35e63cad0f00b86cbce7d31261fd13665d7c5b210a5828dd5494d05390600090a3600280546001600160a01b0319166001600160a01b0392909216919091179055565b6116e761210a565b60405162461bcd60e51b815260206004820152603c60248201527f5a69766f654c6f636b65723a3a70757368546f4c6f636b65724d756c7469455260448201527b433732312829202163616e507573684d756c7469455243373231282960201b6064820152608401610a3a565b85811015610ba05786868281811061176e5761176e612b92565b905060200201602081019061178391906128b9565b6001600160a01b031663b88d4fde6117996114df565b308888868181106117ac576117ac612b92565b905060200201358787878181106117c5576117c5612b92565b90506020028101906117d79190612ba8565b6040518663ffffffff1660e01b81526004016117f7959493929190612b5e565b600060405180830381600087803b15801561181157600080fd5b505af1158015611825573d6000803e3d6000fd5b50505050808061183490612b1c565b915050611754565b61184461210a565b6004546001600160a01b038481169116146118c15760405162461bcd60e51b815260206004820152603760248201527f4f43595f436f6e7665785f433a3a70756c6c46726f6d4c6f636b65722829206160448201527639b9b2ba10109e9031b7b73b32bc2837b7b62a37b5b2b760491b6064820152608401610a3a565b6118cb6000610580565b6005546040516370a0823160e01b81526001600160a01b039091169063c32e72029082906370a08231906119039030906004016124ba565b602060405180830381865afa158015611920573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119449190612ad0565b6040516001600160e01b031960e084901b1681526004810191909152600060248201526044016020604051808303816000875af1158015611989573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119ad9190612ab3565b506000806119bd83850185612cc9565b6040805160028082526060820183529395509193506000929060208301908036833701905050905082816000815181106119f9576119f9612b92565b6020026020010181815250508181600181518110611a1957611a19612b92565b60209081029190910101526007546008546040516370a0823160e01b81526001600160a01b039283169263d40ddb8c9216906370a0823190611a5f9030906004016124ba565b602060405180830381865afa158015611a7c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611aa09190612ad0565b836040518363ffffffff1660e01b8152600401611abe929190612ceb565b600060405180830381600087803b158015611ad857600080fd5b505af1158015611aec573d6000803e3d6000fd5b50505050611b8f611afb6114df565b6040516370a0823160e01b8152736c3ea9036406852006290770bedfcaba0e23a0e8906370a0823190611b329030906004016124ba565b602060405180830381865afa158015611b4f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b739190612ad0565b736c3ea9036406852006290770bedfcaba0e23a0e891906120af565b6112ff611b9a6114df565b6040516370a0823160e01b815273a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48906370a0823190611bd19030906004016124ba565b602060405180830381865afa158015611bee573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c129190612ad0565b73a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4891906120af565b611c3661210a565b6040805162461bcd60e51b8152602060048201526024810191909152600080516020612da483398151915260448201527f5061727469616c2829202163616e50756c6c4d756c74695061727469616c28296064820152608401610a3a565b85811015610ba057611cd2611ca76114df565b868684818110611cb957611cb9612b92565b90506020020135898985818110610c6c57610c6c612b92565b80611cdc81612b1c565b915050611c94565b611cec61210a565b6004546001600160a01b03858116911614611d6f5760405162461bcd60e51b815260206004820152603e60248201527f4f43595f436f6e7665785f433a3a70756c6c46726f6d4c6f636b65725061727460448201527f69616c282920617373657420213d20636f6e766578506f6f6c546f6b656e00006064820152608401610a3a565b611d796000610580565b600554604051636197390160e11b815260048101859052600060248201526001600160a01b039091169063c32e7202906044016020604051808303816000875af1158015611dcb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611def9190612ab3565b50600080611dff83850185612cc9565b604080516002808252606082018352939550919350600092906020830190803683370190505090508281600081518110611e3b57611e3b612b92565b6020026020010181815250508181600181518110611e5b57611e5b612b92565b60209081029190910101526007546008546040516370a0823160e01b81526001600160a01b039283169263d40ddb8c9216906370a0823190611ea19030906004016124ba565b602060405180830381865afa158015611ebe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ee29190612ad0565b836040518363ffffffff1660e01b8152600401611f00929190612ceb565b600060405180830381600087803b158015611f1a57600080fd5b505af1158015611f2e573d6000803e3d6000fd5b50505050611f3d611afb6114df565b610ba0611b9a6114df565b611f5061210a565b600054600160a01b900460ff1615611f7a5760405162461bcd60e51b8152600401610a3a90612c94565b6001600160a01b038116611fe05760405162461bcd60e51b81526020600482015260396024820152600080516020612dc48339815191526044820152782829206e65774f776e6572203d3d206164647265737328302960381b6064820152608401610a3a565b6109ce81612244565b611ff161210a565b60405162461bcd60e51b815260206004820152603460248201527f5a69766f654c6f636b65723a3a70757368546f4c6f636b6572455243313135356044820152732829202163616e5075736845524331313535282960601b6064820152608401610a3a565b6002600154036120a85760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610a3a565b6002600155565b6121058363a9059cbb60e01b84846040516024016120ce929190612d04565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152612294565b505050565b336121136114df565b6001600160a01b0316146114dd5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a3a565b6040516001600160a01b03808516602483015283166044820152606481018290526121a19085906323b872dd60e01b906084016120ce565b50505050565b600081846001600160a01b031663dd62ed3e30866040518363ffffffff1660e01b81526004016121d8929190612c64565b602060405180830381865afa1580156121f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122199190612ad0565b6122239190612d1d565b90506121a18463095ea7b360e01b85846040516024016120ce929190612d04565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006122e9826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166123669092919063ffffffff16565b80519091501561210557808060200190518101906123079190612ab3565b6121055760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610a3a565b6060610a4c848460008585600080866001600160a01b0316858760405161238d9190612d54565b60006040518083038185875af1925050503d80600081146123ca576040519150601f19603f3d011682016040523d82523d6000602084013e6123cf565b606091505b50915091506123e0878383876123eb565b979650505050505050565b6060831561245a578251600003612453576001600160a01b0385163b6124535760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610a3a565b5081610a4c565b610a4c838381511561246f5781518083602001fd5b8060405162461bcd60e51b8152600401610a3a9190612d70565b60006020828403121561249b57600080fd5b81356001600160e01b0319811681146124b357600080fd5b9392505050565b6001600160a01b0391909116815260200190565b80151581146109ce57600080fd5b6000602082840312156124ee57600080fd5b81356124b3816124ce565b6001600160a01b03811681146109ce57600080fd5b60008083601f84011261252057600080fd5b5081356001600160401b0381111561253757600080fd5b60208301915083602082850101111561254f57600080fd5b9250929050565b6000806000806060858703121561256c57600080fd5b8435612577816124f9565b93506020850135925060408501356001600160401b0381111561259957600080fd5b6125a58782880161250e565b95989497509550505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156125ef576125ef6125b1565b604052919050565b600082601f83011261260857600080fd5b81356001600160401b03811115612621576126216125b1565b612634601f8201601f19166020016125c7565b81815284602083860101111561264957600080fd5b816020850160208301376000918101602001919091529392505050565b6000806000806080858703121561267c57600080fd5b8435612687816124f9565b93506020850135612697816124f9565b92506040850135915060608501356001600160401b038111156126b957600080fd5b6126c5878288016125f7565b91505092959194509250565b60008083601f8401126126e357600080fd5b5081356001600160401b038111156126fa57600080fd5b6020830191508360208260051b850101111561254f57600080fd5b6000806000806000806060878903121561272e57600080fd5b86356001600160401b038082111561274557600080fd5b6127518a838b016126d1565b9098509650602089013591508082111561276a57600080fd5b6127768a838b016126d1565b9096509450604089013591508082111561278f57600080fd5b5061279c89828a016126d1565b979a9699509497509295939492505050565b600080600080604085870312156127c457600080fd5b84356001600160401b03808211156127db57600080fd5b6127e7888389016126d1565b9096509450602087013591508082111561280057600080fd5b506125a5878288016126d1565b60008060008060008060006080888a03121561282857600080fd5b8735612833816124f9565b965060208801356001600160401b038082111561284f57600080fd5b61285b8b838c016126d1565b909850965060408a013591508082111561287457600080fd5b6128808b838c016126d1565b909650945060608a013591508082111561289957600080fd5b506128a68a828b0161250e565b989b979a50959850939692959293505050565b6000602082840312156128cb57600080fd5b81356124b3816124f9565b600082601f8301126128e757600080fd5b813560206001600160401b03821115612902576129026125b1565b8160051b6129118282016125c7565b928352848101820192828101908785111561292b57600080fd5b83870192505b848310156123e057823582529183019190830190612931565b600080600080600060a0868803121561296257600080fd5b853561296d816124f9565b9450602086013561297d816124f9565b935060408601356001600160401b038082111561299957600080fd5b6129a589838a016128d6565b945060608801359150808211156129bb57600080fd5b6129c789838a016128d6565b935060808801359150808211156129dd57600080fd5b506129ea888289016125f7565b9150509295509295909350565b600080600060408486031215612a0c57600080fd5b8335612a17816124f9565b925060208401356001600160401b03811115612a3257600080fd5b612a3e8682870161250e565b9497909650939450505050565b600080600080600060a08688031215612a6357600080fd5b8535612a6e816124f9565b94506020860135612a7e816124f9565b9350604086013592506060860135915060808601356001600160401b03811115612aa757600080fd5b6129ea888289016125f7565b600060208284031215612ac557600080fd5b81516124b3816124ce565b600060208284031215612ae257600080fd5b5051919050565b600060208284031215612afb57600080fd5b81516124b3816124f9565b634e487b7160e01b600052601160045260246000fd5b600060018201612b2e57612b2e612b06565b5060010190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b03868116825285166020820152604081018490526080606082018190526000906123e09083018486612b35565b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112612bbf57600080fd5b8301803591506001600160401b03821115612bd957600080fd5b60200191503681900382131561254f57600080fd5b600060208284031215612c0057600080fd5b5035919050565b600081518084526020808501945080840160005b83811015612c3757815187529582019590820190600101612c1b565b509495945050505050565b604081526000612c556040830185612c07565b90508260208301529392505050565b6001600160a01b0392831681529116602082015260400190565b634e487b7160e01b600052600160045260246000fd5b6020808252818101527f4f776e61626c654c6f636b65643a3a756e6c6f636b65642829206c6f636b6564604082015260600190565b60008060408385031215612cdc57600080fd5b50508035926020909101359150565b828152604060208201526000610a4c6040830184612c07565b6001600160a01b03929092168252602082015260400190565b8082018082111561057a5761057a612b06565b60005b83811015612d4b578181015183820152602001612d33565b50506000910152565b60008251612d66818460208701612d30565b9190910192915050565b6020815260008251806020840152612d8f816040850160208701612d30565b601f01601f1916919091016040019291505056fe5a69766f654c6f636b65723a3a70756c6c46726f6d4c6f636b65724d756c74694f776e61626c654c6f636b65643a3a7472616e736665724f776e657273686970a2646970667358221220f78f3bc80a6d9610deed31e520b521ad3cdab9044357a866534a6785dc9c7ddb64736f6c63430008110033000000000000000000000000b65a66621d7de34afec9b9ac0755133051550dd7000000000000000000000000ea537eb0bbcc7783bdf7c595bf9371984583da660000000000000000000000006172f8103d156c49532e610232d33f0796e6ef87
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106102255760003560e01c806301ffc9a71461022a5780630b9c91fa146102525780630e6878a3146102725780631205217614610287578063150b7a021461029a57806315e98744146102c65780631852b383146102d957806319165874146102e05780631d9389e9146102f3578063215cccdd146103065780632f08d48b146102d95780633c117244146102d95780633ce8d4321461030d5780633eda81ad14610306578063422b201814610334578063423156321461034757806349a5e73b1461035a57806358289c7e1461037157806364c77735146103065780636a7ab9af14610384578063715018a614610397578063759cb53b1461039f57806379054cc9146103ba578063885d37e9146103cd57806389a30271146103e05780638b648ee2146102d95780638da5cb5b146103fb578063945c9142146104035780639e19789d1461041e578063a4a3e79d146102d9578063a785a3a814610439578063a891c6841461044c578063b0607cf8146102d9578063b892bcc01461045f578063bc197c8114610472578063c70ecd5614610491578063cd45e1fb146104a4578063cf10b7ab146102d9578063cf309012146104b7578063d284af94146104cb578063d8f2a78b146104de578063dd913bdb146102d9578063e7f4462914610306578063f1641cbe146104f1578063f23a6e6114610504578063f2fde38b14610523578063fd76f59d14610536575b600080fd5b61023d610238366004612489565b610549565b60405190151581526020015b60405180910390f35b600354610265906001600160a01b031681565b60405161024991906124ba565b6102856102803660046124dc565b610580565b005b610285610295366004612556565b6109d1565b6102ad6102a8366004612666565b610a43565b6040516001600160e01b03199091168152602001610249565b6102856102d4366004612715565b610a54565b600061023d565b6102856102ee3660046127ae565b610ba9565b610285610301366004612556565b610caa565b600161023d565b6102657f000000000000000000000000ea537eb0bbcc7783bdf7c595bf9371984583da6681565b61028561034236600461280d565b610d15565b610285610355366004612556565b610d84565b61036360065481565b604051908152602001610249565b61028561037f3660046128b9565b611307565b610285610392366004612715565b6113c1565b6102856114a1565b610265734e3fbd56cd56c3e72c1403e103b45db9da5b9d2b81565b600554610265906001600160a01b031681565b600454610265906001600160a01b031681565b61026573a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4881565b6102656114df565b61026573d533a949740bb3306d119cc777fa900ba034cd5281565b610265736c3ea9036406852006290770bedfcaba0e23a0e881565b6102856104473660046128b9565b6114ee565b600754610265906001600160a01b031681565b61028561046d366004612715565b6116df565b6102ad61048036600461294a565b63bc197c8160e01b95945050505050565b600854610265906001600160a01b031681565b6102856104b23660046129f7565b61183c565b60005461023d90600160a01b900460ff1681565b6102856104d9366004612715565b611c2e565b6102856104ec366004612556565b611ce4565b600254610265906001600160a01b031681565b6102ad610512366004612a4b565b63f23a6e6160e01b95945050505050565b6102856105313660046128b9565b611f48565b61028561054436600461280d565b611fe9565b60006001600160e01b03198216630271189760e51b148061057a57506301ffc9a760e01b6001600160e01b03198316145b92915050565b610588612056565b600560009054906101000a90046001600160a01b03166001600160a01b0316633d18b9126040518163ffffffff1660e01b81526004016020604051808303816000875af11580156105dd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106019190612ab3565b506040516370a0823160e01b815260009073d533a949740bb3306d119cc777fa900ba034cd52906370a082319061063c9030906004016124ba565b602060405180830381865afa158015610659573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061067d9190612ad0565b6040516370a0823160e01b8152909150600090734e3fbd56cd56c3e72c1403e103b45db9da5b9d2b906370a08231906106ba9030906004016124ba565b602060405180830381865afa1580156106d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106fb9190612ad0565b9050811561072f5760025461072f9073d533a949740bb3306d119cc777fa900ba034cd52906001600160a01b0316846120af565b80156107615760025461076190734e3fbd56cd56c3e72c1403e103b45db9da5b9d2b906001600160a01b0316836120af565b82156109c3576005546040805163355688fd60e21b815290516000926001600160a01b03169163d55a23f49160048083019260209291908290030181865afa1580156107b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107d59190612ad0565b905060005b818110156109c057600554604051632061aa2360e11b8152600481018390526000916001600160a01b0316906340c3544690602401602060405180830381865afa15801561082c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108509190612ae9565b90506000816001600160a01b031663f7c618c16040518163ffffffff1660e01b8152600401602060405180830381865afa158015610892573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108b69190612ae9565b6001600160a01b031663fc0c546a6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108f3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109179190612ae9565b90506000816001600160a01b03166370a08231306040518263ffffffff1660e01b815260040161094791906124ba565b602060405180830381865afa158015610964573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109889190612ad0565b905080156109aa576002546109aa906001600160a01b038481169116836120af565b50505080806109b890612b1c565b9150506107da565b50505b50506109ce60018055565b50565b6109d961210a565b60405162461bcd60e51b815260206004820152603460248201527f5a69766f654c6f636b65723a3a70756c6c46726f6d4c6f636b65724552433732604482015273312829202163616e50756c6c455243373231282960601b60648201526084015b60405180910390fd5b630a85bd0160e11b5b949350505050565b610a5c61210a565b60405162461bcd60e51b815260206004820152603e6024820152600080516020612da483398151915260448201527f4552433732312829202163616e50756c6c4d756c7469455243373231282900006064820152608401610a3a565b85811015610ba057868682818110610ad257610ad2612b92565b9050602002016020810190610ae791906128b9565b6001600160a01b031663b88d4fde30610afe6114df565b888886818110610b1057610b10612b92565b90506020020135878787818110610b2957610b29612b92565b9050602002810190610b3b9190612ba8565b6040518663ffffffff1660e01b8152600401610b5b959493929190612b5e565b600060405180830381600087803b158015610b7557600080fd5b505af1158015610b89573d6000803e3d6000fd5b505050508080610b9890612b1c565b915050610ab8565b50505050505050565b610bb161210a565b60005b83811015610ca357610c91610bc76114df565b868684818110610bd957610bd9612b92565b9050602002016020810190610bee91906128b9565b6001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401610c1991906124ba565b602060405180830381865afa158015610c36573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c5a9190612ad0565b878785818110610c6c57610c6c612b92565b9050602002016020810190610c8191906128b9565b6001600160a01b031691906120af565b80610c9b81612b1c565b915050610bb4565b5050505050565b610cb261210a565b60405162461bcd60e51b815260206004820152603260248201527f5a69766f654c6f636b65723a3a70757368546f4c6f636b65724552433732312860448201527129202163616e50757368455243373231282960701b6064820152608401610a3a565b610d1d61210a565b60405162461bcd60e51b815260206004820152603660248201527f5a69766f654c6f636b65723a3a70756c6c46726f6d4c6f636b6572455243313160448201527535352829202163616e50756c6c45524331313535282960501b6064820152608401610a3a565b610d8c61210a565b6001600160a01b038416736c3ea9036406852006290770bedfcaba0e23a0e81480610dd357506001600160a01b03841673a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48145b610e445760405162461bcd60e51b815260206004820152603c60248201527f4f43595f436f6e7665785f433a3a70757368546f4c6f636b657228292061737360448201527b657420213d20505955534420262620617373657420213d205553444360201b6064820152608401610a3a565b610e61610e4f6114df565b6001600160a01b038616903086612169565b6000610e6f82840184612bee565b9050736c3ea9036406852006290770bedfcaba0e23a0e7196001600160a01b0386160161100057600754610ec290736c3ea9036406852006290770bedfcaba0e23a0e8906001600160a01b0316866121a7565b6040805160028082526060820183526000926020830190803683370190505090508481600081518110610ef757610ef7612b92565b6020908102919091010152600754604051635b96faef60e11b81526001600160a01b039091169063b72df5de90610f349084908690600401612c42565b600060405180830381600087803b158015610f4e57600080fd5b505af1158015610f62573d6000803e3d6000fd5b5050600754604051636eb1769f60e11b8152736c3ea9036406852006290770bedfcaba0e23a0e8935063dd62ed3e9250610fac9130916001600160a01b0390911690600401612c64565b602060405180830381865afa158015610fc9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fed9190612ad0565b15610ffa57610ffa612c7e565b50611166565b60075461102c9073a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48906001600160a01b0316866121a7565b604080516002808252606082018352600092602083019080368337019050509050848160018151811061106157611061612b92565b6020908102919091010152600754604051635b96faef60e11b81526001600160a01b039091169063b72df5de9061109e9084908690600401612c42565b600060405180830381600087803b1580156110b857600080fd5b505af11580156110cc573d6000803e3d6000fd5b5050600754604051636eb1769f60e11b815273a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48935063dd62ed3e92506111169130916001600160a01b0390911690600401612c64565b602060405180830381865afa158015611133573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111579190612ad0565b1561116457611164612c7e565b505b6008546040516370a0823160e01b81526000916001600160a01b0316906370a08231906111979030906004016124ba565b602060405180830381865afa1580156111b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111d89190612ad0565b6003546008549192506111f8916001600160a01b039081169116836121a7565b6003546006546040516321d0683360e11b8152600481019190915260248101839052600160448201526001600160a01b03909116906343a0d066906064016020604051808303816000875af1158015611255573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112799190612ab3565b50600854600354604051636eb1769f60e11b81526001600160a01b039283169263dd62ed3e926112b192309290911690600401612c64565b602060405180830381865afa1580156112ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112f29190612ad0565b156112ff576112ff612c7e565b505050505050565b61130f61210a565b600054600160a01b900460ff16156113395760405162461bcd60e51b8152600401610a3a90612c94565b6001600160a01b0381166113a5576040805162461bcd60e51b8152602060048201526024810191909152600080516020612dc483398151915260448201527f416e644c6f636b2829206e65774f776e6572203d3d20616464726573732830296064820152608401610a3a565b6000805460ff60a01b1916600160a01b1790556109ce81612244565b6113c961210a565b60405162461bcd60e51b815260206004820152603060248201527f5a69766f654c6f636b65723a3a70757368546f4c6f636b65724d756c7469282960448201526f202163616e507573684d756c7469282960801b6064820152608401610a3a565b85811015610ba05761148f61143d6114df565b3087878581811061145057611450612b92565b905060200201358a8a8681811061146957611469612b92565b905060200201602081019061147e91906128b9565b6001600160a01b0316929190612169565b8061149981612b1c565b91505061142a565b6114a961210a565b600054600160a01b900460ff16156114d35760405162461bcd60e51b8152600401610a3a90612c94565b6114dd6000612244565b565b6000546001600160a01b031690565b7f000000000000000000000000ea537eb0bbcc7783bdf7c595bf9371984583da666001600160a01b0316620960456040518163ffffffff1660e01b8152600401602060405180830381865afa15801561154b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061156f9190612ae9565b6001600160a01b0316336001600160a01b0316146116105760405162461bcd60e51b815260206004820152605260248201527f4f43595f436f6e7665785f433a3a7570646174654f435459444c2829205f6d7360448201527f6753656e646572282920213d20495a69766f65476c6f62616c735f4f43595f436064820152716f6e7665785f432847424c292e5a564c282960701b608482015260a401610a3a565b6001600160a01b0381166116825760405162461bcd60e51b815260206004820152603360248201527f4f43595f436f6e7665785f433a3a7570646174654f435459444c2829205f4f43604482015272545f59444c203d3d206164647265737328302960681b6064820152608401610a3a565b6002546040516001600160a01b03918216918316907f82f2be5c35e63cad0f00b86cbce7d31261fd13665d7c5b210a5828dd5494d05390600090a3600280546001600160a01b0319166001600160a01b0392909216919091179055565b6116e761210a565b60405162461bcd60e51b815260206004820152603c60248201527f5a69766f654c6f636b65723a3a70757368546f4c6f636b65724d756c7469455260448201527b433732312829202163616e507573684d756c7469455243373231282960201b6064820152608401610a3a565b85811015610ba05786868281811061176e5761176e612b92565b905060200201602081019061178391906128b9565b6001600160a01b031663b88d4fde6117996114df565b308888868181106117ac576117ac612b92565b905060200201358787878181106117c5576117c5612b92565b90506020028101906117d79190612ba8565b6040518663ffffffff1660e01b81526004016117f7959493929190612b5e565b600060405180830381600087803b15801561181157600080fd5b505af1158015611825573d6000803e3d6000fd5b50505050808061183490612b1c565b915050611754565b61184461210a565b6004546001600160a01b038481169116146118c15760405162461bcd60e51b815260206004820152603760248201527f4f43595f436f6e7665785f433a3a70756c6c46726f6d4c6f636b65722829206160448201527639b9b2ba10109e9031b7b73b32bc2837b7b62a37b5b2b760491b6064820152608401610a3a565b6118cb6000610580565b6005546040516370a0823160e01b81526001600160a01b039091169063c32e72029082906370a08231906119039030906004016124ba565b602060405180830381865afa158015611920573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119449190612ad0565b6040516001600160e01b031960e084901b1681526004810191909152600060248201526044016020604051808303816000875af1158015611989573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119ad9190612ab3565b506000806119bd83850185612cc9565b6040805160028082526060820183529395509193506000929060208301908036833701905050905082816000815181106119f9576119f9612b92565b6020026020010181815250508181600181518110611a1957611a19612b92565b60209081029190910101526007546008546040516370a0823160e01b81526001600160a01b039283169263d40ddb8c9216906370a0823190611a5f9030906004016124ba565b602060405180830381865afa158015611a7c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611aa09190612ad0565b836040518363ffffffff1660e01b8152600401611abe929190612ceb565b600060405180830381600087803b158015611ad857600080fd5b505af1158015611aec573d6000803e3d6000fd5b50505050611b8f611afb6114df565b6040516370a0823160e01b8152736c3ea9036406852006290770bedfcaba0e23a0e8906370a0823190611b329030906004016124ba565b602060405180830381865afa158015611b4f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b739190612ad0565b736c3ea9036406852006290770bedfcaba0e23a0e891906120af565b6112ff611b9a6114df565b6040516370a0823160e01b815273a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48906370a0823190611bd19030906004016124ba565b602060405180830381865afa158015611bee573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c129190612ad0565b73a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4891906120af565b611c3661210a565b6040805162461bcd60e51b8152602060048201526024810191909152600080516020612da483398151915260448201527f5061727469616c2829202163616e50756c6c4d756c74695061727469616c28296064820152608401610a3a565b85811015610ba057611cd2611ca76114df565b868684818110611cb957611cb9612b92565b90506020020135898985818110610c6c57610c6c612b92565b80611cdc81612b1c565b915050611c94565b611cec61210a565b6004546001600160a01b03858116911614611d6f5760405162461bcd60e51b815260206004820152603e60248201527f4f43595f436f6e7665785f433a3a70756c6c46726f6d4c6f636b65725061727460448201527f69616c282920617373657420213d20636f6e766578506f6f6c546f6b656e00006064820152608401610a3a565b611d796000610580565b600554604051636197390160e11b815260048101859052600060248201526001600160a01b039091169063c32e7202906044016020604051808303816000875af1158015611dcb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611def9190612ab3565b50600080611dff83850185612cc9565b604080516002808252606082018352939550919350600092906020830190803683370190505090508281600081518110611e3b57611e3b612b92565b6020026020010181815250508181600181518110611e5b57611e5b612b92565b60209081029190910101526007546008546040516370a0823160e01b81526001600160a01b039283169263d40ddb8c9216906370a0823190611ea19030906004016124ba565b602060405180830381865afa158015611ebe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ee29190612ad0565b836040518363ffffffff1660e01b8152600401611f00929190612ceb565b600060405180830381600087803b158015611f1a57600080fd5b505af1158015611f2e573d6000803e3d6000fd5b50505050611f3d611afb6114df565b610ba0611b9a6114df565b611f5061210a565b600054600160a01b900460ff1615611f7a5760405162461bcd60e51b8152600401610a3a90612c94565b6001600160a01b038116611fe05760405162461bcd60e51b81526020600482015260396024820152600080516020612dc48339815191526044820152782829206e65774f776e6572203d3d206164647265737328302960381b6064820152608401610a3a565b6109ce81612244565b611ff161210a565b60405162461bcd60e51b815260206004820152603460248201527f5a69766f654c6f636b65723a3a70757368546f4c6f636b6572455243313135356044820152732829202163616e5075736845524331313535282960601b6064820152608401610a3a565b6002600154036120a85760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610a3a565b6002600155565b6121058363a9059cbb60e01b84846040516024016120ce929190612d04565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152612294565b505050565b336121136114df565b6001600160a01b0316146114dd5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a3a565b6040516001600160a01b03808516602483015283166044820152606481018290526121a19085906323b872dd60e01b906084016120ce565b50505050565b600081846001600160a01b031663dd62ed3e30866040518363ffffffff1660e01b81526004016121d8929190612c64565b602060405180830381865afa1580156121f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122199190612ad0565b6122239190612d1d565b90506121a18463095ea7b360e01b85846040516024016120ce929190612d04565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006122e9826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166123669092919063ffffffff16565b80519091501561210557808060200190518101906123079190612ab3565b6121055760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610a3a565b6060610a4c848460008585600080866001600160a01b0316858760405161238d9190612d54565b60006040518083038185875af1925050503d80600081146123ca576040519150601f19603f3d011682016040523d82523d6000602084013e6123cf565b606091505b50915091506123e0878383876123eb565b979650505050505050565b6060831561245a578251600003612453576001600160a01b0385163b6124535760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610a3a565b5081610a4c565b610a4c838381511561246f5781518083602001fd5b8060405162461bcd60e51b8152600401610a3a9190612d70565b60006020828403121561249b57600080fd5b81356001600160e01b0319811681146124b357600080fd5b9392505050565b6001600160a01b0391909116815260200190565b80151581146109ce57600080fd5b6000602082840312156124ee57600080fd5b81356124b3816124ce565b6001600160a01b03811681146109ce57600080fd5b60008083601f84011261252057600080fd5b5081356001600160401b0381111561253757600080fd5b60208301915083602082850101111561254f57600080fd5b9250929050565b6000806000806060858703121561256c57600080fd5b8435612577816124f9565b93506020850135925060408501356001600160401b0381111561259957600080fd5b6125a58782880161250e565b95989497509550505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156125ef576125ef6125b1565b604052919050565b600082601f83011261260857600080fd5b81356001600160401b03811115612621576126216125b1565b612634601f8201601f19166020016125c7565b81815284602083860101111561264957600080fd5b816020850160208301376000918101602001919091529392505050565b6000806000806080858703121561267c57600080fd5b8435612687816124f9565b93506020850135612697816124f9565b92506040850135915060608501356001600160401b038111156126b957600080fd5b6126c5878288016125f7565b91505092959194509250565b60008083601f8401126126e357600080fd5b5081356001600160401b038111156126fa57600080fd5b6020830191508360208260051b850101111561254f57600080fd5b6000806000806000806060878903121561272e57600080fd5b86356001600160401b038082111561274557600080fd5b6127518a838b016126d1565b9098509650602089013591508082111561276a57600080fd5b6127768a838b016126d1565b9096509450604089013591508082111561278f57600080fd5b5061279c89828a016126d1565b979a9699509497509295939492505050565b600080600080604085870312156127c457600080fd5b84356001600160401b03808211156127db57600080fd5b6127e7888389016126d1565b9096509450602087013591508082111561280057600080fd5b506125a5878288016126d1565b60008060008060008060006080888a03121561282857600080fd5b8735612833816124f9565b965060208801356001600160401b038082111561284f57600080fd5b61285b8b838c016126d1565b909850965060408a013591508082111561287457600080fd5b6128808b838c016126d1565b909650945060608a013591508082111561289957600080fd5b506128a68a828b0161250e565b989b979a50959850939692959293505050565b6000602082840312156128cb57600080fd5b81356124b3816124f9565b600082601f8301126128e757600080fd5b813560206001600160401b03821115612902576129026125b1565b8160051b6129118282016125c7565b928352848101820192828101908785111561292b57600080fd5b83870192505b848310156123e057823582529183019190830190612931565b600080600080600060a0868803121561296257600080fd5b853561296d816124f9565b9450602086013561297d816124f9565b935060408601356001600160401b038082111561299957600080fd5b6129a589838a016128d6565b945060608801359150808211156129bb57600080fd5b6129c789838a016128d6565b935060808801359150808211156129dd57600080fd5b506129ea888289016125f7565b9150509295509295909350565b600080600060408486031215612a0c57600080fd5b8335612a17816124f9565b925060208401356001600160401b03811115612a3257600080fd5b612a3e8682870161250e565b9497909650939450505050565b600080600080600060a08688031215612a6357600080fd5b8535612a6e816124f9565b94506020860135612a7e816124f9565b9350604086013592506060860135915060808601356001600160401b03811115612aa757600080fd5b6129ea888289016125f7565b600060208284031215612ac557600080fd5b81516124b3816124ce565b600060208284031215612ae257600080fd5b5051919050565b600060208284031215612afb57600080fd5b81516124b3816124f9565b634e487b7160e01b600052601160045260246000fd5b600060018201612b2e57612b2e612b06565b5060010190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b03868116825285166020820152604081018490526080606082018190526000906123e09083018486612b35565b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112612bbf57600080fd5b8301803591506001600160401b03821115612bd957600080fd5b60200191503681900382131561254f57600080fd5b600060208284031215612c0057600080fd5b5035919050565b600081518084526020808501945080840160005b83811015612c3757815187529582019590820190600101612c1b565b509495945050505050565b604081526000612c556040830185612c07565b90508260208301529392505050565b6001600160a01b0392831681529116602082015260400190565b634e487b7160e01b600052600160045260246000fd5b6020808252818101527f4f776e61626c654c6f636b65643a3a756e6c6f636b65642829206c6f636b6564604082015260600190565b60008060408385031215612cdc57600080fd5b50508035926020909101359150565b828152604060208201526000610a4c6040830184612c07565b6001600160a01b03929092168252602082015260400190565b8082018082111561057a5761057a612b06565b60005b83811015612d4b578181015183820152602001612d33565b50506000910152565b60008251612d66818460208701612d30565b9190910192915050565b6020815260008251806020840152612d8f816040850160208701612d30565b601f01601f1916919091016040019291505056fe5a69766f654c6f636b65723a3a70756c6c46726f6d4c6f636b65724d756c74694f776e61626c654c6f636b65643a3a7472616e736665724f776e657273686970a2646970667358221220f78f3bc80a6d9610deed31e520b521ad3cdab9044357a866534a6785dc9c7ddb64736f6c63430008110033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000b65a66621d7de34afec9b9ac0755133051550dd7000000000000000000000000ea537eb0bbcc7783bdf7c595bf9371984583da660000000000000000000000006172f8103d156c49532e610232d33f0796e6ef87
-----Decoded View---------------
Arg [0] : DAO (address): 0xB65a66621D7dE34afec9b9AC0755133051550dD7
Arg [1] : _GBL (address): 0xEa537eB0bBcC7783bDF7c595bF9371984583dA66
Arg [2] : _OCT_YDL (address): 0x6172f8103d156c49532E610232d33F0796E6EF87
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000b65a66621d7de34afec9b9ac0755133051550dd7
Arg [1] : 000000000000000000000000ea537eb0bbcc7783bdf7c595bf9371984583da66
Arg [2] : 0000000000000000000000006172f8103d156c49532e610232d33f0796e6ef87
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
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.