ETH Price: $3,317.08 (+6.57%)
Gas: 5 Gwei

Contract

0x96F68837877fd0414B55050c9e794AECdBcfCA59
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Value
Approve179240912023-08-16 1:23:47256 days ago1692149027IN
0x96F68837...CdBcfCA59
0 ETH0.0008249317.79841963
Approve175401542023-06-23 5:18:47310 days ago1687497527IN
0x96F68837...CdBcfCA59
0 ETH0.0006263413.45452641
Transfer174790632023-06-14 15:27:11318 days ago1686756431IN
0x96F68837...CdBcfCA59
0 ETH0.0011541636
Permit169870132023-04-06 3:36:23388 days ago1680752183IN
0x96F68837...CdBcfCA59
0 ETH0.000919928.32490479
Permit169841422023-04-05 17:48:11388 days ago1680716891IN
0x96F68837...CdBcfCA59
0 ETH0.0011509635.43953924
Permit169778102023-04-04 20:15:35389 days ago1680639335IN
0x96F68837...CdBcfCA59
0 ETH0.001356341.79291192
Permit169777962023-04-04 20:12:47389 days ago1680639167IN
0x96F68837...CdBcfCA59
0 ETH0.0013884842.76865199
Permit169777462023-04-04 20:02:47389 days ago1680638567IN
0x96F68837...CdBcfCA59
0 ETH0.001599949.2627904
0x60806040166428362023-02-16 17:39:11436 days ago1676569151IN
 Create: AaveTokenV2
0 ETH0.0760321836.02603357

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
AaveTokenV2

Compiler Version
v0.7.5+commit.eb77ed08

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 1 : AaveTokenV2.sol
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.5;
pragma experimental ABIEncoderV2;


interface IGovernancePowerDelegationToken {
  
  enum DelegationType {VOTING_POWER, PROPOSITION_POWER}

  /**
   * @dev emitted when a user delegates to another
   * @param delegator the delegator
   * @param delegatee the delegatee
   * @param delegationType the type of delegation (VOTING_POWER, PROPOSITION_POWER)
   **/
  event DelegateChanged(
    address indexed delegator,
    address indexed delegatee,
    DelegationType delegationType
  );

  /**
   * @dev emitted when an action changes the delegated power of a user
   * @param user the user which delegated power has changed
   * @param amount the amount of delegated power for the user
   * @param delegationType the type of delegation (VOTING_POWER, PROPOSITION_POWER)
   **/
  event DelegatedPowerChanged(address indexed user, uint256 amount, DelegationType delegationType);

  /**
   * @dev delegates the specific power to a delegatee
   * @param delegatee the user which delegated power has changed
   * @param delegationType the type of delegation (VOTING_POWER, PROPOSITION_POWER)
   **/
  function delegateByType(address delegatee, DelegationType delegationType) external virtual;
  /**
   * @dev delegates all the powers to a specific user
   * @param delegatee the user to which the power will be delegated
   **/
  function delegate(address delegatee) external virtual;
  /**
   * @dev returns the delegatee of an user
   * @param delegator the address of the delegator
   **/
  function getDelegateeByType(address delegator, DelegationType delegationType)
    external
    virtual
    view
    returns (address);

  /**
   * @dev returns the current delegated power of a user. The current power is the
   * power delegated at the time of the last snapshot
   * @param user the user
   **/
  function getPowerCurrent(address user, DelegationType delegationType)
    external
    virtual
    view
    returns (uint256);

  /**
   * @dev returns the delegated power of a user at a certain block
   * @param user the user
   **/
  function getPowerAtBlock(
    address user,
    uint256 blockNumber,
    DelegationType delegationType
  ) external virtual view returns (uint256);
 
  /**
  * @dev returns the total supply at a certain block number
  **/
  function totalSupplyAt(uint256 blockNumber) external virtual view returns (uint256);
}

/**
 * @dev From https://github.com/OpenZeppelin/openzeppelin-contracts
 * 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 GSN 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 payable) {
    return msg.sender;
  }

  function _msgData() internal view virtual returns (bytes memory) {
    this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
    return msg.data;
  }
}


/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 * From https://github.com/OpenZeppelin/openzeppelin-contracts
 */
interface IERC20 {
  /**
   * @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 `recipient`.
   *
   * Returns a boolean value indicating whether the operation succeeded.
   *
   * Emits a {Transfer} event.
   */
  function transfer(address recipient, 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 `sender` to `recipient` 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 sender,
    address recipient,
    uint256 amount
  ) external returns (bool);

  /**
   * @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 From https://github.com/OpenZeppelin/openzeppelin-contracts
 * Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
  /**
   * @dev Returns the addition of two unsigned integers, reverting on
   * overflow.
   *
   * Counterpart to Solidity's `+` operator.
   *
   * Requirements:
   * - Addition cannot overflow.
   */
  function add(uint256 a, uint256 b) internal pure returns (uint256) {
    uint256 c = a + b;
    require(c >= a, 'SafeMath: addition overflow');

    return c;
  }

  /**
   * @dev Returns the subtraction of two unsigned integers, reverting on
   * overflow (when the result is negative).
   *
   * Counterpart to Solidity's `-` operator.
   *
   * Requirements:
   * - Subtraction cannot overflow.
   */
  function sub(uint256 a, uint256 b) internal pure returns (uint256) {
    return sub(a, b, 'SafeMath: subtraction overflow');
  }

  /**
   * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
   * overflow (when the result is negative).
   *
   * Counterpart to Solidity's `-` operator.
   *
   * Requirements:
   * - Subtraction cannot overflow.
   */
  function sub(
    uint256 a,
    uint256 b,
    string memory errorMessage
  ) internal pure returns (uint256) {
    require(b <= a, errorMessage);
    uint256 c = a - b;

    return c;
  }

  /**
   * @dev Returns the multiplication of two unsigned integers, reverting on
   * overflow.
   *
   * Counterpart to Solidity's `*` operator.
   *
   * Requirements:
   * - Multiplication cannot overflow.
   */
  function mul(uint256 a, uint256 b) internal pure returns (uint256) {
    // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
    // benefit is lost if 'b' is also tested.
    // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
    if (a == 0) {
      return 0;
    }

    uint256 c = a * b;
    require(c / a == b, 'SafeMath: multiplication overflow');

    return c;
  }

  /**
   * @dev Returns the integer division of two unsigned integers. Reverts on
   * division by zero. The result is rounded towards zero.
   *
   * Counterpart to Solidity's `/` operator. Note: this function uses a
   * `revert` opcode (which leaves remaining gas untouched) while Solidity
   * uses an invalid opcode to revert (consuming all remaining gas).
   *
   * Requirements:
   * - The divisor cannot be zero.
   */
  function div(uint256 a, uint256 b) internal pure returns (uint256) {
    return div(a, b, 'SafeMath: division by zero');
  }

  /**
   * @dev Returns the integer division of two unsigned integers. Reverts with custom message on
   * division by zero. The result is rounded towards zero.
   *
   * Counterpart to Solidity's `/` operator. Note: this function uses a
   * `revert` opcode (which leaves remaining gas untouched) while Solidity
   * uses an invalid opcode to revert (consuming all remaining gas).
   *
   * Requirements:
   * - The divisor cannot be zero.
   */
  function div(
    uint256 a,
    uint256 b,
    string memory errorMessage
  ) internal pure returns (uint256) {
    // Solidity only automatically asserts when dividing by 0
    require(b > 0, errorMessage);
    uint256 c = a / b;
    // assert(a == b * c + a % b); // There is no case in which this doesn't hold

    return c;
  }

  /**
   * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
   * Reverts when dividing by zero.
   *
   * Counterpart to Solidity's `%` operator. This function uses a `revert`
   * opcode (which leaves remaining gas untouched) while Solidity uses an
   * invalid opcode to revert (consuming all remaining gas).
   *
   * Requirements:
   * - The divisor cannot be zero.
   */
  function mod(uint256 a, uint256 b) internal pure returns (uint256) {
    return mod(a, b, 'SafeMath: modulo by zero');
  }

  /**
   * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
   * Reverts with custom message when dividing by zero.
   *
   * Counterpart to Solidity's `%` operator. This function uses a `revert`
   * opcode (which leaves remaining gas untouched) while Solidity uses an
   * invalid opcode to revert (consuming all remaining gas).
   *
   * Requirements:
   * - The divisor cannot be zero.
   */
  function mod(
    uint256 a,
    uint256 b,
    string memory errorMessage
  ) internal pure returns (uint256) {
    require(b != 0, errorMessage);
    return a % b;
  }
}



/**
 * @dev Collection of functions related to the address type
 * From https://github.com/OpenZeppelin/openzeppelin-contracts
 */
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
   * ====
   */
  function isContract(address account) internal view returns (bool) {
    // According to EIP-1052, 0x0 is the value returned for not-yet created accounts
    // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
    // for accounts without code, i.e. `keccak256('')`
    bytes32 codehash;
    bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
    // solhint-disable-next-line no-inline-assembly
    assembly {
      codehash := extcodehash(account)
    }
    return (codehash != accountHash && codehash != 0x0);
  }

  /**
   * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
   * `recipient`, forwarding all available gas and reverting on errors.
   *
   * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
   * of certain opcodes, possibly making contracts go over the 2300 gas limit
   * imposed by `transfer`, making them unable to receive funds via
   * `transfer`. {sendValue} removes this limitation.
   *
   * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
   *
   * IMPORTANT: because control is transferred to `recipient`, care must be
   * taken to not create reentrancy vulnerabilities. Consider using
   * {ReentrancyGuard} or the
   * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
   */
  function sendValue(address payable recipient, uint256 amount) internal {
    require(address(this).balance >= amount, 'Address: insufficient balance');

    // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
    (bool success, ) = recipient.call{value: amount}('');
    require(success, 'Address: unable to send value, recipient may have reverted');
  }
}

/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 * For a generic mechanism see {ERC20PresetMinterPauser}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * We have followed general OpenZeppelin guidelines: functions revert instead
 * of returning `false` on failure. This behavior is nonetheless conventional
 * and does not conflict with the expectations of ERC20 applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 *
 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See {IERC20-approve}.
 */
contract ERC20 is Context, IERC20 {
    using SafeMath for uint256;
    using Address for address;

    mapping (address => uint256) private _balances;

    mapping (address => mapping (address => uint256)) private _allowances;

    uint256 private _totalSupply;

    string internal _name;
    string internal _symbol;
    uint8 private _decimals;

    /**
     * @dev Sets the values for {name} and {symbol}, initializes {decimals} with
     * a default value of 18.
     *
     * To select a different value for {decimals}, use {_setupDecimals}.
     *
     * All three of these values are immutable: they can only be set once during
     * construction.
     */
    constructor (string memory name, string memory symbol) public {
        _name = name;
        _symbol = symbol;
        _decimals = 18;
    }

    /**
     * @dev Returns the name of the token.
     */
    function name() public view returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5,05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei. This is the value {ERC20} uses, unless {_setupDecimals} is
     * called.
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() public view returns (uint8) {
        return _decimals;
    }

    /**
     * @dev See {IERC20-totalSupply}.
     */
    function totalSupply() public view override returns (uint256) {
        return _totalSupply;
    }

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view override returns (uint256) {
        return _balances[account];
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `recipient` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
        _transfer(_msgSender(), recipient, amount);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) public view virtual override returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        _approve(_msgSender(), spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20};
     *
     * Requirements:
     * - `sender` and `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     * - the caller must have allowance for ``sender``'s tokens of at least
     * `amount`.
     */
    function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
        _transfer(sender, recipient, amount);
        _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
        return true;
    }

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
        return true;
    }

    /**
     * @dev Moves tokens `amount` from `sender` to `recipient`.
     *
     * This is internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * Requirements:
     *
     * - `sender` cannot be the zero address.
     * - `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     */
    function _transfer(address sender, address recipient, uint256 amount) internal virtual {
        require(sender != address(0), "ERC20: transfer from the zero address");
        require(recipient != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(sender, recipient, amount);

        _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
        _balances[recipient] = _balances[recipient].add(amount);
        emit Transfer(sender, recipient, amount);
    }

    /** @dev Creates `amount` tokens and assigns them to `account`, increasing
     * the total supply.
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * Requirements
     *
     * - `to` cannot be the zero address.
     */
    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");

        _beforeTokenTransfer(address(0), account, amount);

        _totalSupply = _totalSupply.add(amount);
        _balances[account] = _balances[account].add(amount);
        emit Transfer(address(0), account, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, reducing the
     * total supply.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * Requirements
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens.
     */
    function _burn(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: burn from the zero address");

        _beforeTokenTransfer(account, address(0), amount);

        _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
        _totalSupply = _totalSupply.sub(amount);
        emit Transfer(account, address(0), amount);
    }

    /**
     * @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens.
     *
     * This is internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     */
    function _approve(address owner, address spender, uint256 amount) internal virtual {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

    /**
     * @dev Sets {decimals} to a value other than the default one of 18.
     *
     * WARNING: This function should only be called from the constructor. Most
     * applications that interact with token contracts will not expect
     * {decimals} to ever change, and may work incorrectly if it does.
     */
    function _setupDecimals(uint8 decimals_) internal {
        _decimals = decimals_;
    }

    /**
     * @dev Hook that is called before any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * will be to transferred to `to`.
     * - when `from` is zero, `amount` tokens will be minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
}

interface ITransferHook {
  function onTransfer(
    address from,
    address to,
    uint256 amount
  ) external;
}


/**
 * @title SafeERC20
 * @dev From https://github.com/OpenZeppelin/openzeppelin-contracts
 * 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 SafeMath for uint256;
  using Address for address;

  function safeTransfer(
    IERC20 token,
    address to,
    uint256 value
  ) internal {
    callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
  }

  function safeTransferFrom(
    IERC20 token,
    address from,
    address to,
    uint256 value
  ) internal {
    callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
  }

  function safeApprove(
    IERC20 token,
    address spender,
    uint256 value
  ) internal {
    require(
      (value == 0) || (token.allowance(address(this), spender) == 0),
      'SafeERC20: approve from non-zero to non-zero allowance'
    );
    callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
  }

  function callOptionalReturn(IERC20 token, bytes memory data) private {
    require(address(token).isContract(), 'SafeERC20: call to non-contract');

    // solhint-disable-next-line avoid-low-level-calls
    (bool success, bytes memory returndata) = address(token).call(data);
    require(success, 'SafeERC20: low-level call failed');

    if (returndata.length > 0) {
      // Return data is optional
      // solhint-disable-next-line max-line-length
      require(abi.decode(returndata, (bool)), 'SafeERC20: ERC20 operation did not succeed');
    }
  }
}

/**
 * @title VersionedInitializable
 *
 * @dev Helper contract to support initializer functions. To use it, replace
 * the constructor with a function that has the `initializer` modifier.
 * WARNING: Unlike constructors, initializer functions must be manually
 * invoked. This applies both to deploying an Initializable contract, as well
 * as extending an Initializable contract via inheritance.
 * WARNING: When used with inheritance, manual care must be taken to not invoke
 * a parent initializer twice, or ensure that all initializers are idempotent,
 * because this is not dealt with automatically as with constructors.
 *
 * @author Aave, inspired by the OpenZeppelin Initializable contract
 */
abstract contract VersionedInitializable {
  /**
   * @dev Indicates that the contract has been initialized.
   */
  uint256 internal lastInitializedRevision = 0;

  /**
   * @dev Modifier to use in the initializer function of a contract.
   */
  modifier initializer() {
    uint256 revision = getRevision();
    require(revision > lastInitializedRevision, 'Contract instance has already been initialized');

    lastInitializedRevision = revision;

    _;
  }

  /// @dev returns the revision number of the contract.
  /// Needs to be defined in the inherited class as a constant.
  function getRevision() internal pure virtual returns (uint256);

  // Reserved storage space to allow for layout changes in the future.
  uint256[50] private ______gap;
}




/**
 * @notice implementation of the AAVE token contract
 * @author Aave
 */
abstract contract GovernancePowerDelegationERC20 is ERC20, IGovernancePowerDelegationToken {
  using SafeMath for uint256;
  /// @notice The EIP-712 typehash for the delegation struct used by the contract
  bytes32 public constant DELEGATE_BY_TYPE_TYPEHASH = keccak256(
    'DelegateByType(address delegatee,uint256 type,uint256 nonce,uint256 expiry)'
  );

  bytes32 public constant DELEGATE_TYPEHASH = keccak256(
    'Delegate(address delegatee,uint256 nonce,uint256 expiry)'
  );

  /// @dev snapshot of a value on a specific block, used for votes
  struct Snapshot {
    uint128 blockNumber;
    uint128 value;
  }

  /**
   * @dev delegates one specific power to a delegatee
   * @param delegatee the user which delegated power has changed
   * @param delegationType the type of delegation (VOTING_POWER, PROPOSITION_POWER)
   **/
  function delegateByType(address delegatee, DelegationType delegationType) external override {
    _delegateByType(msg.sender, delegatee, delegationType);
  }

  /**
   * @dev delegates all the powers to a specific user
   * @param delegatee the user to which the power will be delegated
   **/
  function delegate(address delegatee) external override {
    _delegateByType(msg.sender, delegatee, DelegationType.VOTING_POWER);
    _delegateByType(msg.sender, delegatee, DelegationType.PROPOSITION_POWER);
  }

  /**
   * @dev returns the delegatee of an user
   * @param delegator the address of the delegator
   **/
  function getDelegateeByType(address delegator, DelegationType delegationType)
    external
    override
    view
    returns (address)
  {
    (, , mapping(address => address) storage delegates) = _getDelegationDataByType(delegationType);

    return _getDelegatee(delegator, delegates);
  }

  /**
   * @dev returns the current delegated power of a user. The current power is the
   * power delegated at the time of the last snapshot
   * @param user the user
   **/
  function getPowerCurrent(address user, DelegationType delegationType)
    external
    override
    view
    returns (uint256)
  {
    (
      mapping(address => mapping(uint256 => Snapshot)) storage snapshots,
      mapping(address => uint256) storage snapshotsCounts,

    ) = _getDelegationDataByType(delegationType);

    return _searchByBlockNumber(snapshots, snapshotsCounts, user, block.number);
  }

  /**
   * @dev returns the delegated power of a user at a certain block
   * @param user the user
   **/
  function getPowerAtBlock(
    address user,
    uint256 blockNumber,
    DelegationType delegationType
  ) external override view returns (uint256) {
    (
      mapping(address => mapping(uint256 => Snapshot)) storage snapshots,
      mapping(address => uint256) storage snapshotsCounts,

    ) = _getDelegationDataByType(delegationType);

    return _searchByBlockNumber(snapshots, snapshotsCounts, user, blockNumber);
  }

  /**
   * @dev returns the total supply at a certain block number
   * used by the voting strategy contracts to calculate the total votes needed for threshold/quorum
   * In this initial implementation with no AAVE minting, simply returns the current supply
   * A snapshots mapping will need to be added in case a mint function is added to the AAVE token in the future
   **/
  function totalSupplyAt(uint256 blockNumber) external override view returns (uint256) {
    return super.totalSupply();
  }

  /**
   * @dev delegates the specific power to a delegatee
   * @param delegatee the user which delegated power has changed
   * @param delegationType the type of delegation (VOTING_POWER, PROPOSITION_POWER)
   **/
  function _delegateByType(
    address delegator,
    address delegatee,
    DelegationType delegationType
  ) internal {
    require(delegatee != address(0), 'INVALID_DELEGATEE');

    (, , mapping(address => address) storage delegates) = _getDelegationDataByType(delegationType);

    uint256 delegatorBalance = balanceOf(delegator);

    address previousDelegatee = _getDelegatee(delegator, delegates);

    delegates[delegator] = delegatee;

    _moveDelegatesByType(previousDelegatee, delegatee, delegatorBalance, delegationType);
    emit DelegateChanged(delegator, delegatee, delegationType);
  }

  /**
   * @dev moves delegated power from one user to another
   * @param from the user from which delegated power is moved
   * @param to the user that will receive the delegated power
   * @param amount the amount of delegated power to be moved
   * @param delegationType the type of delegation (VOTING_POWER, PROPOSITION_POWER)
   **/
  function _moveDelegatesByType(
    address from,
    address to,
    uint256 amount,
    DelegationType delegationType
  ) internal {
    if (from == to) {
      return;
    }

    (
      mapping(address => mapping(uint256 => Snapshot)) storage snapshots,
      mapping(address => uint256) storage snapshotsCounts,

    ) = _getDelegationDataByType(delegationType);

    if (from != address(0)) {
      uint256 previous = 0;
      uint256 fromSnapshotsCount = snapshotsCounts[from];

      if (fromSnapshotsCount != 0) {
        previous = snapshots[from][fromSnapshotsCount - 1].value;
      } else {
        previous = balanceOf(from);
      }

      _writeSnapshot(
        snapshots,
        snapshotsCounts,
        from,
        uint128(previous),
        uint128(previous.sub(amount))
      );

      emit DelegatedPowerChanged(from, previous.sub(amount), delegationType);
    }
    if (to != address(0)) {
      uint256 previous = 0;
      uint256 toSnapshotsCount = snapshotsCounts[to];
      if (toSnapshotsCount != 0) {
        previous = snapshots[to][toSnapshotsCount - 1].value;
      } else {
        previous = balanceOf(to);
      }

      _writeSnapshot(
        snapshots,
        snapshotsCounts,
        to,
        uint128(previous),
        uint128(previous.add(amount))
      );

      emit DelegatedPowerChanged(to, previous.add(amount), delegationType);
    }
  }

  /**
   * @dev searches a snapshot by block number. Uses binary search.
   * @param snapshots the snapshots mapping
   * @param snapshotsCounts the number of snapshots
   * @param user the user for which the snapshot is being searched
   * @param blockNumber the block number being searched
   **/
  function _searchByBlockNumber(
    mapping(address => mapping(uint256 => Snapshot)) storage snapshots,
    mapping(address => uint256) storage snapshotsCounts,
    address user,
    uint256 blockNumber
  ) internal view returns (uint256) {
    require(blockNumber <= block.number, 'INVALID_BLOCK_NUMBER');

    uint256 snapshotsCount = snapshotsCounts[user];

    if (snapshotsCount == 0) {
      return balanceOf(user);
    }

    // First check most recent balance
    if (snapshots[user][snapshotsCount - 1].blockNumber <= blockNumber) {
      return snapshots[user][snapshotsCount - 1].value;
    }

    // Next check implicit zero balance
    if (snapshots[user][0].blockNumber > blockNumber) {
      return 0;
    }

    uint256 lower = 0;
    uint256 upper = snapshotsCount - 1;
    while (upper > lower) {
      uint256 center = upper - (upper - lower) / 2; // ceil, avoiding overflow
      Snapshot memory snapshot = snapshots[user][center];
      if (snapshot.blockNumber == blockNumber) {
        return snapshot.value;
      } else if (snapshot.blockNumber < blockNumber) {
        lower = center;
      } else {
        upper = center - 1;
      }
    }
    return snapshots[user][lower].value;
  }

  /**
   * @dev returns the delegation data (snapshot, snapshotsCount, list of delegates) by delegation type
   * NOTE: Ideal implementation would have mapped this in a struct by delegation type. Unfortunately,
   * the AAVE token and StakeToken already include a mapping for the snapshots, so we require contracts
   * who inherit from this to provide access to the delegation data by overriding this method.
   * @param delegationType the type of delegation
   **/
  function _getDelegationDataByType(DelegationType delegationType)
    internal
    virtual
    view
    returns (
      mapping(address => mapping(uint256 => Snapshot)) storage, //snapshots
      mapping(address => uint256) storage, //snapshots count
      mapping(address => address) storage //delegatees list
    );

  /**
   * @dev Writes a snapshot for an owner of tokens
   * @param owner The owner of the tokens
   * @param oldValue The value before the operation that is gonna be executed after the snapshot
   * @param newValue The value after the operation
   */
  function _writeSnapshot(
    mapping(address => mapping(uint256 => Snapshot)) storage snapshots,
    mapping(address => uint256) storage snapshotsCounts,
    address owner,
    uint128 oldValue,
    uint128 newValue
  ) internal {
    uint128 currentBlock = uint128(block.number);

    uint256 ownerSnapshotsCount = snapshotsCounts[owner];
    mapping(uint256 => Snapshot) storage snapshotsOwner = snapshots[owner];

    // Doing multiple operations in the same block
    if (
      ownerSnapshotsCount != 0 &&
      snapshotsOwner[ownerSnapshotsCount - 1].blockNumber == currentBlock
    ) {
      snapshotsOwner[ownerSnapshotsCount - 1].value = newValue;
    } else {
      snapshotsOwner[ownerSnapshotsCount] = Snapshot(currentBlock, newValue);
      snapshotsCounts[owner] = ownerSnapshotsCount + 1;
    }
  }

  /**
   * @dev returns the user delegatee. If a user never performed any delegation,
   * his delegated address will be 0x0. In that case we simply return the user itself
   * @param delegator the address of the user for which return the delegatee
   * @param delegates the array of delegates for a particular type of delegation
   **/
  function _getDelegatee(address delegator, mapping(address => address) storage delegates)
    internal
    view
    returns (address)
  {
    address previousDelegatee = delegates[delegator];

    if (previousDelegatee == address(0)) {
      return delegator;
    }

    return previousDelegatee;
  }
}

/**
 * @notice implementation of the AAVE token contract
 * @author Aave
 */
contract AaveTokenV2 is GovernancePowerDelegationERC20, VersionedInitializable {
  using SafeMath for uint256;
  using SafeERC20 for IERC20;

  string internal constant NAME = 'Aave Token';
  string internal constant SYMBOL = 'AAVE';
  uint8 internal constant DECIMALS = 18;

  uint256 public constant REVISION = 3;

  /// @dev owner => next valid nonce to submit with permit()
  mapping(address => uint256) public _nonces;

  mapping(address => mapping(uint256 => Snapshot)) public _votingSnapshots;

  mapping(address => uint256) public _votingSnapshotsCounts;

  /// @dev reference to the Aave governance contract to call (if initialized) on _beforeTokenTransfer
  /// !!! IMPORTANT The Aave governance is considered a trustable contract, being its responsibility
  /// to control all potential reentrancies by calling back the AaveToken
  ITransferHook public _aaveGovernance;

  bytes32 public DOMAIN_SEPARATOR;
  bytes public constant EIP712_REVISION = bytes('1');
  bytes32 internal constant EIP712_DOMAIN = keccak256(
    'EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)'
  );
  bytes32 public constant PERMIT_TYPEHASH = keccak256(
    'Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)'
  );

  mapping(address => address) internal _votingDelegates;

  mapping(address => mapping(uint256 => Snapshot)) internal _propositionPowerSnapshots;
  mapping(address => uint256) internal _propositionPowerSnapshotsCounts;

  mapping(address => address) internal _propositionPowerDelegates;

  event TokensRescued(address indexed tokenRescued, address indexed aaveMerkleDistributor, uint256 amountRescued);

  constructor() ERC20(NAME, SYMBOL) public {
    lastInitializedRevision = REVISION;
  }

  /**
   * @dev initializes the contract upon assignment to the InitializableAdminUpgradeabilityProxy
   */
  function initialize(address[] memory tokens, uint256[] memory amounts, address aaveMerkleDistributor, address lendToken, uint256 lendToAaveAmount) external initializer {
    // send tokens to distributor
    require(tokens.length == amounts.length, 'initialize(): amounts and tokens lengths inconsistent'); 
    for(uint i = 0; i < tokens.length; i++) {
      IERC20(tokens[i]).safeTransfer(aaveMerkleDistributor, amounts[i]);

      emit TokensRescued(tokens[i], aaveMerkleDistributor, amounts[i]);
    }

    IERC20(lendToken).safeTransfer(lendToken, lendToAaveAmount);
  }

  /**
   * @dev implements the permit function as for https://github.com/ethereum/EIPs/blob/8a34d644aacf0f9f8f00815307fd7dd5da07655f/EIPS/eip-2612.md
   * @param owner the owner of the funds
   * @param spender the spender
   * @param value the amount
   * @param deadline the deadline timestamp, type(uint256).max for no deadline
   * @param v signature param
   * @param s signature param
   * @param r signature param
   */

  function permit(
    address owner,
    address spender,
    uint256 value,
    uint256 deadline,
    uint8 v,
    bytes32 r,
    bytes32 s
  ) external {
    require(owner != address(0), 'INVALID_OWNER');
    //solium-disable-next-line
    require(block.timestamp <= deadline, 'INVALID_EXPIRATION');
    uint256 currentValidNonce = _nonces[owner];
    bytes32 digest = keccak256(
      abi.encodePacked(
        '\x19\x01',
        DOMAIN_SEPARATOR,
        keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, currentValidNonce, deadline))
      )
    );

    require(owner == ecrecover(digest, v, r, s), 'INVALID_SIGNATURE');
    _nonces[owner] = currentValidNonce.add(1);
    _approve(owner, spender, value);
  }

  /**
   * @dev returns the revision of the implementation contract
   */
  function getRevision() internal override pure returns (uint256) {
    return REVISION;
  }

  /**
   * @dev Writes a snapshot before any operation involving transfer of value: _transfer, _mint and _burn
   * - On _transfer, it writes snapshots for both "from" and "to"
   * - On _mint, only for _to
   * - On _burn, only for _from
   * @param from the from address
   * @param to the to address
   * @param amount the amount to transfer
   */
  function _beforeTokenTransfer(
    address from,
    address to,
    uint256 amount
  ) internal override {
    address votingFromDelegatee = _getDelegatee(from, _votingDelegates);
    address votingToDelegatee = _getDelegatee(to, _votingDelegates);

    _moveDelegatesByType(
      votingFromDelegatee,
      votingToDelegatee,
      amount,
      DelegationType.VOTING_POWER
    );

    address propPowerFromDelegatee = _getDelegatee(from, _propositionPowerDelegates);
    address propPowerToDelegatee = _getDelegatee(to, _propositionPowerDelegates);

    _moveDelegatesByType(
      propPowerFromDelegatee,
      propPowerToDelegatee,
      amount,
      DelegationType.PROPOSITION_POWER
    );

    // caching the aave governance address to avoid multiple state loads
    ITransferHook aaveGovernance = _aaveGovernance;
    if (aaveGovernance != ITransferHook(0)) {
      aaveGovernance.onTransfer(from, to, amount);
    }
  }

  function _getDelegationDataByType(DelegationType delegationType)
    internal
    override
    view
    returns (
      mapping(address => mapping(uint256 => Snapshot)) storage, //snapshots
      mapping(address => uint256) storage, //snapshots count
      mapping(address => address) storage //delegatees list
    )
  {
    if (delegationType == DelegationType.VOTING_POWER) {
      return (_votingSnapshots, _votingSnapshotsCounts, _votingDelegates);
    } else {
      return (
        _propositionPowerSnapshots,
        _propositionPowerSnapshotsCounts,
        _propositionPowerDelegates
      );
    }
  }

  /**
   * @dev Delegates power from signatory to `delegatee`
   * @param delegatee The address to delegate votes to
   * @param delegationType the type of delegation (VOTING_POWER, PROPOSITION_POWER)
   * @param nonce The contract state required to match the signature
   * @param expiry The time at which to expire the signature
   * @param v The recovery byte of the signature
   * @param r Half of the ECDSA signature pair
   * @param s Half of the ECDSA signature pair
   */
  function delegateByTypeBySig(
    address delegatee,
    DelegationType delegationType,
    uint256 nonce,
    uint256 expiry,
    uint8 v,
    bytes32 r,
    bytes32 s
  ) public {
    bytes32 structHash = keccak256(
      abi.encode(DELEGATE_BY_TYPE_TYPEHASH, delegatee, uint256(delegationType), nonce, expiry)
    );
    bytes32 digest = keccak256(abi.encodePacked('\x19\x01', DOMAIN_SEPARATOR, structHash));
    address signatory = ecrecover(digest, v, r, s);
    require(signatory != address(0), 'INVALID_SIGNATURE');
    require(nonce == _nonces[signatory]++, 'INVALID_NONCE');
    require(block.timestamp <= expiry, 'INVALID_EXPIRATION');
    _delegateByType(signatory, delegatee, delegationType);
  }

  /**
   * @dev Delegates power from signatory to `delegatee`
   * @param delegatee The address to delegate votes to
   * @param nonce The contract state required to match the signature
   * @param expiry The time at which to expire the signature
   * @param v The recovery byte of the signature
   * @param r Half of the ECDSA signature pair
   * @param s Half of the ECDSA signature pair
   */
  function delegateBySig(
    address delegatee,
    uint256 nonce,
    uint256 expiry,
    uint8 v,
    bytes32 r,
    bytes32 s
  ) public {
    bytes32 structHash = keccak256(abi.encode(DELEGATE_TYPEHASH, delegatee, nonce, expiry));
    bytes32 digest = keccak256(abi.encodePacked('\x19\x01', DOMAIN_SEPARATOR, structHash));
    address signatory = ecrecover(digest, v, r, s);
    require(signatory != address(0), 'INVALID_SIGNATURE');
    require(nonce == _nonces[signatory]++, 'INVALID_NONCE');
    require(block.timestamp <= expiry, 'INVALID_EXPIRATION');
    _delegateByType(signatory, delegatee, DelegationType.VOTING_POWER);
    _delegateByType(signatory, delegatee, DelegationType.PROPOSITION_POWER);
  }
}

Settings
{
  "remappings": [
    "@aave/core-v3/=lib/aave-address-book/lib/aave-v3-core/",
    "@aave/periphery-v3/=lib/aave-address-book/lib/aave-v3-periphery/",
    "aave-address-book/=lib/aave-address-book/src/",
    "aave-autonomous-proposal/=lib/aave-autonomous-proposal/src/",
    "aave-helpers/=lib/aave-helpers/src/",
    "aave-v3-core/=lib/aave-address-book/lib/aave-v3-core/",
    "aave-v3-periphery/=lib/aave-address-book/lib/aave-v3-periphery/",
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "forge-std/=lib/forge-std/src/",
    "solidity-utils/=lib/solidity-utils/src/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "bytecodeHash": "ipfs"
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "istanbul",
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[],"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":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"address","name":"delegatee","type":"address"},{"indexed":false,"internalType":"enum IGovernancePowerDelegationToken.DelegationType","name":"delegationType","type":"uint8"}],"name":"DelegateChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"enum IGovernancePowerDelegationToken.DelegationType","name":"delegationType","type":"uint8"}],"name":"DelegatedPowerChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"tokenRescued","type":"address"},{"indexed":true,"internalType":"address","name":"aaveMerkleDistributor","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountRescued","type":"uint256"}],"name":"TokensRescued","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":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"DELEGATE_BY_TYPE_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DELEGATE_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"EIP712_REVISION","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PERMIT_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"REVISION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_aaveGovernance","outputs":[{"internalType":"contract ITransferHook","name":"","type":"address"}],"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":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"_votingSnapshots","outputs":[{"internalType":"uint128","name":"blockNumber","type":"uint128"},{"internalType":"uint128","name":"value","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"_votingSnapshotsCounts","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","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":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","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":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"delegatee","type":"address"}],"name":"delegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"delegatee","type":"address"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"delegateBySig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"delegatee","type":"address"},{"internalType":"enum IGovernancePowerDelegationToken.DelegationType","name":"delegationType","type":"uint8"}],"name":"delegateByType","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"delegatee","type":"address"},{"internalType":"enum IGovernancePowerDelegationToken.DelegationType","name":"delegationType","type":"uint8"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"delegateByTypeBySig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"delegator","type":"address"},{"internalType":"enum IGovernancePowerDelegationToken.DelegationType","name":"delegationType","type":"uint8"}],"name":"getDelegateeByType","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"blockNumber","type":"uint256"},{"internalType":"enum IGovernancePowerDelegationToken.DelegationType","name":"delegationType","type":"uint8"}],"name":"getPowerAtBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"enum IGovernancePowerDelegationToken.DelegationType","name":"delegationType","type":"uint8"}],"name":"getPowerCurrent","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"address","name":"aaveMerkleDistributor","type":"address"},{"internalType":"address","name":"lendToken","type":"address"},{"internalType":"uint256","name":"lendToAaveAmount","type":"uint256"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"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":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"blockNumber","type":"uint256"}],"name":"totalSupplyAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]

608060405260006006553480156200001657600080fd5b50604080518082018252600a81526920b0bb32902a37b5b2b760b11b6020808301918252835180850190945260048452634141564560e01b908401528151919291620000659160039162000096565b5080516200007b90600490602084019062000096565b50506005805460ff1916601217905550600360065562000142565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282620000ce576000855562000119565b82601f10620000e957805160ff191683800117855562000119565b8280016001018555821562000119579182015b8281111562000119578251825591602001919060010190620000fc565b50620001279291506200012b565b5090565b5b808211156200012757600081556001016200012c565b61238180620001526000396000f3fe608060405234801561001057600080fd5b50600436106101e55760003560e01c806395d89b411161010f578063c3863ada116100a2578063dd62ed3e11610071578063dd62ed3e146103d7578063dde43cba146103ea578063f713d8a8146103f2578063f91d282814610405576101e5565b8063c3863ada14610396578063c3cda5201461039e578063d505accf146103b1578063dc937e1c146103c4576101e5565b8063aa9fbe02116100de578063aa9fbe0214610355578063b2f4201d1461035d578063b9844d8d14610370578063c2ffbb9114610383576101e5565b806395d89b4114610314578063981b24d01461031c578063a457c2d71461032f578063a9059cbb14610342576101e5565b806339509351116101875780636f50458d116101565780636f50458d146102c657806370a08231146102e657806378160376146102f95780637bb73c9714610301576101e5565b8063395093511461027557806341cbf54a146102885780635b3cc0cf146102905780635c19a95c146102b1576101e5565b806323b872dd116101c357806323b872dd1461023d57806330adf81f14610250578063313ce567146102585780633644e5151461026d576101e5565b806306fdde03146101ea578063095ea7b31461020857806318160ddd14610228575b600080fd5b6101f2610418565b6040516101ff9190611e71565b60405180910390f35b61021b610216366004611b1c565b6104ae565b6040516101ff9190611dbb565b6102306104cc565b6040516101ff9190611dc6565b61021b61024b366004611a1e565b6104d2565b61023061055a565b61026061057e565b6040516101ff919061225c565b610230610587565b61021b610283366004611b1c565b61058d565b6102306105db565b6102a361029e366004611b1c565b6105ff565b6040516101ff92919061222e565b6102c46102bf3660046119d2565b610630565b005b6102d96102d4366004611ac2565b61064b565b6040516101ff9190611d6a565b6102306102f43660046119d2565b61066d565b6101f261068c565b61023061030f3660046119d2565b6106a9565b6101f26106bb565b61023061032a366004611ce1565b61071c565b61021b61033d366004611b1c565b610726565b61021b610350366004611b1c565b61078e565b6102306107a2565b61023061036b366004611ac2565b6107c6565b61023061037e3660046119d2565b6107ee565b610230610391366004611b45565b610800565b6102d9610829565b6102c46103ac366004611b80565b610838565b6102c46103bf366004611a59565b6109bd565b6102c46103d2366004611ac2565b610b4a565b6102306103e53660046119ec565b610b59565b610230610b84565b6102c4610400366004611aeb565b610b89565b6102c4610413366004611bd7565b610d06565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104a45780601f10610479576101008083540402835291602001916104a4565b820191906000526020600020905b81548152906001019060200180831161048757829003601f168201915b5050505050905090565b60006104c26104bb610e3f565b8484610e43565b5060015b92915050565b60025490565b60006104df848484610ef7565b61054f846104eb610e3f565b61054a856040518060600160405280602881526020016122ff602891396001600160a01b038a16600090815260016020526040812090610529610e3f565b6001600160a01b03168152602081019190915260400160002054919061100c565b610e43565b5060015b9392505050565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b60055460ff1690565b603d5481565b60006104c261059a610e3f565b8461054a85600160006105ab610e3f565b6001600160a01b03908116825260208083019390935260409182016000908120918c168152925290205490611038565b7f9a9a49b990ba9bb39f8048c490a40ab25c18f55d208d5fbcf958261a9b48716d81565b603a6020908152600092835260408084209091529082529020546001600160801b0380821691600160801b90041682565b61063c3382600061105d565b6106483382600161105d565b50565b6000806106578361113a565b925050506106658482611174565b949350505050565b6001600160a01b0381166000908152602081905260409020545b919050565b604051806040016040528060018152602001603160f81b81525081565b603b6020526000908152604090205481565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104a45780601f10610479576101008083540402835291602001916104a4565b60006104c66104cc565b60006104c2610733610e3f565b8461054a85604051806060016040528060258152602001612327602591396001600061075d610e3f565b6001600160a01b03908116825260208083019390935260409182016000908120918d1681529252902054919061100c565b60006104c261079b610e3f565b8484610ef7565b7f10d8d059343739efce7dad10d09f0806da52b252b3e6a7951920d2d6ec4102e581565b60008060006107d48461113a565b50915091506107e58282874361119f565b95945050505050565b60396020526000908152604090205481565b600080600061080e8461113a565b509150915061081f8282888861119f565b9695505050505050565b603c546001600160a01b031681565b60007f9a9a49b990ba9bb39f8048c490a40ab25c18f55d208d5fbcf958261a9b48716d8787876040516020016108719493929190611e03565b6040516020818303038152906040528051906020012090506000603d54826040516020016108a0929190611d4f565b6040516020818303038152906040528051906020012090506000600182878787604051600081526020016040526040516108dd9493929190611e53565b6020604051602081039080840390855afa1580156108ff573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661093b5760405162461bcd60e51b815260040161093290611f83565b60405180910390fd5b6001600160a01b0381166000908152603960205260409020805460018101909155881461097a5760405162461bcd60e51b81526004016109329061207d565b8642111561099a5760405162461bcd60e51b815260040161093290612051565b6109a6818a600061105d565b6109b2818a600161105d565b505050505050505050565b6001600160a01b0387166109e35760405162461bcd60e51b8152600401610932906120a4565b83421115610a035760405162461bcd60e51b815260040161093290612051565b6001600160a01b038716600090815260396020908152604080832054603d549151909392610a5d917f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9918d918d918d9189918e9101611dcf565b60405160208183030381529060405280519060200120604051602001610a84929190611d4f565b60405160208183030381529060405280519060200120905060018186868660405160008152602001604052604051610abf9493929190611e53565b6020604051602081039080840390855afa158015610ae1573d6000803e3d6000fd5b505050602060405103516001600160a01b0316896001600160a01b031614610b1b5760405162461bcd60e51b815260040161093290611f83565b610b26826001611038565b6001600160a01b038a166000908152603960205260409020556109b2898989610e43565b610b5533838361105d565b5050565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b600381565b60007f10d8d059343739efce7dad10d09f0806da52b252b3e6a7951920d2d6ec4102e588886001811115610bb957fe5b8888604051602001610bcf959493929190611e27565b6040516020818303038152906040528051906020012090506000603d5482604051602001610bfe929190611d4f565b604051602081830303815290604052805190602001209050600060018287878760405160008152602001604052604051610c3b9493929190611e53565b6020604051602081039080840390855afa158015610c5d573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610c905760405162461bcd60e51b815260040161093290611f83565b6001600160a01b03811660009081526039602052604090208054600181019091558814610ccf5760405162461bcd60e51b81526004016109329061207d565b86421115610cef5760405162461bcd60e51b815260040161093290612051565b610cfa818b8b61105d565b50505050505050505050565b6000610d1061138e565b90506006548111610d335760405162461bcd60e51b815260040161093290612003565b60068190558451865114610d595760405162461bcd60e51b815260040161093290611fae565b60005b8651811015610e2257610da985878381518110610d7557fe5b6020026020010151898481518110610d8957fe5b60200260200101516001600160a01b03166113939092919063ffffffff16565b846001600160a01b0316878281518110610dbf57fe5b60200260200101516001600160a01b03167f77023e19c7343ad491fd706c36335ca0e738340a91f29b1fd81e2673d44896c4888481518110610dfd57fe5b6020026020010151604051610e129190611dc6565b60405180910390a3600101610d5c565b50610e376001600160a01b0384168484611393565b505050505050565b3390565b6001600160a01b038316610e695760405162461bcd60e51b815260040161093290612110565b6001600160a01b038216610e8f5760405162461bcd60e51b815260040161093290611ed5565b6001600160a01b0380841660008181526001602090815260408083209487168084529490915290819020849055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590610eea908590611dc6565b60405180910390a3505050565b6001600160a01b038316610f1d5760405162461bcd60e51b8152600401610932906120cb565b6001600160a01b038216610f435760405162461bcd60e51b815260040161093290611e92565b610f4e8383836113ee565b610f8b816040518060600160405280602681526020016122d9602691396001600160a01b038616600090815260208190526040902054919061100c565b6001600160a01b038085166000908152602081905260408082209390935590841681522054610fba9082611038565b6001600160a01b0380841660008181526020819052604090819020939093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610eea908590611dc6565b600081848411156110305760405162461bcd60e51b81526004016109329190611e71565b505050900390565b6000828201838110156105535760405162461bcd60e51b815260040161093290611f17565b6001600160a01b0382166110835760405162461bcd60e51b8152600401610932906121cc565b600061108e8261113a565b92505050600061109d8561066d565b905060006110ab8684611174565b6001600160a01b03878116600090815260208690526040902080546001600160a01b03191691881691909117905590506110e7818684876114c3565b846001600160a01b0316866001600160a01b03167fe8d51c8e11bd570db1734c8ec775785330e77007feed45c43b608ef33ff914bd8660405161112a9190611e84565b60405180910390a3505050505050565b600080808084600181111561114b57fe5b14156111615750603a9150603b9050603e61116d565b50603f91506040905060415b9193909250565b6001600160a01b038083166000908152602083905260408120549091168061055357839150506104c6565b6000438211156111c15760405162461bcd60e51b815260040161093290612154565b6001600160a01b038316600090815260208590526040902054806111f0576111e88461066d565b915050610665565b6001600160a01b038416600090815260208781526040808320600019850184529091529020546001600160801b03168310611263576001600160a01b038416600090815260208781526040808320600019909401835292905220546001600160801b03600160801b909104169050610665565b6001600160a01b0384166000908152602087815260408083208380529091529020546001600160801b031683101561129f576000915050610665565b600060001982015b818111156113515760028282030481036112bf611916565b506001600160a01b038716600090815260208a815260408083208484528252918290208251808401909352546001600160801b03808216808552600160801b909204169183019190915287141561132957602001516001600160801b031694506106659350505050565b80516001600160801b03168711156113435781935061134a565b6001820392505b50506112a7565b506001600160a01b0385166000908152602088815260408083209383529290522054600160801b90046001600160801b0316915050949350505050565b600390565b6113e98363a9059cbb60e01b84846040516024016113b2929190611da2565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526116af565b505050565b60006113fb84603e611174565b9050600061140a84603e611174565b905061141982828560006114c3565b6000611426866041611174565b90506000611435866041611174565b905061144482828760016114c3565b603c546001600160a01b031680156114b957604051634a39314960e01b81526001600160a01b03821690634a39314990611486908b908b908b90600401611d7e565b600060405180830381600087803b1580156114a057600080fd5b505af11580156114b4573d6000803e3d6000fd5b505050505b5050505050505050565b826001600160a01b0316846001600160a01b031614156114e2576116a9565b6000806114ee8361113a565b5090925090506001600160a01b038616156115d0576001600160a01b038616600090815260208290526040812054801561155f576001600160a01b03881660009081526020858152604080832060001985018452909152902054600160801b90046001600160801b0316915061156b565b6115688861066d565b91505b61158184848a8561157c818c611794565b6117d6565b6001600160a01b0388167fa0a19463ee116110c9b282012d9b65cc5522dc38a9520340cbaf3142e550127f6115b68489611794565b876040516115c5929190612248565b60405180910390a250505b6001600160a01b03851615610e37576001600160a01b038516600090815260208290526040812054801561163b576001600160a01b03871660009081526020858152604080832060001985018452909152902054600160801b90046001600160801b03169150611647565b6116448761066d565b91505b6116588484898561157c818c611038565b6001600160a01b0387167fa0a19463ee116110c9b282012d9b65cc5522dc38a9520340cbaf3142e550127f61168d8489611038565b8760405161169c929190612248565b60405180910390a2505050505b50505050565b6116c1826001600160a01b03166118dd565b6116dd5760405162461bcd60e51b8152600401610932906121f7565b60006060836001600160a01b0316836040516116f99190611d33565b6000604051808303816000865af19150503d8060008114611736576040519150601f19603f3d011682016040523d82523d6000602084013e61173b565b606091505b50915091508161175d5760405162461bcd60e51b815260040161093290611f4e565b8051156116a957808060200190518101906117789190611cc1565b6116a95760405162461bcd60e51b815260040161093290612182565b600061055383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061100c565b6001600160a01b03831660009081526020858152604080832054918890529091204391908115801590611827575060001982016000908152602082905260409020546001600160801b038481169116145b1561185c576000198201600090815260208290526040902080546001600160801b03808716600160801b0291161790556114b9565b6040805180820182526001600160801b038086168252868116602080840191825260008781528682528581209451855493518516600160801b029085166fffffffffffffffffffffffffffffffff1990941693909317909316919091179092556001600160a01b038916815290899052206001830190555050505050505050565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470818114801590610665575050151592915050565b604080518082019091526000808252602082015290565b80356001600160a01b038116811461068757600080fd5b600082601f830112611954578081fd5b81356119676119628261228e565b61226a565b81815291506020808301908481018184028601820187101561198857600080fd5b60005b848110156119a75781358452928201929082019060010161198b565b505050505092915050565b80356002811061068757600080fd5b803560ff8116811461068757600080fd5b6000602082840312156119e3578081fd5b6105538261192d565b600080604083850312156119fe578081fd5b611a078361192d565b9150611a156020840161192d565b90509250929050565b600080600060608486031215611a32578081fd5b611a3b8461192d565b9250611a496020850161192d565b9150604084013590509250925092565b600080600080600080600060e0888a031215611a73578283fd5b611a7c8861192d565b9650611a8a6020890161192d565b95506040880135945060608801359350611aa6608089016119c1565b925060a0880135915060c0880135905092959891949750929550565b60008060408385031215611ad4578182fd5b611add8361192d565b9150611a15602084016119b2565b600080600080600080600060e0888a031215611b05578283fd5b611b0e8861192d565b9650611a8a602089016119b2565b60008060408385031215611b2e578182fd5b611b378361192d565b946020939093013593505050565b600080600060608486031215611b59578283fd5b611b628461192d565b925060208401359150611b77604085016119b2565b90509250925092565b60008060008060008060c08789031215611b98578182fd5b611ba18761192d565b95506020870135945060408701359350611bbd606088016119c1565b92506080870135915060a087013590509295509295509295565b600080600080600060a08688031215611bee578283fd5b853567ffffffffffffffff80821115611c05578485fd5b818801915088601f830112611c18578485fd5b8135611c266119628261228e565b80828252602080830192508086018d828387028901011115611c4657898afd5b8996505b84871015611c6f57611c5b8161192d565b845260019690960195928101928101611c4a565b509099508a01359350505080821115611c86578485fd5b50611c9388828901611944565b945050611ca26040870161192d565b9250611cb06060870161192d565b949793965091946080013592915050565b600060208284031215611cd2578081fd5b81518015158114610553578182fd5b600060208284031215611cf2578081fd5b5035919050565b60008151808452611d118160208601602086016122ac565b601f01601f19169290920160200192915050565b60028110611d2f57fe5b9052565b60008251611d458184602087016122ac565b9190910192915050565b61190160f01b81526002810192909252602282015260420190565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03929092168252602082015260400190565b901515815260200190565b90815260200190565b9586526001600160a01b0394851660208701529290931660408501526060840152608083019190915260a082015260c00190565b9384526001600160a01b039290921660208401526040830152606082015260800190565b9485526001600160a01b0393909316602085015260408401919091526060830152608082015260a00190565b93845260ff9290921660208401526040830152606082015260800190565b6000602082526105536020830184611cf9565b602081016104c68284611d25565b60208082526023908201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260408201526265737360e81b606082015260800190565b60208082526022908201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604082015261737360f01b606082015260800190565b6020808252601b908201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604082015260600190565b6020808252818101527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604082015260600190565b602080825260119082015270494e56414c49445f5349474e415455524560781b604082015260600190565b60208082526035908201527f696e697469616c697a6528293a20616d6f756e747320616e6420746f6b656e73604082015274081b195b99dd1a1cc81a5b98dbdb9cda5cdd195b9d605a1b606082015260800190565b6020808252602e908201527f436f6e747261637420696e7374616e63652068617320616c726561647920626560408201526d195b881a5b9a5d1a585b1a5e995960921b606082015260800190565b60208082526012908201527124a72b20a624a22fa2ac2824a920aa24a7a760711b604082015260600190565b6020808252600d908201526c494e56414c49445f4e4f4e434560981b604082015260600190565b6020808252600d908201526c24a72b20a624a22fa7aba722a960991b604082015260600190565b60208082526025908201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526024908201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646040820152637265737360e01b606082015260800190565b60208082526014908201527324a72b20a624a22fa12627a1a5afa72aa6a122a960611b604082015260600190565b6020808252602a908201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6040820152691bdd081cdd58d8d9595960b21b606082015260800190565b602080825260119082015270494e56414c49445f44454c45474154454560781b604082015260600190565b6020808252601f908201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604082015260600190565b6001600160801b0392831681529116602082015260400190565b828152604081016105536020830184611d25565b60ff91909116815260200190565b60405181810167ffffffffffffffff8111828210171561228657fe5b604052919050565b600067ffffffffffffffff8211156122a257fe5b5060209081020190565b60005b838110156122c75781810151838201526020016122af565b838111156116a9575050600091015256fe45524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220d08971707d23eeba147c1d3b69a3784f6d1ababfbfe28d44e7cb1932efa9bf2f64736f6c63430007050033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101e55760003560e01c806395d89b411161010f578063c3863ada116100a2578063dd62ed3e11610071578063dd62ed3e146103d7578063dde43cba146103ea578063f713d8a8146103f2578063f91d282814610405576101e5565b8063c3863ada14610396578063c3cda5201461039e578063d505accf146103b1578063dc937e1c146103c4576101e5565b8063aa9fbe02116100de578063aa9fbe0214610355578063b2f4201d1461035d578063b9844d8d14610370578063c2ffbb9114610383576101e5565b806395d89b4114610314578063981b24d01461031c578063a457c2d71461032f578063a9059cbb14610342576101e5565b806339509351116101875780636f50458d116101565780636f50458d146102c657806370a08231146102e657806378160376146102f95780637bb73c9714610301576101e5565b8063395093511461027557806341cbf54a146102885780635b3cc0cf146102905780635c19a95c146102b1576101e5565b806323b872dd116101c357806323b872dd1461023d57806330adf81f14610250578063313ce567146102585780633644e5151461026d576101e5565b806306fdde03146101ea578063095ea7b31461020857806318160ddd14610228575b600080fd5b6101f2610418565b6040516101ff9190611e71565b60405180910390f35b61021b610216366004611b1c565b6104ae565b6040516101ff9190611dbb565b6102306104cc565b6040516101ff9190611dc6565b61021b61024b366004611a1e565b6104d2565b61023061055a565b61026061057e565b6040516101ff919061225c565b610230610587565b61021b610283366004611b1c565b61058d565b6102306105db565b6102a361029e366004611b1c565b6105ff565b6040516101ff92919061222e565b6102c46102bf3660046119d2565b610630565b005b6102d96102d4366004611ac2565b61064b565b6040516101ff9190611d6a565b6102306102f43660046119d2565b61066d565b6101f261068c565b61023061030f3660046119d2565b6106a9565b6101f26106bb565b61023061032a366004611ce1565b61071c565b61021b61033d366004611b1c565b610726565b61021b610350366004611b1c565b61078e565b6102306107a2565b61023061036b366004611ac2565b6107c6565b61023061037e3660046119d2565b6107ee565b610230610391366004611b45565b610800565b6102d9610829565b6102c46103ac366004611b80565b610838565b6102c46103bf366004611a59565b6109bd565b6102c46103d2366004611ac2565b610b4a565b6102306103e53660046119ec565b610b59565b610230610b84565b6102c4610400366004611aeb565b610b89565b6102c4610413366004611bd7565b610d06565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104a45780601f10610479576101008083540402835291602001916104a4565b820191906000526020600020905b81548152906001019060200180831161048757829003601f168201915b5050505050905090565b60006104c26104bb610e3f565b8484610e43565b5060015b92915050565b60025490565b60006104df848484610ef7565b61054f846104eb610e3f565b61054a856040518060600160405280602881526020016122ff602891396001600160a01b038a16600090815260016020526040812090610529610e3f565b6001600160a01b03168152602081019190915260400160002054919061100c565b610e43565b5060015b9392505050565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b60055460ff1690565b603d5481565b60006104c261059a610e3f565b8461054a85600160006105ab610e3f565b6001600160a01b03908116825260208083019390935260409182016000908120918c168152925290205490611038565b7f9a9a49b990ba9bb39f8048c490a40ab25c18f55d208d5fbcf958261a9b48716d81565b603a6020908152600092835260408084209091529082529020546001600160801b0380821691600160801b90041682565b61063c3382600061105d565b6106483382600161105d565b50565b6000806106578361113a565b925050506106658482611174565b949350505050565b6001600160a01b0381166000908152602081905260409020545b919050565b604051806040016040528060018152602001603160f81b81525081565b603b6020526000908152604090205481565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104a45780601f10610479576101008083540402835291602001916104a4565b60006104c66104cc565b60006104c2610733610e3f565b8461054a85604051806060016040528060258152602001612327602591396001600061075d610e3f565b6001600160a01b03908116825260208083019390935260409182016000908120918d1681529252902054919061100c565b60006104c261079b610e3f565b8484610ef7565b7f10d8d059343739efce7dad10d09f0806da52b252b3e6a7951920d2d6ec4102e581565b60008060006107d48461113a565b50915091506107e58282874361119f565b95945050505050565b60396020526000908152604090205481565b600080600061080e8461113a565b509150915061081f8282888861119f565b9695505050505050565b603c546001600160a01b031681565b60007f9a9a49b990ba9bb39f8048c490a40ab25c18f55d208d5fbcf958261a9b48716d8787876040516020016108719493929190611e03565b6040516020818303038152906040528051906020012090506000603d54826040516020016108a0929190611d4f565b6040516020818303038152906040528051906020012090506000600182878787604051600081526020016040526040516108dd9493929190611e53565b6020604051602081039080840390855afa1580156108ff573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661093b5760405162461bcd60e51b815260040161093290611f83565b60405180910390fd5b6001600160a01b0381166000908152603960205260409020805460018101909155881461097a5760405162461bcd60e51b81526004016109329061207d565b8642111561099a5760405162461bcd60e51b815260040161093290612051565b6109a6818a600061105d565b6109b2818a600161105d565b505050505050505050565b6001600160a01b0387166109e35760405162461bcd60e51b8152600401610932906120a4565b83421115610a035760405162461bcd60e51b815260040161093290612051565b6001600160a01b038716600090815260396020908152604080832054603d549151909392610a5d917f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9918d918d918d9189918e9101611dcf565b60405160208183030381529060405280519060200120604051602001610a84929190611d4f565b60405160208183030381529060405280519060200120905060018186868660405160008152602001604052604051610abf9493929190611e53565b6020604051602081039080840390855afa158015610ae1573d6000803e3d6000fd5b505050602060405103516001600160a01b0316896001600160a01b031614610b1b5760405162461bcd60e51b815260040161093290611f83565b610b26826001611038565b6001600160a01b038a166000908152603960205260409020556109b2898989610e43565b610b5533838361105d565b5050565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b600381565b60007f10d8d059343739efce7dad10d09f0806da52b252b3e6a7951920d2d6ec4102e588886001811115610bb957fe5b8888604051602001610bcf959493929190611e27565b6040516020818303038152906040528051906020012090506000603d5482604051602001610bfe929190611d4f565b604051602081830303815290604052805190602001209050600060018287878760405160008152602001604052604051610c3b9493929190611e53565b6020604051602081039080840390855afa158015610c5d573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610c905760405162461bcd60e51b815260040161093290611f83565b6001600160a01b03811660009081526039602052604090208054600181019091558814610ccf5760405162461bcd60e51b81526004016109329061207d565b86421115610cef5760405162461bcd60e51b815260040161093290612051565b610cfa818b8b61105d565b50505050505050505050565b6000610d1061138e565b90506006548111610d335760405162461bcd60e51b815260040161093290612003565b60068190558451865114610d595760405162461bcd60e51b815260040161093290611fae565b60005b8651811015610e2257610da985878381518110610d7557fe5b6020026020010151898481518110610d8957fe5b60200260200101516001600160a01b03166113939092919063ffffffff16565b846001600160a01b0316878281518110610dbf57fe5b60200260200101516001600160a01b03167f77023e19c7343ad491fd706c36335ca0e738340a91f29b1fd81e2673d44896c4888481518110610dfd57fe5b6020026020010151604051610e129190611dc6565b60405180910390a3600101610d5c565b50610e376001600160a01b0384168484611393565b505050505050565b3390565b6001600160a01b038316610e695760405162461bcd60e51b815260040161093290612110565b6001600160a01b038216610e8f5760405162461bcd60e51b815260040161093290611ed5565b6001600160a01b0380841660008181526001602090815260408083209487168084529490915290819020849055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590610eea908590611dc6565b60405180910390a3505050565b6001600160a01b038316610f1d5760405162461bcd60e51b8152600401610932906120cb565b6001600160a01b038216610f435760405162461bcd60e51b815260040161093290611e92565b610f4e8383836113ee565b610f8b816040518060600160405280602681526020016122d9602691396001600160a01b038616600090815260208190526040902054919061100c565b6001600160a01b038085166000908152602081905260408082209390935590841681522054610fba9082611038565b6001600160a01b0380841660008181526020819052604090819020939093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610eea908590611dc6565b600081848411156110305760405162461bcd60e51b81526004016109329190611e71565b505050900390565b6000828201838110156105535760405162461bcd60e51b815260040161093290611f17565b6001600160a01b0382166110835760405162461bcd60e51b8152600401610932906121cc565b600061108e8261113a565b92505050600061109d8561066d565b905060006110ab8684611174565b6001600160a01b03878116600090815260208690526040902080546001600160a01b03191691881691909117905590506110e7818684876114c3565b846001600160a01b0316866001600160a01b03167fe8d51c8e11bd570db1734c8ec775785330e77007feed45c43b608ef33ff914bd8660405161112a9190611e84565b60405180910390a3505050505050565b600080808084600181111561114b57fe5b14156111615750603a9150603b9050603e61116d565b50603f91506040905060415b9193909250565b6001600160a01b038083166000908152602083905260408120549091168061055357839150506104c6565b6000438211156111c15760405162461bcd60e51b815260040161093290612154565b6001600160a01b038316600090815260208590526040902054806111f0576111e88461066d565b915050610665565b6001600160a01b038416600090815260208781526040808320600019850184529091529020546001600160801b03168310611263576001600160a01b038416600090815260208781526040808320600019909401835292905220546001600160801b03600160801b909104169050610665565b6001600160a01b0384166000908152602087815260408083208380529091529020546001600160801b031683101561129f576000915050610665565b600060001982015b818111156113515760028282030481036112bf611916565b506001600160a01b038716600090815260208a815260408083208484528252918290208251808401909352546001600160801b03808216808552600160801b909204169183019190915287141561132957602001516001600160801b031694506106659350505050565b80516001600160801b03168711156113435781935061134a565b6001820392505b50506112a7565b506001600160a01b0385166000908152602088815260408083209383529290522054600160801b90046001600160801b0316915050949350505050565b600390565b6113e98363a9059cbb60e01b84846040516024016113b2929190611da2565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526116af565b505050565b60006113fb84603e611174565b9050600061140a84603e611174565b905061141982828560006114c3565b6000611426866041611174565b90506000611435866041611174565b905061144482828760016114c3565b603c546001600160a01b031680156114b957604051634a39314960e01b81526001600160a01b03821690634a39314990611486908b908b908b90600401611d7e565b600060405180830381600087803b1580156114a057600080fd5b505af11580156114b4573d6000803e3d6000fd5b505050505b5050505050505050565b826001600160a01b0316846001600160a01b031614156114e2576116a9565b6000806114ee8361113a565b5090925090506001600160a01b038616156115d0576001600160a01b038616600090815260208290526040812054801561155f576001600160a01b03881660009081526020858152604080832060001985018452909152902054600160801b90046001600160801b0316915061156b565b6115688861066d565b91505b61158184848a8561157c818c611794565b6117d6565b6001600160a01b0388167fa0a19463ee116110c9b282012d9b65cc5522dc38a9520340cbaf3142e550127f6115b68489611794565b876040516115c5929190612248565b60405180910390a250505b6001600160a01b03851615610e37576001600160a01b038516600090815260208290526040812054801561163b576001600160a01b03871660009081526020858152604080832060001985018452909152902054600160801b90046001600160801b03169150611647565b6116448761066d565b91505b6116588484898561157c818c611038565b6001600160a01b0387167fa0a19463ee116110c9b282012d9b65cc5522dc38a9520340cbaf3142e550127f61168d8489611038565b8760405161169c929190612248565b60405180910390a2505050505b50505050565b6116c1826001600160a01b03166118dd565b6116dd5760405162461bcd60e51b8152600401610932906121f7565b60006060836001600160a01b0316836040516116f99190611d33565b6000604051808303816000865af19150503d8060008114611736576040519150601f19603f3d011682016040523d82523d6000602084013e61173b565b606091505b50915091508161175d5760405162461bcd60e51b815260040161093290611f4e565b8051156116a957808060200190518101906117789190611cc1565b6116a95760405162461bcd60e51b815260040161093290612182565b600061055383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061100c565b6001600160a01b03831660009081526020858152604080832054918890529091204391908115801590611827575060001982016000908152602082905260409020546001600160801b038481169116145b1561185c576000198201600090815260208290526040902080546001600160801b03808716600160801b0291161790556114b9565b6040805180820182526001600160801b038086168252868116602080840191825260008781528682528581209451855493518516600160801b029085166fffffffffffffffffffffffffffffffff1990941693909317909316919091179092556001600160a01b038916815290899052206001830190555050505050505050565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470818114801590610665575050151592915050565b604080518082019091526000808252602082015290565b80356001600160a01b038116811461068757600080fd5b600082601f830112611954578081fd5b81356119676119628261228e565b61226a565b81815291506020808301908481018184028601820187101561198857600080fd5b60005b848110156119a75781358452928201929082019060010161198b565b505050505092915050565b80356002811061068757600080fd5b803560ff8116811461068757600080fd5b6000602082840312156119e3578081fd5b6105538261192d565b600080604083850312156119fe578081fd5b611a078361192d565b9150611a156020840161192d565b90509250929050565b600080600060608486031215611a32578081fd5b611a3b8461192d565b9250611a496020850161192d565b9150604084013590509250925092565b600080600080600080600060e0888a031215611a73578283fd5b611a7c8861192d565b9650611a8a6020890161192d565b95506040880135945060608801359350611aa6608089016119c1565b925060a0880135915060c0880135905092959891949750929550565b60008060408385031215611ad4578182fd5b611add8361192d565b9150611a15602084016119b2565b600080600080600080600060e0888a031215611b05578283fd5b611b0e8861192d565b9650611a8a602089016119b2565b60008060408385031215611b2e578182fd5b611b378361192d565b946020939093013593505050565b600080600060608486031215611b59578283fd5b611b628461192d565b925060208401359150611b77604085016119b2565b90509250925092565b60008060008060008060c08789031215611b98578182fd5b611ba18761192d565b95506020870135945060408701359350611bbd606088016119c1565b92506080870135915060a087013590509295509295509295565b600080600080600060a08688031215611bee578283fd5b853567ffffffffffffffff80821115611c05578485fd5b818801915088601f830112611c18578485fd5b8135611c266119628261228e565b80828252602080830192508086018d828387028901011115611c4657898afd5b8996505b84871015611c6f57611c5b8161192d565b845260019690960195928101928101611c4a565b509099508a01359350505080821115611c86578485fd5b50611c9388828901611944565b945050611ca26040870161192d565b9250611cb06060870161192d565b949793965091946080013592915050565b600060208284031215611cd2578081fd5b81518015158114610553578182fd5b600060208284031215611cf2578081fd5b5035919050565b60008151808452611d118160208601602086016122ac565b601f01601f19169290920160200192915050565b60028110611d2f57fe5b9052565b60008251611d458184602087016122ac565b9190910192915050565b61190160f01b81526002810192909252602282015260420190565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03929092168252602082015260400190565b901515815260200190565b90815260200190565b9586526001600160a01b0394851660208701529290931660408501526060840152608083019190915260a082015260c00190565b9384526001600160a01b039290921660208401526040830152606082015260800190565b9485526001600160a01b0393909316602085015260408401919091526060830152608082015260a00190565b93845260ff9290921660208401526040830152606082015260800190565b6000602082526105536020830184611cf9565b602081016104c68284611d25565b60208082526023908201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260408201526265737360e81b606082015260800190565b60208082526022908201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604082015261737360f01b606082015260800190565b6020808252601b908201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604082015260600190565b6020808252818101527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604082015260600190565b602080825260119082015270494e56414c49445f5349474e415455524560781b604082015260600190565b60208082526035908201527f696e697469616c697a6528293a20616d6f756e747320616e6420746f6b656e73604082015274081b195b99dd1a1cc81a5b98dbdb9cda5cdd195b9d605a1b606082015260800190565b6020808252602e908201527f436f6e747261637420696e7374616e63652068617320616c726561647920626560408201526d195b881a5b9a5d1a585b1a5e995960921b606082015260800190565b60208082526012908201527124a72b20a624a22fa2ac2824a920aa24a7a760711b604082015260600190565b6020808252600d908201526c494e56414c49445f4e4f4e434560981b604082015260600190565b6020808252600d908201526c24a72b20a624a22fa7aba722a960991b604082015260600190565b60208082526025908201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526024908201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646040820152637265737360e01b606082015260800190565b60208082526014908201527324a72b20a624a22fa12627a1a5afa72aa6a122a960611b604082015260600190565b6020808252602a908201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6040820152691bdd081cdd58d8d9595960b21b606082015260800190565b602080825260119082015270494e56414c49445f44454c45474154454560781b604082015260600190565b6020808252601f908201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604082015260600190565b6001600160801b0392831681529116602082015260400190565b828152604081016105536020830184611d25565b60ff91909116815260200190565b60405181810167ffffffffffffffff8111828210171561228657fe5b604052919050565b600067ffffffffffffffff8211156122a257fe5b5060209081020190565b60005b838110156122c75781810151838201526020016122af565b838111156116a9575050600091015256fe45524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220d08971707d23eeba147c1d3b69a3784f6d1ababfbfe28d44e7cb1932efa9bf2f64736f6c63430007050033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
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.