Source Code
More Info
Private Name Tags
ContractCreator
TokenTracker
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
Latest 1 internal transaction
Advanced mode:
| Parent Transaction Hash | Block | From | To | |||
|---|---|---|---|---|---|---|
| 108927557 | 956 days ago | Contract Creation | 0 ETH |
Cross-Chain Transactions
Loading...
Loading
Contract Name:
AaveV3ERC4626
Compiler Version
v0.8.19+commit.7dd6d404
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: AGPL-3.0
pragma solidity ^0.8.13;
import {ERC20} from "solmate/tokens/ERC20.sol";
import {ERC4626} from "solmate/mixins/ERC4626.sol";
import {SafeTransferLib} from "solmate/utils/SafeTransferLib.sol";
import {IPool} from "./external/IPool.sol";
import {IRewardsController} from "./external/IRewardsController.sol";
/// @title AaveV3ERC4626
/// @author zefram.eth
/// @notice ERC4626 wrapper for Aave V3
/// @dev Important security note: due to Aave using a rebasing model for aTokens,
/// this contract cannot independently keep track of the deposited funds, so it is possible
/// for an attacker to directly transfer aTokens to this contract, increase the vault share
/// price atomically, and then exploit an external lending market that uses this contract
/// as collateral.
contract AaveV3ERC4626 is ERC4626 {
/// -----------------------------------------------------------------------
/// Libraries usage
/// -----------------------------------------------------------------------
using SafeTransferLib for ERC20;
/// -----------------------------------------------------------------------
/// Events
/// -----------------------------------------------------------------------
event ClaimRewards(uint256 amount);
/// -----------------------------------------------------------------------
/// Constants
/// -----------------------------------------------------------------------
uint256 internal constant DECIMALS_MASK = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFFFFFFFF;
uint256 internal constant ACTIVE_MASK = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFF;
uint256 internal constant FROZEN_MASK = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDFFFFFFFFFFFFFF;
uint256 internal constant PAUSED_MASK = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFF;
uint256 internal constant SUPPLY_CAP_MASK = 0xFFFFFFFFFFFFFFFFFFFFFFFFFF000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFF;
uint256 internal constant SUPPLY_CAP_START_BIT_POSITION = 116;
uint256 internal constant RESERVE_DECIMALS_START_BIT_POSITION = 48;
/// -----------------------------------------------------------------------
/// Immutable params
/// -----------------------------------------------------------------------
/// @notice The Aave aToken contract
ERC20 public immutable aToken;
/// @notice The Aave Pool contract
IPool public immutable lendingPool;
/// @notice The address that will receive the liquidity mining rewards (if any)
address public immutable rewardRecipient;
/// @notice The Aave RewardsController contract
IRewardsController public immutable rewardsController;
/// -----------------------------------------------------------------------
/// Constructor
/// -----------------------------------------------------------------------
constructor(
ERC20 asset_,
ERC20 aToken_,
IPool lendingPool_,
address rewardRecipient_,
IRewardsController rewardsController_
) ERC4626(asset_, _vaultName(asset_), _vaultSymbol(asset_)) {
aToken = aToken_;
lendingPool = lendingPool_;
rewardRecipient = rewardRecipient_;
rewardsController = rewardsController_;
}
/// -----------------------------------------------------------------------
/// Aave liquidity mining
/// -----------------------------------------------------------------------
/// @notice Claims liquidity mining rewards from Aave and sends it to rewardRecipient
function claimRewards() external {
address[] memory assets = new address[](1);
assets[0] = address(aToken);
(, uint256[] memory claimedAmounts) = rewardsController.claimAllRewards(assets, rewardRecipient);
emit ClaimRewards(claimedAmounts[0]);
}
/// -----------------------------------------------------------------------
/// ERC4626 overrides
/// -----------------------------------------------------------------------
function withdraw(uint256 assets, address receiver, address owner)
public
virtual
override
returns (uint256 shares)
{
shares = previewWithdraw(assets); // No need to check for rounding error, previewWithdraw rounds up.
if (msg.sender != owner) {
uint256 allowed = allowance[owner][msg.sender]; // Saves gas for limited approvals.
if (allowed != type(uint256).max) {
allowance[owner][msg.sender] = allowed - shares;
}
}
beforeWithdraw(assets, shares);
_burn(owner, shares);
emit Withdraw(msg.sender, receiver, owner, assets, shares);
// withdraw assets directly from Aave
lendingPool.withdraw(address(asset), assets, receiver);
}
function redeem(uint256 shares, address receiver, address owner) public virtual override returns (uint256 assets) {
if (msg.sender != owner) {
uint256 allowed = allowance[owner][msg.sender]; // Saves gas for limited approvals.
if (allowed != type(uint256).max) {
allowance[owner][msg.sender] = allowed - shares;
}
}
// Check for rounding error since we round down in previewRedeem.
require((assets = previewRedeem(shares)) != 0, "ZERO_ASSETS");
beforeWithdraw(assets, shares);
_burn(owner, shares);
emit Withdraw(msg.sender, receiver, owner, assets, shares);
// withdraw assets directly from Aave
lendingPool.withdraw(address(asset), assets, receiver);
}
function totalAssets() public view virtual override returns (uint256) {
// aTokens use rebasing to accrue interest, so the total assets is just the aToken balance
return aToken.balanceOf(address(this));
}
function afterDeposit(uint256 assets, uint256 /*shares*/ ) internal virtual override {
/// -----------------------------------------------------------------------
/// Deposit assets into Aave
/// -----------------------------------------------------------------------
// approve to lendingPool
asset.safeApprove(address(lendingPool), assets);
// deposit into lendingPool
lendingPool.supply(address(asset), assets, address(this), 0);
}
function maxDeposit(address) public view virtual override returns (uint256) {
// check if asset is paused
uint256 configData = lendingPool.getReserveData(address(asset)).configuration.data;
if (!(_getActive(configData) && !_getFrozen(configData) && !_getPaused(configData))) {
return 0;
}
// handle supply cap
uint256 supplyCapInWholeTokens = _getSupplyCap(configData);
if (supplyCapInWholeTokens == 0) {
return type(uint256).max;
}
uint8 tokenDecimals = _getDecimals(configData);
uint256 supplyCap = supplyCapInWholeTokens * 10 ** tokenDecimals;
return supplyCap - aToken.totalSupply();
}
function maxMint(address) public view virtual override returns (uint256) {
// check if asset is paused
uint256 configData = lendingPool.getReserveData(address(asset)).configuration.data;
if (!(_getActive(configData) && !_getFrozen(configData) && !_getPaused(configData))) {
return 0;
}
// handle supply cap
uint256 supplyCapInWholeTokens = _getSupplyCap(configData);
if (supplyCapInWholeTokens == 0) {
return type(uint256).max;
}
uint8 tokenDecimals = _getDecimals(configData);
uint256 supplyCap = supplyCapInWholeTokens * 10 ** tokenDecimals;
return convertToShares(supplyCap - aToken.totalSupply());
}
function maxWithdraw(address owner) public view virtual override returns (uint256) {
// check if asset is paused
uint256 configData = lendingPool.getReserveData(address(asset)).configuration.data;
if (!(_getActive(configData) && !_getPaused(configData))) {
return 0;
}
uint256 cash = asset.balanceOf(address(aToken));
uint256 assetsBalance = convertToAssets(balanceOf[owner]);
return cash < assetsBalance ? cash : assetsBalance;
}
function maxRedeem(address owner) public view virtual override returns (uint256) {
// check if asset is paused
uint256 configData = lendingPool.getReserveData(address(asset)).configuration.data;
if (!(_getActive(configData) && !_getPaused(configData))) {
return 0;
}
uint256 cash = asset.balanceOf(address(aToken));
uint256 cashInShares = convertToShares(cash);
uint256 shareBalance = balanceOf[owner];
return cashInShares < shareBalance ? cashInShares : shareBalance;
}
/// -----------------------------------------------------------------------
/// ERC20 metadata generation
/// -----------------------------------------------------------------------
function _vaultName(ERC20 asset_) internal view virtual returns (string memory vaultName) {
vaultName = string.concat("ERC4626-Wrapped Aave v3 ", asset_.symbol());
}
function _vaultSymbol(ERC20 asset_) internal view virtual returns (string memory vaultSymbol) {
vaultSymbol = string.concat("wa", asset_.symbol());
}
/// -----------------------------------------------------------------------
/// Internal functions
/// -----------------------------------------------------------------------
function _getDecimals(uint256 configData) internal pure returns (uint8) {
return uint8((configData & ~DECIMALS_MASK) >> RESERVE_DECIMALS_START_BIT_POSITION);
}
function _getActive(uint256 configData) internal pure returns (bool) {
return configData & ~ACTIVE_MASK != 0;
}
function _getFrozen(uint256 configData) internal pure returns (bool) {
return configData & ~FROZEN_MASK != 0;
}
function _getPaused(uint256 configData) internal pure returns (bool) {
return configData & ~PAUSED_MASK != 0;
}
function _getSupplyCap(uint256 configData) internal pure returns (uint256) {
return (configData & ~SUPPLY_CAP_MASK) >> SUPPLY_CAP_START_BIT_POSITION;
}
}// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;
/// @notice Modern and gas efficient ERC20 + EIP-2612 implementation.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/tokens/ERC20.sol)
/// @author Modified from Uniswap (https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/UniswapV2ERC20.sol)
/// @dev Do not manually set balances without updating totalSupply, as the sum of all user balances must not exceed it.
abstract contract ERC20 {
/*//////////////////////////////////////////////////////////////
EVENTS
//////////////////////////////////////////////////////////////*/
event Transfer(address indexed from, address indexed to, uint256 amount);
event Approval(address indexed owner, address indexed spender, uint256 amount);
/*//////////////////////////////////////////////////////////////
METADATA STORAGE
//////////////////////////////////////////////////////////////*/
string public name;
string public symbol;
uint8 public immutable decimals;
/*//////////////////////////////////////////////////////////////
ERC20 STORAGE
//////////////////////////////////////////////////////////////*/
uint256 public totalSupply;
mapping(address => uint256) public balanceOf;
mapping(address => mapping(address => uint256)) public allowance;
/*//////////////////////////////////////////////////////////////
EIP-2612 STORAGE
//////////////////////////////////////////////////////////////*/
uint256 internal immutable INITIAL_CHAIN_ID;
bytes32 internal immutable INITIAL_DOMAIN_SEPARATOR;
mapping(address => uint256) public nonces;
/*//////////////////////////////////////////////////////////////
CONSTRUCTOR
//////////////////////////////////////////////////////////////*/
constructor(
string memory _name,
string memory _symbol,
uint8 _decimals
) {
name = _name;
symbol = _symbol;
decimals = _decimals;
INITIAL_CHAIN_ID = block.chainid;
INITIAL_DOMAIN_SEPARATOR = computeDomainSeparator();
}
/*//////////////////////////////////////////////////////////////
ERC20 LOGIC
//////////////////////////////////////////////////////////////*/
function approve(address spender, uint256 amount) public virtual returns (bool) {
allowance[msg.sender][spender] = amount;
emit Approval(msg.sender, spender, amount);
return true;
}
function transfer(address to, uint256 amount) public virtual returns (bool) {
balanceOf[msg.sender] -= amount;
// Cannot overflow because the sum of all user
// balances can't exceed the max uint256 value.
unchecked {
balanceOf[to] += amount;
}
emit Transfer(msg.sender, to, amount);
return true;
}
function transferFrom(
address from,
address to,
uint256 amount
) public virtual returns (bool) {
uint256 allowed = allowance[from][msg.sender]; // Saves gas for limited approvals.
if (allowed != type(uint256).max) allowance[from][msg.sender] = allowed - amount;
balanceOf[from] -= amount;
// Cannot overflow because the sum of all user
// balances can't exceed the max uint256 value.
unchecked {
balanceOf[to] += amount;
}
emit Transfer(from, to, amount);
return true;
}
/*//////////////////////////////////////////////////////////////
EIP-2612 LOGIC
//////////////////////////////////////////////////////////////*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) public virtual {
require(deadline >= block.timestamp, "PERMIT_DEADLINE_EXPIRED");
// Unchecked because the only math done is incrementing
// the owner's nonce which cannot realistically overflow.
unchecked {
address recoveredAddress = ecrecover(
keccak256(
abi.encodePacked(
"\x19\x01",
DOMAIN_SEPARATOR(),
keccak256(
abi.encode(
keccak256(
"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"
),
owner,
spender,
value,
nonces[owner]++,
deadline
)
)
)
),
v,
r,
s
);
require(recoveredAddress != address(0) && recoveredAddress == owner, "INVALID_SIGNER");
allowance[recoveredAddress][spender] = value;
}
emit Approval(owner, spender, value);
}
function DOMAIN_SEPARATOR() public view virtual returns (bytes32) {
return block.chainid == INITIAL_CHAIN_ID ? INITIAL_DOMAIN_SEPARATOR : computeDomainSeparator();
}
function computeDomainSeparator() internal view virtual returns (bytes32) {
return
keccak256(
abi.encode(
keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"),
keccak256(bytes(name)),
keccak256("1"),
block.chainid,
address(this)
)
);
}
/*//////////////////////////////////////////////////////////////
INTERNAL MINT/BURN LOGIC
//////////////////////////////////////////////////////////////*/
function _mint(address to, uint256 amount) internal virtual {
totalSupply += amount;
// Cannot overflow because the sum of all user
// balances can't exceed the max uint256 value.
unchecked {
balanceOf[to] += amount;
}
emit Transfer(address(0), to, amount);
}
function _burn(address from, uint256 amount) internal virtual {
balanceOf[from] -= amount;
// Cannot underflow because a user's balance
// will never be larger than the total supply.
unchecked {
totalSupply -= amount;
}
emit Transfer(from, address(0), amount);
}
}// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;
import {ERC20} from "../tokens/ERC20.sol";
import {SafeTransferLib} from "../utils/SafeTransferLib.sol";
import {FixedPointMathLib} from "../utils/FixedPointMathLib.sol";
/// @notice Minimal ERC4626 tokenized Vault implementation.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/mixins/ERC4626.sol)
abstract contract ERC4626 is ERC20 {
using SafeTransferLib for ERC20;
using FixedPointMathLib for uint256;
/*//////////////////////////////////////////////////////////////
EVENTS
//////////////////////////////////////////////////////////////*/
event Deposit(address indexed caller, address indexed owner, uint256 assets, uint256 shares);
event Withdraw(
address indexed caller,
address indexed receiver,
address indexed owner,
uint256 assets,
uint256 shares
);
/*//////////////////////////////////////////////////////////////
IMMUTABLES
//////////////////////////////////////////////////////////////*/
ERC20 public immutable asset;
constructor(
ERC20 _asset,
string memory _name,
string memory _symbol
) ERC20(_name, _symbol, _asset.decimals()) {
asset = _asset;
}
/*//////////////////////////////////////////////////////////////
DEPOSIT/WITHDRAWAL LOGIC
//////////////////////////////////////////////////////////////*/
function deposit(uint256 assets, address receiver) public virtual returns (uint256 shares) {
// Check for rounding error since we round down in previewDeposit.
require((shares = previewDeposit(assets)) != 0, "ZERO_SHARES");
// Need to transfer before minting or ERC777s could reenter.
asset.safeTransferFrom(msg.sender, address(this), assets);
_mint(receiver, shares);
emit Deposit(msg.sender, receiver, assets, shares);
afterDeposit(assets, shares);
}
function mint(uint256 shares, address receiver) public virtual returns (uint256 assets) {
assets = previewMint(shares); // No need to check for rounding error, previewMint rounds up.
// Need to transfer before minting or ERC777s could reenter.
asset.safeTransferFrom(msg.sender, address(this), assets);
_mint(receiver, shares);
emit Deposit(msg.sender, receiver, assets, shares);
afterDeposit(assets, shares);
}
function withdraw(
uint256 assets,
address receiver,
address owner
) public virtual returns (uint256 shares) {
shares = previewWithdraw(assets); // No need to check for rounding error, previewWithdraw rounds up.
if (msg.sender != owner) {
uint256 allowed = allowance[owner][msg.sender]; // Saves gas for limited approvals.
if (allowed != type(uint256).max) allowance[owner][msg.sender] = allowed - shares;
}
beforeWithdraw(assets, shares);
_burn(owner, shares);
emit Withdraw(msg.sender, receiver, owner, assets, shares);
asset.safeTransfer(receiver, assets);
}
function redeem(
uint256 shares,
address receiver,
address owner
) public virtual returns (uint256 assets) {
if (msg.sender != owner) {
uint256 allowed = allowance[owner][msg.sender]; // Saves gas for limited approvals.
if (allowed != type(uint256).max) allowance[owner][msg.sender] = allowed - shares;
}
// Check for rounding error since we round down in previewRedeem.
require((assets = previewRedeem(shares)) != 0, "ZERO_ASSETS");
beforeWithdraw(assets, shares);
_burn(owner, shares);
emit Withdraw(msg.sender, receiver, owner, assets, shares);
asset.safeTransfer(receiver, assets);
}
/*//////////////////////////////////////////////////////////////
ACCOUNTING LOGIC
//////////////////////////////////////////////////////////////*/
function totalAssets() public view virtual returns (uint256);
function convertToShares(uint256 assets) public view virtual returns (uint256) {
uint256 supply = totalSupply; // Saves an extra SLOAD if totalSupply is non-zero.
return supply == 0 ? assets : assets.mulDivDown(supply, totalAssets());
}
function convertToAssets(uint256 shares) public view virtual returns (uint256) {
uint256 supply = totalSupply; // Saves an extra SLOAD if totalSupply is non-zero.
return supply == 0 ? shares : shares.mulDivDown(totalAssets(), supply);
}
function previewDeposit(uint256 assets) public view virtual returns (uint256) {
return convertToShares(assets);
}
function previewMint(uint256 shares) public view virtual returns (uint256) {
uint256 supply = totalSupply; // Saves an extra SLOAD if totalSupply is non-zero.
return supply == 0 ? shares : shares.mulDivUp(totalAssets(), supply);
}
function previewWithdraw(uint256 assets) public view virtual returns (uint256) {
uint256 supply = totalSupply; // Saves an extra SLOAD if totalSupply is non-zero.
return supply == 0 ? assets : assets.mulDivUp(supply, totalAssets());
}
function previewRedeem(uint256 shares) public view virtual returns (uint256) {
return convertToAssets(shares);
}
/*//////////////////////////////////////////////////////////////
DEPOSIT/WITHDRAWAL LIMIT LOGIC
//////////////////////////////////////////////////////////////*/
function maxDeposit(address) public view virtual returns (uint256) {
return type(uint256).max;
}
function maxMint(address) public view virtual returns (uint256) {
return type(uint256).max;
}
function maxWithdraw(address owner) public view virtual returns (uint256) {
return convertToAssets(balanceOf[owner]);
}
function maxRedeem(address owner) public view virtual returns (uint256) {
return balanceOf[owner];
}
/*//////////////////////////////////////////////////////////////
INTERNAL HOOKS LOGIC
//////////////////////////////////////////////////////////////*/
function beforeWithdraw(uint256 assets, uint256 shares) internal virtual {}
function afterDeposit(uint256 assets, uint256 shares) internal virtual {}
}// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;
import {ERC20} from "../tokens/ERC20.sol";
/// @notice Safe ETH and ERC20 transfer library that gracefully handles missing return values.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/SafeTransferLib.sol)
/// @dev Use with caution! Some functions in this library knowingly create dirty bits at the destination of the free memory pointer.
/// @dev Note that none of the functions in this library check that a token has code at all! That responsibility is delegated to the caller.
library SafeTransferLib {
/*//////////////////////////////////////////////////////////////
ETH OPERATIONS
//////////////////////////////////////////////////////////////*/
function safeTransferETH(address to, uint256 amount) internal {
bool success;
assembly {
// Transfer the ETH and store if it succeeded or not.
success := call(gas(), to, amount, 0, 0, 0, 0)
}
require(success, "ETH_TRANSFER_FAILED");
}
/*//////////////////////////////////////////////////////////////
ERC20 OPERATIONS
//////////////////////////////////////////////////////////////*/
function safeTransferFrom(
ERC20 token,
address from,
address to,
uint256 amount
) internal {
bool success;
assembly {
// Get a pointer to some free memory.
let freeMemoryPointer := mload(0x40)
// Write the abi-encoded calldata into memory, beginning with the function selector.
mstore(freeMemoryPointer, 0x23b872dd00000000000000000000000000000000000000000000000000000000)
mstore(add(freeMemoryPointer, 4), from) // Append the "from" argument.
mstore(add(freeMemoryPointer, 36), to) // Append the "to" argument.
mstore(add(freeMemoryPointer, 68), amount) // Append the "amount" argument.
success := and(
// Set success to whether the call reverted, if not we check it either
// returned exactly 1 (can't just be non-zero data), or had no return data.
or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),
// We use 100 because the length of our calldata totals up like so: 4 + 32 * 3.
// We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.
// Counterintuitively, this call must be positioned second to the or() call in the
// surrounding and() call or else returndatasize() will be zero during the computation.
call(gas(), token, 0, freeMemoryPointer, 100, 0, 32)
)
}
require(success, "TRANSFER_FROM_FAILED");
}
function safeTransfer(
ERC20 token,
address to,
uint256 amount
) internal {
bool success;
assembly {
// Get a pointer to some free memory.
let freeMemoryPointer := mload(0x40)
// Write the abi-encoded calldata into memory, beginning with the function selector.
mstore(freeMemoryPointer, 0xa9059cbb00000000000000000000000000000000000000000000000000000000)
mstore(add(freeMemoryPointer, 4), to) // Append the "to" argument.
mstore(add(freeMemoryPointer, 36), amount) // Append the "amount" argument.
success := and(
// Set success to whether the call reverted, if not we check it either
// returned exactly 1 (can't just be non-zero data), or had no return data.
or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),
// We use 68 because the length of our calldata totals up like so: 4 + 32 * 2.
// We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.
// Counterintuitively, this call must be positioned second to the or() call in the
// surrounding and() call or else returndatasize() will be zero during the computation.
call(gas(), token, 0, freeMemoryPointer, 68, 0, 32)
)
}
require(success, "TRANSFER_FAILED");
}
function safeApprove(
ERC20 token,
address to,
uint256 amount
) internal {
bool success;
assembly {
// Get a pointer to some free memory.
let freeMemoryPointer := mload(0x40)
// Write the abi-encoded calldata into memory, beginning with the function selector.
mstore(freeMemoryPointer, 0x095ea7b300000000000000000000000000000000000000000000000000000000)
mstore(add(freeMemoryPointer, 4), to) // Append the "to" argument.
mstore(add(freeMemoryPointer, 36), amount) // Append the "amount" argument.
success := and(
// Set success to whether the call reverted, if not we check it either
// returned exactly 1 (can't just be non-zero data), or had no return data.
or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),
// We use 68 because the length of our calldata totals up like so: 4 + 32 * 2.
// We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.
// Counterintuitively, this call must be positioned second to the or() call in the
// surrounding and() call or else returndatasize() will be zero during the computation.
call(gas(), token, 0, freeMemoryPointer, 68, 0, 32)
)
}
require(success, "APPROVE_FAILED");
}
}// SPDX-License-Identifier: AGPL-3.0
pragma solidity ^0.8.4;
/**
* @title IPool
* @author Aave
* @notice Defines the basic interface for an Aave Pool.
*
*/
interface IPool {
struct ReserveConfigurationMap {
//bit 0-15: LTV
//bit 16-31: Liq. threshold
//bit 32-47: Liq. bonus
//bit 48-55: Decimals
//bit 56: reserve is active
//bit 57: reserve is frozen
//bit 58: borrowing is enabled
//bit 59: stable rate borrowing enabled
//bit 60: asset is paused
//bit 61: borrowing in isolation mode is enabled
//bit 62-63: reserved
//bit 64-79: reserve factor
//bit 80-115 borrow cap in whole tokens, borrowCap == 0 => no cap
//bit 116-151 supply cap in whole tokens, supplyCap == 0 => no cap
//bit 152-167 liquidation protocol fee
//bit 168-175 eMode category
//bit 176-211 unbacked mint cap in whole tokens, unbackedMintCap == 0 => minting disabled
//bit 212-251 debt ceiling for isolation mode with (ReserveConfiguration::DEBT_CEILING_DECIMALS) decimals
//bit 252-255 unused
uint256 data;
}
struct ReserveData {
ReserveConfigurationMap configuration;
//the liquidity index. Expressed in ray
uint128 liquidityIndex;
//the current supply rate. Expressed in ray
uint128 currentLiquidityRate;
//variable borrow index. Expressed in ray
uint128 variableBorrowIndex;
//the current variable borrow rate. Expressed in ray
uint128 currentVariableBorrowRate;
//the current stable borrow rate. Expressed in ray
uint128 currentStableBorrowRate;
//timestamp of last update
uint40 lastUpdateTimestamp;
//the id of the reserve. Represents the position in the list of the active reserves
uint16 id;
//aToken address
address aTokenAddress;
//stableDebtToken address
address stableDebtTokenAddress;
//variableDebtToken address
address variableDebtTokenAddress;
//address of the interest rate strategy
address interestRateStrategyAddress;
//the current treasury balance, scaled
uint128 accruedToTreasury;
//the outstanding unbacked aTokens minted through the bridging feature
uint128 unbacked;
//the outstanding debt borrowed against this asset in isolation mode
uint128 isolationModeTotalDebt;
}
/**
* @notice Supplies an `amount` of underlying asset into the reserve, receiving in return overlying aTokens.
* - E.g. User supplies 100 USDC and gets in return 100 aUSDC
* @param asset The address of the underlying asset to supply
* @param amount The amount to be supplied
* @param onBehalfOf The address that will receive the aTokens, same as msg.sender if the user
* wants to receive them on his own wallet, or a different address if the beneficiary of aTokens
* is a different wallet
* @param referralCode Code used to register the integrator originating the operation, for potential rewards.
* 0 if the action is executed directly by the user, without any middle-man
*
*/
function supply(address asset, uint256 amount, address onBehalfOf, uint16 referralCode) external;
/**
* @notice Withdraws an `amount` of underlying asset from the reserve, burning the equivalent aTokens owned
* E.g. User has 100 aUSDC, calls withdraw() and receives 100 USDC, burning the 100 aUSDC
* @param asset The address of the underlying asset to withdraw
* @param amount The underlying amount to be withdrawn
* - Send the value type(uint256).max in order to withdraw the whole aToken balance
* @param to The address that will receive the underlying, same as msg.sender if the user
* wants to receive it on his own wallet, or a different address if the beneficiary is a
* different wallet
* @return The final amount withdrawn
*
*/
function withdraw(address asset, uint256 amount, address to) external returns (uint256);
/**
* @notice Returns the state and configuration of the reserve
* @param asset The address of the underlying asset of the reserve
* @return The state and configuration data of the reserve
*
*/
function getReserveData(address asset) external view returns (ReserveData memory);
}// SPDX-License-Identifier: AGPL-3.0
pragma solidity ^0.8.4;
/**
* @title IRewardsController
* @author Aave
* @notice Defines the basic interface for a Rewards Controller.
*/
interface IRewardsController {
/**
* @dev Claims all rewards for a user to the desired address, on all the assets of the pool, accumulating the pending rewards
* @param assets The list of assets to check eligible distributions before claiming rewards
* @param to The address that will be receiving the rewards
* @return rewardsList List of addresses of the reward tokens
* @return claimedAmounts List that contains the claimed amount per reward, following same order as "rewardList"
*
*/
function claimAllRewards(address[] calldata assets, address to)
external
returns (address[] memory rewardsList, uint256[] memory claimedAmounts);
}// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;
/// @notice Arithmetic library with operations for fixed-point numbers.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/FixedPointMathLib.sol)
/// @author Inspired by USM (https://github.com/usmfum/USM/blob/master/contracts/WadMath.sol)
library FixedPointMathLib {
/*//////////////////////////////////////////////////////////////
SIMPLIFIED FIXED POINT OPERATIONS
//////////////////////////////////////////////////////////////*/
uint256 internal constant WAD = 1e18; // The scalar of ETH and most ERC20s.
function mulWadDown(uint256 x, uint256 y) internal pure returns (uint256) {
return mulDivDown(x, y, WAD); // Equivalent to (x * y) / WAD rounded down.
}
function mulWadUp(uint256 x, uint256 y) internal pure returns (uint256) {
return mulDivUp(x, y, WAD); // Equivalent to (x * y) / WAD rounded up.
}
function divWadDown(uint256 x, uint256 y) internal pure returns (uint256) {
return mulDivDown(x, WAD, y); // Equivalent to (x * WAD) / y rounded down.
}
function divWadUp(uint256 x, uint256 y) internal pure returns (uint256) {
return mulDivUp(x, WAD, y); // Equivalent to (x * WAD) / y rounded up.
}
/*//////////////////////////////////////////////////////////////
LOW LEVEL FIXED POINT OPERATIONS
//////////////////////////////////////////////////////////////*/
function mulDivDown(
uint256 x,
uint256 y,
uint256 denominator
) internal pure returns (uint256 z) {
assembly {
// Store x * y in z for now.
z := mul(x, y)
// Equivalent to require(denominator != 0 && (x == 0 || (x * y) / x == y))
if iszero(and(iszero(iszero(denominator)), or(iszero(x), eq(div(z, x), y)))) {
revert(0, 0)
}
// Divide z by the denominator.
z := div(z, denominator)
}
}
function mulDivUp(
uint256 x,
uint256 y,
uint256 denominator
) internal pure returns (uint256 z) {
assembly {
// Store x * y in z for now.
z := mul(x, y)
// Equivalent to require(denominator != 0 && (x == 0 || (x * y) / x == y))
if iszero(and(iszero(iszero(denominator)), or(iszero(x), eq(div(z, x), y)))) {
revert(0, 0)
}
// First, divide z - 1 by the denominator and add 1.
// We allow z - 1 to underflow if z is 0, because we multiply the
// end result by 0 if z is zero, ensuring we return 0 if z is zero.
z := mul(iszero(iszero(z)), add(div(sub(z, 1), denominator), 1))
}
}
function rpow(
uint256 x,
uint256 n,
uint256 scalar
) internal pure returns (uint256 z) {
assembly {
switch x
case 0 {
switch n
case 0 {
// 0 ** 0 = 1
z := scalar
}
default {
// 0 ** n = 0
z := 0
}
}
default {
switch mod(n, 2)
case 0 {
// If n is even, store scalar in z for now.
z := scalar
}
default {
// If n is odd, store x in z for now.
z := x
}
// Shifting right by 1 is like dividing by 2.
let half := shr(1, scalar)
for {
// Shift n right by 1 before looping to halve it.
n := shr(1, n)
} n {
// Shift n right by 1 each iteration to halve it.
n := shr(1, n)
} {
// Revert immediately if x ** 2 would overflow.
// Equivalent to iszero(eq(div(xx, x), x)) here.
if shr(128, x) {
revert(0, 0)
}
// Store x squared.
let xx := mul(x, x)
// Round to the nearest number.
let xxRound := add(xx, half)
// Revert if xx + half overflowed.
if lt(xxRound, xx) {
revert(0, 0)
}
// Set x to scaled xxRound.
x := div(xxRound, scalar)
// If n is even:
if mod(n, 2) {
// Compute z * x.
let zx := mul(z, x)
// If z * x overflowed:
if iszero(eq(div(zx, x), z)) {
// Revert if x is non-zero.
if iszero(iszero(x)) {
revert(0, 0)
}
}
// Round to the nearest number.
let zxRound := add(zx, half)
// Revert if zx + half overflowed.
if lt(zxRound, zx) {
revert(0, 0)
}
// Return properly scaled zxRound.
z := div(zxRound, scalar)
}
}
}
}
}
/*//////////////////////////////////////////////////////////////
GENERAL NUMBER UTILITIES
//////////////////////////////////////////////////////////////*/
function sqrt(uint256 x) internal pure returns (uint256 z) {
assembly {
let y := x // We start y at x, which will help us make our initial estimate.
z := 181 // The "correct" value is 1, but this saves a multiplication later.
// This segment is to get a reasonable initial estimate for the Babylonian method. With a bad
// start, the correct # of bits increases ~linearly each iteration instead of ~quadratically.
// We check y >= 2^(k + 8) but shift right by k bits
// each branch to ensure that if x >= 256, then y >= 256.
if iszero(lt(y, 0x10000000000000000000000000000000000)) {
y := shr(128, y)
z := shl(64, z)
}
if iszero(lt(y, 0x1000000000000000000)) {
y := shr(64, y)
z := shl(32, z)
}
if iszero(lt(y, 0x10000000000)) {
y := shr(32, y)
z := shl(16, z)
}
if iszero(lt(y, 0x1000000)) {
y := shr(16, y)
z := shl(8, z)
}
// Goal was to get z*z*y within a small factor of x. More iterations could
// get y in a tighter range. Currently, we will have y in [256, 256*2^16).
// We ensured y >= 256 so that the relative difference between y and y+1 is small.
// That's not possible if x < 256 but we can just verify those cases exhaustively.
// Now, z*z*y <= x < z*z*(y+1), and y <= 2^(16+8), and either y >= 256, or x < 256.
// Correctness can be checked exhaustively for x < 256, so we assume y >= 256.
// Then z*sqrt(y) is within sqrt(257)/sqrt(256) of sqrt(x), or about 20bps.
// For s in the range [1/256, 256], the estimate f(s) = (181/1024) * (s+1) is in the range
// (1/2.84 * sqrt(s), 2.84 * sqrt(s)), with largest error when s = 1 and when s = 256 or 1/256.
// Since y is in [256, 256*2^16), let a = y/65536, so that a is in [1/256, 256). Then we can estimate
// sqrt(y) using sqrt(65536) * 181/1024 * (a + 1) = 181/4 * (y + 65536)/65536 = 181 * (y + 65536)/2^18.
// There is no overflow risk here since y < 2^136 after the first branch above.
z := shr(18, mul(z, add(y, 65536))) // A mul() is saved from starting z at 181.
// Given the worst case multiplicative error of 2.84 above, 7 iterations should be enough.
z := shr(1, add(z, div(x, z)))
z := shr(1, add(z, div(x, z)))
z := shr(1, add(z, div(x, z)))
z := shr(1, add(z, div(x, z)))
z := shr(1, add(z, div(x, z)))
z := shr(1, add(z, div(x, z)))
z := shr(1, add(z, div(x, z)))
// If x+1 is a perfect square, the Babylonian method cycles between
// floor(sqrt(x)) and ceil(sqrt(x)). This statement ensures we return floor.
// See: https://en.wikipedia.org/wiki/Integer_square_root#Using_only_integer_division
// Since the ceil is rare, we save gas on the assignment and repeat division in the rare case.
// If you don't care whether the floor or ceil square root is returned, you can remove this statement.
z := sub(z, lt(div(x, z), z))
}
}
function unsafeMod(uint256 x, uint256 y) internal pure returns (uint256 z) {
assembly {
// Mod x by y. Note this will return
// 0 instead of reverting if y is zero.
z := mod(x, y)
}
}
function unsafeDiv(uint256 x, uint256 y) internal pure returns (uint256 r) {
assembly {
// Divide x by y. Note this will return
// 0 instead of reverting if y is zero.
r := div(x, y)
}
}
function unsafeDivUp(uint256 x, uint256 y) internal pure returns (uint256 z) {
assembly {
// Add 1 to x * y if x % y > 0. Note this will
// return 0 instead of reverting if y is zero.
z := add(gt(mod(x, y), 0), div(x, y))
}
}
}{
"remappings": [
"ds-test/=lib/forge-std/lib/ds-test/src/",
"forge-std/=lib/forge-std/src/",
"aave-address-book/=lib/aave-address-book/src/",
"chainlink/=lib/pt-v5-chainlink-vrf-v2-direct/lib/chainlink/contracts/src/v0.8/",
"openzeppelin/=lib/openzeppelin-contracts/contracts/",
"prb-math/=lib/pt-v5-cgda-liquidator/lib/prb-math/src/",
"solidity-stringutils/=lib/solidity-stringutils/src/",
"yield-daddy/=lib/yield-daddy/src/",
"pt-v5-chainlink-vrf-v2-direct/=lib/pt-v5-chainlink-vrf-v2-direct/src/",
"pt-v5-draw-auction/=lib/pt-v5-draw-auction/src/",
"pt-v5-cgda-liquidator/=lib/pt-v5-cgda-liquidator/src/",
"pt-v5-liquidator-interfaces/=lib/pt-v5-cgda-liquidator/lib/pt-v5-liquidator-interfaces/src/interfaces/",
"pt-v5-prize-pool/=lib/pt-v5-prize-pool/src/",
"pt-v5-twab-controller/=lib/pt-v5-twab-controller/src/",
"pt-v5-vault/=lib/pt-v5-vault/src/",
"pt-v5-vault-boost/=lib/pt-v5-vault-boost/src/",
"pt-v5-vault-mock/=lib/pt-v5-vault/test/contracts/mock/",
"pt-v5-claimer/=lib/pt-v5-claimer/src/",
"rng/=lib/pt-v5-draw-auction/lib/pt-v5-rng-contracts/contracts/",
"rng-contracts/=lib/pt-v5-draw-auction/lib/pt-v5-rng-contracts/contracts/",
"remote-owner/=lib/pt-v5-draw-auction/lib/remote-owner/src/",
"@aave/core-v3/=lib/aave-address-book/lib/aave-v3-core/",
"@aave/periphery-v3/=lib/aave-address-book/lib/aave-v3-periphery/",
"@openzeppelin/=lib/pt-v5-draw-auction/lib/openzeppelin-contracts/",
"@prb/test/=lib/pt-v5-vault-boost/lib/prb-math/lib/prb-test/src/",
"aave-v3-core/=lib/aave-address-book/lib/aave-v3-core/",
"aave-v3-periphery/=lib/aave-address-book/lib/aave-v3-periphery/",
"brokentoken/=lib/pt-v5-vault/lib/brokentoken/src/",
"create3-factory/=lib/yield-daddy/lib/create3-factory/",
"erc4626-tests/=lib/pt-v5-vault/lib/erc4626-tests/",
"erc5164-interfaces/=lib/pt-v5-draw-auction/lib/remote-owner/lib/erc5164-interfaces/src/",
"openzeppelin-contracts/=lib/openzeppelin-contracts/",
"owner-manager-contracts/=lib/pt-v5-chainlink-vrf-v2-direct/lib/owner-manager-contracts/contracts/",
"owner-manager/=lib/pt-v5-chainlink-vrf-v2-direct/lib/owner-manager-contracts/contracts/",
"prb-test/=lib/pt-v5-vault-boost/lib/prb-math/lib/prb-test/src/",
"pt-v5-rng-contracts/=lib/pt-v5-rng-contracts/contracts/",
"pt-v5-twab-delegator/=lib/pt-v5-twab-delegator/src/",
"ring-buffer-lib/=lib/pt-v5-twab-controller/lib/ring-buffer-lib/src/",
"rng/=lib/pt-v5-draw-auction/lib/pt-v5-rng-contracts/contracts/",
"solmate/=lib/yield-daddy/lib/solmate/src/",
"uniform-random-number/=lib/pt-v5-prize-pool/lib/uniform-random-number/src/",
"weird-erc20/=lib/pt-v5-vault/lib/brokentoken/lib/weird-erc20/src/"
],
"optimizer": {
"enabled": true,
"runs": 200,
"details": {
"peephole": true,
"inliner": true,
"deduplicate": true,
"cse": true,
"yul": true
}
},
"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
Contract ABI
API[{"inputs":[{"internalType":"contract ERC20","name":"asset_","type":"address"},{"internalType":"contract ERC20","name":"aToken_","type":"address"},{"internalType":"contract IPool","name":"lendingPool_","type":"address"},{"internalType":"address","name":"rewardRecipient_","type":"address"},{"internalType":"contract IRewardsController","name":"rewardsController_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ClaimRewards","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"assets","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"assets","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"aToken","outputs":[{"internalType":"contract ERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"asset","outputs":[{"internalType":"contract ERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"name":"convertToAssets","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"assets","type":"uint256"}],"name":"convertToShares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"assets","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"}],"name":"deposit","outputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lendingPool","outputs":[{"internalType":"contract IPool","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"maxDeposit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"maxMint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"maxRedeem","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"maxWithdraw","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"}],"name":"mint","outputs":[{"internalType":"uint256","name":"assets","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"assets","type":"uint256"}],"name":"previewDeposit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"name":"previewMint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"name":"previewRedeem","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"assets","type":"uint256"}],"name":"previewWithdraw","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"address","name":"owner","type":"address"}],"name":"redeem","outputs":[{"internalType":"uint256","name":"assets","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardRecipient","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardsController","outputs":[{"internalType":"contract IRewardsController","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalAssets","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"assets","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"address","name":"owner","type":"address"}],"name":"withdraw","outputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
610180604081815234620006ae5760a08262002b768038038091620000258285620006b3565b833981010312620006ae576200003b82620006ed565b916020906200004c828201620006ed565b8184015190946001600160a01b03938483168303620006ae576060840151938585168503620006ae5760800151948086168603620006ae578216908651966395d89b4160e01b808952600090600494828b8781845afa9a8b156200065b57839b6200068e575b506200010860388551809d7f455243343632362d57726170706564204161766520763320000000000000000089830152620000f6815180928b86860191016200073f565b8101038d601882019052018c620006b3565b835191825282828781845afa9182156200065b5786918691859462000665575b506200016260228751809661776160f01b8683015262000151815180928886860191016200073f565b8101036002810187520185620006b3565b855163313ce56760e01b815292839182905afa9081156200065b57839162000619575b508a516001600160401b039b908c8111620005415780620001a7865462000702565b92601f93848111620005c8575b5088908483116001146200056057879262000554575b50508160011b916000199060031b1c19161784555b8251908c821162000541578190600194620001fb865462000702565b828111620004ec575b5088918311600114620004885786926200047c575b5050600019600383901b1c191690831b1782555b6080524660a05282518254918184620002468562000702565b92838352888301958982821691826000146200045c5750506001146200041c575b506200027692500382620006b3565b519020938251938401947f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f8652838501527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608501524660808501523060a085015260a0845260c0840199848b10908b11176200040957505087905251902060c05260e05261010094855261012090815261014091825261016092835261239d9485620007d98639608051856106b8015260a0518561153e015260c05185611565015260e0518581816108620152818161093c01528181610a9c01528181610ea70152818161106a01528181611aa001528181611d8001528181611f100152818161206001526121e701525184818161073301528181610cde01528181611a4701528181611e4501528181611fce015281816120f10152612277015251838181610b1601528181610d2301528181610ef501528181611aca01528181611db201528181611f4201528181612096015261221c01525182818161051a01526107810152518181816107ae01526108cd0152f35b634e487b7160e01b825260419052602490fd5b8891508680528187209087915b858310620004435750506200027693508201013862000267565b80548388018501528694508a9390920191810162000429565b60ff191688526200027695151560051b8501019250389150620002679050565b01519050388062000219565b8587528887208694509190601f198416885b8b828210620004d55750508411620004bb575b505050811b0182556200022d565b015160001960f88460031b161c19169055388080620004ad565b83850151865589979095019493840193016200049a565b909192508587528887208380860160051c8201928b871062000537575b91869589929594930160051c01915b8281106200052857505062000204565b89815586955088910162000518565b9250819262000509565b634e487b7160e01b855260418852602485fd5b015190503880620001ca565b8780528988209250601f198416885b8b828210620005b157505090846001959493921062000597575b505050811b018455620001df565b015160001960f88460031b161c1916905538808062000589565b60018596829396860151815501950193016200056f565b9091508680528887208480850160051c8201928b86106200060f575b9085949392910160051c01905b818110620006005750620001b4565b888155849350600101620005f1565b92508192620005e4565b90508481813d831162000653575b620006338183620006b3565b810103126200064f575160ff811681036200064f573862000185565b8280fd5b503d62000627565b84513d85823e3d90fd5b620006869194503d8087833e6200067d8183620006b3565b81019062000764565b923862000128565b620006a6919b503d8085833e6200067d8183620006b3565b9938620000b2565b600080fd5b601f909101601f19168101906001600160401b03821190821017620006d757604052565b634e487b7160e01b600052604160045260246000fd5b51906001600160a01b0382168203620006ae57565b90600182811c9216801562000734575b60208310146200071e57565b634e487b7160e01b600052602260045260246000fd5b91607f169162000712565b60005b838110620007535750506000910152565b818101518382015260200162000742565b602081830312620006ae5780516001600160401b0391828211620006ae57019082601f83011215620006ae578151908111620006d75760405192620007b4601f8301601f191660200185620006b3565b81845260208284010111620006ae57620007d591602080850191016200073f565b9056fe6080604052600436101561001257600080fd5b60003560e01c806301e1d1141461021d57806306fdde031461021857806307a2d13a146101e1578063095ea7b3146102135780630a28a4771461020e57806317f333401461020957806318160ddd1461020457806323b872dd146101ff578063313ce567146101fa5780633644e515146101f5578063372500ab146101f057806338d52e0f146101eb578063402d267d146101e65780634cdad506146101e15780636bb65f53146101dc5780636e553f65146101d757806370a08231146101d25780637ecebe00146101cd57806394bf804d146101c857806395d89b41146101c3578063a0c1f15e146101be578063a59a9973146101b9578063a9059cbb146101b4578063b3d7f6b9146101af578063b460af94146101aa578063ba087652146101a5578063c63d75b6146101a0578063c6e6f59214610187578063ce96cb771461019b578063d505accf14610196578063d905777e14610191578063dd62ed3e1461018c5763ef8b30f71461018757600080fd5b61113f565b6113a4565b61137d565b611184565b61115d565b611119565b610fcf565b610e19565b610dcf565b610d52565b610d0d565b610cc8565b610c23565b610a6c565b610a2f565b6109f2565b6108fc565b6108b7565b610428565b610891565b61084c565b6106f7565b6106dc565b61069e565b610567565b610549565b610504565b6104e6565b610457565b610345565b610232565b600091031261022d57565b600080fd5b3461022d57600036600319011261022d57602061024d611a2c565b604051908152f35b90600182811c92168015610285575b602083101461026f57565b634e487b7160e01b600052602260045260246000fd5b91607f1691610264565b634e487b7160e01b600052604160045260246000fd5b67ffffffffffffffff81116102b957604052565b61028f565b6040810190811067ffffffffffffffff8211176102b957604052565b90601f8019910116810190811067ffffffffffffffff8211176102b957604052565b6020808252825181830181905290939260005b82811061033157505060409293506000838284010152601f8019910116010190565b81810186015184820160400152850161030f565b3461022d57600080600319360112610425576040519080805461036781610255565b808552916001918083169081156103fb57506001146103a1575b61039d85610391818703826102da565b604051918291826102fc565b0390f35b80809450527f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5635b8284106103e35750505081016020016103918261039d610381565b805460208587018101919091529093019281016103c8565b86955061039d9693506020925061039194915060ff191682840152151560051b8201019293610381565b80fd5b3461022d57602036600319011261022d57602061024d600435611426565b6001600160a01b0381160361022d57565b3461022d57604036600319011261022d5760043561047481610446565b60243590336000526004602052816104a28260406000209060018060a01b0316600052602052604060002090565b556040519182526001600160a01b03169033907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590602090a3602060405160018152f35b3461022d57602036600319011261022d57602061024d600435611462565b3461022d57600036600319011261022d576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b3461022d57600036600319011261022d576020600254604051908152f35b3461022d57606036600319011261022d5760043561058481610446565b60243561059081610446565b6001600160a01b038083166000818152600460209081526040808320338452909152902060443594919391929190546001810161063c575b506105f46000805160206123488339815191529360018060a01b03166000526003602052604060002090565b6105ff868254611497565b90556001600160a01b0381166000908152600360205260409020805486019055604051948552169280602081015b0390a360405160018152602090f35b85810390811161069957600080516020612348833981519152936105f4916106913361067a8460018060a01b03166000526004602052604060002090565b9060018060a01b0316600052602052604060002090565b5593506105c8565b611481565b3461022d57600036600319011261022d57602060405160ff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b3461022d57600036600319011261022d57602061024d611539565b3461022d576000806003193601126104255780806107aa60405161071a816102be565b60018152602036818301376001600160a01b039061076c7f0000000000000000000000000000000000000000000000000000000000000000831661075d83611813565b6001600160a01b039091169052565b60405194858094819363bb492bf560e01b83527f00000000000000000000000000000000000000000000000000000000000000009060048401611941565b03927f0000000000000000000000000000000000000000000000000000000000000000165af180156108475761080c61081d917fbacfa9662d479c707dae707c358323f0c7711ef382007957dc9935e629da36b2938591610823575b50611813565b516040519081529081906020820190565b0390a180f35b61083f91503d8087833e61083781836102da565b8101906118a1565b905038610806565b6114f0565b3461022d57600036600319011261022d576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b3461022d57602036600319011261022d576108ad600435610446565b602061024d611d69565b3461022d57600036600319011261022d576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b3461022d57604036600319011261022d5760043560243561091c81610446565b61092582611407565b9081156109bf57826109af9161096061039d9530337f000000000000000000000000000000000000000000000000000000000000000061175e565b61096a84826116d5565b60408051838152602081018690526001600160a01b03929092169133917fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d791a3611a9b565b6040519081529081906020820190565b60405162461bcd60e51b815260206004820152600b60248201526a5a45524f5f53484152455360a81b6044820152606490fd5b3461022d57602036600319011261022d57600435610a0f81610446565b60018060a01b031660005260036020526020604060002054604051908152f35b3461022d57602036600319011261022d57600435610a4c81610446565b60018060a01b031660005260056020526020604060002054604051908152f35b3461022d5760408060031936011261022d5760043560243591610a8e83610446565b6044610a9983611444565b927f000000000000000000000000000000000000000000000000000000000000000090610ac88530338561175e565b610ad281876116d5565b835185815260208101919091526001600160a01b039586169033907fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d790604090a3847f0000000000000000000000000000000000000000000000000000000000000000166020845163095ea7b360e01b8152826004820152866024820152600094859182865af13d15601f3d11600186511416171615610bee57803b15610bea57835163617ba03760e01b8152959091166001600160a01b03166004860152602485018490523060448601526000606486015284908183816084810103925af19283156108475761039d93610bd1575b50519081529081906020820190565b80610bde610be4926102a5565b80610222565b38610bc2565b8280fd5b835162461bcd60e51b815260206004820152600e60248201526d1054141493d59157d1905253115160921b6044820152606490fd5b3461022d576000806003193601126104255760405190806001805491610c4883610255565b808652928281169081156103fb5750600114610c6e5761039d85610391818703826102da565b92508083527fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf65b828410610cb05750505081016020016103918261039d610381565b80546020858701810191909152909301928101610c95565b3461022d57600036600319011261022d576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b3461022d57600036600319011261022d576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b3461022d57604036600319011261022d57600435610d6f81610446565b602435903360005260036020526040600020805490838203918211610699575560018060a01b03169081600052600360205260406000208181540190556000805160206123488339815191526040518061062d3394829190602083019252565b3461022d57602036600319011261022d57602061024d600435611444565b606090600319011261022d5760043590602435610e0981610446565b90604435610e1681610446565b90565b3461022d57610ef16020610e2c36610ded565b610e37839493611462565b936001600160a01b039180831690610e5890879033849003610f66576119a6565b60408051838152602081018890528486169133917ffbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db9190a4604051631a4ca37b60e21b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008416811660048301526024820192909252921660448301529093849190829060009082906064820190565b03927f0000000000000000000000000000000000000000000000000000000000000000165af19182156108475761039d92610f38575b506040519081529081906020820190565b610f589060203d8111610f5f575b610f5081836102da565b810190611997565b5038610f27565b503d610f46565b6001600160a01b0381166000908152600460205260409020610f8990339061067a565b548260018201610f9b575b50506119a6565b610fa491611497565b6001600160a01b0382166000908152600460205260409020610fc790339061067a565b553882610f94565b3461022d576000610ef16020610fe436610ded565b93916001600160a01b03919082861690338290036110b0575b61101b8161100a81611426565b986110168a15156119f2565b6119a6565b6040805188815260208101929092528484169133917ffbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db91a4604051631a4ca37b60e21b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000084168116600483015260248201879052909116604482015294859283919082906064820190565b6001600160a01b03871660009081526004602052604090206110d390339061067a565b5481891982036110e5575b5050610ffd565b6110ee91611497565b6001600160a01b038816600090815260046020526040902061111190339061067a565b5538816110de565b3461022d57602036600319011261022d57611135600435610446565b602061024d611ef9565b3461022d57602036600319011261022d57602061024d600435611407565b3461022d57602036600319011261022d57602061024d60043561117f81610446565b612049565b3461022d5760e036600319011261022d576004356111a181610446565b602435906111ae82610446565b604435606435926084359360ff8516850361022d576112e16020916111d5428210156114a4565b6112a86112b46111e3611539565b92886112018160018060a01b03166000526005602052604060002090565b805460018101909155604080517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98a82019081526001600160a01b039485166020820152938b1691840191909152606083018b9052608083019190915260a08201929092528160c08201039161127f601f19938481018352826102da565b5190206040519384918883019687909160429261190160f01b8352600283015260228201520190565b039081018352826102da565b5190206040805191825260ff909716602082015260a4359681019690965260c43560608701526080860190565b856000968792838052039060015afa156108475783517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925916001600160a01b0391849061135e90839061067a906113448782168015159081611371575b506114fc565b6001600160a01b0316600090815260046020526040902090565b556040519384528116931691602090a380f35b9050888c16143861133e565b3461022d57602036600319011261022d57602061024d60043561139f81610446565b6121d0565b3461022d57604036600319011261022d5760206113fe6004356113c681610446565b602435906113d382610446565b60018060a01b03166000526004835260406000209060018060a01b0316600052602052604060002090565b54604051908152f35b60025480611413575090565b90610e1691611420611a2c565b9161171e565b60025480611432575090565b610e169161143e611a2c565b9061171e565b60025480611450575090565b610e169161145c611a2c565b90611736565b6002548061146e575090565b90610e169161147b611a2c565b91611736565b634e487b7160e01b600052601160045260246000fd5b9190820391821161069957565b156114ab57565b60405162461bcd60e51b815260206004820152601760248201527f5045524d49545f444541444c494e455f455850495245440000000000000000006044820152606490fd5b6040513d6000823e3d90fd5b1561150357565b60405162461bcd60e51b815260206004820152600e60248201526d24a72b20a624a22fa9a4a3a722a960911b6044820152606490fd5b6000467f00000000000000000000000000000000000000000000000000000000000000000361158757507f000000000000000000000000000000000000000000000000000000000000000090565b604051815491908161159884610255565b808352602094858401946001918783821691826000146116b0575050600114611658575b50505091816115d3611652936116449503826102da565b519020604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f95810195865260208601929092527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc69085015246606085015230608085015291829060a0850190565b03601f1981018352826102da565b51902090565b91908693508280527f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5635b82841061169b57505050820101816115d36116526115bc565b80548685018601528794909301928101611682565b60ff1916885293151560051b860190930193508492506115d3915061165290506115bc565b600254908282018092116106995760206000805160206123488339815191529160009360025560018060a01b0316938484526003825260408420818154019055604051908152a3565b8181029181830414901517821515161561022d570490565b9190918281029281840414901517811515161561022d57600190600019830104019015150290565b9060006064926020958295604051946323b872dd60e01b86526004860152602485015260448401525af13d15601f3d116001600051141617161561179e57565b60405162461bcd60e51b81526020600482015260146024820152731514905394d1915497d19493d357d1905253115160621b6044820152606490fd5b604051906101e0820182811067ffffffffffffffff8211176102b957604052565b67ffffffffffffffff81116102b95760051b60200190565b8051156118205760200190565b634e487b7160e01b600052603260045260246000fd5b519061184182610446565b565b81601f8201121561022d5780519161185a836117fb565b9261186860405194856102da565b808452602092838086019260051b82010192831161022d578301905b828210611892575050505090565b81518152908301908301611884565b91909160408184031261022d5780519267ffffffffffffffff9384811161022d5782019381601f8601121561022d5784516118db816117fb565b906118e960405192836102da565b808252602096878084019260051b8201019185831161022d5788809201905b83821061192857505050509483015190811161022d57610e169201611843565b828091835161193681610446565b815201910190611908565b9092919260408201604083528151809152606083019060208093019060005b8482821061197a57505050509360018060a01b0316910152565b83516001600160a01b031685529384019390920191600101611960565b9081602091031261022d575190565b6001600160a01b031660008181526003602052604090208054838103919082116106995760009360008051602061234883398151915292602092558060025403600255604051908152a3565b156119f957565b60405162461bcd60e51b815260206004820152600b60248201526a5a45524f5f41535345545360a81b6044820152606490fd5b6040516370a0823160e01b81523060048201526020816024817f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165afa90811561084757600091611a83575090565b610e16915060203d8111610f5f57610f5081836102da565b9060447f000000000000000000000000000000000000000000000000000000000000000060018060a01b0393847f00000000000000000000000000000000000000000000000000000000000000001690602060405163095ea7b360e01b8152836004820152826024820152600095869182875af13d15601f3d11600187511416171615611b8b57813b15611b875760405163617ba03760e01b8152959092166001600160a01b0316600486015260248501919091523060448501526000606485015291929182908183816084810103925af1801561084757611b7a5750565b80610bde611841926102a5565b8380fd5b60405162461bcd60e51b815260206004820152600e60248201526d1054141493d59157d1905253115160921b6044820152606490fd5b919082602091031261022d576040516020810181811067ffffffffffffffff8211176102b95760405291518252565b51906fffffffffffffffffffffffffffffffff8216820361022d57565b519064ffffffffff8216820361022d57565b519061ffff8216820361022d57565b6101e08183031261022d57611c4b611c446117da565b9282611bc1565b8252611c5960208201611bf0565b6020830152611c6a60408201611bf0565b6040830152611c7b60608201611bf0565b6060830152611c8c60808201611bf0565b6080830152611c9d60a08201611bf0565b60a0830152611cae60c08201611c0d565b60c0830152611cbf60e08201611c1f565b60e0830152610100611cd2818301611836565b90830152610120611ce4818301611836565b90830152610140611cf6818301611836565b90830152610160611d08818301611836565b90830152610180611d1a818301611bf0565b908301526101a0611d2c818301611bf0565b90830152611d3e6101c0809201611bf0565b9082015290565b60ff16604d811161069957600a0a90565b8181029291811591840414171561069957565b6040516335ea6a7560e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166004830152906101e09081816024817f000000000000000000000000000000000000000000000000000000000000000087165afa91821561084757600092611ecc575b5050515190600160381b8216151580611ebe575b80611eb0575b15611ea957640fffffffff8260741c168015611ea057611e31602091611e2b60ff60049660301c16611d45565b90611d56565b91604051938480926318160ddd60e01b82527f0000000000000000000000000000000000000000000000000000000000000000165afa90811561084757610e1692600092611e80575b50611497565b611e9991925060203d8111610f5f57610f5081836102da565b9038611e7a565b50505060001990565b5050600090565b506001603c1b821615611dfe565b50600160391b821615611df8565b611eeb9250803d10611ef2575b611ee381836102da565b810190611c2e565b3880611de4565b503d611ed9565b6040516335ea6a7560e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166004830152906101e09081816024817f000000000000000000000000000000000000000000000000000000000000000087165afa9182156108475760009261202c575b50505151600160381b811615158061201e575b80612010575b15611ea957640fffffffff8160741c168015611ea057611fba602091611e2b60ff60049560301c16611d45565b92604051928380926318160ddd60e01b82527f0000000000000000000000000000000000000000000000000000000000000000165afa801561084757610e169261200b92600092611e805750611497565b611407565b506001603c1b811615611f8d565b50600160391b811615611f87565b6120429250803d10611ef257611ee381836102da565b3880611f74565b6040516335ea6a7560e01b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116600483018190529092916101e09081816024817f000000000000000000000000000000000000000000000000000000000000000089165afa918215610847576000926121b3575b50505151600160381b8116151590816121a4575b501561219c576040516370a0823160e01b81527f0000000000000000000000000000000000000000000000000000000000000000939093166001600160a01b03166004840152602090839081806024810103915afa91821561084757600092612174575b506001600160a01b03166000908152600360205260409020612163905b54611426565b8082101561216f575090565b905090565b61216391925061219461215d9160203d8111610f5f57610f5081836102da565b929150612140565b505050600090565b6001603c1b91501615386120dc565b6121c99250803d10611ef257611ee381836102da565b38806120c8565b6040516335ea6a7560e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166004830181905290916101e09081816024817f000000000000000000000000000000000000000000000000000000000000000088165afa9182156108475760009261232a575b50505151600160381b81161515908161231b575b501561219c576040516370a0823160e01b81527f0000000000000000000000000000000000000000000000000000000000000000929092166001600160a01b03166004830152602090829081806024810103915afa908115610847576122f0916122d4916000916122fd575b50611407565b6001600160a01b03909216600090815260036020526040902090565b548082101561216f575090565b612315915060203d8111610f5f57610f5081836102da565b386122ce565b6001603c1b9150161538612262565b6123409250803d10611ef257611ee381836102da565b388061224e56feddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa26469706673582212209a4978057029a35a44d06bfbd200af6b09f27351e2f212d7f9d86255060e9b4764736f6c634300081300330000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c31607000000000000000000000000625e7708f30ca75bfd92586e17077590c60eb4cd000000000000000000000000794a61358d6845594f94dc1db02a252b5b4814ad0000000000000000000000008d352083f7094dc51cd7da8c5c0985ad6e149629000000000000000000000000929ec64c34a17401f460460d4b9390518e5b473e
Deployed Bytecode
0x6080604052600436101561001257600080fd5b60003560e01c806301e1d1141461021d57806306fdde031461021857806307a2d13a146101e1578063095ea7b3146102135780630a28a4771461020e57806317f333401461020957806318160ddd1461020457806323b872dd146101ff578063313ce567146101fa5780633644e515146101f5578063372500ab146101f057806338d52e0f146101eb578063402d267d146101e65780634cdad506146101e15780636bb65f53146101dc5780636e553f65146101d757806370a08231146101d25780637ecebe00146101cd57806394bf804d146101c857806395d89b41146101c3578063a0c1f15e146101be578063a59a9973146101b9578063a9059cbb146101b4578063b3d7f6b9146101af578063b460af94146101aa578063ba087652146101a5578063c63d75b6146101a0578063c6e6f59214610187578063ce96cb771461019b578063d505accf14610196578063d905777e14610191578063dd62ed3e1461018c5763ef8b30f71461018757600080fd5b61113f565b6113a4565b61137d565b611184565b61115d565b611119565b610fcf565b610e19565b610dcf565b610d52565b610d0d565b610cc8565b610c23565b610a6c565b610a2f565b6109f2565b6108fc565b6108b7565b610428565b610891565b61084c565b6106f7565b6106dc565b61069e565b610567565b610549565b610504565b6104e6565b610457565b610345565b610232565b600091031261022d57565b600080fd5b3461022d57600036600319011261022d57602061024d611a2c565b604051908152f35b90600182811c92168015610285575b602083101461026f57565b634e487b7160e01b600052602260045260246000fd5b91607f1691610264565b634e487b7160e01b600052604160045260246000fd5b67ffffffffffffffff81116102b957604052565b61028f565b6040810190811067ffffffffffffffff8211176102b957604052565b90601f8019910116810190811067ffffffffffffffff8211176102b957604052565b6020808252825181830181905290939260005b82811061033157505060409293506000838284010152601f8019910116010190565b81810186015184820160400152850161030f565b3461022d57600080600319360112610425576040519080805461036781610255565b808552916001918083169081156103fb57506001146103a1575b61039d85610391818703826102da565b604051918291826102fc565b0390f35b80809450527f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5635b8284106103e35750505081016020016103918261039d610381565b805460208587018101919091529093019281016103c8565b86955061039d9693506020925061039194915060ff191682840152151560051b8201019293610381565b80fd5b3461022d57602036600319011261022d57602061024d600435611426565b6001600160a01b0381160361022d57565b3461022d57604036600319011261022d5760043561047481610446565b60243590336000526004602052816104a28260406000209060018060a01b0316600052602052604060002090565b556040519182526001600160a01b03169033907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590602090a3602060405160018152f35b3461022d57602036600319011261022d57602061024d600435611462565b3461022d57600036600319011261022d576040517f0000000000000000000000008d352083f7094dc51cd7da8c5c0985ad6e1496296001600160a01b03168152602090f35b3461022d57600036600319011261022d576020600254604051908152f35b3461022d57606036600319011261022d5760043561058481610446565b60243561059081610446565b6001600160a01b038083166000818152600460209081526040808320338452909152902060443594919391929190546001810161063c575b506105f46000805160206123488339815191529360018060a01b03166000526003602052604060002090565b6105ff868254611497565b90556001600160a01b0381166000908152600360205260409020805486019055604051948552169280602081015b0390a360405160018152602090f35b85810390811161069957600080516020612348833981519152936105f4916106913361067a8460018060a01b03166000526004602052604060002090565b9060018060a01b0316600052602052604060002090565b5593506105c8565b611481565b3461022d57600036600319011261022d57602060405160ff7f0000000000000000000000000000000000000000000000000000000000000006168152f35b3461022d57600036600319011261022d57602061024d611539565b3461022d576000806003193601126104255780806107aa60405161071a816102be565b60018152602036818301376001600160a01b039061076c7f000000000000000000000000625e7708f30ca75bfd92586e17077590c60eb4cd831661075d83611813565b6001600160a01b039091169052565b60405194858094819363bb492bf560e01b83527f0000000000000000000000008d352083f7094dc51cd7da8c5c0985ad6e1496299060048401611941565b03927f000000000000000000000000929ec64c34a17401f460460d4b9390518e5b473e165af180156108475761080c61081d917fbacfa9662d479c707dae707c358323f0c7711ef382007957dc9935e629da36b2938591610823575b50611813565b516040519081529081906020820190565b0390a180f35b61083f91503d8087833e61083781836102da565b8101906118a1565b905038610806565b6114f0565b3461022d57600036600319011261022d576040517f0000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c316076001600160a01b03168152602090f35b3461022d57602036600319011261022d576108ad600435610446565b602061024d611d69565b3461022d57600036600319011261022d576040517f000000000000000000000000929ec64c34a17401f460460d4b9390518e5b473e6001600160a01b03168152602090f35b3461022d57604036600319011261022d5760043560243561091c81610446565b61092582611407565b9081156109bf57826109af9161096061039d9530337f0000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c3160761175e565b61096a84826116d5565b60408051838152602081018690526001600160a01b03929092169133917fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d791a3611a9b565b6040519081529081906020820190565b60405162461bcd60e51b815260206004820152600b60248201526a5a45524f5f53484152455360a81b6044820152606490fd5b3461022d57602036600319011261022d57600435610a0f81610446565b60018060a01b031660005260036020526020604060002054604051908152f35b3461022d57602036600319011261022d57600435610a4c81610446565b60018060a01b031660005260056020526020604060002054604051908152f35b3461022d5760408060031936011261022d5760043560243591610a8e83610446565b6044610a9983611444565b927f0000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c3160790610ac88530338561175e565b610ad281876116d5565b835185815260208101919091526001600160a01b039586169033907fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d790604090a3847f000000000000000000000000794a61358d6845594f94dc1db02a252b5b4814ad166020845163095ea7b360e01b8152826004820152866024820152600094859182865af13d15601f3d11600186511416171615610bee57803b15610bea57835163617ba03760e01b8152959091166001600160a01b03166004860152602485018490523060448601526000606486015284908183816084810103925af19283156108475761039d93610bd1575b50519081529081906020820190565b80610bde610be4926102a5565b80610222565b38610bc2565b8280fd5b835162461bcd60e51b815260206004820152600e60248201526d1054141493d59157d1905253115160921b6044820152606490fd5b3461022d576000806003193601126104255760405190806001805491610c4883610255565b808652928281169081156103fb5750600114610c6e5761039d85610391818703826102da565b92508083527fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf65b828410610cb05750505081016020016103918261039d610381565b80546020858701810191909152909301928101610c95565b3461022d57600036600319011261022d576040517f000000000000000000000000625e7708f30ca75bfd92586e17077590c60eb4cd6001600160a01b03168152602090f35b3461022d57600036600319011261022d576040517f000000000000000000000000794a61358d6845594f94dc1db02a252b5b4814ad6001600160a01b03168152602090f35b3461022d57604036600319011261022d57600435610d6f81610446565b602435903360005260036020526040600020805490838203918211610699575560018060a01b03169081600052600360205260406000208181540190556000805160206123488339815191526040518061062d3394829190602083019252565b3461022d57602036600319011261022d57602061024d600435611444565b606090600319011261022d5760043590602435610e0981610446565b90604435610e1681610446565b90565b3461022d57610ef16020610e2c36610ded565b610e37839493611462565b936001600160a01b039180831690610e5890879033849003610f66576119a6565b60408051838152602081018890528486169133917ffbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db9190a4604051631a4ca37b60e21b81526001600160a01b037f0000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c316078416811660048301526024820192909252921660448301529093849190829060009082906064820190565b03927f000000000000000000000000794a61358d6845594f94dc1db02a252b5b4814ad165af19182156108475761039d92610f38575b506040519081529081906020820190565b610f589060203d8111610f5f575b610f5081836102da565b810190611997565b5038610f27565b503d610f46565b6001600160a01b0381166000908152600460205260409020610f8990339061067a565b548260018201610f9b575b50506119a6565b610fa491611497565b6001600160a01b0382166000908152600460205260409020610fc790339061067a565b553882610f94565b3461022d576000610ef16020610fe436610ded565b93916001600160a01b03919082861690338290036110b0575b61101b8161100a81611426565b986110168a15156119f2565b6119a6565b6040805188815260208101929092528484169133917ffbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db91a4604051631a4ca37b60e21b81526001600160a01b037f0000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c3160784168116600483015260248201879052909116604482015294859283919082906064820190565b6001600160a01b03871660009081526004602052604090206110d390339061067a565b5481891982036110e5575b5050610ffd565b6110ee91611497565b6001600160a01b038816600090815260046020526040902061111190339061067a565b5538816110de565b3461022d57602036600319011261022d57611135600435610446565b602061024d611ef9565b3461022d57602036600319011261022d57602061024d600435611407565b3461022d57602036600319011261022d57602061024d60043561117f81610446565b612049565b3461022d5760e036600319011261022d576004356111a181610446565b602435906111ae82610446565b604435606435926084359360ff8516850361022d576112e16020916111d5428210156114a4565b6112a86112b46111e3611539565b92886112018160018060a01b03166000526005602052604060002090565b805460018101909155604080517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98a82019081526001600160a01b039485166020820152938b1691840191909152606083018b9052608083019190915260a08201929092528160c08201039161127f601f19938481018352826102da565b5190206040519384918883019687909160429261190160f01b8352600283015260228201520190565b039081018352826102da565b5190206040805191825260ff909716602082015260a4359681019690965260c43560608701526080860190565b856000968792838052039060015afa156108475783517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925916001600160a01b0391849061135e90839061067a906113448782168015159081611371575b506114fc565b6001600160a01b0316600090815260046020526040902090565b556040519384528116931691602090a380f35b9050888c16143861133e565b3461022d57602036600319011261022d57602061024d60043561139f81610446565b6121d0565b3461022d57604036600319011261022d5760206113fe6004356113c681610446565b602435906113d382610446565b60018060a01b03166000526004835260406000209060018060a01b0316600052602052604060002090565b54604051908152f35b60025480611413575090565b90610e1691611420611a2c565b9161171e565b60025480611432575090565b610e169161143e611a2c565b9061171e565b60025480611450575090565b610e169161145c611a2c565b90611736565b6002548061146e575090565b90610e169161147b611a2c565b91611736565b634e487b7160e01b600052601160045260246000fd5b9190820391821161069957565b156114ab57565b60405162461bcd60e51b815260206004820152601760248201527f5045524d49545f444541444c494e455f455850495245440000000000000000006044820152606490fd5b6040513d6000823e3d90fd5b1561150357565b60405162461bcd60e51b815260206004820152600e60248201526d24a72b20a624a22fa9a4a3a722a960911b6044820152606490fd5b6000467f000000000000000000000000000000000000000000000000000000000000000a0361158757507f3a4dc7fa874dea138ecf181abd5f6708627d3f3f388e04cdc53b5de5a60305fc90565b604051815491908161159884610255565b808352602094858401946001918783821691826000146116b0575050600114611658575b50505091816115d3611652936116449503826102da565b519020604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f95810195865260208601929092527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc69085015246606085015230608085015291829060a0850190565b03601f1981018352826102da565b51902090565b91908693508280527f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5635b82841061169b57505050820101816115d36116526115bc565b80548685018601528794909301928101611682565b60ff1916885293151560051b860190930193508492506115d3915061165290506115bc565b600254908282018092116106995760206000805160206123488339815191529160009360025560018060a01b0316938484526003825260408420818154019055604051908152a3565b8181029181830414901517821515161561022d570490565b9190918281029281840414901517811515161561022d57600190600019830104019015150290565b9060006064926020958295604051946323b872dd60e01b86526004860152602485015260448401525af13d15601f3d116001600051141617161561179e57565b60405162461bcd60e51b81526020600482015260146024820152731514905394d1915497d19493d357d1905253115160621b6044820152606490fd5b604051906101e0820182811067ffffffffffffffff8211176102b957604052565b67ffffffffffffffff81116102b95760051b60200190565b8051156118205760200190565b634e487b7160e01b600052603260045260246000fd5b519061184182610446565b565b81601f8201121561022d5780519161185a836117fb565b9261186860405194856102da565b808452602092838086019260051b82010192831161022d578301905b828210611892575050505090565b81518152908301908301611884565b91909160408184031261022d5780519267ffffffffffffffff9384811161022d5782019381601f8601121561022d5784516118db816117fb565b906118e960405192836102da565b808252602096878084019260051b8201019185831161022d5788809201905b83821061192857505050509483015190811161022d57610e169201611843565b828091835161193681610446565b815201910190611908565b9092919260408201604083528151809152606083019060208093019060005b8482821061197a57505050509360018060a01b0316910152565b83516001600160a01b031685529384019390920191600101611960565b9081602091031261022d575190565b6001600160a01b031660008181526003602052604090208054838103919082116106995760009360008051602061234883398151915292602092558060025403600255604051908152a3565b156119f957565b60405162461bcd60e51b815260206004820152600b60248201526a5a45524f5f41535345545360a81b6044820152606490fd5b6040516370a0823160e01b81523060048201526020816024817f000000000000000000000000625e7708f30ca75bfd92586e17077590c60eb4cd6001600160a01b03165afa90811561084757600091611a83575090565b610e16915060203d8111610f5f57610f5081836102da565b9060447f0000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c3160760018060a01b0393847f000000000000000000000000794a61358d6845594f94dc1db02a252b5b4814ad1690602060405163095ea7b360e01b8152836004820152826024820152600095869182875af13d15601f3d11600187511416171615611b8b57813b15611b875760405163617ba03760e01b8152959092166001600160a01b0316600486015260248501919091523060448501526000606485015291929182908183816084810103925af1801561084757611b7a5750565b80610bde611841926102a5565b8380fd5b60405162461bcd60e51b815260206004820152600e60248201526d1054141493d59157d1905253115160921b6044820152606490fd5b919082602091031261022d576040516020810181811067ffffffffffffffff8211176102b95760405291518252565b51906fffffffffffffffffffffffffffffffff8216820361022d57565b519064ffffffffff8216820361022d57565b519061ffff8216820361022d57565b6101e08183031261022d57611c4b611c446117da565b9282611bc1565b8252611c5960208201611bf0565b6020830152611c6a60408201611bf0565b6040830152611c7b60608201611bf0565b6060830152611c8c60808201611bf0565b6080830152611c9d60a08201611bf0565b60a0830152611cae60c08201611c0d565b60c0830152611cbf60e08201611c1f565b60e0830152610100611cd2818301611836565b90830152610120611ce4818301611836565b90830152610140611cf6818301611836565b90830152610160611d08818301611836565b90830152610180611d1a818301611bf0565b908301526101a0611d2c818301611bf0565b90830152611d3e6101c0809201611bf0565b9082015290565b60ff16604d811161069957600a0a90565b8181029291811591840414171561069957565b6040516335ea6a7560e01b81526001600160a01b037f0000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c3160781166004830152906101e09081816024817f000000000000000000000000794a61358d6845594f94dc1db02a252b5b4814ad87165afa91821561084757600092611ecc575b5050515190600160381b8216151580611ebe575b80611eb0575b15611ea957640fffffffff8260741c168015611ea057611e31602091611e2b60ff60049660301c16611d45565b90611d56565b91604051938480926318160ddd60e01b82527f000000000000000000000000625e7708f30ca75bfd92586e17077590c60eb4cd165afa90811561084757610e1692600092611e80575b50611497565b611e9991925060203d8111610f5f57610f5081836102da565b9038611e7a565b50505060001990565b5050600090565b506001603c1b821615611dfe565b50600160391b821615611df8565b611eeb9250803d10611ef2575b611ee381836102da565b810190611c2e565b3880611de4565b503d611ed9565b6040516335ea6a7560e01b81526001600160a01b037f0000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c3160781166004830152906101e09081816024817f000000000000000000000000794a61358d6845594f94dc1db02a252b5b4814ad87165afa9182156108475760009261202c575b50505151600160381b811615158061201e575b80612010575b15611ea957640fffffffff8160741c168015611ea057611fba602091611e2b60ff60049560301c16611d45565b92604051928380926318160ddd60e01b82527f000000000000000000000000625e7708f30ca75bfd92586e17077590c60eb4cd165afa801561084757610e169261200b92600092611e805750611497565b611407565b506001603c1b811615611f8d565b50600160391b811615611f87565b6120429250803d10611ef257611ee381836102da565b3880611f74565b6040516335ea6a7560e01b81526001600160a01b037f0000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c316078116600483018190529092916101e09081816024817f000000000000000000000000794a61358d6845594f94dc1db02a252b5b4814ad89165afa918215610847576000926121b3575b50505151600160381b8116151590816121a4575b501561219c576040516370a0823160e01b81527f000000000000000000000000625e7708f30ca75bfd92586e17077590c60eb4cd939093166001600160a01b03166004840152602090839081806024810103915afa91821561084757600092612174575b506001600160a01b03166000908152600360205260409020612163905b54611426565b8082101561216f575090565b905090565b61216391925061219461215d9160203d8111610f5f57610f5081836102da565b929150612140565b505050600090565b6001603c1b91501615386120dc565b6121c99250803d10611ef257611ee381836102da565b38806120c8565b6040516335ea6a7560e01b81526001600160a01b037f0000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c3160781166004830181905290916101e09081816024817f000000000000000000000000794a61358d6845594f94dc1db02a252b5b4814ad88165afa9182156108475760009261232a575b50505151600160381b81161515908161231b575b501561219c576040516370a0823160e01b81527f000000000000000000000000625e7708f30ca75bfd92586e17077590c60eb4cd929092166001600160a01b03166004830152602090829081806024810103915afa908115610847576122f0916122d4916000916122fd575b50611407565b6001600160a01b03909216600090815260036020526040902090565b548082101561216f575090565b612315915060203d8111610f5f57610f5081836102da565b386122ce565b6001603c1b9150161538612262565b6123409250803d10611ef257611ee381836102da565b388061224e56feddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa26469706673582212209a4978057029a35a44d06bfbd200af6b09f27351e2f212d7f9d86255060e9b4764736f6c63430008130033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c31607000000000000000000000000625e7708f30ca75bfd92586e17077590c60eb4cd000000000000000000000000794a61358d6845594f94dc1db02a252b5b4814ad0000000000000000000000008d352083f7094dc51cd7da8c5c0985ad6e149629000000000000000000000000929ec64c34a17401f460460d4b9390518e5b473e
-----Decoded View---------------
Arg [0] : asset_ (address): 0x7F5c764cBc14f9669B88837ca1490cCa17c31607
Arg [1] : aToken_ (address): 0x625E7708f30cA75bfd92586e17077590C60eb4cD
Arg [2] : lendingPool_ (address): 0x794a61358D6845594F94dc1DB02A252b5b4814aD
Arg [3] : rewardRecipient_ (address): 0x8d352083F7094dc51Cd7dA8c5C0985AD6e149629
Arg [4] : rewardsController_ (address): 0x929EC64c34a17401F460460D4B9390518E5B473e
-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 0000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c31607
Arg [1] : 000000000000000000000000625e7708f30ca75bfd92586e17077590c60eb4cd
Arg [2] : 000000000000000000000000794a61358d6845594f94dc1db02a252b5b4814ad
Arg [3] : 0000000000000000000000008d352083f7094dc51cd7da8c5c0985ad6e149629
Arg [4] : 000000000000000000000000929ec64c34a17401f460460d4b9390518e5b473e
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$431.85
Net Worth in ETH
0.191755
Token Allocations
AOPTUSDC
100.00%
Multichain Portfolio | 32 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|---|---|---|---|---|
| OP | 100.00% | $0.99979 | 431.9426 | $431.85 |
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.