Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
OCE_ZVE
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 IZivoeGlobals_OCE_ZVE {
/// @notice Returns the address of the ZivoeRewards ($zJTT) contract.
function stJTT() external view returns (address);
/// @notice Returns the address of the ZivoeRewards ($zSTT) contract.
function stSTT() external view returns (address);
/// @notice Returns the address of the ZivoeRewards ($ZVE) contract.
function stZVE() external view returns (address);
/// @notice Returns the address of the Timelock contract.
function TLC() external view returns (address);
/// @notice Returns the address of the ZivoeToken contract.
function ZVE() external view returns (address);
}
interface IZivoeRewards_OCE_ZVE {
/// @notice Deposits a reward to this contract for distribution.
/// @param _rewardsToken The asset that's being distributed.
/// @param reward The amount of the _rewardsToken to deposit.
function depositReward(address _rewardsToken, uint256 reward) external;
}
/// @notice This contract facilitates an exponential decay emissions schedule for $ZVE.
/// This contract has the following responsibilities:
/// - Handles accounting (with governable variables) to support emissions schedule.
/// - Forwards $ZVE to all ZivoeRewards contracts at will (stZVE, stSTT, stJTT).
contract OCE_ZVE is ZivoeLocker, ReentrancyGuard {
using SafeERC20 for IERC20;
// ---------------------
// State Variables
// ---------------------
address public immutable GBL; /// @dev The ZivoeGlobals contract.
uint256 public exponentialDecayPerSecond = RAY * 99999999 / 100000000; /// @dev The rate of decay per second.
uint256 public lastDistribution; /// @dev The block.timestamp value of last distribution.
/// @dev Determines distribution between rewards contract, in BIPS.
/// @dev Sum of distributionRatioBIPS[0], distributionRatioBIPS[1], and distributionRatioBIPS[2] must equal BIPS.
/// distributionRatioBIPS[0] => stZVE
/// distributionRatioBIPS[1] => stSTT
/// distributionRatioBIPS[2] => stJTT
uint256[3] public distributionRatioBIPS;
uint256 private constant BIPS = 10000;
uint256 private constant RAY = 10 ** 27;
// -----------------
// Constructor
// -----------------
/// @notice Initializes the OCE_ZVE contract.
/// @param DAO The administrator of this contract (intended to be ZivoeDAO).
/// @param _GBL The ZivoeGlobals contract.
constructor(address DAO, address _GBL) {
transferOwnershipAndLock(DAO);
GBL = _GBL;
lastDistribution = block.timestamp;
distributionRatioBIPS[0] = 3334;
distributionRatioBIPS[1] = 3333;
distributionRatioBIPS[2] = 3333;
}
// ------------
// Events
// ------------
/// @notice Emitted during updateDistributionRatioBIPS().
/// @param oldRatios The old distribution ratios.
/// @param newRatios The new distribution ratios.
event UpdatedDistributionRatioBIPS(uint256[3] oldRatios, uint256[3] newRatios);
/// @notice Emitted during forwardEmissions().
/// @param stZVE The amount of $ZVE emitted to the $ZVE rewards contract.
/// @param stJTT The amount of $ZVE emitted to the $zJTT rewards contract.
/// @param stSTT The amount of $ZVE emitted to the $zSTT rewards contract.
event EmissionsForwarded(uint256 stZVE, uint256 stJTT, uint256 stSTT);
/// @notice Emitted during updateExponentialDecayPerSecond().
/// @param oldValue The old value of exponentialDecayPerSecond.
/// @param newValue The new value of exponentialDecayPerSecond.
event UpdatedExponentialDecayPerSecond(uint256 oldValue, uint256 newValue);
// ---------------
// Functions
// ---------------
/// @notice Permission for owner to call pushToLocker().
function canPush() public override pure returns (bool) { return true; }
/// @notice Permission for owner to call pullFromLocker().
function canPull() public override pure returns (bool) { return true; }
/// @notice Permission for owner to call pullFromLockerPartial().
function canPullPartial() public override pure returns (bool) { return true; }
/// @notice Allocates ZVE from the DAO to this locker for emissions.
/// @dev Only callable by the DAO.
/// @param asset The asset to push to this locker (in this case $ZVE).
/// @param amount The amount of $ZVE to push to this locker.
/// @param data Accompanying transaction data.
function pushToLocker(address asset, uint256 amount, bytes calldata data) external override onlyOwner {
require(
asset == IZivoeGlobals_OCE_ZVE(GBL).ZVE(),
"OCE_ZVE::pushToLocker() asset != IZivoeGlobals_OCE_ZVE(GBL).ZVE()"
);
IERC20(asset).safeTransferFrom(owner(), address(this), amount);
}
/// @notice Forwards $ZVE available for distribution.
function forwardEmissions() external nonReentrant {
uint zveBalance = IERC20(IZivoeGlobals_OCE_ZVE(GBL).ZVE()).balanceOf(address(this));
_forwardEmissions(zveBalance - decay(zveBalance, block.timestamp - lastDistribution));
lastDistribution = block.timestamp;
}
/// @notice This handles the accounting for forwarding ZVE to lockers privately.
/// @param amount The amount of $ZVE to distribute.
function _forwardEmissions(uint256 amount) private {
require(amount >= 100 ether, "OCE_ZVE::_forwardEmissions amount < 100 ether");
uint amountZero = amount * distributionRatioBIPS[0] / BIPS;
uint amountOne = amount * distributionRatioBIPS[1] / BIPS;
uint amountTwo = amount * distributionRatioBIPS[2] / BIPS;
address ZVE = IZivoeGlobals_OCE_ZVE(GBL).ZVE();
address stZVE = IZivoeGlobals_OCE_ZVE(GBL).stZVE();
address stSTT = IZivoeGlobals_OCE_ZVE(GBL).stSTT();
address stJTT = IZivoeGlobals_OCE_ZVE(GBL).stJTT();
emit EmissionsForwarded(amountZero, amountOne, amountTwo);
IERC20(ZVE).safeIncreaseAllowance(stZVE, amountZero);
IERC20(ZVE).safeIncreaseAllowance(stSTT, amountOne);
IERC20(ZVE).safeIncreaseAllowance(stJTT, amountTwo);
IZivoeRewards_OCE_ZVE(stZVE).depositReward(ZVE, amountZero);
IZivoeRewards_OCE_ZVE(stSTT).depositReward(ZVE, amountOne);
IZivoeRewards_OCE_ZVE(stJTT).depositReward(ZVE, amountTwo);
}
/// @notice Updates the distribution between rewards contract, in BIPS.
/// @dev The sum of distributionRatioBIPS[0], [1], and [2] must equal BIPS.
/// @param _distributionRatioBIPS The updated values for the state variable distributionRatioBIPS.
function updateDistributionRatioBIPS(uint256[3] calldata _distributionRatioBIPS) external {
require(
_msgSender() == IZivoeGlobals_OCE_ZVE(GBL).TLC(),
"OCE_ZVE::updateDistributionRatioBIPS() _msgSender() != IZivoeGlobals_OCE_ZVE(GBL).TLC()"
);
require(
_distributionRatioBIPS[0] + _distributionRatioBIPS[1] + _distributionRatioBIPS[2] == BIPS,
"OCE_ZVE::updateDistributionRatioBIPS() sum(_distributionRatioBIPS[0-2]) != BIPS"
);
emit UpdatedDistributionRatioBIPS(distributionRatioBIPS, _distributionRatioBIPS);
distributionRatioBIPS[0] = _distributionRatioBIPS[0];
distributionRatioBIPS[1] = _distributionRatioBIPS[1];
distributionRatioBIPS[2] = _distributionRatioBIPS[2];
}
/// @notice Updates the exponentialDecayPerSecond variable with provided input.
/// @dev For 1.0000% decrease per second, _exponentialDecayPerSecond would be (1 - 0.01) * RAY.
/// @dev For 0.0001% decrease per second, _exponentialDecayPerSecond would be (1 - 0.000001) * RAY.
/// @param _exponentialDecayPerSecond The updated value for exponentialDecayPerSecond state variable.
function updateExponentialDecayPerSecond(uint256 _exponentialDecayPerSecond) external {
require(
_msgSender() == IZivoeGlobals_OCE_ZVE(GBL).TLC(),
"OCE_ZVE::updateExponentialDecayPerSecond() _msgSender() != IZivoeGlobals_OCE_ZVE(GBL).TLC()"
);
require(
_exponentialDecayPerSecond >= RAY * 99999998 / 100000000,
"OCE_ZVE::updateExponentialDecayPerSecond() _exponentialDecayPerSecond < RAY * 99999998 / 100000000"
);
require(
_exponentialDecayPerSecond < RAY,
"OCE_ZVE::updateExponentialDecayPerSecond() _exponentialDecayPerSecond >= RAY"
);
emit UpdatedExponentialDecayPerSecond(exponentialDecayPerSecond, _exponentialDecayPerSecond);
exponentialDecayPerSecond = _exponentialDecayPerSecond;
}
// ----------
// Math
// ----------
/// @notice Returns the amount remaining after a decay.
/// @param top The amount decaying.
/// @param dur The seconds of decay.
function decay(uint256 top, uint256 dur) public view returns (uint256) {
return rmul(top, rpow(exponentialDecayPerSecond, dur, RAY));
}
// rmul() and rpow() were ported from MakerDAO:
// https://github.com/makerdao/dss/blob/master/src/abaci.sol
/// @notice Multiplies two variables and returns value, truncated by RAY precision.
/// @param x First value to multiply.
/// @param y Second value to multiply.
/// @return z Resulting value of x * y, truncated by RAY precision.
function rmul(uint256 x, uint256 y) internal pure returns (uint256 z) {
z = x * y;
require(y == 0 || z / y == x, "OCE_ZVE::rmul() y != 0 && z / y != x");
z = z / RAY;
}
/**
@notice rpow(uint256 x, uint256 n, uint256 b), used for exponentiation in drip, is a fixed-point arithmetic
function that raises x to the power n. It is implemented in Solidity assembly as a repeated squaring
algorithm. x and the returned value are to be interpreted as fixed-point integers with scaling factor b.
For example, if b == 100, this specifies two decimal digits of precision and the normal decimal value
2.1 would be represented as 210; rpow(210, 2, 100) returns 441 (the two-decimal digit fixed-point
representation of 2.1^2 = 4.41). In the current implementation, 10^27 is passed for b, making x and
the rpow result both of type RAY in standard MCD fixed-point terminology. rpow's formal invariants
include "no overflow" as well as constraints on gas usage.
@param x The base value.
@param n The power to raise "x" by.
@param b The scaling factor, a.k.a. resulting precision of "z".
@return z Resulting value of x^n, scaled by factor b.
*/
function rpow(uint256 x, uint256 n, uint256 b) internal pure returns (uint256 z) {
assembly {
switch n case 0 { z := b }
default {
switch x case 0 { z := 0 }
default {
switch mod(n, 2) case 0 { z := b } default { z := x }
let half := div(b, 2) // For rounding.
for { n := div(n, 2) } n { n := div(n,2) } {
let xx := mul(x, x)
if shr(128, x) { revert(0,0) }
let xxRound := add(xx, half)
if lt(xxRound, xx) { revert(0,0) }
x := div(xxRound, b)
if mod(n,2) {
let zx := mul(z, x)
if and(iszero(iszero(x)), iszero(eq(div(zx, x), z))) { revert(0,0) }
let zxRound := add(zx, half)
if lt(zxRound, zx) { revert(0,0) }
z := div(zxRound, b)
}
}
}
}
}
}
}// 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"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"stZVE","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"stJTT","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"stSTT","type":"uint256"}],"name":"EmissionsForwarded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256[3]","name":"oldRatios","type":"uint256[3]"},{"indexed":false,"internalType":"uint256[3]","name":"newRatios","type":"uint256[3]"}],"name":"UpdatedDistributionRatioBIPS","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oldValue","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newValue","type":"uint256"}],"name":"UpdatedExponentialDecayPerSecond","type":"event"},{"inputs":[],"name":"GBL","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":"view","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":"uint256","name":"top","type":"uint256"},{"internalType":"uint256","name":"dur","type":"uint256"}],"name":"decay","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"distributionRatioBIPS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"exponentialDecayPerSecond","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"forwardEmissions","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lastDistribution","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"uint256[3]","name":"_distributionRatioBIPS","type":"uint256[3]"}],"name":"updateDistributionRatioBIPS","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_exponentialDecayPerSecond","type":"uint256"}],"name":"updateExponentialDecayPerSecond","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
60a06040526305f5e100620000256b033b2e3c9fd0803ce80000006305f5e0ff6200025f565b6200003191906200028b565b6002553480156200004157600080fd5b5060405162002ca938038062002ca98339810160408190526200006491620002cb565b6200006f33620000a6565b600180556200007e82620000f6565b6001600160a01b03166080525042600355610d06600455610d05600581905560065562000303565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6200010062000201565b600054600160a01b900460ff1615620001605760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c654c6f636b65643a3a756e6c6f636b65642829206c6f636b656460448201526064015b60405180910390fd5b6001600160a01b038116620001e0576040805162461bcd60e51b81526020600482015260248101919091527f4f776e61626c654c6f636b65643a3a7472616e736665724f776e65727368697060448201527f416e644c6f636b2829206e65774f776e6572203d3d2061646472657373283029606482015260840162000157565b6000805460ff60a01b1916600160a01b179055620001fe81620000a6565b50565b6000546001600160a01b031633146200025d5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640162000157565b565b80820281158282048414176200028557634e487b7160e01b600052601160045260246000fd5b92915050565b600082620002a957634e487b7160e01b600052601260045260246000fd5b500490565b80516001600160a01b0381168114620002c657600080fd5b919050565b60008060408385031215620002df57600080fd5b620002ea83620002ae565b9150620002fa60208401620002ae565b90509250929050565b60805161295262000357600039600081816102c30152818161049901528181610aa101528181610d1801528181611041015281816117e80152818161186e015281816118f4015261197a01526129526000f3fe608060405234801561001057600080fd5b50600436106101e35760003560e01c806301ffc9a7146101e857806309918eab146102105780631205217614610225578063150b7a021461023857806315e98744146102645780631852b38314610277578063191658741461027e5780631d9389e9146102915780631de7a162146102a4578063215cccdd146102b75780632f08d48b146102775780633c117244146102775780633ce8d432146102be5780633eda81ad14610277578063422b2018146102f2578063423156321461030557806358289c7e1461031857806364c77735146102b75780636a7ab9af1461032b578063715018a61461033e5780638b648ee2146102775780638da5cb5b1461034657806392ffcefb1461034e578063a4a3e79d14610277578063a717639c14610356578063b0607cf814610277578063b892bcc01461036d578063b8e4514e14610380578063bc197c8114610393578063cd45e1fb146103b2578063cf10b7ab14610277578063cf309012146103c5578063d284af94146103d9578063d8f2a78b146103ec578063dd913bdb14610277578063e7f44629146102b7578063f23a6e61146103ff578063f2fde38b1461041e578063f3c1639f14610431578063f59603091461043a578063fd76f59d1461044d575b600080fd5b6101fb6101f6366004611f87565b610460565b60405190151581526020015b60405180910390f35b61022361021e366004611fb1565b610497565b005b610223610233366004612027565b610712565b61024b610246366004612137565b61077f565b6040516001600160e01b03199091168152602001610207565b6102236102723660046121e6565b610790565b60006101fb565b61022361028c36600461227f565b6108e5565b61022361029f366004612027565b610a34565b6102236102b23660046122de565b610a9f565b60016101fb565b6102e57f000000000000000000000000000000000000000000000000000000000000000081565b6040516102079190612306565b61022361030036600461231a565b610c9f565b610223610313366004612027565b610d0e565b6102236103263660046123c6565b610e4b565b6102236103393660046121e6565b610f08565b610223610fe8565b6102e5611026565b610223611035565b61035f60035481565b604051908152602001610207565b61022361037b3660046121e6565b611161565b61035f61038e3660046123e3565b6112be565b61024b6103a1366004612479565b63bc197c8160e01b95945050505050565b6102236103c0366004612526565b6112e8565b6000546101fb90600160a01b900460ff1681565b6102236103e73660046121e6565b61137e565b6102236103fa366004612027565b611434565b61024b61040d36600461257a565b63f23a6e6160e01b95945050505050565b61022361042c3660046123c6565b611458565b61035f60025481565b61035f610448366004611fb1565b6114f9565b61022361045b36600461231a565b611510565b60006001600160e01b03198216630271189760e51b148061049157506301ffc9a760e01b6001600160e01b03198316145b92915050565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663c76d41c86040518163ffffffff1660e01b8152600401602060405180830381865afa1580156104f5573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061051991906125e2565b6001600160a01b0316336001600160a01b0316146105b65760405162461bcd60e51b815260206004820152605b60248201526000805160206128dd83398151915260448201527f65725365636f6e642829205f6d736753656e646572282920213d20495a69766f60648201527a65476c6f62616c735f4f43455f5a56452847424c292e544c43282960281b608482015260a4015b60405180910390fd5b6305f5e1006105d4676765c793fa10079d601b1b6305f5e0fe612615565b6105de919061262c565b8110156106605760405162461bcd60e51b815260206004820152606260248201526000805160206128dd833981519152604482015260008051602061289d83398151915260648201527f65636f6e64203c20524159202a203939393939393938202f2031303030303030608482015261030360f41b60a482015260c4016105ad565b676765c793fa10079d601b1b81106106d15760405162461bcd60e51b815260206004820152604c60248201526000805160206128dd833981519152604482015260008051602061289d83398151915260648201526b65636f6e64203e3d2052415960a01b608482015260a4016105ad565b60025460408051918252602082018390527f0daf10a3c0545c8b5252c177d4d830a2497b8c178cf944cb5f9d099fed097272910160405180910390a1600255565b61071a61157d565b60405162461bcd60e51b815260206004820152603460248201527f5a69766f654c6f636b65723a3a70756c6c46726f6d4c6f636b65724552433732604482015273312829202163616e50756c6c455243373231282960601b60648201526084016105ad565b630a85bd0160e11b5b949350505050565b61079861157d565b60405162461bcd60e51b815260206004820152603e602482015260008051602061287d83398151915260448201527f4552433732312829202163616e50756c6c4d756c74694552433732312829000060648201526084016105ad565b858110156108dc5786868281811061080e5761080e6126ab565b905060200201602081019061082391906123c6565b6001600160a01b031663b88d4fde3061083a611026565b88888681811061084c5761084c6126ab565b90506020020135878787818110610865576108656126ab565b905060200281019061087791906126c1565b6040518663ffffffff1660e01b8152600401610897959493929190612677565b600060405180830381600087803b1580156108b157600080fd5b505af11580156108c5573d6000803e3d6000fd5b5050505080806108d490612707565b9150506107f4565b50505050505050565b6108ed61157d565b60405162461bcd60e51b8152602060048201526032602482015260008051602061287d8339815191526044820152712829202163616e50756c6c4d756c7469282960701b60648201526084016105ad565b83811015610a2d57610a1b610951611026565b868684818110610963576109636126ab565b905060200201602081019061097891906123c6565b6001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016109a39190612306565b602060405180830381865afa1580156109c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109e49190612720565b8787858181106109f6576109f66126ab565b9050602002016020810190610a0b91906123c6565b6001600160a01b031691906115dc565b80610a2581612707565b91505061093e565b5050505050565b610a3c61157d565b60405162461bcd60e51b815260206004820152603260248201527f5a69766f654c6f636b65723a3a70757368546f4c6f636b65724552433732312860448201527129202163616e50757368455243373231282960701b60648201526084016105ad565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663c76d41c86040518163ffffffff1660e01b8152600401602060405180830381865afa158015610afd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b2191906125e2565b6001600160a01b0316336001600160a01b031614610bb55760405162461bcd60e51b815260206004820152605760248201526000805160206128fd83398151915260448201527f424950532829205f6d736753656e646572282920213d20495a69766f65476c6f60648201527662616c735f4f43455f5a56452847424c292e544c43282960481b608482015260a4016105ad565b6127106040820135610bcc60208401358435612739565b610bd69190612739565b14610c4f5760405162461bcd60e51b815260206004820152604f60248201526000805160206128fd83398151915260448201527f4249505328292073756d285f646973747269627574696f6e526174696f42495060648201526e535b302d325d2920213d204249505360881b608482015260a4016105ad565b7f78de14f6b87332f7b42d6f9ce9534275c3f593bdc64e5514fabeac41322ba679600482604051610c8192919061274c565b60405180910390a18035600455602081013560055560400135600655565b610ca761157d565b60405162461bcd60e51b815260206004820152603660248201527f5a69766f654c6f636b65723a3a70756c6c46726f6d4c6f636b6572455243313160448201527535352829202163616e50756c6c45524331313535282960501b60648201526084016105ad565b610d1661157d565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316639af6c40e6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d74573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d9891906125e2565b6001600160a01b0316846001600160a01b031614610e285760405162461bcd60e51b815260206004820152604160248201527f4f43455f5a56453a3a70757368546f4c6f636b6572282920617373657420213d60448201527f20495a69766f65476c6f62616c735f4f43455f5a56452847424c292e5a5645286064820152602960f81b608482015260a4016105ad565b610e45610e33611026565b6001600160a01b038616903086611632565b50505050565b610e5361157d565b600054600160a01b900460ff1615610e7d5760405162461bcd60e51b81526004016105ad90612786565b6001600160a01b038116610ee9576040805162461bcd60e51b81526020600482015260248101919091526000805160206128bd83398151915260448201527f416e644c6f636b2829206e65774f776e6572203d3d206164647265737328302960648201526084016105ad565b6000805460ff60a01b1916600160a01b179055610f058161166a565b50565b610f1061157d565b60405162461bcd60e51b815260206004820152603060248201527f5a69766f654c6f636b65723a3a70757368546f4c6f636b65724d756c7469282960448201526f202163616e507573684d756c7469282960801b60648201526084016105ad565b858110156108dc57610fd6610f84611026565b30878785818110610f9757610f976126ab565b905060200201358a8a86818110610fb057610fb06126ab565b9050602002016020810190610fc591906123c6565b6001600160a01b0316929190611632565b80610fe081612707565b915050610f71565b610ff061157d565b600054600160a01b900460ff161561101a5760405162461bcd60e51b81526004016105ad90612786565b611024600061166a565b565b6000546001600160a01b031690565b61103d6116ba565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316639af6c40e6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561109d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110c191906125e2565b6001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016110ec9190612306565b602060405180830381865afa158015611109573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061112d9190612720565b9050611153611144826003544261038e91906127bb565b61114e90836127bb565b611713565b504260035561102460018055565b61116961157d565b60405162461bcd60e51b815260206004820152603c60248201527f5a69766f654c6f636b65723a3a70757368546f4c6f636b65724d756c7469455260448201527b433732312829202163616e507573684d756c7469455243373231282960201b60648201526084016105ad565b858110156108dc578686828181106111f0576111f06126ab565b905060200201602081019061120591906123c6565b6001600160a01b031663b88d4fde61121b611026565b3088888681811061122e5761122e6126ab565b90506020020135878787818110611247576112476126ab565b905060200281019061125991906126c1565b6040518663ffffffff1660e01b8152600401611279959493929190612677565b600060405180830381600087803b15801561129357600080fd5b505af11580156112a7573d6000803e3d6000fd5b5050505080806112b690612707565b9150506111d6565b60006112e1836112dc60025485676765c793fa10079d601b1b611ba4565b611c62565b9392505050565b6112f061157d565b6113796112fb611026565b6040516370a0823160e01b81526001600160a01b038616906370a0823190611327903090600401612306565b602060405180830381865afa158015611344573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113689190612720565b6001600160a01b03861691906115dc565b505050565b61138661157d565b6040805162461bcd60e51b815260206004820152602481019190915260008051602061287d83398151915260448201527f5061727469616c2829202163616e50756c6c4d756c74695061727469616c282960648201526084016105ad565b858110156108dc576114226113f7611026565b868684818110611409576114096126ab565b905060200201358989858181106109f6576109f66126ab565b8061142c81612707565b9150506113e4565b61143c61157d565b610e45611447611026565b6001600160a01b03861690856115dc565b61146061157d565b600054600160a01b900460ff161561148a5760405162461bcd60e51b81526004016105ad90612786565b6001600160a01b0381166114f05760405162461bcd60e51b815260206004820152603960248201526000805160206128bd8339815191526044820152782829206e65774f776e6572203d3d206164647265737328302960381b60648201526084016105ad565b610f058161166a565b6004816003811061150957600080fd5b0154905081565b61151861157d565b60405162461bcd60e51b815260206004820152603460248201527f5a69766f654c6f636b65723a3a70757368546f4c6f636b6572455243313135356044820152732829202163616e5075736845524331313535282960601b60648201526084016105ad565b33611586611026565b6001600160a01b0316146110245760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105ad565b6113798363a9059cbb60e01b84846040516024016115fb9291906127ce565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611cf2565b6040516001600160a01b0380851660248301528316604482015260648101829052610e459085906323b872dd60e01b906084016115fb565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60026001540361170c5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016105ad565b6002600155565b68056bc75e2d631000008110156117825760405162461bcd60e51b815260206004820152602d60248201527f4f43455f5a56453a3a5f666f7277617264456d697373696f6e7320616d6f756e60448201526c3a101e101898181032ba3432b960991b60648201526084016105ad565b600061271060048201546117969084612615565b6117a0919061262c565b905060006127106004600101546117b79085612615565b6117c1919061262c565b905060006127106004600201546117d89086612615565b6117e2919061262c565b905060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316639af6c40e6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611844573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061186891906125e2565b905060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d9fa86ed6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156118ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118ee91906125e2565b905060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166372ad4ba06040518163ffffffff1660e01b8152600401602060405180830381865afa158015611950573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061197491906125e2565b905060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d8c58b6a6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156119d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119fa91906125e2565b60408051898152602081018990529081018790529091507f200bc13416e01daa18815e6e0a84612ed4d6ec7f549dae658548a504df3900b59060600160405180910390a1611a526001600160a01b0385168489611dc4565b611a666001600160a01b0385168388611dc4565b611a7a6001600160a01b0385168287611dc4565b604051637db4e28f60e01b81526001600160a01b03841690637db4e28f90611aa89087908b906004016127ce565b600060405180830381600087803b158015611ac257600080fd5b505af1158015611ad6573d6000803e3d6000fd5b5050604051637db4e28f60e01b81526001600160a01b0385169250637db4e28f9150611b089087908a906004016127ce565b600060405180830381600087803b158015611b2257600080fd5b505af1158015611b36573d6000803e3d6000fd5b5050604051637db4e28f60e01b81526001600160a01b0384169250637db4e28f9150611b6890879089906004016127ce565b600060405180830381600087803b158015611b8257600080fd5b505af1158015611b96573d6000803e3d6000fd5b505050505050505050505050565b6000828015611c5657848015611c4b57600185168015611bc657869350611bca565b8493505b50600284046002860495505b8515611c45578687028760801c15611bed57600080fd5b81810181811015611bfd57600080fd5b8690049750506001861615611c3a578684028488820414158815151615611c2357600080fd5b81810181811015611c3357600080fd5b8690049450505b600286049550611bd6565b50611c50565b600092505b50611c5a565b8291505b509392505050565b6000611c6e8284612615565b9050811580611c85575082611c83838361262c565b145b611cdd5760405162461bcd60e51b8152602060048201526024808201527f4f43455f5a56453a3a726d756c2829207920213d2030202626207a202f2079206044820152630427a40f60e31b60648201526084016105ad565b6112e1676765c793fa10079d601b1b8261262c565b6000611d47826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611e649092919063ffffffff16565b8051909150156113795780806020019051810190611d6591906127e7565b6113795760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016105ad565b604051636eb1769f60e11b81523060048201526001600160a01b038381166024830152600091839186169063dd62ed3e90604401602060405180830381865afa158015611e15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e399190612720565b611e439190612739565b9050610e458463095ea7b360e01b85846040516024016115fb9291906127ce565b6060610788848460008585600080866001600160a01b03168587604051611e8b919061282d565b60006040518083038185875af1925050503d8060008114611ec8576040519150601f19603f3d011682016040523d82523d6000602084013e611ecd565b606091505b5091509150611ede87838387611ee9565b979650505050505050565b60608315611f58578251600003611f51576001600160a01b0385163b611f515760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016105ad565b5081610788565b6107888383815115611f6d5781518083602001fd5b8060405162461bcd60e51b81526004016105ad9190612849565b600060208284031215611f9957600080fd5b81356001600160e01b0319811681146112e157600080fd5b600060208284031215611fc357600080fd5b5035919050565b6001600160a01b0381168114610f0557600080fd5b60008083601f840112611ff157600080fd5b5081356001600160401b0381111561200857600080fd5b60208301915083602082850101111561202057600080fd5b9250929050565b6000806000806060858703121561203d57600080fd5b843561204881611fca565b93506020850135925060408501356001600160401b0381111561206a57600080fd5b61207687828801611fdf565b95989497509550505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156120c0576120c0612082565b604052919050565b600082601f8301126120d957600080fd5b81356001600160401b038111156120f2576120f2612082565b612105601f8201601f1916602001612098565b81815284602083860101111561211a57600080fd5b816020850160208301376000918101602001919091529392505050565b6000806000806080858703121561214d57600080fd5b843561215881611fca565b9350602085013561216881611fca565b92506040850135915060608501356001600160401b0381111561218a57600080fd5b612196878288016120c8565b91505092959194509250565b60008083601f8401126121b457600080fd5b5081356001600160401b038111156121cb57600080fd5b6020830191508360208260051b850101111561202057600080fd5b600080600080600080606087890312156121ff57600080fd5b86356001600160401b038082111561221657600080fd5b6122228a838b016121a2565b9098509650602089013591508082111561223b57600080fd5b6122478a838b016121a2565b9096509450604089013591508082111561226057600080fd5b5061226d89828a016121a2565b979a9699509497509295939492505050565b6000806000806040858703121561229557600080fd5b84356001600160401b03808211156122ac57600080fd5b6122b8888389016121a2565b909650945060208701359150808211156122d157600080fd5b50612076878288016121a2565b6000606082840312156122f057600080fd5b8260608301111561230057600080fd5b50919050565b6001600160a01b0391909116815260200190565b60008060008060008060006080888a03121561233557600080fd5b873561234081611fca565b965060208801356001600160401b038082111561235c57600080fd5b6123688b838c016121a2565b909850965060408a013591508082111561238157600080fd5b61238d8b838c016121a2565b909650945060608a01359150808211156123a657600080fd5b506123b38a828b01611fdf565b989b979a50959850939692959293505050565b6000602082840312156123d857600080fd5b81356112e181611fca565b600080604083850312156123f657600080fd5b50508035926020909101359150565b600082601f83011261241657600080fd5b813560206001600160401b0382111561243157612431612082565b8160051b612440828201612098565b928352848101820192828101908785111561245a57600080fd5b83870192505b84831015611ede57823582529183019190830190612460565b600080600080600060a0868803121561249157600080fd5b853561249c81611fca565b945060208601356124ac81611fca565b935060408601356001600160401b03808211156124c857600080fd5b6124d489838a01612405565b945060608801359150808211156124ea57600080fd5b6124f689838a01612405565b9350608088013591508082111561250c57600080fd5b50612519888289016120c8565b9150509295509295909350565b60008060006040848603121561253b57600080fd5b833561254681611fca565b925060208401356001600160401b0381111561256157600080fd5b61256d86828701611fdf565b9497909650939450505050565b600080600080600060a0868803121561259257600080fd5b853561259d81611fca565b945060208601356125ad81611fca565b9350604086013592506060860135915060808601356001600160401b038111156125d657600080fd5b612519888289016120c8565b6000602082840312156125f457600080fd5b81516112e181611fca565b634e487b7160e01b600052601160045260246000fd5b8082028115828204841417610491576104916125ff565b60008261264957634e487b7160e01b600052601260045260246000fd5b500490565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b0386811682528516602082015260408101849052608060608201819052600090611ede908301848661264e565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126126d857600080fd5b8301803591506001600160401b038211156126f257600080fd5b60200191503681900382131561202057600080fd5b600060018201612719576127196125ff565b5060010190565b60006020828403121561273257600080fd5b5051919050565b80820180821115610491576104916125ff565b60c08101818460005b6003811015612774578154835260209092019160019182019101612755565b50505060608360608401379392505050565b6020808252818101527f4f776e61626c654c6f636b65643a3a756e6c6f636b65642829206c6f636b6564604082015260600190565b81810381811115610491576104916125ff565b6001600160a01b03929092168252602082015260400190565b6000602082840312156127f957600080fd5b815180151581146112e157600080fd5b60005b8381101561282457818101518382015260200161280c565b50506000910152565b6000825161283f818460208701612809565b9190910192915050565b6020815260008251806020840152612868816040850160208701612809565b601f01601f1916919091016040019291505056fe5a69766f654c6f636b65723a3a70756c6c46726f6d4c6f636b65724d756c746965725365636f6e642829205f6578706f6e656e7469616c4465636179506572534f776e61626c654c6f636b65643a3a7472616e736665724f776e6572736869704f43455f5a56453a3a7570646174654578706f6e656e7469616c4465636179504f43455f5a56453a3a757064617465446973747269627574696f6e526174696fa2646970667358221220f916210db1fe1c9ba289140a3915b05d1c2363ec5bbef36627e6c04402e9f36a64736f6c63430008110033000000000000000000000000b65a66621d7de34afec9b9ac0755133051550dd7000000000000000000000000ea537eb0bbcc7783bdf7c595bf9371984583da66
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101e35760003560e01c806301ffc9a7146101e857806309918eab146102105780631205217614610225578063150b7a021461023857806315e98744146102645780631852b38314610277578063191658741461027e5780631d9389e9146102915780631de7a162146102a4578063215cccdd146102b75780632f08d48b146102775780633c117244146102775780633ce8d432146102be5780633eda81ad14610277578063422b2018146102f2578063423156321461030557806358289c7e1461031857806364c77735146102b75780636a7ab9af1461032b578063715018a61461033e5780638b648ee2146102775780638da5cb5b1461034657806392ffcefb1461034e578063a4a3e79d14610277578063a717639c14610356578063b0607cf814610277578063b892bcc01461036d578063b8e4514e14610380578063bc197c8114610393578063cd45e1fb146103b2578063cf10b7ab14610277578063cf309012146103c5578063d284af94146103d9578063d8f2a78b146103ec578063dd913bdb14610277578063e7f44629146102b7578063f23a6e61146103ff578063f2fde38b1461041e578063f3c1639f14610431578063f59603091461043a578063fd76f59d1461044d575b600080fd5b6101fb6101f6366004611f87565b610460565b60405190151581526020015b60405180910390f35b61022361021e366004611fb1565b610497565b005b610223610233366004612027565b610712565b61024b610246366004612137565b61077f565b6040516001600160e01b03199091168152602001610207565b6102236102723660046121e6565b610790565b60006101fb565b61022361028c36600461227f565b6108e5565b61022361029f366004612027565b610a34565b6102236102b23660046122de565b610a9f565b60016101fb565b6102e57f000000000000000000000000ea537eb0bbcc7783bdf7c595bf9371984583da6681565b6040516102079190612306565b61022361030036600461231a565b610c9f565b610223610313366004612027565b610d0e565b6102236103263660046123c6565b610e4b565b6102236103393660046121e6565b610f08565b610223610fe8565b6102e5611026565b610223611035565b61035f60035481565b604051908152602001610207565b61022361037b3660046121e6565b611161565b61035f61038e3660046123e3565b6112be565b61024b6103a1366004612479565b63bc197c8160e01b95945050505050565b6102236103c0366004612526565b6112e8565b6000546101fb90600160a01b900460ff1681565b6102236103e73660046121e6565b61137e565b6102236103fa366004612027565b611434565b61024b61040d36600461257a565b63f23a6e6160e01b95945050505050565b61022361042c3660046123c6565b611458565b61035f60025481565b61035f610448366004611fb1565b6114f9565b61022361045b36600461231a565b611510565b60006001600160e01b03198216630271189760e51b148061049157506301ffc9a760e01b6001600160e01b03198316145b92915050565b7f000000000000000000000000ea537eb0bbcc7783bdf7c595bf9371984583da666001600160a01b031663c76d41c86040518163ffffffff1660e01b8152600401602060405180830381865afa1580156104f5573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061051991906125e2565b6001600160a01b0316336001600160a01b0316146105b65760405162461bcd60e51b815260206004820152605b60248201526000805160206128dd83398151915260448201527f65725365636f6e642829205f6d736753656e646572282920213d20495a69766f60648201527a65476c6f62616c735f4f43455f5a56452847424c292e544c43282960281b608482015260a4015b60405180910390fd5b6305f5e1006105d4676765c793fa10079d601b1b6305f5e0fe612615565b6105de919061262c565b8110156106605760405162461bcd60e51b815260206004820152606260248201526000805160206128dd833981519152604482015260008051602061289d83398151915260648201527f65636f6e64203c20524159202a203939393939393938202f2031303030303030608482015261030360f41b60a482015260c4016105ad565b676765c793fa10079d601b1b81106106d15760405162461bcd60e51b815260206004820152604c60248201526000805160206128dd833981519152604482015260008051602061289d83398151915260648201526b65636f6e64203e3d2052415960a01b608482015260a4016105ad565b60025460408051918252602082018390527f0daf10a3c0545c8b5252c177d4d830a2497b8c178cf944cb5f9d099fed097272910160405180910390a1600255565b61071a61157d565b60405162461bcd60e51b815260206004820152603460248201527f5a69766f654c6f636b65723a3a70756c6c46726f6d4c6f636b65724552433732604482015273312829202163616e50756c6c455243373231282960601b60648201526084016105ad565b630a85bd0160e11b5b949350505050565b61079861157d565b60405162461bcd60e51b815260206004820152603e602482015260008051602061287d83398151915260448201527f4552433732312829202163616e50756c6c4d756c74694552433732312829000060648201526084016105ad565b858110156108dc5786868281811061080e5761080e6126ab565b905060200201602081019061082391906123c6565b6001600160a01b031663b88d4fde3061083a611026565b88888681811061084c5761084c6126ab565b90506020020135878787818110610865576108656126ab565b905060200281019061087791906126c1565b6040518663ffffffff1660e01b8152600401610897959493929190612677565b600060405180830381600087803b1580156108b157600080fd5b505af11580156108c5573d6000803e3d6000fd5b5050505080806108d490612707565b9150506107f4565b50505050505050565b6108ed61157d565b60405162461bcd60e51b8152602060048201526032602482015260008051602061287d8339815191526044820152712829202163616e50756c6c4d756c7469282960701b60648201526084016105ad565b83811015610a2d57610a1b610951611026565b868684818110610963576109636126ab565b905060200201602081019061097891906123c6565b6001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016109a39190612306565b602060405180830381865afa1580156109c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109e49190612720565b8787858181106109f6576109f66126ab565b9050602002016020810190610a0b91906123c6565b6001600160a01b031691906115dc565b80610a2581612707565b91505061093e565b5050505050565b610a3c61157d565b60405162461bcd60e51b815260206004820152603260248201527f5a69766f654c6f636b65723a3a70757368546f4c6f636b65724552433732312860448201527129202163616e50757368455243373231282960701b60648201526084016105ad565b7f000000000000000000000000ea537eb0bbcc7783bdf7c595bf9371984583da666001600160a01b031663c76d41c86040518163ffffffff1660e01b8152600401602060405180830381865afa158015610afd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b2191906125e2565b6001600160a01b0316336001600160a01b031614610bb55760405162461bcd60e51b815260206004820152605760248201526000805160206128fd83398151915260448201527f424950532829205f6d736753656e646572282920213d20495a69766f65476c6f60648201527662616c735f4f43455f5a56452847424c292e544c43282960481b608482015260a4016105ad565b6127106040820135610bcc60208401358435612739565b610bd69190612739565b14610c4f5760405162461bcd60e51b815260206004820152604f60248201526000805160206128fd83398151915260448201527f4249505328292073756d285f646973747269627574696f6e526174696f42495060648201526e535b302d325d2920213d204249505360881b608482015260a4016105ad565b7f78de14f6b87332f7b42d6f9ce9534275c3f593bdc64e5514fabeac41322ba679600482604051610c8192919061274c565b60405180910390a18035600455602081013560055560400135600655565b610ca761157d565b60405162461bcd60e51b815260206004820152603660248201527f5a69766f654c6f636b65723a3a70756c6c46726f6d4c6f636b6572455243313160448201527535352829202163616e50756c6c45524331313535282960501b60648201526084016105ad565b610d1661157d565b7f000000000000000000000000ea537eb0bbcc7783bdf7c595bf9371984583da666001600160a01b0316639af6c40e6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d74573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d9891906125e2565b6001600160a01b0316846001600160a01b031614610e285760405162461bcd60e51b815260206004820152604160248201527f4f43455f5a56453a3a70757368546f4c6f636b6572282920617373657420213d60448201527f20495a69766f65476c6f62616c735f4f43455f5a56452847424c292e5a5645286064820152602960f81b608482015260a4016105ad565b610e45610e33611026565b6001600160a01b038616903086611632565b50505050565b610e5361157d565b600054600160a01b900460ff1615610e7d5760405162461bcd60e51b81526004016105ad90612786565b6001600160a01b038116610ee9576040805162461bcd60e51b81526020600482015260248101919091526000805160206128bd83398151915260448201527f416e644c6f636b2829206e65774f776e6572203d3d206164647265737328302960648201526084016105ad565b6000805460ff60a01b1916600160a01b179055610f058161166a565b50565b610f1061157d565b60405162461bcd60e51b815260206004820152603060248201527f5a69766f654c6f636b65723a3a70757368546f4c6f636b65724d756c7469282960448201526f202163616e507573684d756c7469282960801b60648201526084016105ad565b858110156108dc57610fd6610f84611026565b30878785818110610f9757610f976126ab565b905060200201358a8a86818110610fb057610fb06126ab565b9050602002016020810190610fc591906123c6565b6001600160a01b0316929190611632565b80610fe081612707565b915050610f71565b610ff061157d565b600054600160a01b900460ff161561101a5760405162461bcd60e51b81526004016105ad90612786565b611024600061166a565b565b6000546001600160a01b031690565b61103d6116ba565b60007f000000000000000000000000ea537eb0bbcc7783bdf7c595bf9371984583da666001600160a01b0316639af6c40e6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561109d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110c191906125e2565b6001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016110ec9190612306565b602060405180830381865afa158015611109573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061112d9190612720565b9050611153611144826003544261038e91906127bb565b61114e90836127bb565b611713565b504260035561102460018055565b61116961157d565b60405162461bcd60e51b815260206004820152603c60248201527f5a69766f654c6f636b65723a3a70757368546f4c6f636b65724d756c7469455260448201527b433732312829202163616e507573684d756c7469455243373231282960201b60648201526084016105ad565b858110156108dc578686828181106111f0576111f06126ab565b905060200201602081019061120591906123c6565b6001600160a01b031663b88d4fde61121b611026565b3088888681811061122e5761122e6126ab565b90506020020135878787818110611247576112476126ab565b905060200281019061125991906126c1565b6040518663ffffffff1660e01b8152600401611279959493929190612677565b600060405180830381600087803b15801561129357600080fd5b505af11580156112a7573d6000803e3d6000fd5b5050505080806112b690612707565b9150506111d6565b60006112e1836112dc60025485676765c793fa10079d601b1b611ba4565b611c62565b9392505050565b6112f061157d565b6113796112fb611026565b6040516370a0823160e01b81526001600160a01b038616906370a0823190611327903090600401612306565b602060405180830381865afa158015611344573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113689190612720565b6001600160a01b03861691906115dc565b505050565b61138661157d565b6040805162461bcd60e51b815260206004820152602481019190915260008051602061287d83398151915260448201527f5061727469616c2829202163616e50756c6c4d756c74695061727469616c282960648201526084016105ad565b858110156108dc576114226113f7611026565b868684818110611409576114096126ab565b905060200201358989858181106109f6576109f66126ab565b8061142c81612707565b9150506113e4565b61143c61157d565b610e45611447611026565b6001600160a01b03861690856115dc565b61146061157d565b600054600160a01b900460ff161561148a5760405162461bcd60e51b81526004016105ad90612786565b6001600160a01b0381166114f05760405162461bcd60e51b815260206004820152603960248201526000805160206128bd8339815191526044820152782829206e65774f776e6572203d3d206164647265737328302960381b60648201526084016105ad565b610f058161166a565b6004816003811061150957600080fd5b0154905081565b61151861157d565b60405162461bcd60e51b815260206004820152603460248201527f5a69766f654c6f636b65723a3a70757368546f4c6f636b6572455243313135356044820152732829202163616e5075736845524331313535282960601b60648201526084016105ad565b33611586611026565b6001600160a01b0316146110245760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105ad565b6113798363a9059cbb60e01b84846040516024016115fb9291906127ce565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611cf2565b6040516001600160a01b0380851660248301528316604482015260648101829052610e459085906323b872dd60e01b906084016115fb565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60026001540361170c5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016105ad565b6002600155565b68056bc75e2d631000008110156117825760405162461bcd60e51b815260206004820152602d60248201527f4f43455f5a56453a3a5f666f7277617264456d697373696f6e7320616d6f756e60448201526c3a101e101898181032ba3432b960991b60648201526084016105ad565b600061271060048201546117969084612615565b6117a0919061262c565b905060006127106004600101546117b79085612615565b6117c1919061262c565b905060006127106004600201546117d89086612615565b6117e2919061262c565b905060007f000000000000000000000000ea537eb0bbcc7783bdf7c595bf9371984583da666001600160a01b0316639af6c40e6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611844573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061186891906125e2565b905060007f000000000000000000000000ea537eb0bbcc7783bdf7c595bf9371984583da666001600160a01b031663d9fa86ed6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156118ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118ee91906125e2565b905060007f000000000000000000000000ea537eb0bbcc7783bdf7c595bf9371984583da666001600160a01b03166372ad4ba06040518163ffffffff1660e01b8152600401602060405180830381865afa158015611950573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061197491906125e2565b905060007f000000000000000000000000ea537eb0bbcc7783bdf7c595bf9371984583da666001600160a01b031663d8c58b6a6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156119d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119fa91906125e2565b60408051898152602081018990529081018790529091507f200bc13416e01daa18815e6e0a84612ed4d6ec7f549dae658548a504df3900b59060600160405180910390a1611a526001600160a01b0385168489611dc4565b611a666001600160a01b0385168388611dc4565b611a7a6001600160a01b0385168287611dc4565b604051637db4e28f60e01b81526001600160a01b03841690637db4e28f90611aa89087908b906004016127ce565b600060405180830381600087803b158015611ac257600080fd5b505af1158015611ad6573d6000803e3d6000fd5b5050604051637db4e28f60e01b81526001600160a01b0385169250637db4e28f9150611b089087908a906004016127ce565b600060405180830381600087803b158015611b2257600080fd5b505af1158015611b36573d6000803e3d6000fd5b5050604051637db4e28f60e01b81526001600160a01b0384169250637db4e28f9150611b6890879089906004016127ce565b600060405180830381600087803b158015611b8257600080fd5b505af1158015611b96573d6000803e3d6000fd5b505050505050505050505050565b6000828015611c5657848015611c4b57600185168015611bc657869350611bca565b8493505b50600284046002860495505b8515611c45578687028760801c15611bed57600080fd5b81810181811015611bfd57600080fd5b8690049750506001861615611c3a578684028488820414158815151615611c2357600080fd5b81810181811015611c3357600080fd5b8690049450505b600286049550611bd6565b50611c50565b600092505b50611c5a565b8291505b509392505050565b6000611c6e8284612615565b9050811580611c85575082611c83838361262c565b145b611cdd5760405162461bcd60e51b8152602060048201526024808201527f4f43455f5a56453a3a726d756c2829207920213d2030202626207a202f2079206044820152630427a40f60e31b60648201526084016105ad565b6112e1676765c793fa10079d601b1b8261262c565b6000611d47826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611e649092919063ffffffff16565b8051909150156113795780806020019051810190611d6591906127e7565b6113795760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016105ad565b604051636eb1769f60e11b81523060048201526001600160a01b038381166024830152600091839186169063dd62ed3e90604401602060405180830381865afa158015611e15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e399190612720565b611e439190612739565b9050610e458463095ea7b360e01b85846040516024016115fb9291906127ce565b6060610788848460008585600080866001600160a01b03168587604051611e8b919061282d565b60006040518083038185875af1925050503d8060008114611ec8576040519150601f19603f3d011682016040523d82523d6000602084013e611ecd565b606091505b5091509150611ede87838387611ee9565b979650505050505050565b60608315611f58578251600003611f51576001600160a01b0385163b611f515760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016105ad565b5081610788565b6107888383815115611f6d5781518083602001fd5b8060405162461bcd60e51b81526004016105ad9190612849565b600060208284031215611f9957600080fd5b81356001600160e01b0319811681146112e157600080fd5b600060208284031215611fc357600080fd5b5035919050565b6001600160a01b0381168114610f0557600080fd5b60008083601f840112611ff157600080fd5b5081356001600160401b0381111561200857600080fd5b60208301915083602082850101111561202057600080fd5b9250929050565b6000806000806060858703121561203d57600080fd5b843561204881611fca565b93506020850135925060408501356001600160401b0381111561206a57600080fd5b61207687828801611fdf565b95989497509550505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156120c0576120c0612082565b604052919050565b600082601f8301126120d957600080fd5b81356001600160401b038111156120f2576120f2612082565b612105601f8201601f1916602001612098565b81815284602083860101111561211a57600080fd5b816020850160208301376000918101602001919091529392505050565b6000806000806080858703121561214d57600080fd5b843561215881611fca565b9350602085013561216881611fca565b92506040850135915060608501356001600160401b0381111561218a57600080fd5b612196878288016120c8565b91505092959194509250565b60008083601f8401126121b457600080fd5b5081356001600160401b038111156121cb57600080fd5b6020830191508360208260051b850101111561202057600080fd5b600080600080600080606087890312156121ff57600080fd5b86356001600160401b038082111561221657600080fd5b6122228a838b016121a2565b9098509650602089013591508082111561223b57600080fd5b6122478a838b016121a2565b9096509450604089013591508082111561226057600080fd5b5061226d89828a016121a2565b979a9699509497509295939492505050565b6000806000806040858703121561229557600080fd5b84356001600160401b03808211156122ac57600080fd5b6122b8888389016121a2565b909650945060208701359150808211156122d157600080fd5b50612076878288016121a2565b6000606082840312156122f057600080fd5b8260608301111561230057600080fd5b50919050565b6001600160a01b0391909116815260200190565b60008060008060008060006080888a03121561233557600080fd5b873561234081611fca565b965060208801356001600160401b038082111561235c57600080fd5b6123688b838c016121a2565b909850965060408a013591508082111561238157600080fd5b61238d8b838c016121a2565b909650945060608a01359150808211156123a657600080fd5b506123b38a828b01611fdf565b989b979a50959850939692959293505050565b6000602082840312156123d857600080fd5b81356112e181611fca565b600080604083850312156123f657600080fd5b50508035926020909101359150565b600082601f83011261241657600080fd5b813560206001600160401b0382111561243157612431612082565b8160051b612440828201612098565b928352848101820192828101908785111561245a57600080fd5b83870192505b84831015611ede57823582529183019190830190612460565b600080600080600060a0868803121561249157600080fd5b853561249c81611fca565b945060208601356124ac81611fca565b935060408601356001600160401b03808211156124c857600080fd5b6124d489838a01612405565b945060608801359150808211156124ea57600080fd5b6124f689838a01612405565b9350608088013591508082111561250c57600080fd5b50612519888289016120c8565b9150509295509295909350565b60008060006040848603121561253b57600080fd5b833561254681611fca565b925060208401356001600160401b0381111561256157600080fd5b61256d86828701611fdf565b9497909650939450505050565b600080600080600060a0868803121561259257600080fd5b853561259d81611fca565b945060208601356125ad81611fca565b9350604086013592506060860135915060808601356001600160401b038111156125d657600080fd5b612519888289016120c8565b6000602082840312156125f457600080fd5b81516112e181611fca565b634e487b7160e01b600052601160045260246000fd5b8082028115828204841417610491576104916125ff565b60008261264957634e487b7160e01b600052601260045260246000fd5b500490565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b0386811682528516602082015260408101849052608060608201819052600090611ede908301848661264e565b634e487b7160e01b600052603260045260246000fd5b6000808335601e198436030181126126d857600080fd5b8301803591506001600160401b038211156126f257600080fd5b60200191503681900382131561202057600080fd5b600060018201612719576127196125ff565b5060010190565b60006020828403121561273257600080fd5b5051919050565b80820180821115610491576104916125ff565b60c08101818460005b6003811015612774578154835260209092019160019182019101612755565b50505060608360608401379392505050565b6020808252818101527f4f776e61626c654c6f636b65643a3a756e6c6f636b65642829206c6f636b6564604082015260600190565b81810381811115610491576104916125ff565b6001600160a01b03929092168252602082015260400190565b6000602082840312156127f957600080fd5b815180151581146112e157600080fd5b60005b8381101561282457818101518382015260200161280c565b50506000910152565b6000825161283f818460208701612809565b9190910192915050565b6020815260008251806020840152612868816040850160208701612809565b601f01601f1916919091016040019291505056fe5a69766f654c6f636b65723a3a70756c6c46726f6d4c6f636b65724d756c746965725365636f6e642829205f6578706f6e656e7469616c4465636179506572534f776e61626c654c6f636b65643a3a7472616e736665724f776e6572736869704f43455f5a56453a3a7570646174654578706f6e656e7469616c4465636179504f43455f5a56453a3a757064617465446973747269627574696f6e526174696fa2646970667358221220f916210db1fe1c9ba289140a3915b05d1c2363ec5bbef36627e6c04402e9f36a64736f6c63430008110033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000b65a66621d7de34afec9b9ac0755133051550dd7000000000000000000000000ea537eb0bbcc7783bdf7c595bf9371984583da66
-----Decoded View---------------
Arg [0] : DAO (address): 0xB65a66621D7dE34afec9b9AC0755133051550dD7
Arg [1] : _GBL (address): 0xEa537eB0bBcC7783bDF7c595bF9371984583dA66
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000b65a66621d7de34afec9b9ac0755133051550dd7
Arg [1] : 000000000000000000000000ea537eb0bbcc7783bdf7c595bf9371984583da66
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.