Overview
ETH Balance
ETH Value
$0.00More Info
Private Name Tags
ContractCreator
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Latest 25 internal transactions (View All)
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
17365163 | 12 mins ago | 0 ETH | ||||
17365163 | 12 mins ago | 0 ETH | ||||
17364527 | 38 mins ago | 0 ETH | ||||
17364527 | 38 mins ago | 0 ETH | ||||
17364508 | 39 mins ago | 0 ETH | ||||
17364505 | 39 mins ago | 0 ETH | ||||
17364502 | 39 mins ago | 0 ETH | ||||
17364493 | 40 mins ago | 0 ETH | ||||
17364489 | 40 mins ago | 0 ETH | ||||
17364485 | 40 mins ago | 0 ETH | ||||
17364481 | 40 mins ago | 0 ETH | ||||
17364474 | 40 mins ago | 0 ETH | ||||
17364470 | 40 mins ago | 0 ETH | ||||
17364466 | 41 mins ago | 0 ETH | ||||
17364463 | 41 mins ago | 0 ETH | ||||
17364449 | 41 mins ago | 0 ETH | ||||
17364265 | 49 mins ago | 0 ETH | ||||
17364265 | 49 mins ago | 0 ETH | ||||
17364247 | 50 mins ago | 0 ETH | ||||
17364227 | 50 mins ago | 0 ETH | ||||
17364216 | 51 mins ago | 0 ETH | ||||
17363346 | 1 hr ago | 0 ETH | ||||
17363346 | 1 hr ago | 0 ETH | ||||
17363189 | 1 hr ago | 0 ETH | ||||
17363189 | 1 hr ago | 0 ETH |
Loading...
Loading
Contract Name:
FeeDistributor
Compiler Version
v0.8.22+commit.4fc1097e
Optimization Enabled:
Yes with 800 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts-upgradeable/utils/math/MathUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "./interfaces/IFeeDistributor.sol"; import "./interfaces/IERC20.sol"; import "./interfaces/IVoter.sol"; import "./interfaces/IVotingEscrow.sol"; contract FeeDistributor is IFeeDistributor, Initializable { address public voter; // only voter can modify balances (since it only happens on vote()) address public _ve; address public pairFees; uint256 internal _unlocked; uint256 public constant WEEK = 1 weeks; uint256 public firstPeriod; /// @notice token id => amount mapping(uint256 => uint256) public balanceOf; /// @notice total amount of votes per epoch mapping(uint256 => uint256) public votes; // epoch => amount /// @notice period => token id => amount mapping(uint256 => mapping(uint256 => uint256)) public userVotes; /// @notice period => token => total supply mapping(uint256 => mapping(address => uint256)) public rewardSupply; /// @notice period => token id => token => amount mapping(uint256 => mapping(uint256 => mapping(address => uint256))) public userClaimed; /// @notice token => token id => period mapping(address => mapping(uint256 => uint256)) public lastClaimByToken; address[] public rewards; mapping(address => bool) public isReward; event Deposit(address indexed from, uint256 tokenId, uint256 amount); event Withdraw(address indexed from, uint256 tokenId, uint256 amount); event NotifyReward( address indexed from, address indexed reward, uint256 amount, uint256 period ); event VotesIncentivized( address indexed from, address indexed reward, uint256 amount, uint256 period ); event ClaimRewards( uint256 period, uint256 tokenId, address receiver, address reward, uint256 amount ); constructor() { _disableInitializers(); } function initialize( address _voter, address _pairFees ) external initializer { _unlocked = 1; voter = _voter; _ve = IVoter(_voter)._ve(); firstPeriod = getPeriod(); pairFees = _pairFees; } function setPairFees() external reinitializer(2) { require( address(this) == 0x60DD85d0795316b07af5319859F4e7A876e209Bb || address(this) == 0x692716fCA7DCB50b017601eB36cF642Fc08c17d9 || address(this) == 0x741627fD7B0a2Bb3D28a6761078B953bd50a4fEb || address(this) == 0x5B24fdd2bfD5830C527bFFBf63B16D7ED9cD2521 ); pairFees = 0xAAA2A49958a443Dc9d19FdDEe873B5D1d6e84A2f; } /// @notice simple re-entrancy check modifier lock() { require(_unlocked == 1, "LOK"); _unlocked = 2; _; _unlocked = 1; } function getRewardTokens() external view returns (address[] memory) { return rewards; } function _getReward( uint256 period, uint256 tokenId, address token, address receiver ) internal { require(period <= getPeriod(), "!FP"); if (votes[period] != 0) { uint256 _reward = (rewardSupply[period][token] * userVotes[period][tokenId]) / votes[period]; _reward -= userClaimed[period][tokenId][token]; userClaimed[period][tokenId][token] += _reward; if (_reward > 0) { _safeTransfer(token, receiver, _reward); emit ClaimRewards(period, tokenId, receiver, token, _reward); } } } function _getAllRewards( uint256 tokenId, address[] memory tokens, address receiver ) internal { uint256 currentPeriod = getPeriod(); uint256 lastClaim; for (uint256 i = 0; i < tokens.length; ++i) { lastClaim = MathUpgradeable.max( lastClaimByToken[tokens[i]][tokenId], firstPeriod ); for ( uint256 period = lastClaim; period <= currentPeriod; period += WEEK ) { _getReward(period, tokenId, tokens[i], receiver); } lastClaimByToken[tokens[i]][tokenId] = currentPeriod - WEEK; } } function getPeriodReward( uint256 period, uint256 tokenId, address token ) external lock { require(IVotingEscrow(_ve).isApprovedOrOwner(msg.sender, tokenId)); _getReward(period, tokenId, token, msg.sender); } function getReward(uint256 tokenId, address[] memory tokens) external lock { require(IVotingEscrow(_ve).isApprovedOrOwner(msg.sender, tokenId)); _getAllRewards(tokenId, tokens, msg.sender); } /// @dev used by Voter to allow batched reward claims function getRewardForOwner( uint256 tokenId, address[] memory tokens ) external lock { require(msg.sender == voter); address owner = IVotingEscrow(_ve).ownerOf(tokenId); _getAllRewards(tokenId, tokens, owner); } function earned( address token, uint256 tokenId ) external view returns (uint256 reward) { uint256 currentPeriod = getPeriod(); uint256 lastClaim = MathUpgradeable.max( lastClaimByToken[token][tokenId], firstPeriod ); for ( uint256 period = lastClaim; period <= currentPeriod; period += WEEK ) { if (votes[period] != 0) { reward += (rewardSupply[period][token] * userVotes[period][tokenId]) / votes[period]; reward -= userClaimed[period][tokenId][token]; } } } function getPeriod() public view returns (uint256) { return (block.timestamp / WEEK) * WEEK; } /// @dev This is an external function, but internal notation is used since it can only be called "internally" from Voter function _deposit(uint256 amount, uint256 tokenId) external { require(msg.sender == voter); uint256 period = getPeriod() + WEEK; balanceOf[tokenId] += amount; votes[period] += amount; userVotes[period][tokenId] += amount; emit Deposit(msg.sender, tokenId, amount); } function _withdraw(uint256 amount, uint256 tokenId) external { require(msg.sender == voter); uint256 period = getPeriod() + WEEK; balanceOf[tokenId] -= amount; if (userVotes[period][tokenId] > 0) { userVotes[period][tokenId] -= amount; votes[period] -= amount; } emit Withdraw(msg.sender, tokenId, amount); } function notifyRewardAmount(address token, uint256 amount) external lock { require(msg.sender == pairFees, "!FEES"); uint256 period = getPeriod(); /// @notice there are no votes for the first period; distribute first period fees as vote incentives to second period voters if (votes[period] == 0) { period += WEEK; } if (!isReward[token]) { isReward[token] = true; rewards.push(token); } uint256 balanceBefore = IERC20(token).balanceOf(address(this)); _safeTransferFrom(token, msg.sender, address(this), amount); uint256 balanceAfter = IERC20(token).balanceOf(address(this)); amount = balanceAfter - balanceBefore; rewardSupply[period][token] += amount; emit NotifyReward(msg.sender, token, amount, period); } /// @dev record incentives amount for next period function incentivize(address token, uint256 amount) external lock { uint256 period = getPeriod() + WEEK; if (!isReward[token]) { isReward[token] = true; rewards.push(token); } uint256 balanceBefore = IERC20(token).balanceOf(address(this)); _safeTransferFrom(token, msg.sender, address(this), amount); uint256 balanceAfter = IERC20(token).balanceOf(address(this)); amount = balanceAfter - balanceBefore; rewardSupply[period][token] += amount; emit VotesIncentivized(msg.sender, token, amount, period); } function _safeTransfer(address token, address to, uint256 value) internal { require(token.code.length > 0); (bool success, bytes memory data) = token.call( abi.encodeWithSelector(IERC20.transfer.selector, to, value) ); require(success && (data.length == 0 || abi.decode(data, (bool)))); } function _safeTransferFrom( address token, address from, address to, uint256 value ) internal { require(token.code.length > 0); (bool success, bytes memory data) = token.call( abi.encodeWithSelector( IERC20.transferFrom.selector, from, to, value ) ); require(success && (data.length == 0 || abi.decode(data, (bool)))); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.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] * ```solidity * 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 Returns the highest version that has been initialized. See {reinitializer}. */ function _getInitializedVersion() internal view returns (uint8) { return _initialized; } /** * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}. */ function _isInitializing() internal view returns (bool) { return _initializing; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.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 * * Furthermore, `isContract` will also return true if the target contract within * the same transaction is already scheduled for destruction by `SELFDESTRUCT`, * which only has an effect at the end of a transaction. * ==== * * [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://consensys.net/diligence/blog/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.8.0/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 (last updated v4.9.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library MathUpgradeable { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { // Solidity will revert if denominator == 0, unlike the div opcode on its own. // The surrounding unchecked block does not change this fact. // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic. return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1, "Math: mulDiv overflow"); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10 ** 64) { value /= 10 ** 64; result += 64; } if (value >= 10 ** 32) { value /= 10 ** 32; result += 32; } if (value >= 10 ** 16) { value /= 10 ** 16; result += 16; } if (value >= 10 ** 8) { value /= 10 ** 8; result += 8; } if (value >= 10 ** 4) { value /= 10 ** 4; result += 4; } if (value >= 10 ** 2) { value /= 10 ** 2; result += 2; } if (value >= 10 ** 1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 256, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; interface IERC20 { function totalSupply() external view returns (uint256); function transfer( address recipient, uint256 amount ) external returns (bool); function decimals() external view returns (uint8); function symbol() external view returns (string memory); function balanceOf(address) external view returns (uint256); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); function allowance( address owner, address spender ) external view returns (uint256); function approve(address spender, uint256 value) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); function name() external view returns (string memory); function burn(uint256 amount) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.13; interface IFeeDistributor { function initialize(address _voter, address _pairFees) external; function _deposit(uint256 amount, uint256 tokenId) external; function _withdraw(uint256 amount, uint256 tokenId) external; function getRewardForOwner( uint256 tokenId, address[] memory tokens ) external; function notifyRewardAmount(address token, uint256 amount) external; function getRewardTokens() external view returns (address[] memory); function earned( address token, uint256 tokenId ) external view returns (uint256 reward); function incentivize(address token, uint256 amount) external; }
// SPDX-License-Identifier: MIT pragma solidity =0.7.6 || ^0.8.13; pragma abicoder v2; interface IVoter { function _ve() external view returns (address); function governor() external view returns (address); function emergencyCouncil() external view returns (address); function attachTokenToGauge(uint256 _tokenId, address account) external; function detachTokenFromGauge(uint256 _tokenId, address account) external; function emitDeposit( uint256 _tokenId, address account, uint256 amount ) external; function emitWithdraw( uint256 _tokenId, address account, uint256 amount ) external; function isWhitelisted(address token) external view returns (bool); function notifyRewardAmount(uint256 amount) external; function distribute(address _gauge) external; function gauges(address pool) external view returns (address); function feeDistributors(address gauge) external view returns (address); function gaugefactory() external view returns (address); function feeDistributorFactory() external view returns (address); function minter() external view returns (address); function factory() external view returns (address); function length() external view returns (uint256); function pools(uint256) external view returns (address); function isAlive(address) external view returns (bool); function setXRatio(uint256 _xRatio) external; function setPoolXRatio( address[] calldata _gauges, uint256[] calldata _xRaRatios ) external; function resetGaugeXRatio(address[] calldata _gauges) external; function whitelist(address _token) external; function forbid(address _token, bool _status) external; function whitelistOperator() external view returns (address); function gaugeXRatio(address gauge) external view returns (uint256); function isGauge(address gauge) external view returns (bool); function killGauge(address _gauge) external; function reviveGauge(address _gauge) external; function stale(uint256 _tokenID) external view returns (bool); function poolForGauge(address gauge) external view returns (address pool); function recoverFees( address[] calldata fees, address[][] calldata tokens ) external; function designateStale(uint256 _tokenId, bool _status) external; function base() external view returns (address); function xToken() external view returns (address); function addClGaugeReward(address gauge, address reward) external; function removeClGaugeReward(address gauge, address reward) external; function addInitialRewardPerGauge(address _gauge, address token) external; function clawBackUnusedEmissions(address[] calldata _gauges) external; function customGaugeForPool( address pool ) external view returns (address customGauge); }
// SPDX-License-Identifier: MIT pragma solidity =0.7.6 || ^0.8.13; pragma abicoder v2; interface IVotingEscrow { struct Point { int128 bias; int128 slope; // # -dweight / dt uint256 ts; uint256 blk; // block } struct LockedBalance { int128 amount; uint256 end; } function emissionsToken() external view returns (address); function team() external returns (address); function epoch() external view returns (uint256); function pointHistory(uint256 loc) external view returns (Point memory); function userPointHistory( uint256 tokenId, uint256 loc ) external view returns (Point memory); function userPointEpoch(uint256 tokenId) external view returns (uint256); function ownerOf(uint256) external view returns (address); function isApprovedOrOwner(address, uint256) external view returns (bool); function transferFrom(address, address, uint256) external; function voting(uint256 tokenId) external; function abstain(uint256 tokenId) external; function attach(uint256 tokenId) external; function detach(uint256 tokenId) external; function checkpoint() external; function depositFor(uint256 tokenId, uint256 value) external; function createLockFor( uint256, uint256, address ) external returns (uint256); function balanceOfNFT(uint256) external view returns (uint256); function balanceOfNFTAt(uint256, uint256) external view returns (uint256); function totalSupply() external view returns (uint256); function locked__end(uint256) external view returns (uint256); function balanceOf(address) external view returns (uint256); function tokenOfOwnerByIndex( address, uint256 ) external view returns (uint256); function increaseUnlockTime(uint256 tokenID, uint256 duration) external; function locked( uint256 tokenID ) external view returns (uint256 amount, uint256 unlockTime); function increaseAmount(uint256 _tokenId, uint256 _value) external; function isDelegate( address _operator, uint256 _tokenId ) external view returns (bool); }
{ "optimizer": { "enabled": true, "runs": 800 }, "evmVersion": "paris", "viaIR": true, "metadata": { "bytecodeHash": "none" }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"period","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"address","name":"reward","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ClaimRewards","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"reward","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"period","type":"uint256"}],"name":"NotifyReward","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"reward","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"period","type":"uint256"}],"name":"VotesIncentivized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"WEEK","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"_deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"_ve","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"_withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"earned","outputs":[{"internalType":"uint256","name":"reward","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"firstPeriod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPeriod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"period","type":"uint256"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"token","type":"address"}],"name":"getPeriodReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address[]","name":"tokens","type":"address[]"}],"name":"getReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address[]","name":"tokens","type":"address[]"}],"name":"getRewardForOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getRewardTokens","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"incentivize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_voter","type":"address"},{"internalType":"address","name":"_pairFees","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isReward","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"lastClaimByToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"notifyRewardAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"pairFees","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"rewardSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"rewards","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"setPairFees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"userClaimed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"userVotes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"voter","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"votes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
608080604052346100c1576000549060ff8260081c1661006f575060ff80821603610034575b60405161177a90816100c78239f35b60ff90811916176000557f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498602060405160ff8152a138610025565b62461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b6064820152608490fd5b600080fdfe6040608081526004908136101561001557600080fd5b600091823560e01c9081631ed24195146110285781633e491d4714610f0857816346c96aac14610edf578163485cc95514610d175781634a7e3e5d14610ceb5781634d5ce03814610caf5781634eceb5ff14610c875781635cfbc4b914610c475781635df8133014610c1f57816366e47d2914610ba85781638bb28cb514610b675781638dd598fb14610b3f5781639cc7f70814610b175781639e2bf22c14610a3c578163a7852afa14610989578163b66503cf14610786578163b8d17df81461065d578163c4e3a63b1461063f578163c4f59f9b14610577578163f301af421461051f578163f320772314610449578163f4359ce51461042b578163f5f8d36514610364578163f915f98214610175575063f940e3ff1461013657600080fd5b34610171578060209261014836611093565b9183526009865283832090835285526001600160a01b0383832091168252845220549051908152f35b5080fd5b90503461036057816003193601126103605761018f61104c565b9061019e60016003541461129c565b60026003556101ab6111d7565b9262093a80840180941161034d576001600160a01b03831693848652602093600c8552828720805460ff811615610334575b50508251936370a0823160e01b91828652308287015286866024818b5afa95861561032a5789966102f5575b5061021b9060243590309033906116c6565b835191825230908201528481602481895afa9081156102eb57879161029a575b507f4a1b99824c404164ed567bfb779dbdcd0367cf61723d7f537e4d1c28e63cb88293610267916111fe565b938187526008815282872086885281528287206102858682546111f1565b905582519485528401523392a3600160035580f35b90508481813d83116102e4575b6102b181836110bd565b810103126102e057517f4a1b99824c404164ed567bfb779dbdcd0367cf61723d7f537e4d1c28e63cb88261023b565b8680fd5b503d6102a7565b83513d89823e3d90fd5b9095508681813d8311610323575b61030d81836110bd565b8101031261031f57519461021b610209565b8880fd5b503d610303565b85513d8b823e3d90fd5b60ff19166001179055610346816112e6565b38806101dd565b634e487b7160e01b855260118252602485fd5b8280fd5b905034610360576020916103c761037a366110f5565b9490809461038c60016003541461129c565b6002600355600154855163430c208160e01b8152339281019283526020830193909352919384926001600160a01b0316918391829160400190565b03915afa918215610422575084916103f3575b5015610360576103eb913391611560565b600160035580f35b610415915060203d60201161041b575b61040d81836110bd565b8101906112ce565b386103da565b503d610403565b513d86823e3d90fd5b5050346101715781600319360112610171576020905162093a808152f35b838334610171576104593661107d565b91906001600160a01b03845460101c16330361051b576104776111d7565b62093a80810180911161050857907f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a15929184865260056020528286206104be8382546111f1565b905580865260066020528286206104d68382546111f1565b9055855260076020528185208486526020528185206104f68282546111f1565b9055815193845260208401523392a280f35b634e487b7160e01b855260118652602485fd5b8380fd5b9050346103605760203660031901126103605735600b54811015610360576001600160a01b0390600b602094527f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db90154169051908152f35b82843461063c578060031936011261063c57908051918290600b549182855260208095018093600b84527f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db990845b81811061061f57505050816105db9103826110bd565b83519485948186019282875251809352850193925b8281106105ff57505050500390f35b83516001600160a01b0316855286955093810193928101926001016105f0565b82546001600160a01b0316845292880192600192830192016105c5565b80fd5b90503461036057826003193601126103605760209250549051908152f35b505034610171578160031936011261017157815460ff8160081c161580610779575b6106889061120b565b7360dd85d0795316b07af5319859f4e7a876e209bb3014801561075c575b801561073f575b8015610722575b15610360577f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb384740249891600260209273aaa2a49958a443dc9d19fddee873b5d1d6e84a2f73ffffffffffffffffffffffffffffffffffffffff1983541617825561ffff19161784555160028152a180f35b50735b24fdd2bfd5830c527bffbf63b16d7ed9cd252130146106b4565b5073741627fd7b0a2bb3d28a6761078b953bd50a4feb30146106ad565b5073692716fca7dcb50b017601eb36cf642fc08c17d930146106a6565b50600260ff82161061067f565b919050346103605780600319360112610360576107a161104c565b916107b060016003541461129c565b60026003556001600160a01b039182600254163303610946576107d16111d7565b80865260209360068552828720541561091f575b851694858752600c8552828720805460ff811615610906575b50508251936370a0823160e01b91828652308287015286866024818b5afa95861561032a5789966108d5575b5061083c9060243590309033906116c6565b835191825230908201528481602481895afa9081156102eb578791610888575b507f52977ea98a2220a03ee9ba5cb003ada08d394ea10155483c95dc2dc77a7eb24b93610267916111fe565b90508481813d83116108ce575b61089f81836110bd565b810103126102e057517f52977ea98a2220a03ee9ba5cb003ada08d394ea10155483c95dc2dc77a7eb24b61085c565b503d610895565b9095508681813d83116108ff575b6108ed81836110bd565b8101031261031f57519461083c61082a565b503d6108e3565b60ff19166001179055610918816112e6565b38806107fe565b9062093a80810180911161093357906107e5565b634e487b7160e01b875260118452602487fd5b906020606492519162461bcd60e51b8352820152600560248201527f21464545530000000000000000000000000000000000000000000000000000006044820152fd5b90503461036057610999366110f5565b906109a860016003541461129c565b60026003556001600160a01b0380865460101c163303610a385760015485516331a9108f60e11b815294850183905260209185916024918391165afa928315610a2e576103eb945085936109fd575b50611560565b610a2091935060203d602011610a27575b610a1881836110bd565b81019061127d565b91386109f7565b503d610a0e565b84513d87823e3d90fd5b8580fd5b83833461017157610a4c3661107d565b91906001600160a01b03845460101c16330361051b57610a6a6111d7565b62093a80810180911161050857907ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b568929184865260209060058252838720610ab38482546111fe565b905580875260078252838720868852825283872054610adc575b5082519485528401523392a280f35b808752600782528387208688528252838720610af98482546111fe565b9055865260068152828620610b0f8382546111fe565b905586610acd565b9050346103605760203660031901126103605760209282913581526005845220549051908152f35b5050346101715781600319360112610171576020906001600160a01b03600154169051908152f35b9050346103605781600319360112610360576020928291610b86611067565b90358252600885526001600160a01b0383832091168252845220549051908152f35b9190503461036057610bd3602091610bbf36611093565b93919490809661038c60016003541461129c565b03915afa918215610c1657508591610bf7575b501561051b576103eb92339261136f565b610c10915060203d60201161041b5761040d81836110bd565b38610be6565b513d87823e3d90fd5b9050346103605760203660031901126103605760209282913581526006845220549051908152f35b505034610171578060031936011261017157806020926001600160a01b03610c6d61104c565b168152600a84528181206024358252845220549051908152f35b5050346101715781600319360112610171576020906001600160a01b03600254169051908152f35b5050346101715760203660031901126101715760ff816020936001600160a01b03610cd861104c565b168152600c855220541690519015158152f35b5050346101715780602092610cff3661107d565b90825260078552828220908252845220549051908152f35b905034610360578160031936011261036057610d3161104c565b91610d3a611067565b84549060ff8260081c161591828093610ed2575b8015610ebb575b610d5e9061120b565b60ff198116600117875582610eaa575b5060016003556001600160a01b038091875495602075ffffffffffffffffffffffffffffffffffffffff00008960101b1698897fffffffffffffffffffff0000000000000000000000000000000000000000ffff8a16178b5582885180978193638dd598fb60e01b8352165afa938415610ea0578994610e7f575b508273ffffffffffffffffffffffffffffffffffffffff199416846001541617600155610e146111d7565b905516906002541617600255610e28578380f35b7f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498927fffffffffffffffffffff000000000000000000000000000000000000000000ff602093161784555160018152a13880808380f35b610e9991945060203d602011610a2757610a1881836110bd565b9238610de9565b86513d8b823e3d90fd5b61ffff191661010117865538610d6e565b50303b158015610d55575060ff8116600114610d55565b50600160ff821610610d4e565b5050346101715781600319360112610171576001600160a01b036020925460101c169051908152f35b91905034610360578060031936011261036057610f2361104c565b602480359480946001600160a01b03610f3a6111d7565b941696878352602097600a8952868420828552895286842054835480821160001461102157505b86811115610f725789898951908152f35b8085526006808b528a89872054610fa7575b505062093a80810180911115610f61575050634e487b7160e01b83525060119052fd5b99610ff283610ff8938d610fe4611019979f8f60088e92528082208b8352845285818320549252600784528d8c828220915284528d2054906111ae565b928b52528b8920549061118e565b906111f1565b89865260098b528886208487528b528886208387528b5288862054906111fe565b97388a610f84565b9050610f61565b5050346101715781600319360112610171576020906110456111d7565b9051908152f35b600435906001600160a01b038216820361106257565b600080fd5b602435906001600160a01b038216820361106257565b6040906003190112611062576004359060243590565b60609060031901126110625760043590602435906044356001600160a01b03811681036110625790565b90601f8019910116810190811067ffffffffffffffff8211176110df57604052565b634e487b7160e01b600052604160045260246000fd5b906040600319830112611062576004359160243567ffffffffffffffff9182821161106257806023830112156110625781600401359283116110df578260051b6020926040519461114960208401876110bd565b85526024602086019282010192831161106257602401905b82821061116f575050505090565b81356001600160a01b0381168103611062578152908301908301611161565b8115611198570490565b634e487b7160e01b600052601260045260246000fd5b818102929181159184041417156111c157565b634e487b7160e01b600052601160045260246000fd5b62093a808042048181029181830414901517156111c15790565b919082018092116111c157565b919082039182116111c157565b1561121257565b60405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608490fd5b9081602091031261106257516001600160a01b03811681036110625790565b156112a357565b60405162461bcd60e51b81526020600482015260036024820152624c4f4b60e81b6044820152606490fd5b90816020910312611062575180151581036110625790565b600b54680100000000000000008110156110df576001810180600b55811015611359576001600160a01b0390600b6000527f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db901911673ffffffffffffffffffffffffffffffffffffffff19825416179055565b634e487b7160e01b600052603260045260246000fd5b92906113796111d7565b841161152157600084815260209260068452604092838320546113a0575b50505050505050565b60088552838320946001600160a01b03938488169687825282526114126113f16113e0888420548c855260078652898520878652865289852054906111ae565b8b845260068552888420549061118e565b8a8352600984528783208584528452878320898452845287832054906111fe565b9789825260098352868220848352835286822088835283528682206114388a82546111f1565b905588611448575b505050611397565b803b1561017157865163a9059cbb60e01b8482019081526001600160a01b038716602483015260448083018c9052825283928392909190839061148c6064826110bd565b51925af1611498611686565b816114f1575b501561063c575084519788528701521690840152606083015260808201527f9c1eb2a00102fc0ed9e0650403eefcb3ca775247e5988ae9e94fe9b85e6a81cc9060a090a138808080808080808080611440565b80518015925084908315611509575b5050503861149e565b61151993508201810191016112ce565b388381611500565b60405162461bcd60e51b815260206004820152600360248201526202146560ec1b6044820152606490fd5b80518210156113595760209160051b010190565b9291909261156c6111d7565b90600062093a7f19830193838511915b875181101561167c576001600160a01b0380611598838b61154c565b5116600052600a602090808252604092836000208860005283528360002054600490815480821160001461166d57508a888f8986918d955b945b8511156116255750505050506116105750918493918a936115f56001978f61154c565b5116600052815281600020908860005252600020550161157c565b601190634e487b7160e01b6000525260246000fd5b61163e949550906116359161154c565b51168c8461136f565b62093a808101809111611658578890888f8986918f6115d2565b601182634e487b7160e01b6000525260246000fd5b90508a888f8986918d956115d0565b5050505050509050565b3d156116c1573d9067ffffffffffffffff82116110df57604051916116b5601f8201601f1916602001846110bd565b82523d6000602084013e565b606090565b909192813b15611062576040519260208401946323b872dd60e01b86526001600160a01b03809216602486015216604484015260648301526064825260a082019282841067ffffffffffffffff8511176110df576000809493819460405251925af1611730611686565b8161173e575b501561106257565b8051801592508215611753575b505038611736565b61176692506020809183010191016112ce565b388061174b56fea164736f6c6343000816000a
Deployed Bytecode
0x6040608081526004908136101561001557600080fd5b600091823560e01c9081631ed24195146110285781633e491d4714610f0857816346c96aac14610edf578163485cc95514610d175781634a7e3e5d14610ceb5781634d5ce03814610caf5781634eceb5ff14610c875781635cfbc4b914610c475781635df8133014610c1f57816366e47d2914610ba85781638bb28cb514610b675781638dd598fb14610b3f5781639cc7f70814610b175781639e2bf22c14610a3c578163a7852afa14610989578163b66503cf14610786578163b8d17df81461065d578163c4e3a63b1461063f578163c4f59f9b14610577578163f301af421461051f578163f320772314610449578163f4359ce51461042b578163f5f8d36514610364578163f915f98214610175575063f940e3ff1461013657600080fd5b34610171578060209261014836611093565b9183526009865283832090835285526001600160a01b0383832091168252845220549051908152f35b5080fd5b90503461036057816003193601126103605761018f61104c565b9061019e60016003541461129c565b60026003556101ab6111d7565b9262093a80840180941161034d576001600160a01b03831693848652602093600c8552828720805460ff811615610334575b50508251936370a0823160e01b91828652308287015286866024818b5afa95861561032a5789966102f5575b5061021b9060243590309033906116c6565b835191825230908201528481602481895afa9081156102eb57879161029a575b507f4a1b99824c404164ed567bfb779dbdcd0367cf61723d7f537e4d1c28e63cb88293610267916111fe565b938187526008815282872086885281528287206102858682546111f1565b905582519485528401523392a3600160035580f35b90508481813d83116102e4575b6102b181836110bd565b810103126102e057517f4a1b99824c404164ed567bfb779dbdcd0367cf61723d7f537e4d1c28e63cb88261023b565b8680fd5b503d6102a7565b83513d89823e3d90fd5b9095508681813d8311610323575b61030d81836110bd565b8101031261031f57519461021b610209565b8880fd5b503d610303565b85513d8b823e3d90fd5b60ff19166001179055610346816112e6565b38806101dd565b634e487b7160e01b855260118252602485fd5b8280fd5b905034610360576020916103c761037a366110f5565b9490809461038c60016003541461129c565b6002600355600154855163430c208160e01b8152339281019283526020830193909352919384926001600160a01b0316918391829160400190565b03915afa918215610422575084916103f3575b5015610360576103eb913391611560565b600160035580f35b610415915060203d60201161041b575b61040d81836110bd565b8101906112ce565b386103da565b503d610403565b513d86823e3d90fd5b5050346101715781600319360112610171576020905162093a808152f35b838334610171576104593661107d565b91906001600160a01b03845460101c16330361051b576104776111d7565b62093a80810180911161050857907f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a15929184865260056020528286206104be8382546111f1565b905580865260066020528286206104d68382546111f1565b9055855260076020528185208486526020528185206104f68282546111f1565b9055815193845260208401523392a280f35b634e487b7160e01b855260118652602485fd5b8380fd5b9050346103605760203660031901126103605735600b54811015610360576001600160a01b0390600b602094527f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db90154169051908152f35b82843461063c578060031936011261063c57908051918290600b549182855260208095018093600b84527f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db990845b81811061061f57505050816105db9103826110bd565b83519485948186019282875251809352850193925b8281106105ff57505050500390f35b83516001600160a01b0316855286955093810193928101926001016105f0565b82546001600160a01b0316845292880192600192830192016105c5565b80fd5b90503461036057826003193601126103605760209250549051908152f35b505034610171578160031936011261017157815460ff8160081c161580610779575b6106889061120b565b7360dd85d0795316b07af5319859f4e7a876e209bb3014801561075c575b801561073f575b8015610722575b15610360577f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb384740249891600260209273aaa2a49958a443dc9d19fddee873b5d1d6e84a2f73ffffffffffffffffffffffffffffffffffffffff1983541617825561ffff19161784555160028152a180f35b50735b24fdd2bfd5830c527bffbf63b16d7ed9cd252130146106b4565b5073741627fd7b0a2bb3d28a6761078b953bd50a4feb30146106ad565b5073692716fca7dcb50b017601eb36cf642fc08c17d930146106a6565b50600260ff82161061067f565b919050346103605780600319360112610360576107a161104c565b916107b060016003541461129c565b60026003556001600160a01b039182600254163303610946576107d16111d7565b80865260209360068552828720541561091f575b851694858752600c8552828720805460ff811615610906575b50508251936370a0823160e01b91828652308287015286866024818b5afa95861561032a5789966108d5575b5061083c9060243590309033906116c6565b835191825230908201528481602481895afa9081156102eb578791610888575b507f52977ea98a2220a03ee9ba5cb003ada08d394ea10155483c95dc2dc77a7eb24b93610267916111fe565b90508481813d83116108ce575b61089f81836110bd565b810103126102e057517f52977ea98a2220a03ee9ba5cb003ada08d394ea10155483c95dc2dc77a7eb24b61085c565b503d610895565b9095508681813d83116108ff575b6108ed81836110bd565b8101031261031f57519461083c61082a565b503d6108e3565b60ff19166001179055610918816112e6565b38806107fe565b9062093a80810180911161093357906107e5565b634e487b7160e01b875260118452602487fd5b906020606492519162461bcd60e51b8352820152600560248201527f21464545530000000000000000000000000000000000000000000000000000006044820152fd5b90503461036057610999366110f5565b906109a860016003541461129c565b60026003556001600160a01b0380865460101c163303610a385760015485516331a9108f60e11b815294850183905260209185916024918391165afa928315610a2e576103eb945085936109fd575b50611560565b610a2091935060203d602011610a27575b610a1881836110bd565b81019061127d565b91386109f7565b503d610a0e565b84513d87823e3d90fd5b8580fd5b83833461017157610a4c3661107d565b91906001600160a01b03845460101c16330361051b57610a6a6111d7565b62093a80810180911161050857907ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b568929184865260209060058252838720610ab38482546111fe565b905580875260078252838720868852825283872054610adc575b5082519485528401523392a280f35b808752600782528387208688528252838720610af98482546111fe565b9055865260068152828620610b0f8382546111fe565b905586610acd565b9050346103605760203660031901126103605760209282913581526005845220549051908152f35b5050346101715781600319360112610171576020906001600160a01b03600154169051908152f35b9050346103605781600319360112610360576020928291610b86611067565b90358252600885526001600160a01b0383832091168252845220549051908152f35b9190503461036057610bd3602091610bbf36611093565b93919490809661038c60016003541461129c565b03915afa918215610c1657508591610bf7575b501561051b576103eb92339261136f565b610c10915060203d60201161041b5761040d81836110bd565b38610be6565b513d87823e3d90fd5b9050346103605760203660031901126103605760209282913581526006845220549051908152f35b505034610171578060031936011261017157806020926001600160a01b03610c6d61104c565b168152600a84528181206024358252845220549051908152f35b5050346101715781600319360112610171576020906001600160a01b03600254169051908152f35b5050346101715760203660031901126101715760ff816020936001600160a01b03610cd861104c565b168152600c855220541690519015158152f35b5050346101715780602092610cff3661107d565b90825260078552828220908252845220549051908152f35b905034610360578160031936011261036057610d3161104c565b91610d3a611067565b84549060ff8260081c161591828093610ed2575b8015610ebb575b610d5e9061120b565b60ff198116600117875582610eaa575b5060016003556001600160a01b038091875495602075ffffffffffffffffffffffffffffffffffffffff00008960101b1698897fffffffffffffffffffff0000000000000000000000000000000000000000ffff8a16178b5582885180978193638dd598fb60e01b8352165afa938415610ea0578994610e7f575b508273ffffffffffffffffffffffffffffffffffffffff199416846001541617600155610e146111d7565b905516906002541617600255610e28578380f35b7f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498927fffffffffffffffffffff000000000000000000000000000000000000000000ff602093161784555160018152a13880808380f35b610e9991945060203d602011610a2757610a1881836110bd565b9238610de9565b86513d8b823e3d90fd5b61ffff191661010117865538610d6e565b50303b158015610d55575060ff8116600114610d55565b50600160ff821610610d4e565b5050346101715781600319360112610171576001600160a01b036020925460101c169051908152f35b91905034610360578060031936011261036057610f2361104c565b602480359480946001600160a01b03610f3a6111d7565b941696878352602097600a8952868420828552895286842054835480821160001461102157505b86811115610f725789898951908152f35b8085526006808b528a89872054610fa7575b505062093a80810180911115610f61575050634e487b7160e01b83525060119052fd5b99610ff283610ff8938d610fe4611019979f8f60088e92528082208b8352845285818320549252600784528d8c828220915284528d2054906111ae565b928b52528b8920549061118e565b906111f1565b89865260098b528886208487528b528886208387528b5288862054906111fe565b97388a610f84565b9050610f61565b5050346101715781600319360112610171576020906110456111d7565b9051908152f35b600435906001600160a01b038216820361106257565b600080fd5b602435906001600160a01b038216820361106257565b6040906003190112611062576004359060243590565b60609060031901126110625760043590602435906044356001600160a01b03811681036110625790565b90601f8019910116810190811067ffffffffffffffff8211176110df57604052565b634e487b7160e01b600052604160045260246000fd5b906040600319830112611062576004359160243567ffffffffffffffff9182821161106257806023830112156110625781600401359283116110df578260051b6020926040519461114960208401876110bd565b85526024602086019282010192831161106257602401905b82821061116f575050505090565b81356001600160a01b0381168103611062578152908301908301611161565b8115611198570490565b634e487b7160e01b600052601260045260246000fd5b818102929181159184041417156111c157565b634e487b7160e01b600052601160045260246000fd5b62093a808042048181029181830414901517156111c15790565b919082018092116111c157565b919082039182116111c157565b1561121257565b60405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608490fd5b9081602091031261106257516001600160a01b03811681036110625790565b156112a357565b60405162461bcd60e51b81526020600482015260036024820152624c4f4b60e81b6044820152606490fd5b90816020910312611062575180151581036110625790565b600b54680100000000000000008110156110df576001810180600b55811015611359576001600160a01b0390600b6000527f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db901911673ffffffffffffffffffffffffffffffffffffffff19825416179055565b634e487b7160e01b600052603260045260246000fd5b92906113796111d7565b841161152157600084815260209260068452604092838320546113a0575b50505050505050565b60088552838320946001600160a01b03938488169687825282526114126113f16113e0888420548c855260078652898520878652865289852054906111ae565b8b845260068552888420549061118e565b8a8352600984528783208584528452878320898452845287832054906111fe565b9789825260098352868220848352835286822088835283528682206114388a82546111f1565b905588611448575b505050611397565b803b1561017157865163a9059cbb60e01b8482019081526001600160a01b038716602483015260448083018c9052825283928392909190839061148c6064826110bd565b51925af1611498611686565b816114f1575b501561063c575084519788528701521690840152606083015260808201527f9c1eb2a00102fc0ed9e0650403eefcb3ca775247e5988ae9e94fe9b85e6a81cc9060a090a138808080808080808080611440565b80518015925084908315611509575b5050503861149e565b61151993508201810191016112ce565b388381611500565b60405162461bcd60e51b815260206004820152600360248201526202146560ec1b6044820152606490fd5b80518210156113595760209160051b010190565b9291909261156c6111d7565b90600062093a7f19830193838511915b875181101561167c576001600160a01b0380611598838b61154c565b5116600052600a602090808252604092836000208860005283528360002054600490815480821160001461166d57508a888f8986918d955b945b8511156116255750505050506116105750918493918a936115f56001978f61154c565b5116600052815281600020908860005252600020550161157c565b601190634e487b7160e01b6000525260246000fd5b61163e949550906116359161154c565b51168c8461136f565b62093a808101809111611658578890888f8986918f6115d2565b601182634e487b7160e01b6000525260246000fd5b90508a888f8986918d956115d0565b5050505050509050565b3d156116c1573d9067ffffffffffffffff82116110df57604051916116b5601f8201601f1916602001846110bd565b82523d6000602084013e565b606090565b909192813b15611062576040519260208401946323b872dd60e01b86526001600160a01b03809216602486015216604484015260648301526064825260a082019282841067ffffffffffffffff8511176110df576000809493819460405251925af1611730611686565b8161173e575b501561106257565b8051801592508215611753575b505038611736565b61176692506020809183010191016112ce565b388061174b56fea164736f6c6343000816000a
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 35 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.