More Info
Private Name Tags
ContractCreator
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Block |
From
|
To
|
|||
---|---|---|---|---|---|---|
21748472 | 10 hrs ago | 0.04712721 ETH | ||||
21748472 | 10 hrs ago | 0.04712721 ETH | ||||
21747193 | 14 hrs ago | 0.46039629 ETH | ||||
21747193 | 14 hrs ago | 0.46039629 ETH | ||||
21734790 | 2 days ago | 0.17910725 ETH | ||||
21734790 | 2 days ago | 0.17910725 ETH | ||||
21730121 | 2 days ago | 0.10097288 ETH | ||||
21730121 | 2 days ago | 0.10097288 ETH | ||||
21727531 | 3 days ago | 0.09630194 ETH | ||||
21727531 | 3 days ago | 0.09630194 ETH | ||||
21725078 | 3 days ago | 0.09214093 ETH | ||||
21725078 | 3 days ago | 0.09214093 ETH | ||||
21722731 | 4 days ago | 0.08752242 ETH | ||||
21722731 | 4 days ago | 0.08752242 ETH | ||||
21720495 | 4 days ago | 0.08989834 ETH | ||||
21720495 | 4 days ago | 0.08989834 ETH | ||||
21718186 | 4 days ago | 0.14356561 ETH | ||||
21718186 | 4 days ago | 0.14356561 ETH | ||||
21714641 | 5 days ago | 0.06948605 ETH | ||||
21714641 | 5 days ago | 0.06948605 ETH | ||||
21712930 | 5 days ago | 0.0977431 ETH | ||||
21712930 | 5 days ago | 0.0977431 ETH | ||||
21710442 | 5 days ago | 0.09643958 ETH | ||||
21710442 | 5 days ago | 0.09643958 ETH | ||||
21707868 | 6 days ago | 0.06777733 ETH |
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
InterestManager
Compiler Version
v0.8.25+commit.b61c2a91
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.25; import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; import { Math } from "@openzeppelin/contracts/utils/math/Math.sol"; import { IDripVault } from "src/interfaces/IDripVault.sol"; import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import { IStreamingPool } from "src/interfaces/IStreamingPool.sol"; import { IInterestManager } from "src/interfaces/IInterestManager.sol"; import { TransferHelper } from "@uniswap/v3-periphery/contracts/libraries/TransferHelper.sol"; import { ISwapRouter } from "@uniswap/v3-periphery/contracts/interfaces/ISwapRouter.sol"; import { IWETH } from "src/interfaces/IWETH.sol"; import { IPirexEth } from "src/vendor/dinero/IPirexEth.sol"; import { IApxETH } from "src/vendor/dinero/IApxETH.sol"; import { ReentrancyGuard } from "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; interface IChainlinkOracle { function latestRoundData() external view returns ( uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound ); } /** * @title InterestManager * @notice It manages the rewards distribution to the megapools based on people votes with * their HCT. * @custom:export abi */ contract InterestManager is IInterestManager, Ownable, ReentrancyGuard { uint32 private constant MINIMUM_EPOCH_DURATION = 7 days; uint32 private constant MAXIMUM_EPOCH_DURATION = 30 days; uint256 public constant PRECISION = 1e18; uint256 public constant MINIMUM_SWAP_DAI = 100e18; uint256 public constant BPS = 10_000; uint24 private constant DAI_POOL_FEE = 500; mapping(address => uint128) internal pendingRewards; mapping(uint64 => Epoch) public epochs; address public gaugeController; uint64 public epochId; uint32 public override epochDuration; IStreamingPool public streamingPool; uint256 private apxBalanceTracker; uint256 public allowedSlippage; address public immutable SWAP_ROUTER; IDripVault public immutable DRIP_VAULT_ETH; IDripVault public immutable DRIP_VAULT_DAI; IChainlinkOracle public immutable CHAINLINK_DAI_ETH; IERC20 public immutable DAI; IWETH public immutable WETH; IERC20 public immutable APX_ETH; IPirexEth public immutable PIREX_ETH; constructor( address _owner, address _gaugeController, address _dripVaultETH, address _dripVaultDAI, address _swapRouter, address _chainlinkDaiETH, address _weth ) Ownable(_owner) { gaugeController = _gaugeController; DRIP_VAULT_ETH = IDripVault(_dripVaultETH); DRIP_VAULT_DAI = IDripVault(_dripVaultDAI); SWAP_ROUTER = _swapRouter; WETH = IWETH(_weth); DAI = IERC20(IDripVault(_dripVaultDAI).getInputToken()); APX_ETH = IERC20(IDripVault(_dripVaultETH).getOutputToken()); PIREX_ETH = IPirexEth(IApxETH(address(APX_ETH)).pirexEth()); CHAINLINK_DAI_ETH = IChainlinkOracle(_chainlinkDaiETH); allowedSlippage = 500; // 5% epochDuration = MINIMUM_EPOCH_DURATION; TransferHelper.safeApprove(address(DAI), SWAP_ROUTER, type(uint256).max); } function applyGauges(address[] memory _megapools, uint128[] memory _weights) external override { uint256 megapoolsLength = _megapools.length; if (msg.sender != gaugeController) revert NotGaugeController(); if (megapoolsLength != _weights.length) revert InvalidInputLength(); _endEpoch(); Epoch storage epoch = epochs[epochId]; uint128 weight; uint128 totalWeight; address megapool; for (uint256 i = 0; i < megapoolsLength; ++i) { megapool = _megapools[i]; weight = _weights[i]; epoch.megapools.push(megapool); epoch.megapoolToWeight[megapool] += weight; totalWeight += weight; } epoch.totalWeight = totalWeight; epoch.endOfEpoch = uint32(block.timestamp + epochDuration); emit EpochInitialized(epochId, _megapools, _weights, totalWeight); } function _endEpoch() internal { uint64 currentEpoch = epochId; Epoch storage epoch = epochs[currentEpoch]; if (epoch.endOfEpoch > block.timestamp) revert EpochNotFinished(); if (epoch.totalWeight != 0) { epoch.totalRewards += uint128(_claimFromServices()); for (uint256 i = 0; i < epoch.megapools.length; ++i) { _assignRewardToMegapool(epoch, epoch.megapools[i]); } emit EpochEnded(currentEpoch); } epochId = currentEpoch + 1; } function claim() external override nonReentrant returns (uint256 rewards_) { Epoch storage epoch = epochs[epochId]; if (epoch.totalWeight != 0) { epoch.totalRewards += uint128(_claimFromServices()); } _assignRewardToMegapool(epoch, msg.sender); rewards_ = pendingRewards[msg.sender]; if (rewards_ == 0) return 0; pendingRewards[msg.sender] = 0; APX_ETH.transfer(msg.sender, rewards_); apxBalanceTracker -= rewards_; emit RewardClaimed(msg.sender, rewards_); return rewards_; } function _claimFromServices() internal returns (uint256 rewards_) { IStreamingPool cachedStreamingPool = streamingPool; if (address(cachedStreamingPool) != address(0)) { cachedStreamingPool.claim(); } DRIP_VAULT_ETH.claim(); _claimDaiAndConvertToApxETH(); uint256 newApxBalance = APX_ETH.balanceOf(address(this)); rewards_ = newApxBalance - apxBalanceTracker; apxBalanceTracker = newApxBalance; return rewards_; } function _claimDaiAndConvertToApxETH() internal returns (uint256 apxOut_) { DRIP_VAULT_DAI.claim(); uint256 daiBalance = DAI.balanceOf(address(this)); if (daiBalance < MINIMUM_SWAP_DAI) return 0; ( /*uint80 roundId*/ , int256 answer, /*uint256 startedAt*/ , /*uint256 updatedAt*/ , /*uint80 answeredInRound*/ ) = CHAINLINK_DAI_ETH.latestRoundData(); uint256 minimumOut = daiBalance * uint256(answer) / PRECISION; minimumOut -= minimumOut * allowedSlippage / BPS; ISwapRouter.ExactInputSingleParams memory params = ISwapRouter.ExactInputSingleParams({ tokenIn: address(DAI), tokenOut: address(WETH), fee: DAI_POOL_FEE, recipient: address(this), deadline: block.timestamp, amountIn: daiBalance, amountOutMinimum: minimumOut, sqrtPriceLimitX96: 0 }); uint256 amountOut = ISwapRouter(SWAP_ROUTER).exactInputSingle(params); WETH.withdraw(amountOut); (apxOut_,) = PIREX_ETH.deposit{ value: amountOut }(address(this), true); return apxOut_; } function _assignRewardToMegapool(Epoch storage _epoch, address _megapool) internal { (uint128 totalRewards, uint128 addedRewards) = _getRewards(_epoch, _megapool); if (addedRewards == 0) return; _epoch.megapoolClaims[_megapool] += addedRewards; pendingRewards[_megapool] = totalRewards; emit RewardAssigned(_megapool, addedRewards, totalRewards); } function setAllowedSlippage(uint256 _allowedSlippage) external onlyOwner { allowedSlippage = _allowedSlippage; } function setGaugeController(address _gaugeController) external onlyOwner { gaugeController = _gaugeController; emit GaugeControllerSet(_gaugeController); } function setEpochDuration(uint32 _epochDuration) external onlyOwner { if ( _epochDuration < MINIMUM_EPOCH_DURATION || _epochDuration > MAXIMUM_EPOCH_DURATION ) { revert InvalidEpochDuration(); } epochDuration = _epochDuration; emit EpochDurationSet(_epochDuration); } function setStreamingPool(address _streamingPool) external onlyOwner { streamingPool = IStreamingPool(_streamingPool); emit StreamingPoolSet(_streamingPool); } function getRewards(address _megapool) external view override returns (uint256 totalRewards_) { (totalRewards_,) = _getRewards(epochs[epochId], _megapool); return totalRewards_; } function _getRewards(Epoch storage epoch, address _megapool) internal view returns (uint128 totalRewards_, uint128 addedRewards_) { totalRewards_ = pendingRewards[_megapool]; uint128 totalServiceRewards = epoch.totalRewards; uint256 weight = epoch.megapoolToWeight[_megapool]; uint256 totalClaimedByPool = epoch.megapoolClaims[_megapool]; if (weight == 0 || epoch.totalWeight == 0) return (totalRewards_, 0); uint256 weightRatioOfPool = Math.mulDiv(weight, PRECISION, epoch.totalWeight); uint256 totalRewardsToPool = uint128(Math.mulDiv(totalServiceRewards, weightRatioOfPool, PRECISION)); addedRewards_ = uint128(totalRewardsToPool - totalClaimedByPool); totalRewards_ += addedRewards_; return (totalRewards_, addedRewards_); } function getEpochData(uint64 _epochId) external view returns ( uint128 totalRewards_, uint128 totalWeight_, uint32 endOfEpoch_, address[] memory megapools_ ) { Epoch storage epoch = epochs[_epochId]; totalRewards_ = epoch.totalRewards; totalWeight_ = epoch.totalWeight; megapools_ = epoch.megapools; endOfEpoch_ = epoch.endOfEpoch; return (totalRewards_, totalWeight_, endOfEpoch_, megapools_); } function getMegapoolWeight(uint64 _epochId, address _megapool) external view returns (uint128 weight_) { return epochs[_epochId].megapoolToWeight[_megapool]; } receive() external payable { } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol) pragma solidity ^0.8.20; import {Context} from "../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. * * The initial owner is set to the address provided by the deployer. 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; /** * @dev The caller account is not authorized to perform an operation. */ error OwnableUnauthorizedAccount(address account); /** * @dev The owner is not a valid owner account. (eg. `address(0)`) */ error OwnableInvalidOwner(address owner); event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the address provided by the deployer as the initial owner. */ constructor(address initialOwner) { if (initialOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(initialOwner); } /** * @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 { if (owner() != _msgSender()) { revert OwnableUnauthorizedAccount(_msgSender()); } } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling 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 { if (newOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _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 v5.0.0) (utils/math/Math.sol) pragma solidity ^0.8.20; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { /** * @dev Muldiv operation overflow. */ error MathOverflowedMulDiv(); enum Rounding { Floor, // Toward negative infinity Ceil, // Toward positive infinity Trunc, // Toward zero Expand // Away from zero } /** * @dev Returns the addition of two unsigned integers, with an overflow flag. */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the subtraction of two unsigned integers, with an overflow flag. */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @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 towards infinity instead * of rounding towards zero. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { if (b == 0) { // Guarantee the same behavior as in a regular Solidity division. return a / b; } // (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 = x * y; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) 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. if (denominator <= prod1) { revert MathOverflowedMulDiv(); } /////////////////////////////////////////////// // 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. uint256 twos = denominator & (0 - denominator); 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 (unsignedRoundsUp(rounding) && 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 * towards zero. * * 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 + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2 of a positive value rounded towards zero. * 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 + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10 of a positive value rounded towards zero. * 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 + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0); } } /** * @dev Return the log in base 256 of a positive value rounded towards zero. * 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 + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0); } } /** * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers. */ function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) { return uint8(rounding) % 2 == 1; } }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0; interface IDripVault { error FailedToSendETH(); error InvalidAmount(); error NotObeliskRegistry(); error NativeNotAccepted(); error ZeroAddress(); event ObeliskRegistryUpdated(address indexed obeliskRegistry); event InterestRateReceiverUpdated(address indexed interestRateReceiver); /** * @notice Deposits ETH or a specified amount of ERC20 token into the vault. * @dev ERC20 has to be transferred before calling this function */ function deposit(uint256 _amount) external payable returns (uint256 depositAmount_); /** * @notice Withdraws ETH or a specified amount of ERC20 token from the vault. * @param _to The address to withdraw the funds to. * @param _amount The amount of ETH or ERC20 token to withdraw. Use 0 for ETH. */ function withdraw(address _to, uint256 _amount) external returns (uint256 withdrawAmount_); /** * @notice Claims any accrued interest in the vault. * @return The amount of interest claimed. */ function claim() external returns (uint256); /** * @notice Gets the total deposit amount in the vault. * @return The total deposit amount. */ function getTotalDeposit() external view returns (uint256); /** * @notice Gets the input token of the vault. * @return The input token address. */ function getInputToken() external view returns (address); /** * @notice Gets the output token of the vault. * @return The output token address. */ function getOutputToken() external view returns (address); /** * @notice Gets the preview deposit amount of the vault. * @return The preview deposit amount. */ function previewDeposit(uint256 _amount) external view returns (uint256); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.20; /** * @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 value of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the value of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves a `value` amount of 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 value) 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 a `value` amount of tokens 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 value) external returns (bool); /** * @dev Moves a `value` amount of tokens from `from` to `to` using the * allowance mechanism. `value` 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 value) external returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0; interface IStreamingPool { error NotInterestManager(); error InvalidAmount(); error EpochNotFinished(); event Claimed(uint256 amount); event ApyBoosted(uint256 amount, uint256 until); function claim() external returns (uint256 amount_); }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0; interface IInterestManager { error InvalidInputLength(); error NotGaugeController(); error EpochNotFinished(); error InvalidEpochDuration(); event EpochInitialized( uint64 indexed epochId, address[] megapools, uint128[] weights, uint128 totalWeight ); event GaugeControllerSet(address indexed gaugeController); event EpochEnded(uint64 indexed epochId); event RewardAssigned( address indexed megapool, uint256 addedRewards, uint256 totalRewards ); event RewardClaimed(address indexed megapool, uint256 rewards); event EpochDurationSet(uint32 epochDuration); event StreamingPoolSet(address indexed streamingPool); struct Epoch { uint32 endOfEpoch; uint128 totalRewards; uint128 totalWeight; address[] megapools; mapping(address => uint128) megapoolToWeight; mapping(address => uint128) megapoolClaims; } function epochDuration() external view returns (uint32); /** * @notice Applies gauges to the interest manager * @param _megapools The megapools to apply the gauges to * @param _weights The weights of the megapools */ function applyGauges(address[] memory _megapools, uint128[] memory _weights) external; /** * @notice Claims rewards for the caller * @return rewards_ The amount of rewards claimed */ function claim() external returns (uint256 rewards_); /** * @notice Gets the rewards for a megapool * @param _megapool The megapool to get the rewards for * @return rewards_ The amount of rewards for the megapool */ function getRewards(address _megapool) external view returns (uint256); }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.6.0; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; library TransferHelper { /// @notice Transfers tokens from the targeted address to the given destination /// @notice Errors with 'STF' if transfer fails /// @param token The contract address of the token to be transferred /// @param from The originating address from which the tokens will be transferred /// @param to The destination address of the transfer /// @param value The amount to be transferred function safeTransferFrom( address token, address from, address to, uint256 value ) internal { (bool success, bytes memory data) = token.call(abi.encodeWithSelector(IERC20.transferFrom.selector, from, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'STF'); } /// @notice Transfers tokens from msg.sender to a recipient /// @dev Errors with ST if transfer fails /// @param token The contract address of the token which will be transferred /// @param to The recipient of the transfer /// @param value The value of the transfer function safeTransfer( address token, address to, uint256 value ) internal { (bool success, bytes memory data) = token.call(abi.encodeWithSelector(IERC20.transfer.selector, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'ST'); } /// @notice Approves the stipulated contract to spend the given allowance in the given token /// @dev Errors with 'SA' if transfer fails /// @param token The contract address of the token to be approved /// @param to The target of the approval /// @param value The amount of the given token the target will be allowed to spend function safeApprove( address token, address to, uint256 value ) internal { (bool success, bytes memory data) = token.call(abi.encodeWithSelector(IERC20.approve.selector, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'SA'); } /// @notice Transfers ETH to the recipient address /// @dev Fails with `STE` /// @param to The destination of the transfer /// @param value The value to be transferred function safeTransferETH(address to, uint256 value) internal { (bool success, ) = to.call{value: value}(new bytes(0)); require(success, 'STE'); } }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.7.5; pragma abicoder v2; import '@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol'; /// @title Router token swapping functionality /// @notice Functions for swapping tokens via Uniswap V3 interface ISwapRouter is IUniswapV3SwapCallback { struct ExactInputSingleParams { address tokenIn; address tokenOut; uint24 fee; address recipient; uint256 deadline; uint256 amountIn; uint256 amountOutMinimum; uint160 sqrtPriceLimitX96; } /// @notice Swaps `amountIn` of one token for as much as possible of another token /// @param params The parameters necessary for the swap, encoded as `ExactInputSingleParams` in calldata /// @return amountOut The amount of the received token function exactInputSingle(ExactInputSingleParams calldata params) external payable returns (uint256 amountOut); struct ExactInputParams { bytes path; address recipient; uint256 deadline; uint256 amountIn; uint256 amountOutMinimum; } /// @notice Swaps `amountIn` of one token for as much as possible of another along the specified path /// @param params The parameters necessary for the multi-hop swap, encoded as `ExactInputParams` in calldata /// @return amountOut The amount of the received token function exactInput(ExactInputParams calldata params) external payable returns (uint256 amountOut); struct ExactOutputSingleParams { address tokenIn; address tokenOut; uint24 fee; address recipient; uint256 deadline; uint256 amountOut; uint256 amountInMaximum; uint160 sqrtPriceLimitX96; } /// @notice Swaps as little as possible of one token for `amountOut` of another token /// @param params The parameters necessary for the swap, encoded as `ExactOutputSingleParams` in calldata /// @return amountIn The amount of the input token function exactOutputSingle(ExactOutputSingleParams calldata params) external payable returns (uint256 amountIn); struct ExactOutputParams { bytes path; address recipient; uint256 deadline; uint256 amountOut; uint256 amountInMaximum; } /// @notice Swaps as little as possible of one token for `amountOut` of another along the specified path (reversed) /// @param params The parameters necessary for the multi-hop swap, encoded as `ExactOutputParams` in calldata /// @return amountIn The amount of the input token function exactOutput(ExactOutputParams calldata params) external payable returns (uint256 amountIn); }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.8.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; interface IWETH is IERC20 { function deposit() external payable; function withdraw(uint256) external; }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0; interface IPirexEth { function deposit(address receiver, bool shouldCompound) external payable returns (uint256 postFeeAmount, uint256 feeAmount); function fees(uint8 _feeType) external view returns (uint32); }
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0; import { IERC4626 } from "@openzeppelin/contracts/interfaces/IERC4626.sol"; interface IApxETH is IERC4626 { function pirexEth() external view returns (address); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/ReentrancyGuard.sol) pragma solidity ^0.8.20; /** * @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; /** * @dev Unauthorized reentrant call. */ error ReentrancyGuardReentrantCall(); 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 if (_status == ENTERED) { revert ReentrancyGuardReentrantCall(); } // 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; } /** * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a * `nonReentrant` function in the call stack. */ function _reentrancyGuardEntered() internal view returns (bool) { return _status == ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol) pragma solidity ^0.8.20; /** * @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; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity >=0.5.0; /// @title Callback for IUniswapV3PoolActions#swap /// @notice Any contract that calls IUniswapV3PoolActions#swap must implement this interface interface IUniswapV3SwapCallback { /// @notice Called to `msg.sender` after executing a swap via IUniswapV3Pool#swap. /// @dev In the implementation you must pay the pool tokens owed for the swap. /// The caller of this method must be checked to be a UniswapV3Pool deployed by the canonical UniswapV3Factory. /// amount0Delta and amount1Delta can both be 0 if no tokens were swapped. /// @param amount0Delta The amount of token0 that was sent (negative) or must be received (positive) by the pool by /// the end of the swap. If positive, the callback must send that amount of token0 to the pool. /// @param amount1Delta The amount of token1 that was sent (negative) or must be received (positive) by the pool by /// the end of the swap. If positive, the callback must send that amount of token1 to the pool. /// @param data Any data passed through by the caller via the IUniswapV3PoolActions#swap call function uniswapV3SwapCallback( int256 amount0Delta, int256 amount1Delta, bytes calldata data ) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC4626.sol) pragma solidity ^0.8.20; import {IERC20} from "../token/ERC20/IERC20.sol"; import {IERC20Metadata} from "../token/ERC20/extensions/IERC20Metadata.sol"; /** * @dev Interface of the ERC4626 "Tokenized Vault Standard", as defined in * https://eips.ethereum.org/EIPS/eip-4626[ERC-4626]. */ interface IERC4626 is IERC20, IERC20Metadata { event Deposit(address indexed sender, address indexed owner, uint256 assets, uint256 shares); event Withdraw( address indexed sender, address indexed receiver, address indexed owner, uint256 assets, uint256 shares ); /** * @dev Returns the address of the underlying token used for the Vault for accounting, depositing, and withdrawing. * * - MUST be an ERC-20 token contract. * - MUST NOT revert. */ function asset() external view returns (address assetTokenAddress); /** * @dev Returns the total amount of the underlying asset that is “managed” by Vault. * * - SHOULD include any compounding that occurs from yield. * - MUST be inclusive of any fees that are charged against assets in the Vault. * - MUST NOT revert. */ function totalAssets() external view returns (uint256 totalManagedAssets); /** * @dev Returns the amount of shares that the Vault would exchange for the amount of assets provided, in an ideal * scenario where all the conditions are met. * * - MUST NOT be inclusive of any fees that are charged against assets in the Vault. * - MUST NOT show any variations depending on the caller. * - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange. * - MUST NOT revert. * * NOTE: This calculation MAY NOT reflect the “per-user” price-per-share, and instead should reflect the * “average-user’s” price-per-share, meaning what the average user should expect to see when exchanging to and * from. */ function convertToShares(uint256 assets) external view returns (uint256 shares); /** * @dev Returns the amount of assets that the Vault would exchange for the amount of shares provided, in an ideal * scenario where all the conditions are met. * * - MUST NOT be inclusive of any fees that are charged against assets in the Vault. * - MUST NOT show any variations depending on the caller. * - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange. * - MUST NOT revert. * * NOTE: This calculation MAY NOT reflect the “per-user” price-per-share, and instead should reflect the * “average-user’s” price-per-share, meaning what the average user should expect to see when exchanging to and * from. */ function convertToAssets(uint256 shares) external view returns (uint256 assets); /** * @dev Returns the maximum amount of the underlying asset that can be deposited into the Vault for the receiver, * through a deposit call. * * - MUST return a limited value if receiver is subject to some deposit limit. * - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of assets that may be deposited. * - MUST NOT revert. */ function maxDeposit(address receiver) external view returns (uint256 maxAssets); /** * @dev Allows an on-chain or off-chain user to simulate the effects of their deposit at the current block, given * current on-chain conditions. * * - MUST return as close to and no more than the exact amount of Vault shares that would be minted in a deposit * call in the same transaction. I.e. deposit should return the same or more shares as previewDeposit if called * in the same transaction. * - MUST NOT account for deposit limits like those returned from maxDeposit and should always act as though the * deposit would be accepted, regardless if the user has enough tokens approved, etc. * - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees. * - MUST NOT revert. * * NOTE: any unfavorable discrepancy between convertToShares and previewDeposit SHOULD be considered slippage in * share price or some other type of condition, meaning the depositor will lose assets by depositing. */ function previewDeposit(uint256 assets) external view returns (uint256 shares); /** * @dev Mints shares Vault shares to receiver by depositing exactly amount of underlying tokens. * * - MUST emit the Deposit event. * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the * deposit execution, and are accounted for during deposit. * - MUST revert if all of assets cannot be deposited (due to deposit limit being reached, slippage, the user not * approving enough underlying tokens to the Vault contract, etc). * * NOTE: most implementations will require pre-approval of the Vault with the Vault’s underlying asset token. */ function deposit(uint256 assets, address receiver) external returns (uint256 shares); /** * @dev Returns the maximum amount of the Vault shares that can be minted for the receiver, through a mint call. * - MUST return a limited value if receiver is subject to some mint limit. * - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of shares that may be minted. * - MUST NOT revert. */ function maxMint(address receiver) external view returns (uint256 maxShares); /** * @dev Allows an on-chain or off-chain user to simulate the effects of their mint at the current block, given * current on-chain conditions. * * - MUST return as close to and no fewer than the exact amount of assets that would be deposited in a mint call * in the same transaction. I.e. mint should return the same or fewer assets as previewMint if called in the * same transaction. * - MUST NOT account for mint limits like those returned from maxMint and should always act as though the mint * would be accepted, regardless if the user has enough tokens approved, etc. * - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees. * - MUST NOT revert. * * NOTE: any unfavorable discrepancy between convertToAssets and previewMint SHOULD be considered slippage in * share price or some other type of condition, meaning the depositor will lose assets by minting. */ function previewMint(uint256 shares) external view returns (uint256 assets); /** * @dev Mints exactly shares Vault shares to receiver by depositing amount of underlying tokens. * * - MUST emit the Deposit event. * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the mint * execution, and are accounted for during mint. * - MUST revert if all of shares cannot be minted (due to deposit limit being reached, slippage, the user not * approving enough underlying tokens to the Vault contract, etc). * * NOTE: most implementations will require pre-approval of the Vault with the Vault’s underlying asset token. */ function mint(uint256 shares, address receiver) external returns (uint256 assets); /** * @dev Returns the maximum amount of the underlying asset that can be withdrawn from the owner balance in the * Vault, through a withdraw call. * * - MUST return a limited value if owner is subject to some withdrawal limit or timelock. * - MUST NOT revert. */ function maxWithdraw(address owner) external view returns (uint256 maxAssets); /** * @dev Allows an on-chain or off-chain user to simulate the effects of their withdrawal at the current block, * given current on-chain conditions. * * - MUST return as close to and no fewer than the exact amount of Vault shares that would be burned in a withdraw * call in the same transaction. I.e. withdraw should return the same or fewer shares as previewWithdraw if * called * in the same transaction. * - MUST NOT account for withdrawal limits like those returned from maxWithdraw and should always act as though * the withdrawal would be accepted, regardless if the user has enough shares, etc. * - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees. * - MUST NOT revert. * * NOTE: any unfavorable discrepancy between convertToShares and previewWithdraw SHOULD be considered slippage in * share price or some other type of condition, meaning the depositor will lose assets by depositing. */ function previewWithdraw(uint256 assets) external view returns (uint256 shares); /** * @dev Burns shares from owner and sends exactly assets of underlying tokens to receiver. * * - MUST emit the Withdraw event. * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the * withdraw execution, and are accounted for during withdraw. * - MUST revert if all of assets cannot be withdrawn (due to withdrawal limit being reached, slippage, the owner * not having enough shares, etc). * * Note that some implementations will require pre-requesting to the Vault before a withdrawal may be performed. * Those methods should be performed separately. */ function withdraw(uint256 assets, address receiver, address owner) external returns (uint256 shares); /** * @dev Returns the maximum amount of Vault shares that can be redeemed from the owner balance in the Vault, * through a redeem call. * * - MUST return a limited value if owner is subject to some withdrawal limit or timelock. * - MUST return balanceOf(owner) if owner is not subject to any withdrawal limit or timelock. * - MUST NOT revert. */ function maxRedeem(address owner) external view returns (uint256 maxShares); /** * @dev Allows an on-chain or off-chain user to simulate the effects of their redeemption at the current block, * given current on-chain conditions. * * - MUST return as close to and no more than the exact amount of assets that would be withdrawn in a redeem call * in the same transaction. I.e. redeem should return the same or more assets as previewRedeem if called in the * same transaction. * - MUST NOT account for redemption limits like those returned from maxRedeem and should always act as though the * redemption would be accepted, regardless if the user has enough shares, etc. * - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees. * - MUST NOT revert. * * NOTE: any unfavorable discrepancy between convertToAssets and previewRedeem SHOULD be considered slippage in * share price or some other type of condition, meaning the depositor will lose assets by redeeming. */ function previewRedeem(uint256 shares) external view returns (uint256 assets); /** * @dev Burns exactly shares from owner and sends assets of underlying tokens to receiver. * * - MUST emit the Withdraw event. * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the * redeem execution, and are accounted for during redeem. * - MUST revert if all of shares cannot be redeemed (due to withdrawal limit being reached, slippage, the owner * not having enough shares, etc). * * NOTE: some implementations will require pre-requesting to the Vault before a withdrawal may be performed. * Those methods should be performed separately. */ function redeem(uint256 shares, address receiver, address owner) external returns (uint256 assets); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Metadata.sol) pragma solidity ^0.8.20; import {IERC20} from "../IERC20.sol"; /** * @dev Interface for the optional metadata functions from the ERC20 standard. */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); }
{ "remappings": [ "hero-tokens/test/=test/", "ds-test/=node_modules/@layerzerolabs/toolbox-foundry/lib/ds-test/", "forge-std/=node_modules/@layerzerolabs/toolbox-foundry/lib/forge-std/src/", "@layerzerolabs/=node_modules/@layerzerolabs/", "@openzeppelin/=node_modules/@openzeppelin/", "heroglyph-library/=node_modules/@layerzerolabs/toolbox-foundry/lib/heroglyph-library/src/", "@axelar-network/=node_modules/@axelar-network/", "@chainlink/=node_modules/@chainlink/", "@eth-optimism/=node_modules/@eth-optimism/", "hardhat-deploy/=node_modules/hardhat-deploy/", "hardhat/=node_modules/hardhat/", "solidity-bytes-utils/=node_modules/solidity-bytes-utils/", "@prb-math/=node_modules/@layerzerolabs/toolbox-foundry/lib/prb-math/", "@prb/math/=node_modules/@layerzerolabs/toolbox-foundry/lib/prb-math/", "@sablier/v2-core/=node_modules/@sablier/v2-core/", "@uniswap/v3-periphery/=node_modules/@layerzerolabs/toolbox-foundry/lib/v3-periphery/", "@uniswap/v3-core/=node_modules/@layerzerolabs/toolbox-foundry/lib/v3-core/", "atoumic/=node_modules/@layerzerolabs/toolbox-foundry/lib/atoumic/src/" ], "optimizer": { "enabled": true, "runs": 200 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "ipfs", "appendCBOR": true }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "paris", "viaIR": true, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_gaugeController","type":"address"},{"internalType":"address","name":"_dripVaultETH","type":"address"},{"internalType":"address","name":"_dripVaultDAI","type":"address"},{"internalType":"address","name":"_swapRouter","type":"address"},{"internalType":"address","name":"_chainlinkDaiETH","type":"address"},{"internalType":"address","name":"_weth","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"EpochNotFinished","type":"error"},{"inputs":[],"name":"InvalidEpochDuration","type":"error"},{"inputs":[],"name":"InvalidInputLength","type":"error"},{"inputs":[],"name":"MathOverflowedMulDiv","type":"error"},{"inputs":[],"name":"NotGaugeController","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint32","name":"epochDuration","type":"uint32"}],"name":"EpochDurationSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint64","name":"epochId","type":"uint64"}],"name":"EpochEnded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint64","name":"epochId","type":"uint64"},{"indexed":false,"internalType":"address[]","name":"megapools","type":"address[]"},{"indexed":false,"internalType":"uint128[]","name":"weights","type":"uint128[]"},{"indexed":false,"internalType":"uint128","name":"totalWeight","type":"uint128"}],"name":"EpochInitialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"gaugeController","type":"address"}],"name":"GaugeControllerSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"megapool","type":"address"},{"indexed":false,"internalType":"uint256","name":"addedRewards","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalRewards","type":"uint256"}],"name":"RewardAssigned","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"megapool","type":"address"},{"indexed":false,"internalType":"uint256","name":"rewards","type":"uint256"}],"name":"RewardClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"streamingPool","type":"address"}],"name":"StreamingPoolSet","type":"event"},{"inputs":[],"name":"APX_ETH","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BPS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CHAINLINK_DAI_ETH","outputs":[{"internalType":"contract IChainlinkOracle","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DAI","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DRIP_VAULT_DAI","outputs":[{"internalType":"contract IDripVault","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DRIP_VAULT_ETH","outputs":[{"internalType":"contract IDripVault","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINIMUM_SWAP_DAI","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PIREX_ETH","outputs":[{"internalType":"contract IPirexEth","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PRECISION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SWAP_ROUTER","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WETH","outputs":[{"internalType":"contract IWETH","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"allowedSlippage","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_megapools","type":"address[]"},{"internalType":"uint128[]","name":"_weights","type":"uint128[]"}],"name":"applyGauges","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claim","outputs":[{"internalType":"uint256","name":"rewards_","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"epochDuration","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"epochId","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"","type":"uint64"}],"name":"epochs","outputs":[{"internalType":"uint32","name":"endOfEpoch","type":"uint32"},{"internalType":"uint128","name":"totalRewards","type":"uint128"},{"internalType":"uint128","name":"totalWeight","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"gaugeController","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"_epochId","type":"uint64"}],"name":"getEpochData","outputs":[{"internalType":"uint128","name":"totalRewards_","type":"uint128"},{"internalType":"uint128","name":"totalWeight_","type":"uint128"},{"internalType":"uint32","name":"endOfEpoch_","type":"uint32"},{"internalType":"address[]","name":"megapools_","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"_epochId","type":"uint64"},{"internalType":"address","name":"_megapool","type":"address"}],"name":"getMegapoolWeight","outputs":[{"internalType":"uint128","name":"weight_","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_megapool","type":"address"}],"name":"getRewards","outputs":[{"internalType":"uint256","name":"totalRewards_","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_allowedSlippage","type":"uint256"}],"name":"setAllowedSlippage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_epochDuration","type":"uint32"}],"name":"setEpochDuration","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_gaugeController","type":"address"}],"name":"setGaugeController","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_streamingPool","type":"address"}],"name":"setStreamingPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"streamingPool","outputs":[{"internalType":"contract IStreamingPool","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
610180806040523461037f5760e081611e338038038091610020828561047e565b83398101031261037f57610033816104a1565b61003f602083016104a1565b9161004c604082016104a1565b92610059606083016104a1565b92610066608084016104a1565b9061007f60c061007860a087016104a1565b95016104a1565b946001600160a01b0382161561046557600080546001600160a01b039384166001600160a01b0319821681178355604051986020958a956004958795919492909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a36001805583546001600160a01b038981166001600160a01b031983161786558c811660a05292831660c081905260809890985291166101205263729721ed60e11b8252945afa9384156103de57600094610424575b506001600160a01b039384166101009081526040516302c60b9b60e31b815290959394909360209185916004918391165afa80156103de576000906103ea575b6001600160a01b0316610140818152604051632a9ca34760e21b8152909590945090602090859060049082905afa9384156103de576000946103a2575b506001600160a01b0393841661016090815290841660e0526101f4600755600160a01b600160e01b039091169183169190911761127560e71b1760045583516080805160405163095ea7b360e01b602082019081529186166024820152600019604480830191909152815293946001600160401b039492830193169084841183851017610384576000809493819460405251925af1903d1561039a573d9081116103845760405190610274601f8201601f19166020018361047e565b81523d6000602083013e5b81610347575b501561031d576040519161197d93846104b6853960805184818161086701526115c8015260a051848181610d6501526110f7015260c0518481816107f901526113f7015260e051848181610a37015261149c0152518381816107b4015261144101526101205183818161091501526114fe0152518281816108d001528181610f50015261114f015251818181610aa501526116540152f35b60405162461bcd60e51b8152602060048201526002602482015261534160f01b6044820152606490fd5b805180159250821561035c575b505038610285565b819250906020918101031261037f5760200151801515810361037f573880610354565b600080fd5b634e487b7160e01b600052604160045260246000fd5b50606061027f565b9093506020813d6020116103d6575b816103be6020938361047e565b8101031261037f576103cf906104a1565b92386101b8565b3d91506103b1565b6040513d6000823e3d90fd5b506020833d60201161041c575b816104046020938361047e565b8101031261037f576104176004936104a1565b61017b565b3d91506103f7565b9293506020833d60201161045d575b816104406020938361047e565b8101031261037f5760206104556004946104a1565b94935061013b565b3d9150610433565b604051631e4fbdf760e01b815260006004820152602490fd5b601f909101601f19168101906001600160401b0382119082101761038457604052565b51906001600160a01b038216820361037f5756fe6080604052600436101561001b575b361561001957600080fd5b005b60003560e01c806291d2b814610d9457806305d7f13714610d4f57806314c8d37d14610ca45780632365faea14610c83578063249d39e914610c66578063431f244514610c485780634bd2d7f914610be65780634e71d92d14610b9e5780634ff0876a14610b7d578063715018a614610b2457806379ee54f714610ad45780638331ae2314610a8f5780638da5cb5b14610a6657806391ef6b6d14610a2157806399eecb3b146109f8578063a9273b2514610991578063aa9bbc0c14610967578063aaf5eb6814610944578063ad5c4648146108ff578063b0fc4f58146108ba578063b171947614610896578063c600589314610851578063c7c821c814610828578063ce8abd21146107e3578063e0bab4c41461079e578063e202a9d114610321578063eceea7e714610259578063f2fde38b146101cb5763fdf1b8760361000e57346101c65760403660031901126101c657610177610e11565b6024356001600160a01b03811691908290036101c6576001600160401b0316600052600360205260036040600020019060005260205260206001600160801b0360406000205416604051908152f35b600080fd5b346101c65760203660031901126101c6576101e4610dfb565b6101ec61109b565b6001600160a01b0390811690811561024057600054826bffffffffffffffffffffffff60a01b821617600055167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3005b604051631e4fbdf760e01b815260006004820152602490fd5b346101c6576020806003193601126101c6576001600160401b0361027b610e11565b166000526003815260406000208054906001600160801b039160019160028460018301541691016040518094878354928381520192600052876000209160005b8982821061030557896103018a63ffffffff8b8b6102db848d0385610e27565b60405196879683821c168752860152166040840152608060608401526080830190610e5f565b0390f35b84546001600160a01b03168652909401939282019282016102bb565b346101c65760403660031901126101c6576004356001600160401b0381116101c657366023820112156101c657806004013561035c81610e48565b9161036a6040519384610e27565b8183526024602084019260051b820101903682116101c657602401915b81831061077e57602435846001600160401b0382116101c657366023830112156101c65781600401356103b981610e48565b926103c76040519485610e27565b81845260208401906024829360051b820101903682116101c657602401915b81831061075e57505082516004549091506001600160a01b038116330361074c578451820361073a576001600160401b039060a01c16806000526003602052604060002063ffffffff8154164210610728576001600160801b0360018201541661065f575b506001016001600160401b03811161057d576004805467ffffffffffffffff60a01b191660a092831b67ffffffffffffffff60a01b161790819055901c6001600160401b03166000908152600360205260408120909182905b8082106105935750506001600160801b0360018201921691826001600160801b031982541617905560045460e01c420180421161057d5763ffffffff1663ffffffff198254161790556001600160401b0360045460a01c1693602061051460405195606087526060870190610e5f565b9185830382870152519182815201929060005b81811061055e57867f4deb406d0916a186d80d217a688c9f9132e9abb8872c70923fed215ac723c0138780888860408301520390a2005b82516001600160801b0316855260209485019490920191600101610527565b634e487b7160e01b600052601160045260246000fd5b90926001600160a01b036105a78588611059565b5116906001600160801b036105bc868a611059565b511660028501549168010000000000000000831015610649576001936105f08486610641960160028a015560028901611083565b81549060031b9083821b91888060a01b03901b191617905560005260038601602052604060002080546001600160801b0361062d85828416610e9c565b16906001600160801b031916179055610e9c565b9301906104a4565b634e487b7160e01b600052604160045260246000fd5b9491926106b761068f6001600160801b0361067b9794976110c7565b166001600160801b03895460201c16610e9c565b8754640100000000600160a01b03191660209190911b640100000000600160a01b0316178755565b600286019360005b85548110156106f257806106ec6106d860019389611083565b848060a01b0391549060031b1c168a61125b565b016106bf565b50929550925092600190807f338efde8b9f63a8e84fbb8a45ca6ee0898c1f9f711a48bd31e1fbd97b8336406600080a29061044b565b60405163ec76655760e01b8152600490fd5b604051637db491eb60e01b8152600490fd5b6040516386e01af960e01b8152600490fd5b82356001600160801b03811681036101c6578152602092830192016103e6565b82356001600160a01b03811681036101c657815260209283019201610387565b346101c65760003660031901126101c6576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b346101c65760003660031901126101c6576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b346101c65760003660031901126101c6576005546040516001600160a01b039091168152602090f35b346101c65760003660031901126101c6576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b346101c65760003660031901126101c657602060405168056bc75e2d631000008152f35b346101c65760003660031901126101c6576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b346101c65760003660031901126101c6576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b346101c65760003660031901126101c6576020604051670de0b6b3a76400008152f35b346101c65760003660031901126101c65760206001600160401b0360045460a01c16604051908152f35b346101c65760203660031901126101c6576109aa610dfb565b6109b261109b565b600580546001600160a01b0319166001600160a01b039290921691821790557f3295b50c17caf3a367f409f565243bf8272c18162924525d2bd40e2e22751f77600080a2005b346101c65760003660031901126101c6576004546040516001600160a01b039091168152602090f35b346101c65760003660031901126101c6576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b346101c65760003660031901126101c6576000546040516001600160a01b039091168152602090f35b346101c65760003660031901126101c6576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b346101c65760203660031901126101c6576020610b12610af2610dfb565b6001600160401b0360045460a01c16600052600383526040600020611302565b506001600160801b0360405191168152f35b346101c65760003660031901126101c657610b3d61109b565b600080546001600160a01b0319811682556001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b346101c65760003660031901126101c657602060045460e01c604051908152f35b346101c65760003660031901126101c657600260015414610bd45760026001556020610bc8610ec4565b60018055604051908152f35b604051633ee5aeb560e01b8152600490fd5b346101c65760203660031901126101c6576001600160401b03610c07610e11565b1660005260036020526060604060002060018154916001600160801b03918291015416906040519263ffffffff8116845260201c1660208301526040820152f35b346101c65760003660031901126101c6576020600754604051908152f35b346101c65760003660031901126101c65760206040516127108152f35b346101c65760203660031901126101c657610c9c61109b565b600435600755005b346101c65760203660031901126101c65760043563ffffffff8116908181036101c657610ccf61109b565b62093a8082108015610d43575b610d3157600480546001600160e01b031660e09290921b6001600160e01b0319169190911790556040519081527feb2082219a5218c2cea66e230e64f60a80f027c8776b46dccdd048a4fb70ea3a90602090a1005b6040516368f5f8f160e11b8152600490fd5b5062278d008211610cdc565b346101c65760003660031901126101c6576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b346101c65760203660031901126101c657610dad610dfb565b610db561109b565b600480546001600160a01b0319166001600160a01b039290921691821790557ff10500106b6d9f49d87b59b9afd31c07d7375338cac7b492b463fc67b98dbbba600080a2005b600435906001600160a01b03821682036101c657565b600435906001600160401b03821682036101c657565b90601f801991011681019081106001600160401b0382111761064957604052565b6001600160401b0381116106495760051b60200190565b90815180825260208080930193019160005b828110610e7f575050505090565b83516001600160a01b031685529381019392810192600101610e71565b9190916001600160801b038080941691160191821161057d57565b9190820391821161057d57565b6001600160401b0360045460a01c1660009081526020600381526040822091610f026001600160801b039384600182015416611011575b339061125b565b33815260028252604081208054938416938415611009576fffffffffffffffffffffffffffffffff1916905560405163a9059cbb60e01b8152336004820152602481018490528281604481857f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165af18015610ffe57610fc4575b5050610f9382600654610eb7565b6006557f106f923f993c2149d49b4255ff723acafa1f2d94393f561d3eda32ae348f7241604051918383523392a290565b8281813d8311610ff7575b610fd98183610e27565b81010312610ff3575180151503610ff05780610f85565b80fd5b5080fd5b503d610fcf565b6040513d84823e3d90fd5b505091505090565b61105461102c866110206110c7565b16878454881c16610e9c565b8254640100000000600160a01b03191660209190911b640100000000600160a01b0316178255565b610efb565b805182101561106d5760209160051b010190565b634e487b7160e01b600052603260045260246000fd5b805482101561106d5760005260206000200190600090565b6000546001600160a01b031633036110af57565b60405163118cdaa760e01b8152336004820152602490fd5b6005546001600160a01b03908116806111ff575b50604051634e71d92d60e01b81526020916000908383600481857f000000000000000000000000000000000000000000000000000000000000000086165af18015610ffe579084916111d3575b602493506111346113d0565b506040516370a0823160e01b815230600482015293849182907f0000000000000000000000000000000000000000000000000000000000000000165afa9283156111c6578193611195575b50505061118e60065482610eb7565b9060065590565b9091809350813d83116111bf575b6111ad8183610e27565b81010312610ff057505138808061117f565b503d6111a3565b50604051903d90823e3d90fd5b9192813d83116111f8575b6111e88183610e27565b81010312610ff357828291611128565b503d6111de565b6020600091600460405180948193634e71d92d60e01b83525af1801561124f57156110db57602090813d8311611248575b61123a8183610e27565b810103126101c657386110db565b503d611230565b6040513d6000823e3d90fd5b906112668183611302565b91906001600160801b03928381169182156112fa577f5f21db9dd6966e92ded190212b760bdcd33af75ccc499d4690f15c360d8b5d6a94600460409560018060a01b031697886000520160205284600020816112c6825495828716610e9c565b166001600160801b0319809516179055866000526002602052846000209116809282541617905582519182526020820152a2565b505050505050565b919060018060a01b031660005260026020526001600160801b0380604060002054169281815460201c166003820160205282604060002054166004830160205283604060002054169281158015611398575b61138e579361137c6113829361137683969484600161138a9a0154169061181e565b906118d2565b16610eb7565b168093610e9c565b9190565b5050505050600090565b508460018201541615611354565b519069ffffffffffffffffffff821682036101c657565b8181029291811591840414171561057d57565b60408051634e71d92d60e01b81526001600160a01b039060009060209060049082818381877f00000000000000000000000000000000000000000000000000000000000000008a165af18015611814579083916117e7575b505084516370a0823160e01b81523082820152602492907f000000000000000000000000000000000000000000000000000000000000000086169082818681855afa9081156116f35786916117ba575b5068056bc75e2d6310000081106117af578751633fabe5a360e21b815260a08186817f00000000000000000000000000000000000000000000000000000000000000008c165afa90811561173157879161174d575b50670de0b6b3a76400006114e46114fb92846113bd565b046127106114f4600754836113bd565b0490610eb7565b877f0000000000000000000000000000000000000000000000000000000000000000169189516101008101946001600160401b03958281108782111761173b578c5281528581018481526101f4828d019081523060608401908152426080850190815260a0850195865260c0850196875260e085018d81528f5163414bf38960e01b815295518f16868d015293518e16858d0152915162ffffff166044850152518c166064840152516084830152915160a4820152915160c483015251881660e48201528381610104818a7f00000000000000000000000000000000000000000000000000000000000000008d165af1938415611731578794611701575b5050803b156116fd5790858092868a5180958193632e1a7d4d60e01b8352888a8401525af180156116f357908895949392916116c5575b50509060449160019685519788958694632b725d0360e21b865230908601528401527f0000000000000000000000000000000000000000000000000000000000000000165af19283156116bb57819361168a575b50505090565b9091809350813d83116116b4575b6116a28183610e27565b81010312610ff0575051388080611684565b503d611698565b51903d90823e3d90fd5b9080929496939550116116e15786529285929091806001611630565b634e487b7160e01b8252604184528482fd5b88513d88823e3d90fd5b8580fd5b9080929450813d831161172a575b6117198183610e27565b810103126116fd57519138806115f9565b503d61170f565b89513d89823e3d90fd5b634e487b7160e01b8b5260418952898bfd5b905060a0813d60a0116117a7575b8161176860a09383610e27565b810103126117a357670de0b6b3a76400006114e4826117896114fb946113a6565b5061179a60808883015192016113a6565b509250506114cd565b8680fd5b3d915061175b565b505050505091505090565b90508281813d83116117e0575b6117d18183610e27565b810103126116fd575138611478565b503d6117c7565b813d831161180d575b6117fa8183610e27565b81010312611809578138611428565b8280fd5b503d6117f0565b86513d86823e3d90fd5b670de0b6b3a76400009181830291600019848209938380861095039480860395146118ae578483111561189c5782910981600003821680920460028082600302188083028203028083028203028083028203028083028203028083028203028092029003029360018380600003040190848311900302920304170290565b60405163227bc15360e01b8152600490fd5b5050809250156118bc570490565b634e487b7160e01b600052601260045260246000fd5b90808202906000198184099082808310920391808303921461193657670de0b6b3a7640000908282111561189c577faccb18165bd6fe31ae1cf318dc5b51eee0e1ba569b88cd74c1773b91fac10669940990828211900360ee1b910360121c170290565b5050670de0b6b3a76400009150049056fea2646970667358221220a442bce3a57cb6bf27fa6a20ab3192937294f599acc51cce41e48ed27f669dac64736f6c63430008190033000000000000000000000000c90b92d70af24ef1369389f1a1e3887305cd89c90000000000000000000000004b4cd9807bf3de891cdf57c54b264be462d779f8000000000000000000000000cb6dfd06973bf66c8bd2779538e5c8311b8070b800000000000000000000000090a8e18c1b382fc59009c24081ac58e28b86311b000000000000000000000000e592427a0aece92de3edee1f18e0157c05861564000000000000000000000000773616e4d11a78f511299002da57a0a94577f1f4000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
Deployed Bytecode
0x6080604052600436101561001b575b361561001957600080fd5b005b60003560e01c806291d2b814610d9457806305d7f13714610d4f57806314c8d37d14610ca45780632365faea14610c83578063249d39e914610c66578063431f244514610c485780634bd2d7f914610be65780634e71d92d14610b9e5780634ff0876a14610b7d578063715018a614610b2457806379ee54f714610ad45780638331ae2314610a8f5780638da5cb5b14610a6657806391ef6b6d14610a2157806399eecb3b146109f8578063a9273b2514610991578063aa9bbc0c14610967578063aaf5eb6814610944578063ad5c4648146108ff578063b0fc4f58146108ba578063b171947614610896578063c600589314610851578063c7c821c814610828578063ce8abd21146107e3578063e0bab4c41461079e578063e202a9d114610321578063eceea7e714610259578063f2fde38b146101cb5763fdf1b8760361000e57346101c65760403660031901126101c657610177610e11565b6024356001600160a01b03811691908290036101c6576001600160401b0316600052600360205260036040600020019060005260205260206001600160801b0360406000205416604051908152f35b600080fd5b346101c65760203660031901126101c6576101e4610dfb565b6101ec61109b565b6001600160a01b0390811690811561024057600054826bffffffffffffffffffffffff60a01b821617600055167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3005b604051631e4fbdf760e01b815260006004820152602490fd5b346101c6576020806003193601126101c6576001600160401b0361027b610e11565b166000526003815260406000208054906001600160801b039160019160028460018301541691016040518094878354928381520192600052876000209160005b8982821061030557896103018a63ffffffff8b8b6102db848d0385610e27565b60405196879683821c168752860152166040840152608060608401526080830190610e5f565b0390f35b84546001600160a01b03168652909401939282019282016102bb565b346101c65760403660031901126101c6576004356001600160401b0381116101c657366023820112156101c657806004013561035c81610e48565b9161036a6040519384610e27565b8183526024602084019260051b820101903682116101c657602401915b81831061077e57602435846001600160401b0382116101c657366023830112156101c65781600401356103b981610e48565b926103c76040519485610e27565b81845260208401906024829360051b820101903682116101c657602401915b81831061075e57505082516004549091506001600160a01b038116330361074c578451820361073a576001600160401b039060a01c16806000526003602052604060002063ffffffff8154164210610728576001600160801b0360018201541661065f575b506001016001600160401b03811161057d576004805467ffffffffffffffff60a01b191660a092831b67ffffffffffffffff60a01b161790819055901c6001600160401b03166000908152600360205260408120909182905b8082106105935750506001600160801b0360018201921691826001600160801b031982541617905560045460e01c420180421161057d5763ffffffff1663ffffffff198254161790556001600160401b0360045460a01c1693602061051460405195606087526060870190610e5f565b9185830382870152519182815201929060005b81811061055e57867f4deb406d0916a186d80d217a688c9f9132e9abb8872c70923fed215ac723c0138780888860408301520390a2005b82516001600160801b0316855260209485019490920191600101610527565b634e487b7160e01b600052601160045260246000fd5b90926001600160a01b036105a78588611059565b5116906001600160801b036105bc868a611059565b511660028501549168010000000000000000831015610649576001936105f08486610641960160028a015560028901611083565b81549060031b9083821b91888060a01b03901b191617905560005260038601602052604060002080546001600160801b0361062d85828416610e9c565b16906001600160801b031916179055610e9c565b9301906104a4565b634e487b7160e01b600052604160045260246000fd5b9491926106b761068f6001600160801b0361067b9794976110c7565b166001600160801b03895460201c16610e9c565b8754640100000000600160a01b03191660209190911b640100000000600160a01b0316178755565b600286019360005b85548110156106f257806106ec6106d860019389611083565b848060a01b0391549060031b1c168a61125b565b016106bf565b50929550925092600190807f338efde8b9f63a8e84fbb8a45ca6ee0898c1f9f711a48bd31e1fbd97b8336406600080a29061044b565b60405163ec76655760e01b8152600490fd5b604051637db491eb60e01b8152600490fd5b6040516386e01af960e01b8152600490fd5b82356001600160801b03811681036101c6578152602092830192016103e6565b82356001600160a01b03811681036101c657815260209283019201610387565b346101c65760003660031901126101c6576040517f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f6001600160a01b03168152602090f35b346101c65760003660031901126101c6576040517f00000000000000000000000090a8e18c1b382fc59009c24081ac58e28b86311b6001600160a01b03168152602090f35b346101c65760003660031901126101c6576005546040516001600160a01b039091168152602090f35b346101c65760003660031901126101c6576040517f000000000000000000000000e592427a0aece92de3edee1f18e0157c058615646001600160a01b03168152602090f35b346101c65760003660031901126101c657602060405168056bc75e2d631000008152f35b346101c65760003660031901126101c6576040517f0000000000000000000000009ba021b0a9b958b5e75ce9f6dff97c7ee52cb3e66001600160a01b03168152602090f35b346101c65760003660031901126101c6576040517f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b03168152602090f35b346101c65760003660031901126101c6576020604051670de0b6b3a76400008152f35b346101c65760003660031901126101c65760206001600160401b0360045460a01c16604051908152f35b346101c65760203660031901126101c6576109aa610dfb565b6109b261109b565b600580546001600160a01b0319166001600160a01b039290921691821790557f3295b50c17caf3a367f409f565243bf8272c18162924525d2bd40e2e22751f77600080a2005b346101c65760003660031901126101c6576004546040516001600160a01b039091168152602090f35b346101c65760003660031901126101c6576040517f000000000000000000000000773616e4d11a78f511299002da57a0a94577f1f46001600160a01b03168152602090f35b346101c65760003660031901126101c6576000546040516001600160a01b039091168152602090f35b346101c65760003660031901126101c6576040517f000000000000000000000000d664b74274dfeb538d9bac494f3a4760828b02b06001600160a01b03168152602090f35b346101c65760203660031901126101c6576020610b12610af2610dfb565b6001600160401b0360045460a01c16600052600383526040600020611302565b506001600160801b0360405191168152f35b346101c65760003660031901126101c657610b3d61109b565b600080546001600160a01b0319811682556001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b346101c65760003660031901126101c657602060045460e01c604051908152f35b346101c65760003660031901126101c657600260015414610bd45760026001556020610bc8610ec4565b60018055604051908152f35b604051633ee5aeb560e01b8152600490fd5b346101c65760203660031901126101c6576001600160401b03610c07610e11565b1660005260036020526060604060002060018154916001600160801b03918291015416906040519263ffffffff8116845260201c1660208301526040820152f35b346101c65760003660031901126101c6576020600754604051908152f35b346101c65760003660031901126101c65760206040516127108152f35b346101c65760203660031901126101c657610c9c61109b565b600435600755005b346101c65760203660031901126101c65760043563ffffffff8116908181036101c657610ccf61109b565b62093a8082108015610d43575b610d3157600480546001600160e01b031660e09290921b6001600160e01b0319169190911790556040519081527feb2082219a5218c2cea66e230e64f60a80f027c8776b46dccdd048a4fb70ea3a90602090a1005b6040516368f5f8f160e11b8152600490fd5b5062278d008211610cdc565b346101c65760003660031901126101c6576040517f000000000000000000000000cb6dfd06973bf66c8bd2779538e5c8311b8070b86001600160a01b03168152602090f35b346101c65760203660031901126101c657610dad610dfb565b610db561109b565b600480546001600160a01b0319166001600160a01b039290921691821790557ff10500106b6d9f49d87b59b9afd31c07d7375338cac7b492b463fc67b98dbbba600080a2005b600435906001600160a01b03821682036101c657565b600435906001600160401b03821682036101c657565b90601f801991011681019081106001600160401b0382111761064957604052565b6001600160401b0381116106495760051b60200190565b90815180825260208080930193019160005b828110610e7f575050505090565b83516001600160a01b031685529381019392810192600101610e71565b9190916001600160801b038080941691160191821161057d57565b9190820391821161057d57565b6001600160401b0360045460a01c1660009081526020600381526040822091610f026001600160801b039384600182015416611011575b339061125b565b33815260028252604081208054938416938415611009576fffffffffffffffffffffffffffffffff1916905560405163a9059cbb60e01b8152336004820152602481018490528281604481857f0000000000000000000000009ba021b0a9b958b5e75ce9f6dff97c7ee52cb3e66001600160a01b03165af18015610ffe57610fc4575b5050610f9382600654610eb7565b6006557f106f923f993c2149d49b4255ff723acafa1f2d94393f561d3eda32ae348f7241604051918383523392a290565b8281813d8311610ff7575b610fd98183610e27565b81010312610ff3575180151503610ff05780610f85565b80fd5b5080fd5b503d610fcf565b6040513d84823e3d90fd5b505091505090565b61105461102c866110206110c7565b16878454881c16610e9c565b8254640100000000600160a01b03191660209190911b640100000000600160a01b0316178255565b610efb565b805182101561106d5760209160051b010190565b634e487b7160e01b600052603260045260246000fd5b805482101561106d5760005260206000200190600090565b6000546001600160a01b031633036110af57565b60405163118cdaa760e01b8152336004820152602490fd5b6005546001600160a01b03908116806111ff575b50604051634e71d92d60e01b81526020916000908383600481857f000000000000000000000000cb6dfd06973bf66c8bd2779538e5c8311b8070b886165af18015610ffe579084916111d3575b602493506111346113d0565b506040516370a0823160e01b815230600482015293849182907f0000000000000000000000009ba021b0a9b958b5e75ce9f6dff97c7ee52cb3e6165afa9283156111c6578193611195575b50505061118e60065482610eb7565b9060065590565b9091809350813d83116111bf575b6111ad8183610e27565b81010312610ff057505138808061117f565b503d6111a3565b50604051903d90823e3d90fd5b9192813d83116111f8575b6111e88183610e27565b81010312610ff357828291611128565b503d6111de565b6020600091600460405180948193634e71d92d60e01b83525af1801561124f57156110db57602090813d8311611248575b61123a8183610e27565b810103126101c657386110db565b503d611230565b6040513d6000823e3d90fd5b906112668183611302565b91906001600160801b03928381169182156112fa577f5f21db9dd6966e92ded190212b760bdcd33af75ccc499d4690f15c360d8b5d6a94600460409560018060a01b031697886000520160205284600020816112c6825495828716610e9c565b166001600160801b0319809516179055866000526002602052846000209116809282541617905582519182526020820152a2565b505050505050565b919060018060a01b031660005260026020526001600160801b0380604060002054169281815460201c166003820160205282604060002054166004830160205283604060002054169281158015611398575b61138e579361137c6113829361137683969484600161138a9a0154169061181e565b906118d2565b16610eb7565b168093610e9c565b9190565b5050505050600090565b508460018201541615611354565b519069ffffffffffffffffffff821682036101c657565b8181029291811591840414171561057d57565b60408051634e71d92d60e01b81526001600160a01b039060009060209060049082818381877f00000000000000000000000090a8e18c1b382fc59009c24081ac58e28b86311b8a165af18015611814579083916117e7575b505084516370a0823160e01b81523082820152602492907f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f86169082818681855afa9081156116f35786916117ba575b5068056bc75e2d6310000081106117af578751633fabe5a360e21b815260a08186817f000000000000000000000000773616e4d11a78f511299002da57a0a94577f1f48c165afa90811561173157879161174d575b50670de0b6b3a76400006114e46114fb92846113bd565b046127106114f4600754836113bd565b0490610eb7565b877f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2169189516101008101946001600160401b03958281108782111761173b578c5281528581018481526101f4828d019081523060608401908152426080850190815260a0850195865260c0850196875260e085018d81528f5163414bf38960e01b815295518f16868d015293518e16858d0152915162ffffff166044850152518c166064840152516084830152915160a4820152915160c483015251881660e48201528381610104818a7f000000000000000000000000e592427a0aece92de3edee1f18e0157c058615648d165af1938415611731578794611701575b5050803b156116fd5790858092868a5180958193632e1a7d4d60e01b8352888a8401525af180156116f357908895949392916116c5575b50509060449160019685519788958694632b725d0360e21b865230908601528401527f000000000000000000000000d664b74274dfeb538d9bac494f3a4760828b02b0165af19283156116bb57819361168a575b50505090565b9091809350813d83116116b4575b6116a28183610e27565b81010312610ff0575051388080611684565b503d611698565b51903d90823e3d90fd5b9080929496939550116116e15786529285929091806001611630565b634e487b7160e01b8252604184528482fd5b88513d88823e3d90fd5b8580fd5b9080929450813d831161172a575b6117198183610e27565b810103126116fd57519138806115f9565b503d61170f565b89513d89823e3d90fd5b634e487b7160e01b8b5260418952898bfd5b905060a0813d60a0116117a7575b8161176860a09383610e27565b810103126117a357670de0b6b3a76400006114e4826117896114fb946113a6565b5061179a60808883015192016113a6565b509250506114cd565b8680fd5b3d915061175b565b505050505091505090565b90508281813d83116117e0575b6117d18183610e27565b810103126116fd575138611478565b503d6117c7565b813d831161180d575b6117fa8183610e27565b81010312611809578138611428565b8280fd5b503d6117f0565b86513d86823e3d90fd5b670de0b6b3a76400009181830291600019848209938380861095039480860395146118ae578483111561189c5782910981600003821680920460028082600302188083028203028083028203028083028203028083028203028083028203028092029003029360018380600003040190848311900302920304170290565b60405163227bc15360e01b8152600490fd5b5050809250156118bc570490565b634e487b7160e01b600052601260045260246000fd5b90808202906000198184099082808310920391808303921461193657670de0b6b3a7640000908282111561189c577faccb18165bd6fe31ae1cf318dc5b51eee0e1ba569b88cd74c1773b91fac10669940990828211900360ee1b910360121c170290565b5050670de0b6b3a76400009150049056fea2646970667358221220a442bce3a57cb6bf27fa6a20ab3192937294f599acc51cce41e48ed27f669dac64736f6c63430008190033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000c90b92d70af24ef1369389f1a1e3887305cd89c90000000000000000000000004b4cd9807bf3de891cdf57c54b264be462d779f8000000000000000000000000cb6dfd06973bf66c8bd2779538e5c8311b8070b800000000000000000000000090a8e18c1b382fc59009c24081ac58e28b86311b000000000000000000000000e592427a0aece92de3edee1f18e0157c05861564000000000000000000000000773616e4d11a78f511299002da57a0a94577f1f4000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
-----Decoded View---------------
Arg [0] : _owner (address): 0xc90B92d70AF24eF1369389f1A1E3887305cD89c9
Arg [1] : _gaugeController (address): 0x4B4cd9807BF3de891cDF57C54B264be462d779F8
Arg [2] : _dripVaultETH (address): 0xCb6DFd06973bF66C8bD2779538e5C8311B8070B8
Arg [3] : _dripVaultDAI (address): 0x90A8E18c1B382Fc59009c24081Ac58E28b86311b
Arg [4] : _swapRouter (address): 0xE592427A0AEce92De3Edee1F18E0157C05861564
Arg [5] : _chainlinkDaiETH (address): 0x773616E4d11A78F511299002da57A0a94577F1f4
Arg [6] : _weth (address): 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
-----Encoded View---------------
7 Constructor Arguments found :
Arg [0] : 000000000000000000000000c90b92d70af24ef1369389f1a1e3887305cd89c9
Arg [1] : 0000000000000000000000004b4cd9807bf3de891cdf57c54b264be462d779f8
Arg [2] : 000000000000000000000000cb6dfd06973bf66c8bd2779538e5c8311b8070b8
Arg [3] : 00000000000000000000000090a8e18c1b382fc59009c24081ac58e28b86311b
Arg [4] : 000000000000000000000000e592427a0aece92de3edee1f18e0157c05861564
Arg [5] : 000000000000000000000000773616e4d11a78f511299002da57a0a94577f1f4
Arg [6] : 000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|---|---|---|---|---|
ETH | 100.00% | $0.999784 | 8.3973 | $8.4 |
Loading...
Loading
[ Download: CSV Export ]
[ 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.