Overview
S Balance
0 S
S Value
$0.00More Info
Private Name Tags
ContractCreator
Loading...
Loading
Contract Name:
GaugeFactoryV2
Compiler Version
v0.8.13+commit.abaa5c0e
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.13; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import '../interfaces/IPermissionsRegistry.sol'; import '../interfaces/IGaugeFactoryV2.sol'; import '../GaugeV2.sol'; interface IGauge{ function setDistribution(address _distro) external; function activateEmergencyMode() external; function stopEmergencyMode() external; function setInternalBribe(address intbribe) external; function setRewarderPid(uint256 pid) external; function setGaugeRewarder(address _gr) external; function setFeeVault(address _feeVault) external; } contract GaugeFactoryV2 is IGaugeFactory, OwnableUpgradeable { address public last_gauge; address public permissionsRegistry; address[] internal __gauges; constructor() {} function initialize(address _permissionRegistry) initializer public { __Ownable_init(); //after deploy ownership to multisig permissionsRegistry = _permissionRegistry; } function setRegistry(address _registry) external { require(owner() == msg.sender, 'not owner'); permissionsRegistry = _registry; } function gauges() external view returns(address[] memory) { return __gauges; } function length() external view returns(uint) { return __gauges.length; } function createGaugeV2(address _rewardToken,address _ve,address _token,address _distribution, address _internal_bribe, address _external_bribe, bool _isPair) external onlyAllowed returns (address) { last_gauge = address(new GaugeV2(_rewardToken,_ve,_token,_distribution,_internal_bribe,_external_bribe,_isPair) ); __gauges.push(last_gauge); return last_gauge; } modifier onlyAllowed() { require(owner() == msg.sender || IPermissionsRegistry(permissionsRegistry).hasRole("GAUGE_ADMIN",msg.sender), 'ERR: GAUGE_ADMIN'); _; } modifier EmergencyCouncil() { require( msg.sender == IPermissionsRegistry(permissionsRegistry).emergencyCouncil() ); _; } function activateEmergencyMode( address[] memory _gauges) external EmergencyCouncil { uint i = 0; for ( i ; i < _gauges.length; i++){ IGauge(_gauges[i]).activateEmergencyMode(); } } function stopEmergencyMode( address[] memory _gauges) external EmergencyCouncil { uint i = 0; for ( i ; i < _gauges.length; i++){ IGauge(_gauges[i]).stopEmergencyMode(); } } function setGaugeRewarder( address[] memory _gauges, address[] memory _rewarder) external onlyAllowed { require(_gauges.length == _rewarder.length); uint i = 0; for ( i ; i < _gauges.length; i++){ IGauge(_gauges[i]).setGaugeRewarder(_rewarder[i]); } } function setDistribution(address[] memory _gauges, address distro) external onlyAllowed { uint i = 0; for ( i ; i < _gauges.length; i++){ IGauge(_gauges[i]).setDistribution(distro); } } function setInternalBribe(address[] memory _gauges, address[] memory int_bribe) external onlyAllowed { require(_gauges.length == int_bribe.length); uint i = 0; for ( i ; i < _gauges.length; i++){ IGauge(_gauges[i]).setInternalBribe(int_bribe[i]); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/utils/Initializable.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 OwnableUpgradeable is Initializable, ContextUpgradeable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ function __Ownable_init() internal onlyInitializing { __Ownable_init_unchained(); } function __Ownable_init_unchained() internal onlyInitializing { _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); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol) pragma solidity ^0.8.2; import "../../utils/AddressUpgradeable.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in * case an upgrade adds a module that needs to be initialized. * * For example: * * [.hljs-theme-light.nopadding] * ``` * contract MyToken is ERC20Upgradeable { * function initialize() initializer public { * __ERC20_init("MyToken", "MTK"); * } * } * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { * function initializeV2() reinitializer(2) public { * __ERC20Permit_init("MyToken"); * } * } * ``` * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() { * _disableInitializers(); * } * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. * @custom:oz-retyped-from bool */ uint8 private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint8 version); /** * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, * `onlyInitializing` functions can be used to initialize parent contracts. * * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a * constructor. * * Emits an {Initialized} event. */ modifier initializer() { bool isTopLevelCall = !_initializing; require( (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1), "Initializable: contract is already initialized" ); _initialized = 1; if (isTopLevelCall) { _initializing = true; } _; if (isTopLevelCall) { _initializing = false; emit Initialized(1); } } /** * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be * used to initialize parent contracts. * * A reinitializer may be used after the original initialization step. This is essential to configure modules that * are added through upgrades and that require initialization. * * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer` * cannot be nested. If one is invoked in the context of another, execution will revert. * * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in * a contract, executing them in the right order is up to the developer or operator. * * WARNING: setting the version to 255 will prevent any future reinitialization. * * Emits an {Initialized} event. */ modifier reinitializer(uint8 version) { require(!_initializing && _initialized < version, "Initializable: contract is already initialized"); _initialized = version; _initializing = true; _; _initializing = false; emit Initialized(version); } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} and {reinitializer} modifiers, directly or indirectly. */ modifier onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } /** * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized * to any version. It is recommended to use this to lock implementation contracts that are designed to be called * through proxies. * * Emits an {Initialized} event the first time it is successfully executed. */ function _disableInitializers() internal virtual { require(!_initializing, "Initializable: contract is initializing"); if (_initialized < type(uint8).max) { _initialized = type(uint8).max; emit Initialized(type(uint8).max); } } /** * @dev Internal function that returns the initialized version. Returns `_initialized` */ function _getInitializedVersion() internal view returns (uint8) { return _initialized; } /** * @dev Internal function that returns the initialized version. Returns `_initializing` */ function _isInitializing() internal view returns (bool) { return _initializing; } }
// 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 AddressUpgradeable { /** * @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 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; import "../proxy/utils/Initializable.sol"; /** * @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 ContextUpgradeable is Initializable { function __Context_init() internal onlyInitializing { } function __Context_init_unchained() internal onlyInitializing { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// 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 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) (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 pragma solidity 0.8.13; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import './interfaces/IPair.sol'; import './interfaces/IBribe.sol'; import "./libraries/Math.sol"; import {Constants} from "./libraries/Constants.sol"; interface IRewarder { function onReward( address user, address recipient, uint256 userBalance ) external; } contract GaugeV2 is ReentrancyGuard, Ownable { using SafeERC20 for IERC20; address public constant TOKEN_WITHDRAWER = 0x4D5bCfc14282d930eE09bee96D3a7D5F338251C6; bool public immutable isForPair; bool public emergency; IERC20 public immutable rewardToken; IERC20 public immutable TOKEN; address public VE; address public DISTRIBUTION; address public gaugeRewarder; address public internal_bribe; address public external_bribe; uint256 public immutable DURATION; uint256 internal _periodFinish; uint256 public rewardRate; uint256 public lastUpdateTime; uint256 public rewardPerTokenStored; mapping(address => uint256) public userRewardPerTokenPaid; mapping(address => uint256) public rewards; uint256 internal _totalSupply; mapping(address => uint256) internal _balances; event RewardAdded(uint256 reward); event Deposit(address indexed user, uint256 amount); event Withdraw(address indexed user, uint256 amount); event Harvest(address indexed user, uint256 reward); event ClaimFees(address indexed from, uint256 claimed0, uint256 claimed1); event EmergencyActivated(address indexed gauge, uint256 timestamp); event EmergencyDeactivated(address indexed gauge, uint256 timestamp); modifier updateReward(address account) { rewardPerTokenStored = rewardPerToken(); lastUpdateTime = lastTimeRewardApplicable(); if (account != address(0)) { rewards[account] = earned(account); userRewardPerTokenPaid[account] = rewardPerTokenStored; } _; } modifier onlyDistribution() { require(msg.sender == DISTRIBUTION, "Caller is not RewardsDistribution contract"); _; } modifier isNotEmergency() { require(emergency == false, "emergency"); _; } constructor(address _rewardToken,address _ve,address _token,address _distribution, address _internal_bribe, address _external_bribe, bool _isForPair) { rewardToken = IERC20(_rewardToken); // main reward VE = _ve; // vested TOKEN = IERC20(_token); // underlying (LP) DISTRIBUTION = _distribution; // distro address (voter) DURATION = Constants.EPOCH_LENGTH; // distro time internal_bribe = _internal_bribe; // lp fees goes here external_bribe = _external_bribe; // bribe fees goes here isForPair = _isForPair; // pair boolean, if false no claim_fees emergency = false; // emergency flag } /* ----------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- ONLY OWNER -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- ----------------------------------------------------------------------------- */ ///@notice set distribution address (should be voter) function setDistribution(address _distribution) external onlyOwner { require(_distribution != address(0), "zero addr"); require(_distribution != DISTRIBUTION, "same addr"); DISTRIBUTION = _distribution; } ///@notice set gauge rewarder address function setGaugeRewarder(address _gaugeRewarder) external onlyOwner { require(_gaugeRewarder != gaugeRewarder, "same addr"); gaugeRewarder = _gaugeRewarder; } ///@notice set new internal bribe contract (where to send fees) function setInternalBribe(address _int) external onlyOwner { require(_int >= address(0), "zero"); internal_bribe = _int; } function activateEmergencyMode() external onlyOwner { require(emergency == false, "emergency"); emergency = true; emit EmergencyActivated(address(this), block.timestamp); } function stopEmergencyMode() external onlyOwner { require(emergency == true,"emergency"); emergency = false; emit EmergencyDeactivated(address(this), block.timestamp); } function withdrawExcess(address token, uint256 amount) external { require(msg.sender == TOKEN_WITHDRAWER); require(address(TOKEN) != token && token != address(0) && amount > 0); IERC20(token).safeTransfer(msg.sender, amount); } /* ----------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- VIEW FUNCTIONS -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- ----------------------------------------------------------------------------- */ ///@notice total supply held function totalSupply() public view returns (uint256) { return _totalSupply; } ///@notice balance of a user function balanceOf(address account) external view returns (uint256) { return _balances[account]; } ///@notice last time reward function lastTimeRewardApplicable() public view returns (uint256) { return Math.min(block.timestamp, _periodFinish); } ///@notice reward for a sinle token function rewardPerToken() public view returns (uint256) { if (_totalSupply == 0) { return rewardPerTokenStored; } else { return rewardPerTokenStored + (lastTimeRewardApplicable() - lastUpdateTime) * rewardRate * 1e18 / _totalSupply; } } ///@notice see earned rewards for user function earned(address account) public view returns (uint256) { return rewards[account] + _balances[account] * (rewardPerToken() - userRewardPerTokenPaid[account]) / 1e18; } ///@notice get total reward for the duration function rewardForDuration() external view returns (uint256) { return rewardRate * DURATION; } function periodFinish() external view returns (uint256) { return _periodFinish; } /* ----------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- USER INTERACTION -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- ----------------------------------------------------------------------------- */ ///@notice deposit all TOKEN of msg.sender function depositAll() external { _deposit(TOKEN.balanceOf(msg.sender), msg.sender); } ///@notice deposit amount TOKEN function deposit(uint256 amount) external { _deposit(amount, msg.sender); } ///@notice deposit internal function _deposit(uint256 amount, address account) internal nonReentrant isNotEmergency updateReward(account) { require(amount > 0, "deposit(Gauge): cannot stake 0"); _balances[account] = _balances[account] + amount; _totalSupply = _totalSupply + amount; if (address(gaugeRewarder) != address(0)) { IRewarder(gaugeRewarder).onReward(account, account, _balances[account]); } TOKEN.safeTransferFrom(account, address(this), amount); emit Deposit(account, amount); } ///@notice withdraw all token function withdrawAll() external { _withdraw(_balances[msg.sender]); } ///@notice withdraw a certain amount of TOKEN function withdraw(uint256 amount) external { _withdraw(amount); } ///@notice withdraw internal function _withdraw(uint256 amount) internal nonReentrant isNotEmergency updateReward(msg.sender) { require(amount > 0, "Cannot withdraw 0"); require(_balances[msg.sender] > 0, "no balances"); _totalSupply = _totalSupply - amount; _balances[msg.sender] = _balances[msg.sender] - amount; if (address(gaugeRewarder) != address(0)) { IRewarder(gaugeRewarder).onReward(msg.sender, msg.sender,_balances[msg.sender]); } TOKEN.safeTransfer(msg.sender, amount); emit Withdraw(msg.sender, amount); } function emergencyWithdraw() external nonReentrant { require(emergency, "emergency"); require(_balances[msg.sender] > 0, "no balances"); uint256 _amount = _balances[msg.sender]; _totalSupply = _totalSupply - _amount; _balances[msg.sender] = 0; if(address(gaugeRewarder) != address(0)) { try IRewarder(gaugeRewarder).onReward(msg.sender, msg.sender,_balances[msg.sender]) { // } catch { // } } TOKEN.safeTransfer(msg.sender, _amount); emit Withdraw(msg.sender, _amount); } function emergencyWithdrawAmount(uint256 _amount) external nonReentrant { require(emergency, "emergency"); _totalSupply = _totalSupply - _amount; _balances[msg.sender] = _balances[msg.sender] - _amount; if(address(gaugeRewarder) != address(0)) { try IRewarder(gaugeRewarder).onReward(msg.sender, msg.sender,_balances[msg.sender]) { // } catch { // } } TOKEN.safeTransfer(msg.sender, _amount); emit Withdraw(msg.sender, _amount); } ///@notice withdraw all TOKEN and harvest rewardToken function withdrawAllAndHarvest() external { _withdraw(_balances[msg.sender]); getReward(); } ///@notice User harvest function called from distribution (voter allows harvest on multiple gauges) function getReward(address _user) public nonReentrant onlyDistribution updateReward(_user) { uint256 reward = rewards[_user]; if (reward > 0) { rewards[_user] = 0; rewardToken.safeTransfer(_user, reward); emit Harvest(_user, reward); } if (gaugeRewarder != address(0)) { IRewarder(gaugeRewarder).onReward(_user, _user, _balances[_user]); } } ///@notice User harvest function function getReward() public nonReentrant updateReward(msg.sender) { uint256 reward = rewards[msg.sender]; if (reward > 0) { rewards[msg.sender] = 0; rewardToken.safeTransfer(msg.sender, reward); emit Harvest(msg.sender, reward); } if (gaugeRewarder != address(0)) { IRewarder(gaugeRewarder).onReward(msg.sender, msg.sender, _balances[msg.sender]); } } /* ----------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- DISTRIBUTION -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- ----------------------------------------------------------------------------- */ /// @dev Receive rewards from distribution function notifyRewardAmount(address token, uint256 reward) external nonReentrant isNotEmergency onlyDistribution updateReward(address(0)) { require(token == address(rewardToken), "not rew token"); rewardToken.safeTransferFrom(DISTRIBUTION, address(this), reward); if (block.timestamp >= _periodFinish) { rewardRate = reward / DURATION; } else { uint256 remaining = _periodFinish - block.timestamp; uint256 leftover = remaining * rewardRate; rewardRate = (reward + leftover) / DURATION; } // Ensure the provided reward amount is not more than the balance in the contract. // This keeps the reward rate in the right range, preventing overflows due to // very high values of rewardRate in the earned and rewardsPerToken functions; // Reward + leftover must be less than 2^256 / 10^18 to avoid overflow. uint256 balance = rewardToken.balanceOf(address(this)); require(rewardRate <= balance / DURATION, "Provided reward too high"); lastUpdateTime = block.timestamp; _periodFinish = block.timestamp + DURATION; emit RewardAdded(reward); } function claimFees() external nonReentrant returns (uint256 claimed0, uint256 claimed1) { return _claimFees(); } function _claimFees() internal returns (uint256 claimed0, uint256 claimed1) { if (!isForPair) { return (0, 0); } address _token = address(TOKEN); (claimed0, claimed1) = IPair(_token).claimFees(); if (claimed0 > 0 || claimed1 > 0) { uint256 _fees0 = claimed0; uint256 _fees1 = claimed1; (address _token0, address _token1) = IPair(_token).tokens(); if (_fees0 > 0) { IERC20(_token0).approve(internal_bribe, 0); IERC20(_token0).approve(internal_bribe, _fees0); IBribe(internal_bribe).notifyRewardAmount(_token0, _fees0); } if (_fees1 > 0) { IERC20(_token1).approve(internal_bribe, 0); IERC20(_token1).approve(internal_bribe, _fees1); IBribe(internal_bribe).notifyRewardAmount(_token1, _fees1); } emit ClaimFees(msg.sender, claimed0, claimed1); } } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.13; interface IBribe { function _deposit(uint amount, uint tokenId) external; function _withdraw(uint amount, uint tokenId) external; function getRewardForOwner(uint tokenId, address[] memory tokens) external; function getRewardForAddress(address _owner, address[] memory tokens) external; function notifyRewardAmount(address token, uint amount) external; function left(address token) external view returns (uint); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.13; interface IGaugeFactory { function createGaugeV2(address _rewardToken,address _ve,address _token,address _distribution, address _internal_bribe, address _external_bribe, bool _isPair) external returns (address) ; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.13; interface IPair { function metadata() external view returns (uint dec0, uint dec1, uint r0, uint r1, bool st, address t0, address t1); function claimFees() external returns (uint, uint); function tokens() external view returns (address, address); function token0() external view returns (address); function token1() external view returns (address); function transferFrom(address src, address dst, uint amount) external returns (bool); function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external; function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external; function burn(address to) external returns (uint amount0, uint amount1); function mint(address to) external returns (uint liquidity); function getReserves() external view returns (uint _reserve0, uint _reserve1, uint _blockTimestampLast); function getAmountOut(uint, address) external view returns (uint); function name() external view returns(string memory); function symbol() external view returns(string memory); function totalSupply() external view returns (uint); function decimals() external view returns (uint8); function claimable0(address _user) external view returns (uint); function claimable1(address _user) external view returns (uint); function isStable() external view returns(bool); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.13; interface IPermissionsRegistry { function emergencyCouncil() external view returns(address); function swpxTeamMultisig() external view returns(address); function hasRole(bytes memory role, address caller) external view returns(bool); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.13; library Constants { uint256 internal constant EPOCH_LENGTH = 1 hours; // 7 days; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.13; library Math { function max(uint a, uint b) internal pure returns (uint) { return a >= b ? a : b; } function min(uint a, uint b) internal pure returns (uint) { return a < b ? a : b; } function sqrt(uint y) internal pure returns (uint z) { if (y > 3) { z = y; uint x = y / 2 + 1; while (x < z) { z = x; x = (y / x + x) / 2; } } else if (y != 0) { z = 1; } } function cbrt(uint256 n) internal pure returns (uint256) { unchecked { uint256 x = 0; for (uint256 y = 1 << 255; y > 0; y >>= 3) { x <<= 1; uint256 z = 3 * x * (x + 1) + 1; if (n / y >= z) { n -= y * z; x += 1; } } return x; }} }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","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"},{"inputs":[{"internalType":"address[]","name":"_gauges","type":"address[]"}],"name":"activateEmergencyMode","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_rewardToken","type":"address"},{"internalType":"address","name":"_ve","type":"address"},{"internalType":"address","name":"_token","type":"address"},{"internalType":"address","name":"_distribution","type":"address"},{"internalType":"address","name":"_internal_bribe","type":"address"},{"internalType":"address","name":"_external_bribe","type":"address"},{"internalType":"bool","name":"_isPair","type":"bool"}],"name":"createGaugeV2","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"gauges","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_permissionRegistry","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"last_gauge","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"length","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"permissionsRegistry","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_gauges","type":"address[]"},{"internalType":"address","name":"distro","type":"address"}],"name":"setDistribution","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_gauges","type":"address[]"},{"internalType":"address[]","name":"_rewarder","type":"address[]"}],"name":"setGaugeRewarder","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_gauges","type":"address[]"},{"internalType":"address[]","name":"int_bribe","type":"address[]"}],"name":"setInternalBribe","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_registry","type":"address"}],"name":"setRegistry","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_gauges","type":"address[]"}],"name":"stopEmergencyMode","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b50613a96806100206000396000f3fe60806040523480156200001157600080fd5b5060043610620001095760003560e01c8063730a8bdb11620000a3578063a91ee0dc116200006e578063a91ee0dc146200020f578063c4d66de81462000226578063f0ec7e30146200023d578063f2fde38b146200025457600080fd5b8063730a8bdb14620001b95780637379e77014620001cd578063821bdcf114620001e45780638da5cb5b14620001fd57600080fd5b806330c6f60211620000e457806330c6f60214620001545780633df8504b146200016b5780634ac0374e1462000198578063715018a614620001af57600080fd5b806319fc92f6146200010e5780631aae9afc14620001275780631f7b6d32146200013e575b600080fd5b620001256200011f36600462000fa3565b6200026b565b005b620001256200013836600462000fa3565b6200040d565b6067546040519081526020015b60405180910390f35b62000125620001653660046200100e565b620005a1565b6066546200017f906001600160a01b031681565b6040516001600160a01b0390911681526020016200014b565b62000125620001a936600462001066565b620006fc565b620001256200082c565b6065546200017f906001600160a01b031681565b6200017f620001de366004620010b6565b62000844565b620001ee620009da565b6040516200014b91906200115b565b6033546001600160a01b03166200017f565b6200012562000220366004620011aa565b62000a3e565b6200012562000237366004620011aa565b62000ab8565b620001256200024e36600462001066565b62000bed565b6200012562000265366004620011aa565b62000d19565b336200027f6033546001600160a01b031690565b6001600160a01b03161480620003065750606654604051634448e1eb60e01b81526001600160a01b0390911690634448e1eb90620002c2903390600401620011d1565b602060405180830381865afa158015620002e0573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000306919062001207565b6200032e5760405162461bcd60e51b8152600401620003259062001227565b60405180910390fd5b80518251146200033d57600080fd5b60005b825181101562000408578281815181106200035f576200035f62001251565b60200260200101516001600160a01b03166391f25a948383815181106200038a576200038a62001251565b60200260200101516040518263ffffffff1660e01b8152600401620003be91906001600160a01b0391909116815260200190565b600060405180830381600087803b158015620003d957600080fd5b505af1158015620003ee573d6000803e3d6000fd5b505050508080620003ff9062001267565b91505062000340565b505050565b33620004216033546001600160a01b031690565b6001600160a01b03161480620004a85750606654604051634448e1eb60e01b81526001600160a01b0390911690634448e1eb9062000464903390600401620011d1565b602060405180830381865afa15801562000482573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620004a8919062001207565b620004c75760405162461bcd60e51b8152600401620003259062001227565b8051825114620004d657600080fd5b60005b82518110156200040857828181518110620004f857620004f862001251565b60200260200101516001600160a01b031663f97d211483838151811062000523576200052362001251565b60200260200101516040518263ffffffff1660e01b81526004016200055791906001600160a01b0391909116815260200190565b600060405180830381600087803b1580156200057257600080fd5b505af115801562000587573d6000803e3d6000fd5b505050508080620005989062001267565b915050620004d9565b33620005b56033546001600160a01b031690565b6001600160a01b031614806200063c5750606654604051634448e1eb60e01b81526001600160a01b0390911690634448e1eb90620005f8903390600401620011d1565b602060405180830381865afa15801562000616573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200063c919062001207565b6200065b5760405162461bcd60e51b8152600401620003259062001227565b60005b825181101562000408578281815181106200067d576200067d62001251565b6020908102919091010151604051637f69901560e01b81526001600160a01b03848116600483015290911690637f69901590602401600060405180830381600087803b158015620006cd57600080fd5b505af1158015620006e2573d6000803e3d6000fd5b505050508080620006f39062001267565b9150506200065e565b606660009054906101000a90046001600160a01b03166001600160a01b0316637778960e6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000750573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200077691906200128f565b6001600160a01b0316336001600160a01b0316146200079457600080fd5b60005b81518110156200082857818181518110620007b657620007b662001251565b60200260200101516001600160a01b031663d00960106040518163ffffffff1660e01b8152600401600060405180830381600087803b158015620007f957600080fd5b505af11580156200080e573d6000803e3d6000fd5b5050505080806200081f9062001267565b91505062000797565b5050565b6200083662000d98565b62000842600062000df4565b565b6000336200085a6033546001600160a01b031690565b6001600160a01b03161480620008e15750606654604051634448e1eb60e01b81526001600160a01b0390911690634448e1eb906200089d903390600401620011d1565b602060405180830381865afa158015620008bb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620008e1919062001207565b620009005760405162461bcd60e51b8152600401620003259062001227565b87878787878787604051620009159062000ea9565b6001600160a01b0397881681529587166020870152938616604086015291851660608501528416608084015290921660a082015290151560c082015260e001604051809103906000f08015801562000971573d6000803e3d6000fd5b50606580546001600160a01b039283166001600160a01b031991821681178355606780546001810182556000919091527f9787eeb91fe3101235e4a76063c7023ecb40f923f97916639c598592fa30d6ae01805490921617905554169050979650505050505050565b6060606780548060200260200160405190810160405280929190818152602001828054801562000a3457602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831162000a15575b5050505050905090565b3362000a526033546001600160a01b031690565b6001600160a01b03161462000a965760405162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b604482015260640162000325565b606680546001600160a01b0319166001600160a01b0392909216919091179055565b600054610100900460ff161580801562000ad95750600054600160ff909116105b8062000af55750303b15801562000af5575060005460ff166001145b62000b5a5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840162000325565b6000805460ff19166001179055801562000b7e576000805461ff0019166101001790555b62000b8862000e46565b606680546001600160a01b0319166001600160a01b038416179055801562000828576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050565b606660009054906101000a90046001600160a01b03166001600160a01b0316637778960e6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000c41573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000c6791906200128f565b6001600160a01b0316336001600160a01b03161462000c8557600080fd5b60005b8151811015620008285781818151811062000ca75762000ca762001251565b60200260200101516001600160a01b031663b1534ecd6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801562000cea57600080fd5b505af115801562000cff573d6000803e3d6000fd5b50505050808062000d109062001267565b91505062000c88565b62000d2362000d98565b6001600160a01b03811662000d8a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840162000325565b62000d958162000df4565b50565b6033546001600160a01b03163314620008425760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640162000325565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff1662000e705760405162461bcd60e51b81526004016200032590620012af565b62000842600054610100900460ff1662000e9e5760405162461bcd60e51b81526004016200032590620012af565b620008423362000df4565b61276680620012fb83390190565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811462000d9557600080fd5b803562000ef08162000ecd565b919050565b600082601f83011262000f0757600080fd5b8135602067ffffffffffffffff8083111562000f275762000f2762000eb7565b8260051b604051601f19603f8301168101818110848211171562000f4f5762000f4f62000eb7565b60405293845285810183019383810192508785111562000f6e57600080fd5b83870191505b8482101562000f985762000f888262000ee3565b8352918301919083019062000f74565b979650505050505050565b6000806040838503121562000fb757600080fd5b823567ffffffffffffffff8082111562000fd057600080fd5b62000fde8683870162000ef5565b9350602085013591508082111562000ff557600080fd5b50620010048582860162000ef5565b9150509250929050565b600080604083850312156200102257600080fd5b823567ffffffffffffffff8111156200103a57600080fd5b620010488582860162000ef5565b92505060208301356200105b8162000ecd565b809150509250929050565b6000602082840312156200107957600080fd5b813567ffffffffffffffff8111156200109157600080fd5b6200109f8482850162000ef5565b949350505050565b801515811462000d9557600080fd5b600080600080600080600060e0888a031215620010d257600080fd5b8735620010df8162000ecd565b96506020880135620010f18162000ecd565b95506040880135620011038162000ecd565b94506060880135620011158162000ecd565b93506080880135620011278162000ecd565b925060a0880135620011398162000ecd565b915060c08801356200114b81620010a7565b8091505092959891949750929550565b6020808252825182820181905260009190848201906040850190845b818110156200119e5783516001600160a01b03168352928401929184019160010162001177565b50909695505050505050565b600060208284031215620011bd57600080fd5b8135620011ca8162000ecd565b9392505050565b6040808252600b908201526a23a0aaa3a2afa0a226a4a760a91b60608201526001600160a01b0391909116602082015260800190565b6000602082840312156200121a57600080fd5b8151620011ca81620010a7565b60208082526010908201526f22a9291d1023a0aaa3a2afa0a226a4a760811b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b6000600182016200128857634e487b7160e01b600052601160045260246000fd5b5060010190565b600060208284031215620012a257600080fd5b8151620011ca8162000ecd565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b60608201526080019056fe6101006040523480156200001257600080fd5b50604051620027663803806200276683398101604081905262000035916200012d565b60016000556200004533620000be565b6001600160a01b0396871660a052600280546001600160a01b031990811697891697909717905593861660c05260038054861693871693909317909255610e1060e05260058054851691861691909117905560068054909316931692909217905515156080526001805460ff60a01b19169055620001ca565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b80516001600160a01b03811681146200012857600080fd5b919050565b600080600080600080600060e0888a0312156200014957600080fd5b620001548862000110565b9650620001646020890162000110565b9550620001746040890162000110565b9450620001846060890162000110565b9350620001946080890162000110565b9250620001a460a0890162000110565b915060c08801518015158114620001ba57600080fd5b8091505092959891949750929550565b60805160a05160c05160e0516124e462000282600039600081816102eb015281816107e301528181610bd601528181610c2901528181610cf40152610d760152600081816103cd01528181610840015281816110af0152818161134e015281816113ce0152818161171c01528181611af10152611b9c01526000818161058a015281816106e501528181610b1e01528181610b9e01528181610c7a0152610eb30152600081816105480152611b6c01526124e46000f3fe608060405234801561001057600080fd5b50600436106102685760003560e01c80638b87634711610151578063cd3daf9d116100c3578063df136d6511610087578063df136d651461053a578063e574821314610543578063ebe2b12b1461056a578063f2fde38b14610572578063f7c618c114610585578063f97d2114146105ac57600080fd5b8063cd3daf9d146104fd578063d009601014610505578063d294f0931461050d578063db2e21bc1461052a578063de5f62681461053257600080fd5b8063b6b55f2511610115578063b6b55f2514610484578063c00007b014610497578063c6c8f6b6146104aa578063c863657d146104bd578063c8f33c91146104d0578063caa6fea4146104d957600080fd5b80638b876347146104255780638da5cb5b1461044557806391f25a9414610456578063b1534ecd14610469578063b66503cf1461047157600080fd5b806370a08231116101ea5780637f699015116101ae5780637f699015146103ad57806380faa57d146103c057806382bfefc8146103c857806382fe1891146103ef578063853828b61461040a578063863e24421461041257600080fd5b806370a082311461034d578063715018a614610376578063770f85711461037e5780637b0a47ee146103915780637c91e4eb1461039a57600080fd5b80632e1a7d4d116102315780632e1a7d4d1461030d5780633d18b912146103225780636946a2351461032a5780636e90013d146103325780636e9852f21461034557600080fd5b80628cc2621461026d57806303fbf83a146102935780630700037d146102be57806318160ddd146102de5780631be05289146102e6575b600080fd5b61028061027b366004612221565b6105bf565b6040519081526020015b60405180910390f35b6006546102a6906001600160a01b031681565b6040516001600160a01b03909116815260200161028a565b6102806102cc366004612221565b600c6020526000908152604090205481565b600d54610280565b6102807f000000000000000000000000000000000000000000000000000000000000000081565b61032061031b36600461223e565b61064a565b005b610320610656565b6102806107df565b610320610340366004612257565b610814565b6103206108ab565b61028061035b366004612221565b6001600160a01b03166000908152600e602052604090205490565b6103206108cc565b6005546102a6906001600160a01b031681565b61028060085481565b6003546102a6906001600160a01b031681565b6103206103bb366004612221565b6108de565b610280610999565b6102a67f000000000000000000000000000000000000000000000000000000000000000081565b6102a6734d5bcfc14282d930ee09bee96d3a7d5f338251c681565b6103206109a7565b6004546102a6906001600160a01b031681565b610280610433366004612221565b600b6020526000908152604090205481565b6001546001600160a01b03166102a6565b610320610464366004612221565b6109c0565b6103206109ea565b61032061047f366004612257565b610a64565b61032061049236600461223e565b610ddd565b6103206104a5366004612221565b610de7565b6103206104b836600461223e565b610fb4565b6002546102a6906001600160a01b031681565b61028060095481565b6001546104ed90600160a01b900460ff1681565b604051901515815260200161028a565b610280611115565b610320611176565b6105156111ef565b6040805192835260208301919091520161028a565b610320611214565b6103206113b5565b610280600a5481565b6104ed7f000000000000000000000000000000000000000000000000000000000000000081565b600754610280565b610320610580366004612221565b611447565b6102a67f000000000000000000000000000000000000000000000000000000000000000081565b6103206105ba366004612221565b6114bd565b6001600160a01b0381166000908152600b6020526040812054670de0b6b3a7640000906105ea611115565b6105f49190612299565b6001600160a01b0384166000908152600e602052604090205461061791906122b0565b61062191906122cf565b6001600160a01b0383166000908152600c602052604090205461064491906122f1565b92915050565b61065381611531565b50565b61065e611783565b33610667611115565b600a55610672610999565b6009556001600160a01b038116156106b95761068d816105bf565b6001600160a01b0382166000908152600c6020908152604080832093909355600a54600b909152919020555b336000908152600c6020526040902054801561074a57336000818152600c6020526040812055610714907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690836117dc565b60405181815233907fc9695243a805adb74c91f28311176c65b417e842d5699893cef56d18bfa48cba9060200160405180910390a25b6004546001600160a01b0316156107d15760048054336000818152600e60205260409081902054905163711f31c160e11b81526001600160a01b039093169363e23e63829361079e93928392909101612309565b600060405180830381600087803b1580156107b857600080fd5b505af11580156107cc573d6000803e3d6000fd5b505050505b50506107dd6001600055565b565b60007f000000000000000000000000000000000000000000000000000000000000000060085461080f91906122b0565b905090565b33734d5bcfc14282d930ee09bee96d3a7d5f338251c61461083457600080fd5b816001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03161415801561087e57506001600160a01b03821615155b801561088a5750600081115b61089357600080fd5b6108a76001600160a01b03831633836117dc565b5050565b336000908152600e60205260409020546108c490611531565b6107dd610656565b6108d4611844565b6107dd600061189e565b6108e6611844565b6001600160a01b03811661092d5760405162461bcd60e51b81526020600482015260096024820152683d32b9379030b2323960b91b60448201526064015b60405180910390fd5b6003546001600160a01b03908116908216036109775760405162461bcd60e51b815260206004820152600960248201526839b0b6b29030b2323960b91b6044820152606401610924565b600380546001600160a01b0319166001600160a01b0392909216919091179055565b600061080f426007546118f0565b336000908152600e60205260409020546107dd90611531565b6109c8611844565b600580546001600160a01b0319166001600160a01b0392909216919091179055565b6109f2611844565b60018054600160a01b900460ff16151514610a1f5760405162461bcd60e51b81526004016109249061232d565b6001805460ff60a01b1916905560405142815230907fa30763a9bc0d8e121a6e721624965cae68010ece74128b4ae5b01b8dc22c00f8906020015b60405180910390a2565b610a6c611783565b600154600160a01b900460ff1615610a965760405162461bcd60e51b81526004016109249061232d565b6003546001600160a01b03163314610ac05760405162461bcd60e51b815260040161092490612350565b6000610aca611115565b600a55610ad5610999565b6009556001600160a01b03811615610b1c57610af0816105bf565b6001600160a01b0382166000908152600c6020908152604080832093909355600a54600b909152919020555b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b031614610b8d5760405162461bcd60e51b815260206004820152600d60248201526c3737ba103932bb903a37b5b2b760991b6044820152606401610924565b600354610bc8906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811691163085611908565b6007544210610c0357610bfb7f0000000000000000000000000000000000000000000000000000000000000000836122cf565b600855610c62565b600042600754610c139190612299565b9050600060085482610c2591906122b0565b90507f0000000000000000000000000000000000000000000000000000000000000000610c5282866122f1565b610c5c91906122cf565b60085550505b6040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015610cc9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ced919061239a565b9050610d197f0000000000000000000000000000000000000000000000000000000000000000826122cf565b6008541115610d6a5760405162461bcd60e51b815260206004820152601860248201527f50726f76696465642072657761726420746f6f206869676800000000000000006044820152606401610924565b426009819055610d9b907f0000000000000000000000000000000000000000000000000000000000000000906122f1565b6007556040518381527fde88a922e0d3b88b24e9623efeb464919c6bf9f66857a65e2bfcf2ce87a9433d9060200160405180910390a150506108a76001600055565b610653813361192f565b610def611783565b6003546001600160a01b03163314610e195760405162461bcd60e51b815260040161092490612350565b80610e22611115565b600a55610e2d610999565b6009556001600160a01b03811615610e7457610e48816105bf565b6001600160a01b0382166000908152600c6020908152604080832093909355600a54600b909152919020555b6001600160a01b0382166000908152600c60205260409020548015610f1e576001600160a01b038084166000908152600c6020526040812055610eda907f00000000000000000000000000000000000000000000000000000000000000001684836117dc565b826001600160a01b03167fc9695243a805adb74c91f28311176c65b417e842d5699893cef56d18bfa48cba82604051610f1591815260200190565b60405180910390a25b6004546001600160a01b031615610fa857600480546001600160a01b038581166000908152600e60205260409081902054905163711f31c160e11b8152919092169263e23e638292610f7592889283929101612309565b600060405180830381600087803b158015610f8f57600080fd5b505af1158015610fa3573d6000803e3d6000fd5b505050505b50506106536001600055565b610fbc611783565b600154600160a01b900460ff16610fe55760405162461bcd60e51b81526004016109249061232d565b80600d54610ff39190612299565b600d55336000908152600e6020526040902054611011908290612299565b336000908152600e60205260409020556004546001600160a01b0316156110a25760048054336000818152600e60205260409081902054905163711f31c160e11b81526001600160a01b039093169363e23e63829361107593928392909101612309565b600060405180830381600087803b15801561108f57600080fd5b505af19250505080156110a0575060015b505b6110d66001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633836117dc565b60405181815233907f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a94243649060200160405180910390a26106536001600055565b6000600d546000036111285750600a5490565b600d54600854600954611139610999565b6111439190612299565b61114d91906122b0565b61115f90670de0b6b3a76400006122b0565b61116991906122cf565b600a5461080f91906122f1565b61117e611844565b600154600160a01b900460ff16156111a85760405162461bcd60e51b81526004016109249061232d565b6001805460ff60a01b1916600160a01b17905560405130907f774b57c3410c76d04ea4d51b0c15a9bac99b0e70f28fd88b53d702b5427fd31890610a5a9042815260200190565b6000806111fa611783565b611202611b67565b915091506112106001600055565b9091565b61121c611783565b600154600160a01b900460ff166112455760405162461bcd60e51b81526004016109249061232d565b336000908152600e602052604090205461128f5760405162461bcd60e51b815260206004820152600b60248201526a6e6f2062616c616e63657360a81b6044820152606401610924565b336000908152600e6020526040902054600d546112ad908290612299565b600d55336000908152600e60205260408120556004546001600160a01b0316156113415760048054336000818152600e60205260409081902054905163711f31c160e11b81526001600160a01b039093169363e23e63829361131493928392909101612309565b600060405180830381600087803b15801561132e57600080fd5b505af192505050801561133f575060015b505b6113756001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633836117dc565b60405181815233907f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a94243649060200160405180910390a2506107dd6001600055565b6040516370a0823160e01b81523360048201526107dd907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa15801561141d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611441919061239a565b3361192f565b61144f611844565b6001600160a01b0381166114b45760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610924565b6106538161189e565b6114c5611844565b6004546001600160a01b039081169082160361150f5760405162461bcd60e51b815260206004820152600960248201526839b0b6b29030b2323960b91b6044820152606401610924565b600480546001600160a01b0319166001600160a01b0392909216919091179055565b611539611783565b600154600160a01b900460ff16156115635760405162461bcd60e51b81526004016109249061232d565b3361156c611115565b600a55611577610999565b6009556001600160a01b038116156115be57611592816105bf565b6001600160a01b0382166000908152600c6020908152604080832093909355600a54600b909152919020555b600082116116025760405162461bcd60e51b8152602060048201526011602482015270043616e6e6f74207769746864726177203607c1b6044820152606401610924565b336000908152600e602052604090205461164c5760405162461bcd60e51b815260206004820152600b60248201526a6e6f2062616c616e63657360a81b6044820152606401610924565b81600d5461165a9190612299565b600d55336000908152600e6020526040902054611678908390612299565b336000908152600e60205260409020556004546001600160a01b03161561170f5760048054336000818152600e60205260409081902054905163711f31c160e11b81526001600160a01b039093169363e23e6382936116dc93928392909101612309565b600060405180830381600087803b1580156116f657600080fd5b505af115801561170a573d6000803e3d6000fd5b505050505b6117436001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633846117dc565b60405182815233907f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a94243649060200160405180910390a2506106536001600055565b6002600054036117d55760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610924565b6002600055565b6040516001600160a01b03831660248201526044810182905261183f90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611faa565b505050565b6001546001600160a01b031633146107dd5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610924565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60008183106118ff5781611901565b825b9392505050565b611929846323b872dd60e01b85858560405160240161180893929190612309565b50505050565b611937611783565b600154600160a01b900460ff16156119615760405162461bcd60e51b81526004016109249061232d565b8061196a611115565b600a55611975610999565b6009556001600160a01b038116156119bc57611990816105bf565b6001600160a01b0382166000908152600c6020908152604080832093909355600a54600b909152919020555b60008311611a0c5760405162461bcd60e51b815260206004820152601e60248201527f6465706f736974284761756765293a2063616e6e6f74207374616b65203000006044820152606401610924565b6001600160a01b0382166000908152600e6020526040902054611a309084906122f1565b6001600160a01b0383166000908152600e6020526040902055600d54611a579084906122f1565b600d556004546001600160a01b031615611ae457600480546001600160a01b038481166000908152600e60205260409081902054905163711f31c160e11b8152919092169263e23e638292611ab192879283929101612309565b600060405180830381600087803b158015611acb57600080fd5b505af1158015611adf573d6000803e3d6000fd5b505050505b611b196001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016833086611908565b816001600160a01b03167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c84604051611b5491815260200190565b60405180910390a2506108a76001600055565b6000807f0000000000000000000000000000000000000000000000000000000000000000611b985750600091829150565b60007f00000000000000000000000000000000000000000000000000000000000000009050806001600160a01b031663d294f0936040518163ffffffff1660e01b815260040160408051808303816000875af1158015611bfc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c2091906123b3565b909350915082151580611c335750600082115b15611fa55760008390506000839050600080846001600160a01b0316639d63848a6040518163ffffffff1660e01b81526004016040805180830381865afa158015611c82573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ca691906123d7565b90925090508315611e085760055460405163095ea7b360e01b81526001600160a01b039182166004820152600060248201529083169063095ea7b3906044016020604051808303816000875af1158015611d04573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d289190612411565b5060055460405163095ea7b360e01b81526001600160a01b039182166004820152602481018690529083169063095ea7b3906044016020604051808303816000875af1158015611d7c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611da09190612411565b5060055460405163b66503cf60e01b81526001600160a01b038481166004830152602482018790529091169063b66503cf90604401600060405180830381600087803b158015611def57600080fd5b505af1158015611e03573d6000803e3d6000fd5b505050505b8215611f655760055460405163095ea7b360e01b81526001600160a01b039182166004820152600060248201529082169063095ea7b3906044016020604051808303816000875af1158015611e61573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e859190612411565b5060055460405163095ea7b360e01b81526001600160a01b039182166004820152602481018590529082169063095ea7b3906044016020604051808303816000875af1158015611ed9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611efd9190612411565b5060055460405163b66503cf60e01b81526001600160a01b038381166004830152602482018690529091169063b66503cf90604401600060405180830381600087803b158015611f4c57600080fd5b505af1158015611f60573d6000803e3d6000fd5b505050505b604080518881526020810188905233917fbc567d6cbad26368064baa0ab5a757be46aae4d70f707f9203d9d9b6c8ccbfa3910160405180910390a2505050505b509091565b6000611fff826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661207c9092919063ffffffff16565b80519091501561183f578080602001905181019061201d9190612411565b61183f5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610924565b606061208b8484600085612093565b949350505050565b6060824710156120f45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610924565b600080866001600160a01b03168587604051612110919061245f565b60006040518083038185875af1925050503d806000811461214d576040519150601f19603f3d011682016040523d82523d6000602084013e612152565b606091505b50915091506121638783838761216e565b979650505050505050565b606083156121dd5782516000036121d6576001600160a01b0385163b6121d65760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610924565b508161208b565b61208b83838151156121f25781518083602001fd5b8060405162461bcd60e51b8152600401610924919061247b565b6001600160a01b038116811461065357600080fd5b60006020828403121561223357600080fd5b81356119018161220c565b60006020828403121561225057600080fd5b5035919050565b6000806040838503121561226a57600080fd5b82356122758161220c565b946020939093013593505050565b634e487b7160e01b600052601160045260246000fd5b6000828210156122ab576122ab612283565b500390565b60008160001904831182151516156122ca576122ca612283565b500290565b6000826122ec57634e487b7160e01b600052601260045260246000fd5b500490565b6000821982111561230457612304612283565b500190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b602080825260099082015268656d657267656e637960b81b604082015260600190565b6020808252602a908201527f43616c6c6572206973206e6f742052657761726473446973747269627574696f6040820152691b8818dbdb9d1c9858dd60b21b606082015260800190565b6000602082840312156123ac57600080fd5b5051919050565b600080604083850312156123c657600080fd5b505080516020909101519092909150565b600080604083850312156123ea57600080fd5b82516123f58161220c565b60208401519092506124068161220c565b809150509250929050565b60006020828403121561242357600080fd5b8151801515811461190157600080fd5b60005b8381101561244e578181015183820152602001612436565b838111156119295750506000910152565b60008251612471818460208701612433565b9190910192915050565b602081526000825180602084015261249a816040850160208701612433565b601f01601f1916919091016040019291505056fea26469706673582212203cfd1579ddbed6d7d9c58bd753881e00406904f0ffc580255c410562da9d184564736f6c634300080d0033a264697066735822122076b157e47314631530236403014e9bbf4ff4a7716a13646d5238aa08898cb73b64736f6c634300080d0033
Deployed Bytecode
0x60806040523480156200001157600080fd5b5060043610620001095760003560e01c8063730a8bdb11620000a3578063a91ee0dc116200006e578063a91ee0dc146200020f578063c4d66de81462000226578063f0ec7e30146200023d578063f2fde38b146200025457600080fd5b8063730a8bdb14620001b95780637379e77014620001cd578063821bdcf114620001e45780638da5cb5b14620001fd57600080fd5b806330c6f60211620000e457806330c6f60214620001545780633df8504b146200016b5780634ac0374e1462000198578063715018a614620001af57600080fd5b806319fc92f6146200010e5780631aae9afc14620001275780631f7b6d32146200013e575b600080fd5b620001256200011f36600462000fa3565b6200026b565b005b620001256200013836600462000fa3565b6200040d565b6067546040519081526020015b60405180910390f35b62000125620001653660046200100e565b620005a1565b6066546200017f906001600160a01b031681565b6040516001600160a01b0390911681526020016200014b565b62000125620001a936600462001066565b620006fc565b620001256200082c565b6065546200017f906001600160a01b031681565b6200017f620001de366004620010b6565b62000844565b620001ee620009da565b6040516200014b91906200115b565b6033546001600160a01b03166200017f565b6200012562000220366004620011aa565b62000a3e565b6200012562000237366004620011aa565b62000ab8565b620001256200024e36600462001066565b62000bed565b6200012562000265366004620011aa565b62000d19565b336200027f6033546001600160a01b031690565b6001600160a01b03161480620003065750606654604051634448e1eb60e01b81526001600160a01b0390911690634448e1eb90620002c2903390600401620011d1565b602060405180830381865afa158015620002e0573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000306919062001207565b6200032e5760405162461bcd60e51b8152600401620003259062001227565b60405180910390fd5b80518251146200033d57600080fd5b60005b825181101562000408578281815181106200035f576200035f62001251565b60200260200101516001600160a01b03166391f25a948383815181106200038a576200038a62001251565b60200260200101516040518263ffffffff1660e01b8152600401620003be91906001600160a01b0391909116815260200190565b600060405180830381600087803b158015620003d957600080fd5b505af1158015620003ee573d6000803e3d6000fd5b505050508080620003ff9062001267565b91505062000340565b505050565b33620004216033546001600160a01b031690565b6001600160a01b03161480620004a85750606654604051634448e1eb60e01b81526001600160a01b0390911690634448e1eb9062000464903390600401620011d1565b602060405180830381865afa15801562000482573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620004a8919062001207565b620004c75760405162461bcd60e51b8152600401620003259062001227565b8051825114620004d657600080fd5b60005b82518110156200040857828181518110620004f857620004f862001251565b60200260200101516001600160a01b031663f97d211483838151811062000523576200052362001251565b60200260200101516040518263ffffffff1660e01b81526004016200055791906001600160a01b0391909116815260200190565b600060405180830381600087803b1580156200057257600080fd5b505af115801562000587573d6000803e3d6000fd5b505050508080620005989062001267565b915050620004d9565b33620005b56033546001600160a01b031690565b6001600160a01b031614806200063c5750606654604051634448e1eb60e01b81526001600160a01b0390911690634448e1eb90620005f8903390600401620011d1565b602060405180830381865afa15801562000616573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200063c919062001207565b6200065b5760405162461bcd60e51b8152600401620003259062001227565b60005b825181101562000408578281815181106200067d576200067d62001251565b6020908102919091010151604051637f69901560e01b81526001600160a01b03848116600483015290911690637f69901590602401600060405180830381600087803b158015620006cd57600080fd5b505af1158015620006e2573d6000803e3d6000fd5b505050508080620006f39062001267565b9150506200065e565b606660009054906101000a90046001600160a01b03166001600160a01b0316637778960e6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000750573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200077691906200128f565b6001600160a01b0316336001600160a01b0316146200079457600080fd5b60005b81518110156200082857818181518110620007b657620007b662001251565b60200260200101516001600160a01b031663d00960106040518163ffffffff1660e01b8152600401600060405180830381600087803b158015620007f957600080fd5b505af11580156200080e573d6000803e3d6000fd5b5050505080806200081f9062001267565b91505062000797565b5050565b6200083662000d98565b62000842600062000df4565b565b6000336200085a6033546001600160a01b031690565b6001600160a01b03161480620008e15750606654604051634448e1eb60e01b81526001600160a01b0390911690634448e1eb906200089d903390600401620011d1565b602060405180830381865afa158015620008bb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620008e1919062001207565b620009005760405162461bcd60e51b8152600401620003259062001227565b87878787878787604051620009159062000ea9565b6001600160a01b0397881681529587166020870152938616604086015291851660608501528416608084015290921660a082015290151560c082015260e001604051809103906000f08015801562000971573d6000803e3d6000fd5b50606580546001600160a01b039283166001600160a01b031991821681178355606780546001810182556000919091527f9787eeb91fe3101235e4a76063c7023ecb40f923f97916639c598592fa30d6ae01805490921617905554169050979650505050505050565b6060606780548060200260200160405190810160405280929190818152602001828054801562000a3457602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831162000a15575b5050505050905090565b3362000a526033546001600160a01b031690565b6001600160a01b03161462000a965760405162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b604482015260640162000325565b606680546001600160a01b0319166001600160a01b0392909216919091179055565b600054610100900460ff161580801562000ad95750600054600160ff909116105b8062000af55750303b15801562000af5575060005460ff166001145b62000b5a5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840162000325565b6000805460ff19166001179055801562000b7e576000805461ff0019166101001790555b62000b8862000e46565b606680546001600160a01b0319166001600160a01b038416179055801562000828576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050565b606660009054906101000a90046001600160a01b03166001600160a01b0316637778960e6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000c41573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000c6791906200128f565b6001600160a01b0316336001600160a01b03161462000c8557600080fd5b60005b8151811015620008285781818151811062000ca75762000ca762001251565b60200260200101516001600160a01b031663b1534ecd6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801562000cea57600080fd5b505af115801562000cff573d6000803e3d6000fd5b50505050808062000d109062001267565b91505062000c88565b62000d2362000d98565b6001600160a01b03811662000d8a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840162000325565b62000d958162000df4565b50565b6033546001600160a01b03163314620008425760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640162000325565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff1662000e705760405162461bcd60e51b81526004016200032590620012af565b62000842600054610100900460ff1662000e9e5760405162461bcd60e51b81526004016200032590620012af565b620008423362000df4565b61276680620012fb83390190565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811462000d9557600080fd5b803562000ef08162000ecd565b919050565b600082601f83011262000f0757600080fd5b8135602067ffffffffffffffff8083111562000f275762000f2762000eb7565b8260051b604051601f19603f8301168101818110848211171562000f4f5762000f4f62000eb7565b60405293845285810183019383810192508785111562000f6e57600080fd5b83870191505b8482101562000f985762000f888262000ee3565b8352918301919083019062000f74565b979650505050505050565b6000806040838503121562000fb757600080fd5b823567ffffffffffffffff8082111562000fd057600080fd5b62000fde8683870162000ef5565b9350602085013591508082111562000ff557600080fd5b50620010048582860162000ef5565b9150509250929050565b600080604083850312156200102257600080fd5b823567ffffffffffffffff8111156200103a57600080fd5b620010488582860162000ef5565b92505060208301356200105b8162000ecd565b809150509250929050565b6000602082840312156200107957600080fd5b813567ffffffffffffffff8111156200109157600080fd5b6200109f8482850162000ef5565b949350505050565b801515811462000d9557600080fd5b600080600080600080600060e0888a031215620010d257600080fd5b8735620010df8162000ecd565b96506020880135620010f18162000ecd565b95506040880135620011038162000ecd565b94506060880135620011158162000ecd565b93506080880135620011278162000ecd565b925060a0880135620011398162000ecd565b915060c08801356200114b81620010a7565b8091505092959891949750929550565b6020808252825182820181905260009190848201906040850190845b818110156200119e5783516001600160a01b03168352928401929184019160010162001177565b50909695505050505050565b600060208284031215620011bd57600080fd5b8135620011ca8162000ecd565b9392505050565b6040808252600b908201526a23a0aaa3a2afa0a226a4a760a91b60608201526001600160a01b0391909116602082015260800190565b6000602082840312156200121a57600080fd5b8151620011ca81620010a7565b60208082526010908201526f22a9291d1023a0aaa3a2afa0a226a4a760811b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b6000600182016200128857634e487b7160e01b600052601160045260246000fd5b5060010190565b600060208284031215620012a257600080fd5b8151620011ca8162000ecd565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b60608201526080019056fe6101006040523480156200001257600080fd5b50604051620027663803806200276683398101604081905262000035916200012d565b60016000556200004533620000be565b6001600160a01b0396871660a052600280546001600160a01b031990811697891697909717905593861660c05260038054861693871693909317909255610e1060e05260058054851691861691909117905560068054909316931692909217905515156080526001805460ff60a01b19169055620001ca565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b80516001600160a01b03811681146200012857600080fd5b919050565b600080600080600080600060e0888a0312156200014957600080fd5b620001548862000110565b9650620001646020890162000110565b9550620001746040890162000110565b9450620001846060890162000110565b9350620001946080890162000110565b9250620001a460a0890162000110565b915060c08801518015158114620001ba57600080fd5b8091505092959891949750929550565b60805160a05160c05160e0516124e462000282600039600081816102eb015281816107e301528181610bd601528181610c2901528181610cf40152610d760152600081816103cd01528181610840015281816110af0152818161134e015281816113ce0152818161171c01528181611af10152611b9c01526000818161058a015281816106e501528181610b1e01528181610b9e01528181610c7a0152610eb30152600081816105480152611b6c01526124e46000f3fe608060405234801561001057600080fd5b50600436106102685760003560e01c80638b87634711610151578063cd3daf9d116100c3578063df136d6511610087578063df136d651461053a578063e574821314610543578063ebe2b12b1461056a578063f2fde38b14610572578063f7c618c114610585578063f97d2114146105ac57600080fd5b8063cd3daf9d146104fd578063d009601014610505578063d294f0931461050d578063db2e21bc1461052a578063de5f62681461053257600080fd5b8063b6b55f2511610115578063b6b55f2514610484578063c00007b014610497578063c6c8f6b6146104aa578063c863657d146104bd578063c8f33c91146104d0578063caa6fea4146104d957600080fd5b80638b876347146104255780638da5cb5b1461044557806391f25a9414610456578063b1534ecd14610469578063b66503cf1461047157600080fd5b806370a08231116101ea5780637f699015116101ae5780637f699015146103ad57806380faa57d146103c057806382bfefc8146103c857806382fe1891146103ef578063853828b61461040a578063863e24421461041257600080fd5b806370a082311461034d578063715018a614610376578063770f85711461037e5780637b0a47ee146103915780637c91e4eb1461039a57600080fd5b80632e1a7d4d116102315780632e1a7d4d1461030d5780633d18b912146103225780636946a2351461032a5780636e90013d146103325780636e9852f21461034557600080fd5b80628cc2621461026d57806303fbf83a146102935780630700037d146102be57806318160ddd146102de5780631be05289146102e6575b600080fd5b61028061027b366004612221565b6105bf565b6040519081526020015b60405180910390f35b6006546102a6906001600160a01b031681565b6040516001600160a01b03909116815260200161028a565b6102806102cc366004612221565b600c6020526000908152604090205481565b600d54610280565b6102807f000000000000000000000000000000000000000000000000000000000000000081565b61032061031b36600461223e565b61064a565b005b610320610656565b6102806107df565b610320610340366004612257565b610814565b6103206108ab565b61028061035b366004612221565b6001600160a01b03166000908152600e602052604090205490565b6103206108cc565b6005546102a6906001600160a01b031681565b61028060085481565b6003546102a6906001600160a01b031681565b6103206103bb366004612221565b6108de565b610280610999565b6102a67f000000000000000000000000000000000000000000000000000000000000000081565b6102a6734d5bcfc14282d930ee09bee96d3a7d5f338251c681565b6103206109a7565b6004546102a6906001600160a01b031681565b610280610433366004612221565b600b6020526000908152604090205481565b6001546001600160a01b03166102a6565b610320610464366004612221565b6109c0565b6103206109ea565b61032061047f366004612257565b610a64565b61032061049236600461223e565b610ddd565b6103206104a5366004612221565b610de7565b6103206104b836600461223e565b610fb4565b6002546102a6906001600160a01b031681565b61028060095481565b6001546104ed90600160a01b900460ff1681565b604051901515815260200161028a565b610280611115565b610320611176565b6105156111ef565b6040805192835260208301919091520161028a565b610320611214565b6103206113b5565b610280600a5481565b6104ed7f000000000000000000000000000000000000000000000000000000000000000081565b600754610280565b610320610580366004612221565b611447565b6102a67f000000000000000000000000000000000000000000000000000000000000000081565b6103206105ba366004612221565b6114bd565b6001600160a01b0381166000908152600b6020526040812054670de0b6b3a7640000906105ea611115565b6105f49190612299565b6001600160a01b0384166000908152600e602052604090205461061791906122b0565b61062191906122cf565b6001600160a01b0383166000908152600c602052604090205461064491906122f1565b92915050565b61065381611531565b50565b61065e611783565b33610667611115565b600a55610672610999565b6009556001600160a01b038116156106b95761068d816105bf565b6001600160a01b0382166000908152600c6020908152604080832093909355600a54600b909152919020555b336000908152600c6020526040902054801561074a57336000818152600c6020526040812055610714907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690836117dc565b60405181815233907fc9695243a805adb74c91f28311176c65b417e842d5699893cef56d18bfa48cba9060200160405180910390a25b6004546001600160a01b0316156107d15760048054336000818152600e60205260409081902054905163711f31c160e11b81526001600160a01b039093169363e23e63829361079e93928392909101612309565b600060405180830381600087803b1580156107b857600080fd5b505af11580156107cc573d6000803e3d6000fd5b505050505b50506107dd6001600055565b565b60007f000000000000000000000000000000000000000000000000000000000000000060085461080f91906122b0565b905090565b33734d5bcfc14282d930ee09bee96d3a7d5f338251c61461083457600080fd5b816001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03161415801561087e57506001600160a01b03821615155b801561088a5750600081115b61089357600080fd5b6108a76001600160a01b03831633836117dc565b5050565b336000908152600e60205260409020546108c490611531565b6107dd610656565b6108d4611844565b6107dd600061189e565b6108e6611844565b6001600160a01b03811661092d5760405162461bcd60e51b81526020600482015260096024820152683d32b9379030b2323960b91b60448201526064015b60405180910390fd5b6003546001600160a01b03908116908216036109775760405162461bcd60e51b815260206004820152600960248201526839b0b6b29030b2323960b91b6044820152606401610924565b600380546001600160a01b0319166001600160a01b0392909216919091179055565b600061080f426007546118f0565b336000908152600e60205260409020546107dd90611531565b6109c8611844565b600580546001600160a01b0319166001600160a01b0392909216919091179055565b6109f2611844565b60018054600160a01b900460ff16151514610a1f5760405162461bcd60e51b81526004016109249061232d565b6001805460ff60a01b1916905560405142815230907fa30763a9bc0d8e121a6e721624965cae68010ece74128b4ae5b01b8dc22c00f8906020015b60405180910390a2565b610a6c611783565b600154600160a01b900460ff1615610a965760405162461bcd60e51b81526004016109249061232d565b6003546001600160a01b03163314610ac05760405162461bcd60e51b815260040161092490612350565b6000610aca611115565b600a55610ad5610999565b6009556001600160a01b03811615610b1c57610af0816105bf565b6001600160a01b0382166000908152600c6020908152604080832093909355600a54600b909152919020555b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b031614610b8d5760405162461bcd60e51b815260206004820152600d60248201526c3737ba103932bb903a37b5b2b760991b6044820152606401610924565b600354610bc8906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811691163085611908565b6007544210610c0357610bfb7f0000000000000000000000000000000000000000000000000000000000000000836122cf565b600855610c62565b600042600754610c139190612299565b9050600060085482610c2591906122b0565b90507f0000000000000000000000000000000000000000000000000000000000000000610c5282866122f1565b610c5c91906122cf565b60085550505b6040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015610cc9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ced919061239a565b9050610d197f0000000000000000000000000000000000000000000000000000000000000000826122cf565b6008541115610d6a5760405162461bcd60e51b815260206004820152601860248201527f50726f76696465642072657761726420746f6f206869676800000000000000006044820152606401610924565b426009819055610d9b907f0000000000000000000000000000000000000000000000000000000000000000906122f1565b6007556040518381527fde88a922e0d3b88b24e9623efeb464919c6bf9f66857a65e2bfcf2ce87a9433d9060200160405180910390a150506108a76001600055565b610653813361192f565b610def611783565b6003546001600160a01b03163314610e195760405162461bcd60e51b815260040161092490612350565b80610e22611115565b600a55610e2d610999565b6009556001600160a01b03811615610e7457610e48816105bf565b6001600160a01b0382166000908152600c6020908152604080832093909355600a54600b909152919020555b6001600160a01b0382166000908152600c60205260409020548015610f1e576001600160a01b038084166000908152600c6020526040812055610eda907f00000000000000000000000000000000000000000000000000000000000000001684836117dc565b826001600160a01b03167fc9695243a805adb74c91f28311176c65b417e842d5699893cef56d18bfa48cba82604051610f1591815260200190565b60405180910390a25b6004546001600160a01b031615610fa857600480546001600160a01b038581166000908152600e60205260409081902054905163711f31c160e11b8152919092169263e23e638292610f7592889283929101612309565b600060405180830381600087803b158015610f8f57600080fd5b505af1158015610fa3573d6000803e3d6000fd5b505050505b50506106536001600055565b610fbc611783565b600154600160a01b900460ff16610fe55760405162461bcd60e51b81526004016109249061232d565b80600d54610ff39190612299565b600d55336000908152600e6020526040902054611011908290612299565b336000908152600e60205260409020556004546001600160a01b0316156110a25760048054336000818152600e60205260409081902054905163711f31c160e11b81526001600160a01b039093169363e23e63829361107593928392909101612309565b600060405180830381600087803b15801561108f57600080fd5b505af19250505080156110a0575060015b505b6110d66001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633836117dc565b60405181815233907f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a94243649060200160405180910390a26106536001600055565b6000600d546000036111285750600a5490565b600d54600854600954611139610999565b6111439190612299565b61114d91906122b0565b61115f90670de0b6b3a76400006122b0565b61116991906122cf565b600a5461080f91906122f1565b61117e611844565b600154600160a01b900460ff16156111a85760405162461bcd60e51b81526004016109249061232d565b6001805460ff60a01b1916600160a01b17905560405130907f774b57c3410c76d04ea4d51b0c15a9bac99b0e70f28fd88b53d702b5427fd31890610a5a9042815260200190565b6000806111fa611783565b611202611b67565b915091506112106001600055565b9091565b61121c611783565b600154600160a01b900460ff166112455760405162461bcd60e51b81526004016109249061232d565b336000908152600e602052604090205461128f5760405162461bcd60e51b815260206004820152600b60248201526a6e6f2062616c616e63657360a81b6044820152606401610924565b336000908152600e6020526040902054600d546112ad908290612299565b600d55336000908152600e60205260408120556004546001600160a01b0316156113415760048054336000818152600e60205260409081902054905163711f31c160e11b81526001600160a01b039093169363e23e63829361131493928392909101612309565b600060405180830381600087803b15801561132e57600080fd5b505af192505050801561133f575060015b505b6113756001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633836117dc565b60405181815233907f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a94243649060200160405180910390a2506107dd6001600055565b6040516370a0823160e01b81523360048201526107dd907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa15801561141d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611441919061239a565b3361192f565b61144f611844565b6001600160a01b0381166114b45760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610924565b6106538161189e565b6114c5611844565b6004546001600160a01b039081169082160361150f5760405162461bcd60e51b815260206004820152600960248201526839b0b6b29030b2323960b91b6044820152606401610924565b600480546001600160a01b0319166001600160a01b0392909216919091179055565b611539611783565b600154600160a01b900460ff16156115635760405162461bcd60e51b81526004016109249061232d565b3361156c611115565b600a55611577610999565b6009556001600160a01b038116156115be57611592816105bf565b6001600160a01b0382166000908152600c6020908152604080832093909355600a54600b909152919020555b600082116116025760405162461bcd60e51b8152602060048201526011602482015270043616e6e6f74207769746864726177203607c1b6044820152606401610924565b336000908152600e602052604090205461164c5760405162461bcd60e51b815260206004820152600b60248201526a6e6f2062616c616e63657360a81b6044820152606401610924565b81600d5461165a9190612299565b600d55336000908152600e6020526040902054611678908390612299565b336000908152600e60205260409020556004546001600160a01b03161561170f5760048054336000818152600e60205260409081902054905163711f31c160e11b81526001600160a01b039093169363e23e6382936116dc93928392909101612309565b600060405180830381600087803b1580156116f657600080fd5b505af115801561170a573d6000803e3d6000fd5b505050505b6117436001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633846117dc565b60405182815233907f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a94243649060200160405180910390a2506106536001600055565b6002600054036117d55760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610924565b6002600055565b6040516001600160a01b03831660248201526044810182905261183f90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611faa565b505050565b6001546001600160a01b031633146107dd5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610924565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60008183106118ff5781611901565b825b9392505050565b611929846323b872dd60e01b85858560405160240161180893929190612309565b50505050565b611937611783565b600154600160a01b900460ff16156119615760405162461bcd60e51b81526004016109249061232d565b8061196a611115565b600a55611975610999565b6009556001600160a01b038116156119bc57611990816105bf565b6001600160a01b0382166000908152600c6020908152604080832093909355600a54600b909152919020555b60008311611a0c5760405162461bcd60e51b815260206004820152601e60248201527f6465706f736974284761756765293a2063616e6e6f74207374616b65203000006044820152606401610924565b6001600160a01b0382166000908152600e6020526040902054611a309084906122f1565b6001600160a01b0383166000908152600e6020526040902055600d54611a579084906122f1565b600d556004546001600160a01b031615611ae457600480546001600160a01b038481166000908152600e60205260409081902054905163711f31c160e11b8152919092169263e23e638292611ab192879283929101612309565b600060405180830381600087803b158015611acb57600080fd5b505af1158015611adf573d6000803e3d6000fd5b505050505b611b196001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016833086611908565b816001600160a01b03167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c84604051611b5491815260200190565b60405180910390a2506108a76001600055565b6000807f0000000000000000000000000000000000000000000000000000000000000000611b985750600091829150565b60007f00000000000000000000000000000000000000000000000000000000000000009050806001600160a01b031663d294f0936040518163ffffffff1660e01b815260040160408051808303816000875af1158015611bfc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c2091906123b3565b909350915082151580611c335750600082115b15611fa55760008390506000839050600080846001600160a01b0316639d63848a6040518163ffffffff1660e01b81526004016040805180830381865afa158015611c82573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ca691906123d7565b90925090508315611e085760055460405163095ea7b360e01b81526001600160a01b039182166004820152600060248201529083169063095ea7b3906044016020604051808303816000875af1158015611d04573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d289190612411565b5060055460405163095ea7b360e01b81526001600160a01b039182166004820152602481018690529083169063095ea7b3906044016020604051808303816000875af1158015611d7c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611da09190612411565b5060055460405163b66503cf60e01b81526001600160a01b038481166004830152602482018790529091169063b66503cf90604401600060405180830381600087803b158015611def57600080fd5b505af1158015611e03573d6000803e3d6000fd5b505050505b8215611f655760055460405163095ea7b360e01b81526001600160a01b039182166004820152600060248201529082169063095ea7b3906044016020604051808303816000875af1158015611e61573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e859190612411565b5060055460405163095ea7b360e01b81526001600160a01b039182166004820152602481018590529082169063095ea7b3906044016020604051808303816000875af1158015611ed9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611efd9190612411565b5060055460405163b66503cf60e01b81526001600160a01b038381166004830152602482018690529091169063b66503cf90604401600060405180830381600087803b158015611f4c57600080fd5b505af1158015611f60573d6000803e3d6000fd5b505050505b604080518881526020810188905233917fbc567d6cbad26368064baa0ab5a757be46aae4d70f707f9203d9d9b6c8ccbfa3910160405180910390a2505050505b509091565b6000611fff826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661207c9092919063ffffffff16565b80519091501561183f578080602001905181019061201d9190612411565b61183f5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610924565b606061208b8484600085612093565b949350505050565b6060824710156120f45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610924565b600080866001600160a01b03168587604051612110919061245f565b60006040518083038185875af1925050503d806000811461214d576040519150601f19603f3d011682016040523d82523d6000602084013e612152565b606091505b50915091506121638783838761216e565b979650505050505050565b606083156121dd5782516000036121d6576001600160a01b0385163b6121d65760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610924565b508161208b565b61208b83838151156121f25781518083602001fd5b8060405162461bcd60e51b8152600401610924919061247b565b6001600160a01b038116811461065357600080fd5b60006020828403121561223357600080fd5b81356119018161220c565b60006020828403121561225057600080fd5b5035919050565b6000806040838503121561226a57600080fd5b82356122758161220c565b946020939093013593505050565b634e487b7160e01b600052601160045260246000fd5b6000828210156122ab576122ab612283565b500390565b60008160001904831182151516156122ca576122ca612283565b500290565b6000826122ec57634e487b7160e01b600052601260045260246000fd5b500490565b6000821982111561230457612304612283565b500190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b602080825260099082015268656d657267656e637960b81b604082015260600190565b6020808252602a908201527f43616c6c6572206973206e6f742052657761726473446973747269627574696f6040820152691b8818dbdb9d1c9858dd60b21b606082015260800190565b6000602082840312156123ac57600080fd5b5051919050565b600080604083850312156123c657600080fd5b505080516020909101519092909150565b600080604083850312156123ea57600080fd5b82516123f58161220c565b60208401519092506124068161220c565b809150509250929050565b60006020828403121561242357600080fd5b8151801515811461190157600080fd5b60005b8381101561244e578181015183820152602001612436565b838111156119295750506000910152565b60008251612471818460208701612433565b9190910192915050565b602081526000825180602084015261249a816040850160208701612433565b601f01601f1916919091016040019291505056fea26469706673582212203cfd1579ddbed6d7d9c58bd753881e00406904f0ffc580255c410562da9d184564736f6c634300080d0033a264697066735822122076b157e47314631530236403014e9bbf4ff4a7716a13646d5238aa08898cb73b64736f6c634300080d0033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.