Source Code
Overview
ETH Balance
0 ETH
More Info
ContractCreator
Multichain Info
N/A
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0x23c190Ca...04a036e29 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
AaveYieldAggregator
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 { IAavePool, IAaveGateway } from "contracts/interface/IAave.sol";
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import { IYieldAggregator } from "contracts/interface/IYieldAggregator.sol";
import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
/**
* @notice This contract is designed for Aave's ETH yield farming.
*/
contract AaveYieldAggregator is Ownable, IYieldAggregator {
using SafeERC20 for IERC20;
address public immutable MEST_FACTORY;
address public immutable WETH;
uint256 public yieldBuffer = 1e12;
IAavePool public immutable AAVE_POOL;
IAaveGateway public immutable AAVE_WETH_GATEWAY;
IERC20 public aWETH;
uint256 internal constant ACTIVE_MASK = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFF;
uint256 internal constant FROZEN_MASK = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDFFFFFFFFFFFFFF;
uint256 internal constant PAUSED_MASK = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFF;
constructor(address _mestFactory, address _weth, address _aavePool, address _aaveGateway) {
MEST_FACTORY = _mestFactory;
WETH = _weth;
AAVE_WETH_GATEWAY = IAaveGateway(_aaveGateway);
AAVE_POOL = IAavePool(_aavePool);
aWETH = IERC20(AAVE_POOL.getReserveData(WETH).aTokenAddress);
aWETH.safeApprove(address(AAVE_WETH_GATEWAY), type(uint256).max);
}
modifier onlyFactory() {
require(msg.sender == MEST_FACTORY, "Only factory");
_;
}
fallback() external payable { }
receive() external payable { }
/**
* @notice Updates the yield buffer, which is used to cover rounding errors during withdrawals and deposits.
* For more information, see: https://dev.pooltogether.com/protocol/reference/prize-vaults/PrizeVault#yieldbuffer
*/
function setYieldBuffer(uint256 newYieldBuffer) external onlyOwner {
yieldBuffer = newYieldBuffer;
}
/**
* @notice Deposits ETH into the Aave and mints aToken for the factory.
* Only callable by the factory contract.
*/
function yieldDeposit() external onlyFactory {
require(_checkAavePoolState(), "Aave paused");
uint256 ethAmount = address(this).balance;
if (ethAmount > 0) {
AAVE_WETH_GATEWAY.depositETH{ value: ethAmount }(address(AAVE_POOL), MEST_FACTORY, 0);
}
}
/**
* @notice Withdraws ETH from the Aave and transfers it to the factory.
* Only callable by the factory contract.
*/
function yieldWithdraw(uint256 amount) external onlyFactory {
require(_checkAavePoolState(), "Aave paused");
if (amount > 0) {
aWETH.safeTransferFrom(MEST_FACTORY, address(this), amount);
AAVE_WETH_GATEWAY.withdrawETH(address(AAVE_POOL), amount, MEST_FACTORY);
}
}
function yieldBalanceOf(address owner) external view returns (uint256 withdrawableETHAmount) {
return aWETH.balanceOf(owner);
}
function yieldToken() external view returns (address yieldTokenAddr) {
yieldTokenAddr = address(aWETH);
}
/**
* @notice Calculate the maximum yield that the owner can claim.
* @return maxClaimableETH max yield amount owner could get
*/
function yieldMaxClaimable(uint256 depositedETHAmount) external view returns (uint256 maxClaimableETH) {
uint256 withdrawableETHAmount = aWETH.balanceOf(MEST_FACTORY);
maxClaimableETH = (withdrawableETHAmount - depositedETHAmount) < yieldBuffer
? 0
: withdrawableETHAmount - depositedETHAmount - yieldBuffer;
}
/**
* @notice Check Aave pool state
* @return bool true if Aave pool is active, false otherwise
* @dev For more information, see: https://github.com/aave/aave-v3-core/blob/master/contracts/protocol/libraries/configuration/ReserveConfiguration.sol
*/
function _checkAavePoolState() internal view returns (bool) {
uint256 configData = AAVE_POOL.getReserveData(WETH).configuration.data;
if (!(_getActive(configData) && !_getFrozen(configData) && !_getPaused(configData))) {
return false;
}
return true;
}
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;
}
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.25;
interface IAavePool {
// https://docs.aave.com/developers/core-contracts/pool
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, 0 ⇒ no cap
//bit 116-151: supply cap in whole tokens, 0 ⇒ no cap
//bit 152-167: liquidation protocol fee
//bit 168-175: eMode category
//bit 176-211: unbacked mint cap in whole tokens, 0 ⇒ no cap
//bit 212-251: debt ceiling for isolation mode with decimals bit 252-255: unused
uint256 data;
}
struct ReserveData {
//stores the reserve configuration
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;
}
function getReserveData(address asset) external view returns (ReserveData memory);
}
interface IAaveGateway {
function withdrawETH(address, uint256 amount, address to) external;
function depositETH(address, address onBehalfOf, uint16 referralCode) external payable;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 amount) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.0;
import "../IERC20.sol";
import "../extensions/IERC20Permit.sol";
import "../../../utils/Address.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using Address for address;
/**
* @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
/**
* @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
* calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
*/
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/
function safeApprove(IERC20 token, address spender, uint256 value) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
/**
* @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 oldAllowance = token.allowance(address(this), spender);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));
}
/**
* @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));
}
}
/**
* @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
* to be set to zero before setting it to a non-zero value, such as USDT.
*/
function forceApprove(IERC20 token, address spender, uint256 value) internal {
bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);
if (!_callOptionalReturnBool(token, approvalCall)) {
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));
_callOptionalReturn(token, approvalCall);
}
}
/**
* @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.
* Revert on invalid signature.
*/
function safePermit(
IERC20Permit token,
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) internal {
uint256 nonceBefore = token.nonces(owner);
token.permit(owner, spender, value, deadline, v, r, s);
uint256 nonceAfter = token.nonces(owner);
require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*
* This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
*/
function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false
// and not revert is the subcall reverts.
(bool success, bytes memory returndata) = address(token).call(data);
return
success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));
}
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.25;
interface IYieldAggregator {
function yieldDeposit() external;
function yieldWithdraw(uint256 amount) external;
function yieldBalanceOf(address owner) external view returns (uint256 withdrawableETHAmount);
function yieldToken() external view returns (address);
function yieldMaxClaimable(uint256 depositedETHAmount) external view returns (uint256 maxClaimableETH);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. 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 {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.4) (token/ERC20/extensions/IERC20Permit.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
* need to send a transaction, and thus is not required to hold Ether at all.
*
* ==== Security Considerations
*
* There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
* expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
* considered as an intention to spend the allowance in any specific way. The second is that because permits have
* built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
* take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
* generally recommended is:
*
* ```solidity
* function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
* try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
* doThing(..., value);
* }
*
* function doThing(..., uint256 value) public {
* token.safeTransferFrom(msg.sender, address(this), value);
* ...
* }
* ```
*
* Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of
* `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also
* {SafeERC20-safeTransferFrom}).
*
* Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so
* contracts should have entry points that don't rely on permit.
*/
interface IERC20Permit {
/**
* @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
* given ``owner``'s signed approval.
*
* IMPORTANT: The same issues {IERC20-approve} has related to transaction
* ordering also apply here.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `deadline` must be a timestamp in the future.
* - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
* over the EIP712-formatted function arguments.
* - the signature must use ``owner``'s current nonce (see {nonces}).
*
* For more information on the signature format, see the
* https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
* section].
*
* CAUTION: See Security Considerations above.
*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
/**
* @dev Returns the current nonce for `owner`. This value must be
* included whenever a signature is generated for {permit}.
*
* Every successful call to {permit} increases ``owner``'s nonce by one. This
* prevents a signature from being used multiple times.
*/
function nonces(address owner) external view returns (uint256);
/**
* @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
*/
// solhint-disable-next-line func-name-mixedcase
function DOMAIN_SEPARATOR() external view returns (bytes32);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
*
* Furthermore, `isContract` will also return true if the target contract within
* the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
* which only has an effect at the end of a transaction.
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.4) (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}{
"remappings": [
"contracts/=contracts/",
"@openzeppelin/contracts/=node_modules/@openzeppelin/contracts/",
"solady/=node_modules/solady/src/",
"forge-std/=node_modules/forge-std/src/",
"ds-test/=node_modules/ds-test/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": false,
"libraries": {}
}Contract ABI
API[{"inputs":[{"internalType":"address","name":"_mestFactory","type":"address"},{"internalType":"address","name":"_weth","type":"address"},{"internalType":"address","name":"_aavePool","type":"address"},{"internalType":"address","name":"_aaveGateway","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[],"name":"AAVE_POOL","outputs":[{"internalType":"contract IAavePool","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"AAVE_WETH_GATEWAY","outputs":[{"internalType":"contract IAaveGateway","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MEST_FACTORY","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WETH","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"aWETH","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"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":"newYieldBuffer","type":"uint256"}],"name":"setYieldBuffer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"yieldBalanceOf","outputs":[{"internalType":"uint256","name":"withdrawableETHAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"yieldBuffer","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"yieldDeposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"depositedETHAmount","type":"uint256"}],"name":"yieldMaxClaimable","outputs":[{"internalType":"uint256","name":"maxClaimableETH","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"yieldToken","outputs":[{"internalType":"address","name":"yieldTokenAddr","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"yieldWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]Contract Creation Code
0x61010060405264e8d4a5100060015534801561001a57600080fd5b5060405161188a38038061188a83398101604081905261003991610519565b61004233610103565b6001600160a01b0384811660805283811660a081905282821660e05290831660c08190526040516335ea6a7560e01b81526004810192909252906335ea6a75906024016101e060405180830381865afa1580156100a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100c79190610631565b6101000151600280546001600160a01b0319166001600160a01b03909216918217905560e0516100fa9190600019610153565b50505050610809565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b8015806101cd5750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e90604401602060405180830381865afa1580156101a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101cb9190610754565b155b6102445760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527f20746f206e6f6e2d7a65726f20616c6c6f77616e63650000000000000000000060648201526084015b60405180910390fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b0390811663095ea7b360e01b1790915261029a91859161029f16565b505050565b6040805180820190915260208082527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564908201526000906102ec906001600160a01b03851690849061036c565b905080516000148061030d57508080602001905181019061030d919061076d565b61029a5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161023b565b606061037b8484600085610383565b949350505050565b6060824710156103e45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161023b565b600080866001600160a01b0316858760405161040091906107ba565b60006040518083038185875af1925050503d806000811461043d576040519150601f19603f3d011682016040523d82523d6000602084013e610442565b606091505b5090925090506104548783838761045f565b979650505050505050565b606083156104ce5782516000036104c7576001600160a01b0385163b6104c75760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161023b565b508161037b565b61037b83838151156104e35781518083602001fd5b8060405162461bcd60e51b815260040161023b91906107d6565b80516001600160a01b038116811461051457600080fd5b919050565b6000806000806080858703121561052f57600080fd5b610538856104fd565b9350610546602086016104fd565b9250610554604086016104fd565b9150610562606086016104fd565b905092959194509250565b6040516101e081016001600160401b038111828210171561059e57634e487b7160e01b600052604160045260246000fd5b60405290565b6000602082840312156105b657600080fd5b604051602081016001600160401b03811182821017156105e657634e487b7160e01b600052604160045260246000fd5b6040529151825250919050565b80516001600160801b038116811461051457600080fd5b805164ffffffffff8116811461051457600080fd5b805161ffff8116811461051457600080fd5b60006101e0828403121561064457600080fd5b61064c61056d565b61065684846105a4565b8152610664602084016105f3565b6020820152610675604084016105f3565b6040820152610686606084016105f3565b6060820152610697608084016105f3565b60808201526106a860a084016105f3565b60a08201526106b960c0840161060a565b60c08201526106ca60e0840161061f565b60e08201526101006106dd8185016104fd565b908201526101206106ef8482016104fd565b908201526101406107018482016104fd565b908201526101606107138482016104fd565b908201526101806107258482016105f3565b908201526101a06107378482016105f3565b908201526101c06107498482016105f3565b908201529392505050565b60006020828403121561076657600080fd5b5051919050565b60006020828403121561077f57600080fd5b8151801515811461078f57600080fd5b9392505050565b60005b838110156107b1578181015183820152602001610799565b50506000910152565b600082516107cc818460208701610796565b9190910192915050565b60208152600082518060208401526107f5816040850160208701610796565b601f01601f19169190910160400192915050565b60805160a05160c05160e051610ff561089560003960008181610221015281816105dd015261075b01526000818160fb0152818161058601528181610704015261092001526000818161025501526108f30152600081816102de0152818161033a0152818161048e01528181610549015281816105b501528181610648015261072c0152610ff56000f3fe6080604052600436106100e05760003560e01c80638da5cb5b11610084578063b6bd622811610056578063b6bd622814610297578063bb282e5c146102b7578063e1482b5d146102cc578063f2fde38b1461030057005b80638da5cb5b146101f15780639ab192301461020f578063ad5c464814610243578063b5d431bd1461027757005b80636d2a583a116100bd5780636d2a583a1461017e578063715018a61461019e57806376d5de85146101b35780638812ebc9146101d157005b806308a01675146100e957806313dc6c5d1461013a57806328e762dd1461015e57005b366100e757005b005b3480156100f557600080fd5b5061011d7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561014657600080fd5b5061015060015481565b604051908152602001610131565b34801561016a57600080fd5b50610150610179366004610ca3565b610320565b34801561018a57600080fd5b5060025461011d906001600160a01b031681565b3480156101aa57600080fd5b506100e76103ed565b3480156101bf57600080fd5b506002546001600160a01b031661011d565b3480156101dd57600080fd5b506101506101ec366004610cd1565b610401565b3480156101fd57600080fd5b506000546001600160a01b031661011d565b34801561021b57600080fd5b5061011d7f000000000000000000000000000000000000000000000000000000000000000081565b34801561024f57600080fd5b5061011d7f000000000000000000000000000000000000000000000000000000000000000081565b34801561028357600080fd5b506100e7610292366004610ca3565b610476565b3480156102a357600080fd5b506100e76102b2366004610ca3565b610483565b3480156102c357600080fd5b506100e761063d565b3480156102d857600080fd5b5061011d7f000000000000000000000000000000000000000000000000000000000000000081565b34801561030c57600080fd5b506100e761031b366004610cd1565b6107bc565b6002546040516370a0823160e01b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116600483015260009283929116906370a0823190602401602060405180830381865afa15801561038e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103b29190610cee565b6001549091506103c28483610d07565b106103e3576001546103d48483610d07565b6103de9190610d07565b6103e6565b60005b9392505050565b6103f5610832565b6103ff600061088c565b565b6002546040516370a0823160e01b81526001600160a01b03838116600483015260009216906370a0823190602401602060405180830381865afa15801561044c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104709190610cee565b92915050565b61047e610832565b600155565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146104ef5760405162461bcd60e51b815260206004820152600c60248201526b4f6e6c7920666163746f727960a01b60448201526064015b60405180910390fd5b6104f76108dc565b6105315760405162461bcd60e51b815260206004820152600b60248201526a10585d99481c185d5cd95960aa1b60448201526064016104e6565b801561063a5760025461056f906001600160a01b03167f000000000000000000000000000000000000000000000000000000000000000030846109d9565b604051630402806960e51b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166004830152602482018390527f0000000000000000000000000000000000000000000000000000000000000000811660448301527f000000000000000000000000000000000000000000000000000000000000000016906380500d2090606401600060405180830381600087803b15801561062157600080fd5b505af1158015610635573d6000803e3d6000fd5b505050505b50565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146106a45760405162461bcd60e51b815260206004820152600c60248201526b4f6e6c7920666163746f727960a01b60448201526064016104e6565b6106ac6108dc565b6106e65760405162461bcd60e51b815260206004820152600b60248201526a10585d99481c185d5cd95960aa1b60448201526064016104e6565b47801561063a5760405163474cf53d60e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811660048301527f000000000000000000000000000000000000000000000000000000000000000081166024830152600060448301527f0000000000000000000000000000000000000000000000000000000000000000169063474cf53d9083906064016000604051808303818588803b1580156107a057600080fd5b505af11580156107b4573d6000803e3d6000fd5b505050505050565b6107c4610832565b6001600160a01b0381166108295760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104e6565b61063a8161088c565b6000546001600160a01b031633146103ff5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104e6565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6040516335ea6a7560e01b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116600483015260009182917f000000000000000000000000000000000000000000000000000000000000000016906335ea6a75906024016101e060405180830381865afa158015610968573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061098c9190610e07565b515190506701000000000000008116151580156109b157506702000000000000008116155b80156109c557506710000000000000008116155b6109d157600091505090565b600191505090565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052610a33908590610a39565b50505050565b6000610a8e826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610b139092919063ffffffff16565b9050805160001480610aaf575080806020019051810190610aaf9190610f2a565b610b0e5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016104e6565b505050565b6060610b228484600085610b2a565b949350505050565b606082471015610b8b5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016104e6565b600080866001600160a01b03168587604051610ba79190610f70565b60006040518083038185875af1925050503d8060008114610be4576040519150601f19603f3d011682016040523d82523d6000602084013e610be9565b606091505b5091509150610bfa87838387610c05565b979650505050505050565b60608315610c74578251600003610c6d576001600160a01b0385163b610c6d5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016104e6565b5081610b22565b610b228383815115610c895781518083602001fd5b8060405162461bcd60e51b81526004016104e69190610f8c565b600060208284031215610cb557600080fd5b5035919050565b6001600160a01b038116811461063a57600080fd5b600060208284031215610ce357600080fd5b81356103e681610cbc565b600060208284031215610d0057600080fd5b5051919050565b8181038181111561047057634e487b7160e01b600052601160045260246000fd5b6040516101e0810167ffffffffffffffff81118282101715610d5a57634e487b7160e01b600052604160045260246000fd5b60405290565b600060208284031215610d7257600080fd5b6040516020810181811067ffffffffffffffff82111715610da357634e487b7160e01b600052604160045260246000fd5b6040529151825250919050565b80516fffffffffffffffffffffffffffffffff81168114610dd057600080fd5b919050565b805164ffffffffff81168114610dd057600080fd5b805161ffff81168114610dd057600080fd5b8051610dd081610cbc565b60006101e08284031215610e1a57600080fd5b610e22610d28565b610e2c8484610d60565b8152610e3a60208401610db0565b6020820152610e4b60408401610db0565b6040820152610e5c60608401610db0565b6060820152610e6d60808401610db0565b6080820152610e7e60a08401610db0565b60a0820152610e8f60c08401610dd5565b60c0820152610ea060e08401610dea565b60e0820152610100610eb3818501610dfc565b90820152610120610ec5848201610dfc565b90820152610140610ed7848201610dfc565b90820152610160610ee9848201610dfc565b90820152610180610efb848201610db0565b908201526101a0610f0d848201610db0565b908201526101c0610f1f848201610db0565b908201529392505050565b600060208284031215610f3c57600080fd5b815180151581146103e657600080fd5b60005b83811015610f67578181015183820152602001610f4f565b50506000910152565b60008251610f82818460208701610f4c565b9190910192915050565b6020815260008251806020840152610fab816040850160208701610f4c565b601f01601f1916919091016040019291505056fea2646970667358221220f45d7e8545b9bad61323dc03b4c30de99437c0f0753f7589c307c662dd17fe6064736f6c6343000819003300000000000000000000000026c6f7fa1fe03193d1fb759aac5bda8e4b5fb4f80000000000000000000000004200000000000000000000000000000000000006000000000000000000000000b50201558b00496a145fe76f7424749556e326d8000000000000000000000000589750ba8af186ce5b55391b0b7148cad43a1619
Deployed Bytecode
0x6080604052600436106100e05760003560e01c80638da5cb5b11610084578063b6bd622811610056578063b6bd622814610297578063bb282e5c146102b7578063e1482b5d146102cc578063f2fde38b1461030057005b80638da5cb5b146101f15780639ab192301461020f578063ad5c464814610243578063b5d431bd1461027757005b80636d2a583a116100bd5780636d2a583a1461017e578063715018a61461019e57806376d5de85146101b35780638812ebc9146101d157005b806308a01675146100e957806313dc6c5d1461013a57806328e762dd1461015e57005b366100e757005b005b3480156100f557600080fd5b5061011d7f000000000000000000000000b50201558b00496a145fe76f7424749556e326d881565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561014657600080fd5b5061015060015481565b604051908152602001610131565b34801561016a57600080fd5b50610150610179366004610ca3565b610320565b34801561018a57600080fd5b5060025461011d906001600160a01b031681565b3480156101aa57600080fd5b506100e76103ed565b3480156101bf57600080fd5b506002546001600160a01b031661011d565b3480156101dd57600080fd5b506101506101ec366004610cd1565b610401565b3480156101fd57600080fd5b506000546001600160a01b031661011d565b34801561021b57600080fd5b5061011d7f000000000000000000000000589750ba8af186ce5b55391b0b7148cad43a161981565b34801561024f57600080fd5b5061011d7f000000000000000000000000420000000000000000000000000000000000000681565b34801561028357600080fd5b506100e7610292366004610ca3565b610476565b3480156102a357600080fd5b506100e76102b2366004610ca3565b610483565b3480156102c357600080fd5b506100e761063d565b3480156102d857600080fd5b5061011d7f00000000000000000000000026c6f7fa1fe03193d1fb759aac5bda8e4b5fb4f881565b34801561030c57600080fd5b506100e761031b366004610cd1565b6107bc565b6002546040516370a0823160e01b81526001600160a01b037f00000000000000000000000026c6f7fa1fe03193d1fb759aac5bda8e4b5fb4f88116600483015260009283929116906370a0823190602401602060405180830381865afa15801561038e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103b29190610cee565b6001549091506103c28483610d07565b106103e3576001546103d48483610d07565b6103de9190610d07565b6103e6565b60005b9392505050565b6103f5610832565b6103ff600061088c565b565b6002546040516370a0823160e01b81526001600160a01b03838116600483015260009216906370a0823190602401602060405180830381865afa15801561044c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104709190610cee565b92915050565b61047e610832565b600155565b336001600160a01b037f00000000000000000000000026c6f7fa1fe03193d1fb759aac5bda8e4b5fb4f816146104ef5760405162461bcd60e51b815260206004820152600c60248201526b4f6e6c7920666163746f727960a01b60448201526064015b60405180910390fd5b6104f76108dc565b6105315760405162461bcd60e51b815260206004820152600b60248201526a10585d99481c185d5cd95960aa1b60448201526064016104e6565b801561063a5760025461056f906001600160a01b03167f00000000000000000000000026c6f7fa1fe03193d1fb759aac5bda8e4b5fb4f830846109d9565b604051630402806960e51b81526001600160a01b037f000000000000000000000000b50201558b00496a145fe76f7424749556e326d881166004830152602482018390527f00000000000000000000000026c6f7fa1fe03193d1fb759aac5bda8e4b5fb4f8811660448301527f000000000000000000000000589750ba8af186ce5b55391b0b7148cad43a161916906380500d2090606401600060405180830381600087803b15801561062157600080fd5b505af1158015610635573d6000803e3d6000fd5b505050505b50565b336001600160a01b037f00000000000000000000000026c6f7fa1fe03193d1fb759aac5bda8e4b5fb4f816146106a45760405162461bcd60e51b815260206004820152600c60248201526b4f6e6c7920666163746f727960a01b60448201526064016104e6565b6106ac6108dc565b6106e65760405162461bcd60e51b815260206004820152600b60248201526a10585d99481c185d5cd95960aa1b60448201526064016104e6565b47801561063a5760405163474cf53d60e01b81526001600160a01b037f000000000000000000000000b50201558b00496a145fe76f7424749556e326d8811660048301527f00000000000000000000000026c6f7fa1fe03193d1fb759aac5bda8e4b5fb4f881166024830152600060448301527f000000000000000000000000589750ba8af186ce5b55391b0b7148cad43a1619169063474cf53d9083906064016000604051808303818588803b1580156107a057600080fd5b505af11580156107b4573d6000803e3d6000fd5b505050505050565b6107c4610832565b6001600160a01b0381166108295760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104e6565b61063a8161088c565b6000546001600160a01b031633146103ff5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104e6565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6040516335ea6a7560e01b81526001600160a01b037f00000000000000000000000042000000000000000000000000000000000000068116600483015260009182917f000000000000000000000000b50201558b00496a145fe76f7424749556e326d816906335ea6a75906024016101e060405180830381865afa158015610968573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061098c9190610e07565b515190506701000000000000008116151580156109b157506702000000000000008116155b80156109c557506710000000000000008116155b6109d157600091505090565b600191505090565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052610a33908590610a39565b50505050565b6000610a8e826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610b139092919063ffffffff16565b9050805160001480610aaf575080806020019051810190610aaf9190610f2a565b610b0e5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016104e6565b505050565b6060610b228484600085610b2a565b949350505050565b606082471015610b8b5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016104e6565b600080866001600160a01b03168587604051610ba79190610f70565b60006040518083038185875af1925050503d8060008114610be4576040519150601f19603f3d011682016040523d82523d6000602084013e610be9565b606091505b5091509150610bfa87838387610c05565b979650505050505050565b60608315610c74578251600003610c6d576001600160a01b0385163b610c6d5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016104e6565b5081610b22565b610b228383815115610c895781518083602001fd5b8060405162461bcd60e51b81526004016104e69190610f8c565b600060208284031215610cb557600080fd5b5035919050565b6001600160a01b038116811461063a57600080fd5b600060208284031215610ce357600080fd5b81356103e681610cbc565b600060208284031215610d0057600080fd5b5051919050565b8181038181111561047057634e487b7160e01b600052601160045260246000fd5b6040516101e0810167ffffffffffffffff81118282101715610d5a57634e487b7160e01b600052604160045260246000fd5b60405290565b600060208284031215610d7257600080fd5b6040516020810181811067ffffffffffffffff82111715610da357634e487b7160e01b600052604160045260246000fd5b6040529151825250919050565b80516fffffffffffffffffffffffffffffffff81168114610dd057600080fd5b919050565b805164ffffffffff81168114610dd057600080fd5b805161ffff81168114610dd057600080fd5b8051610dd081610cbc565b60006101e08284031215610e1a57600080fd5b610e22610d28565b610e2c8484610d60565b8152610e3a60208401610db0565b6020820152610e4b60408401610db0565b6040820152610e5c60608401610db0565b6060820152610e6d60808401610db0565b6080820152610e7e60a08401610db0565b60a0820152610e8f60c08401610dd5565b60c0820152610ea060e08401610dea565b60e0820152610100610eb3818501610dfc565b90820152610120610ec5848201610dfc565b90820152610140610ed7848201610dfc565b90820152610160610ee9848201610dfc565b90820152610180610efb848201610db0565b908201526101a0610f0d848201610db0565b908201526101c0610f1f848201610db0565b908201529392505050565b600060208284031215610f3c57600080fd5b815180151581146103e657600080fd5b60005b83811015610f67578181015183820152602001610f4f565b50506000910152565b60008251610f82818460208701610f4c565b9190910192915050565b6020815260008251806020840152610fab816040850160208701610f4c565b601f01601f1916919091016040019291505056fea2646970667358221220f45d7e8545b9bad61323dc03b4c30de99437c0f0753f7589c307c662dd17fe6064736f6c63430008190033
Loading...
Loading
Loading...
Loading
Loading...
Loading
Loading...
Loading
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.