Source Code
Overview
ETH Balance
0 ETH
Token Holdings
More Info
ContractCreator
Multichain Info
N/A
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
AaveTokenV2
Compiler Version
v0.8.10+commit.fc410830
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: agpl-3.0 pragma solidity ^0.8.0; import {IERC20} from 'solidity-utils/contracts/oz-common/interfaces/IERC20.sol'; import {SafeERC20} from 'solidity-utils/contracts/oz-common/SafeERC20.sol'; import {Context} from 'solidity-utils/contracts/oz-common/Context.sol'; import {IERC20Metadata} from 'solidity-utils/contracts/oz-common/interfaces/IERC20Metadata.sol'; /** * @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.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin Contracts guidelines: functions revert * instead 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, IERC20Metadata { mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * The default value of {decimals} is 18. To select a different value for * {decimals} you should overload it. * * All two of these values are immutable: they can only be set once during * construction. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev Returns the name of the token. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual override 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 this function is * overridden; * * 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 virtual override returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf( address account ) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `to` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer( address to, uint256 amount ) public virtual override returns (bool) { address owner = _msgSender(); _transfer(owner, to, 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}. * * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on * `transferFrom`. This is semantically equivalent to an infinite approval. * * Requirements: * * - `spender` cannot be the zero address. */ function approve( address spender, uint256 amount ) public virtual override returns (bool) { address owner = _msgSender(); _approve(owner, 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}. * * NOTE: Does not update the allowance if the current allowance * is the maximum `uint256`. * * Requirements: * * - `from` and `to` cannot be the zero address. * - `from` must have a balance of at least `amount`. * - the caller must have allowance for ``from``'s tokens of at least * `amount`. */ function transferFrom( address from, address to, uint256 amount ) public virtual override returns (bool) { address spender = _msgSender(); _spendAllowance(from, spender, amount); _transfer(from, to, amount); 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) { address owner = _msgSender(); _approve(owner, spender, allowance(owner, spender) + 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) { address owner = _msgSender(); uint256 currentAllowance = allowance(owner, spender); require( currentAllowance >= subtractedValue, 'ERC20: decreased allowance below zero' ); unchecked { _approve(owner, spender, currentAllowance - subtractedValue); } return true; } /** * @dev Moves `amount` of tokens from `from` to `to`. * * This 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: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `from` must have a balance of at least `amount`. */ function _transfer( address from, address to, uint256 amount ) internal virtual { require(from != address(0), 'ERC20: transfer from the zero address'); require(to != address(0), 'ERC20: transfer to the zero address'); _beforeTokenTransfer(from, to, amount); uint256 fromBalance = _balances[from]; require(fromBalance >= amount, 'ERC20: transfer amount exceeds balance'); unchecked { _balances[from] = fromBalance - amount; // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by // decrementing then incrementing. _balances[to] += amount; } emit Transfer(from, to, amount); _afterTokenTransfer(from, to, 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: * * - `account` 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 += amount; unchecked { // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above. _balances[account] += amount; } emit Transfer(address(0), account, amount); _afterTokenTransfer(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); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, 'ERC20: burn amount exceeds balance'); unchecked { _balances[account] = accountBalance - amount; // Overflow not possible: amount <= accountBalance <= totalSupply. _totalSupply -= amount; } emit Transfer(account, address(0), amount); _afterTokenTransfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This 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 Updates `owner` s allowance for `spender` based on spent `amount`. * * Does not update the allowance amount in case of infinite allowance. * Revert if not enough allowance is available. * * Might emit an {Approval} event. */ function _spendAllowance( address owner, address spender, uint256 amount ) internal virtual { uint256 currentAllowance = allowance(owner, spender); if (currentAllowance != type(uint256).max) { require(currentAllowance >= amount, 'ERC20: insufficient allowance'); unchecked { _approve(owner, spender, currentAllowance - amount); } } } /** * @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 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 {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * has been transferred to `to`. * - when `from` is zero, `amount` tokens have been minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens have been 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 _afterTokenTransfer( address from, address to, uint256 amount ) internal virtual {} } 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; /** * @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; /** * @dev returns the delegatee of an user * @param delegator the address of the delegator **/ function getDelegateeByType( address delegator, DelegationType delegationType ) external 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 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 view returns (uint256); /** * @dev returns the total supply at a certain block number **/ function totalSupplyAt(uint256 blockNumber) external view returns (uint256); } interface ITransferHook { function onTransfer(address from, address to, uint256 amount) external; } /** * @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 { /// @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 view override 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 view override 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 view override 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) external view override 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 - amount) ); emit DelegatedPowerChanged(from, previous - 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 + amount) ); emit DelegatedPowerChanged(to, previous + 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 view virtual 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 newValue The value after the operation */ function _writeSnapshot( mapping(address => mapping(uint256 => Snapshot)) storage snapshots, mapping(address => uint256) storage snapshotsCounts, address owner, uint128, 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 { string internal constant NAME = 'Aave Token'; string internal constant SYMBOL = 'AAVE'; uint8 internal constant DECIMALS = 18; uint256 public constant REVISION = 2; /// @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; constructor() ERC20(NAME, SYMBOL) {} /** * @dev initializes the contract upon assignment to the InitializableAdminUpgradeabilityProxy */ function initialize() external initializer {} /** * @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 + 1; _approve(owner, spender, value); } /** * @dev returns the revision of the implementation contract */ function getRevision() internal pure override 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(address(0))) { aaveGovernance.onTransfer(from, to, amount); } } function _getDelegationDataByType( DelegationType delegationType ) internal view override 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); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol) // From commit https://github.com/OpenZeppelin/openzeppelin-contracts/commit/8b778fa20d6d76340c5fac1ed66c80273f05b95a pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://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'); (bool success, ) = recipient.call{value: amount}(''); require(success, 'Address: unable to send value, recipient may have reverted'); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, 'Address: low-level call failed'); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, 'Address: low-level call with value failed'); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, 'Address: insufficient balance for call'); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data ) internal view returns (bytes memory) { return functionStaticCall(target, data, 'Address: low-level static call failed'); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, 'Address: low-level delegate call failed'); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), 'Address: call to non-contract'); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) // From commit https://github.com/OpenZeppelin/openzeppelin-contracts/commit/8b778fa20d6d76340c5fac1ed66c80273f05b95a pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/utils/SafeERC20.sol) // From commit https://github.com/OpenZeppelin/openzeppelin-contracts/commit/3dac7bbed7b4c0dbf504180c33e8ed8e350b93eb pragma solidity ^0.8.0; import './interfaces/IERC20.sol'; import './interfaces/draft-IERC20Permit.sol'; import './Address.sol'; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; 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) ); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove(IERC20 token, address spender, uint256 value) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), 'SafeERC20: approve from non-zero to non-zero allowance' ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender) + value; _callOptionalReturn( token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance) ); } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, 'SafeERC20: decreased allowance below zero'); uint256 newAllowance = oldAllowance - value; _callOptionalReturn( token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance) ); } } function safePermit( IERC20Permit token, address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) internal { uint256 nonceBefore = token.nonces(owner); token.permit(owner, spender, value, deadline, v, r, s); uint256 nonceAfter = token.nonces(owner); require(nonceAfter == nonceBefore + 1, 'SafeERC20: permit did not succeed'); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, 'SafeERC20: low-level call failed'); if (returndata.length > 0) { // Return data is optional require(abi.decode(returndata, (bool)), 'SafeERC20: ERC20 operation did not succeed'); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) // From commit https://github.com/OpenZeppelin/openzeppelin-contracts/commit/a035b235b4f2c9af4ba88edc4447f02e37f8d124 pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 amount) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol) // From commit https://github.com/OpenZeppelin/openzeppelin-contracts/commit/6bd6b76d1156e20e45d1016f355d154141c7e5b9 pragma solidity ^0.8.0; import './IERC20.sol'; /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol) // From commit https://github.com/OpenZeppelin/openzeppelin-contracts/commit/6bd6b76d1156e20e45d1016f355d154141c7e5b9 pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. */ interface IERC20Permit { /** * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, * given ``owner``'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event. * * Requirements: * * - `spender` cannot be the zero address. * - `deadline` must be a timestamp in the future. * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` * over the EIP712-formatted function arguments. * - the signature must use ``owner``'s current nonce (see {nonces}). * * For more information on the signature format, see the * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP * section]. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; /** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. * * Every successful call to {permit} increases ``owner``'s nonce by one. This * prevents a signature from being used multiple times. */ function nonces(address owner) external view returns (uint256); /** * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view returns (bytes32); }
{ "remappings": [ "@aave/core-v3/=lib/aave-a-token-with-delegation/lib/aave-address-book/lib/aave-v3-core/", "@aave/periphery-v3/=lib/aave-a-token-with-delegation/lib/aave-address-book/lib/aave-v3-periphery/", "@openzeppelin/=lib/aave-crosschain-infra/lib/openzeppelin-contracts/", "aave-a-token-with-delegation/=lib/aave-a-token-with-delegation/src/", "aave-address-book/=lib/aave-a-token-with-delegation/lib/aave-address-book/src/", "aave-crosschain-infra/=lib/aave-crosschain-infra/src/", "aave-helpers/=lib/aave-stk-slashing-mgmt/lib/aave-helpers/", "aave-stk-slashing-mgmt/=lib/aave-stk-slashing-mgmt/src/", "aave-token-v2/=lib/aave-token-v3/lib/aave-token-v2/contracts/", "aave-token-v3/=lib/aave-token-v3/src/", "aave-v3-core/=lib/aave-a-token-with-delegation/lib/aave-v3-core/", "aave-v3-periphery/=lib/aave-a-token-with-delegation/lib/aave-address-book/lib/aave-v3-periphery/", "ds-test/=lib/forge-std/lib/ds-test/src/", "emergency-exit/=lib/emergency-exit/src/", "erc4626-tests/=lib/aave-stk-slashing-mgmt/lib/openzeppelin-contracts/lib/erc4626-tests/", "forge-std/=lib/forge-std/src/", "hyperlane-monorepo/=lib/aave-crosschain-infra/lib/hyperlane-monorepo/solidity/", "openzeppelin-contracts/=lib/aave-crosschain-infra/lib/openzeppelin-contracts/", "solidity-examples/=lib/aave-crosschain-infra/lib/solidity-examples/contracts/", "solidity-utils/=lib/solidity-utils/src/" ], "optimizer": { "enabled": true, "runs": 200 }, "metadata": { "bytecodeHash": "ipfs" }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "london", "libraries": {} }
Contract ABI
API[{"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":"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":[],"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":"","type":"uint256"}],"name":"totalSupplyAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405260006005553480156200001657600080fd5b50604080518082018252600a81526920b0bb32902a37b5b2b760b11b6020808301918252835180850190945260048452634141564560e01b908401528151919291620000659160039162000084565b5080516200007b90600490602084019062000084565b50505062000167565b82805462000092906200012a565b90600052602060002090601f016020900481019282620000b6576000855562000101565b82601f10620000d157805160ff191683800117855562000101565b8280016001018555821562000101579182015b8281111562000101578251825591602001919060010190620000e4565b506200010f92915062000113565b5090565b5b808211156200010f576000815560010162000114565b600181811c908216806200013f57607f821691505b602082108114156200016157634e487b7160e01b600052602260045260246000fd5b50919050565b611d1e80620001776000396000f3fe608060405234801561001057600080fd5b50600436106101e55760003560e01c80638129fc1c1161010f578063c2ffbb91116100a2578063dc937e1c11610071578063dc937e1c146104c0578063dd62ed3e146104d3578063dde43cba146104e6578063f713d8a8146104ee57600080fd5b8063c2ffbb9114610474578063c3863ada14610487578063c3cda5201461049a578063d505accf146104ad57600080fd5b8063a9059cbb116100de578063a9059cbb14610407578063aa9fbe021461041a578063b2f4201d14610441578063b9844d8d1461045457600080fd5b80638129fc1c146103d157806395d89b41146103d9578063981b24d0146103e1578063a457c2d7146103f457600080fd5b806339509351116101875780636f50458d116101565780636f50458d1461033d57806370a082311461036857806378160376146103915780637bb73c97146103b157600080fd5b8063395093511461028f57806341cbf54a146102a25780635b3cc0cf146102c95780635c19a95c1461032857600080fd5b806323b872dd116101c357806323b872dd1461023d57806330adf81f14610250578063313ce567146102775780633644e5151461028657600080fd5b806306fdde03146101ea578063095ea7b31461020857806318160ddd1461022b575b600080fd5b6101f2610501565b6040516101ff91906118e9565b60405180910390f35b61021b610216366004611918565b610593565b60405190151581526020016101ff565b6002545b6040519081526020016101ff565b61021b61024b366004611942565b6105ad565b61022f7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b604051601281526020016101ff565b61022f603c5481565b61021b61029d366004611918565b6105d3565b61022f7f9a9a49b990ba9bb39f8048c490a40ab25c18f55d208d5fbcf958261a9b48716d81565b6103086102d7366004611918565b60396020908152600092835260408084209091529082529020546001600160801b0380821691600160801b90041682565b604080516001600160801b039384168152929091166020830152016101ff565b61033b61033636600461197e565b6105f5565b005b61035061034b3660046119a8565b610610565b6040516001600160a01b0390911681526020016101ff565b61022f61037636600461197e565b6001600160a01b031660009081526020819052604090205490565b6101f2604051806040016040528060018152602001603160f81b81525081565b61022f6103bf36600461197e565b603a6020526000908152604090205481565b61033b610632565b6101f26106a7565b61022f6103ef3660046119db565b6106b6565b61021b610402366004611918565b6106c1565b61021b610415366004611918565b610747565b61022f7f10d8d059343739efce7dad10d09f0806da52b252b3e6a7951920d2d6ec4102e581565b61022f61044f3660046119a8565b610755565b61022f61046236600461197e565b60386020526000908152604090205481565b61022f6104823660046119f4565b61077d565b603b54610350906001600160a01b031681565b61033b6104a8366004611a41565b6107a6565b61033b6104bb366004611a99565b61096b565b61033b6104ce3660046119a8565b610b39565b61022f6104e1366004611b03565b610b48565b61022f600281565b61033b6104fc366004611b2d565b610b73565b60606003805461051090611b5f565b80601f016020809104026020016040519081016040528092919081815260200182805461053c90611b5f565b80156105895780601f1061055e57610100808354040283529160200191610589565b820191906000526020600020905b81548152906001019060200180831161056c57829003601f168201915b5050505050905090565b6000336105a1818585610d47565b60019150505b92915050565b6000336105bb858285610e6b565b6105c6858585610ee5565b60019150505b9392505050565b6000336105a18185856105e68383610b48565b6105f09190611bb0565b610d47565b61060133826000611094565b61060d33826001611094565b50565b60008061061c836111ab565b9250505061062a84826111eb565b949350505050565b60055460029081116106a25760405162461bcd60e51b815260206004820152602e60248201527f436f6e747261637420696e7374616e63652068617320616c726561647920626560448201526d195b881a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b600555565b60606004805461051090611b5f565b60006105a760025490565b600033816106cf8286610b48565b90508381101561072f5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610699565b61073c8286868403610d47565b506001949350505050565b6000336105a1818585610ee5565b6000806000610763846111ab565b509150915061077482828743611216565b95945050505050565b600080600061078b846111ab565b509150915061079c82828888611216565b9695505050505050565b604080517f9a9a49b990ba9bb39f8048c490a40ab25c18f55d208d5fbcf958261a9b48716d60208201526001600160a01b03881691810191909152606081018690526080810185905260009060a0016040516020818303038152906040528051906020012090506000603c5482604051602001610824929190611bc8565b60408051601f198184030181528282528051602091820120600080855291840180845281905260ff89169284019290925260608301879052608083018690529092509060019060a0016020604051602081039080840390855afa15801561088f573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166108c25760405162461bcd60e51b815260040161069990611be3565b6001600160a01b03811660009081526038602052604081208054916108e683611c0e565b9190505588146109285760405162461bcd60e51b815260206004820152600d60248201526c494e56414c49445f4e4f4e434560981b6044820152606401610699565b864211156109485760405162461bcd60e51b815260040161069990611c29565b610954818a6000611094565b610960818a6001611094565b505050505050505050565b6001600160a01b0387166109b15760405162461bcd60e51b815260206004820152600d60248201526c24a72b20a624a22fa7aba722a960991b6044820152606401610699565b834211156109d15760405162461bcd60e51b815260040161069990611c29565b6001600160a01b03878116600081815260386020908152604080832054603c5482517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98186015280840196909652958c166060860152608085018b905260a0850181905260c08086018b90528251808703909101815260e086019092528151919092012090939192610a6892919061010001611bc8565b60408051601f1981840301815282825280516020918201206000845290830180835281905260ff8816918301919091526060820186905260808201859052915060019060a0016020604051602081039080840390855afa158015610ad0573d6000803e3d6000fd5b505050602060405103516001600160a01b0316896001600160a01b031614610b0a5760405162461bcd60e51b815260040161069990611be3565b610b15826001611bb0565b6001600160a01b038a16600090815260386020526040902055610960898989610d47565b610b44338383611094565b5050565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b60007f10d8d059343739efce7dad10d09f0806da52b252b3e6a7951920d2d6ec4102e588886001811115610ba957610ba9611c55565b6040805160208101949094526001600160a01b039092169183019190915260608201526080810187905260a0810186905260c0016040516020818303038152906040528051906020012090506000603c5482604051602001610c0c929190611bc8565b60408051601f198184030181528282528051602091820120600080855291840180845281905260ff89169284019290925260608301879052608083018690529092509060019060a0016020604051602081039080840390855afa158015610c77573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610caa5760405162461bcd60e51b815260040161069990611be3565b6001600160a01b0381166000908152603860205260408120805491610cce83611c0e565b919050558814610d105760405162461bcd60e51b815260206004820152600d60248201526c494e56414c49445f4e4f4e434560981b6044820152606401610699565b86421115610d305760405162461bcd60e51b815260040161069990611c29565b610d3b818b8b611094565b50505050505050505050565b6001600160a01b038316610da95760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610699565b6001600160a01b038216610e0a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610699565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6000610e778484610b48565b90506000198114610edf5781811015610ed25760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610699565b610edf8484848403610d47565b50505050565b6001600160a01b038316610f495760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610699565b6001600160a01b038216610fab5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610699565b610fb683838361147f565b6001600160a01b0383166000908152602081905260409020548181101561102e5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610699565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3610edf565b6001600160a01b0382166110de5760405162461bcd60e51b8152602060048201526011602482015270494e56414c49445f44454c45474154454560781b6044820152606401610699565b60006110e9826111ab565b92505050600061110e856001600160a01b031660009081526020819052604090205490565b9050600061111c86846111eb565b6001600160a01b03878116600090815260208690526040902080546001600160a01b03191691881691909117905590506111588186848761155c565b846001600160a01b0316866001600160a01b03167fe8d51c8e11bd570db1734c8ec775785330e77007feed45c43b608ef33ff914bd8660405161119b9190611c8d565b60405180910390a3505050505050565b60008080808460018111156111c2576111c2611c55565b14156111d8575060399150603a9050603d6111e4565b50603e9150603f905060405b9193909250565b6001600160a01b03808316600090815260208390526040812054909116806105cc57839150506105a7565b60004382111561125f5760405162461bcd60e51b815260206004820152601460248201527324a72b20a624a22fa12627a1a5afa72aa6a122a960611b6044820152606401610699565b6001600160a01b0383166000908152602085905260409020548061129d5750506001600160a01b03821660009081526020819052604090205461062a565b6001600160a01b038416600090815260208790526040812084916112c2600185611c9b565b81526020810191909152604001600020546001600160801b03161161132f576001600160a01b038416600090815260208790526040812090611305600184611c9b565b8152602081019190915260400160002054600160801b90046001600160801b0316915061062a9050565b6001600160a01b0384166000908152602087815260408083208380529091529020546001600160801b031683101561136b57600091505061062a565b600080611379600184611c9b565b90505b8181111561144257600060026113928484611c9b565b61139c9190611cb2565b6113a69083611c9b565b6001600160a01b038816600090815260208b815260408083208484528252918290208251808401909352546001600160801b03808216808552600160801b90920416918301919091529192509087141561141357602001516001600160801b0316945061062a9350505050565b80516001600160801b031687111561142d5781935061143b565b611438600183611c9b565b92505b505061137c565b506001600160a01b0385166000908152602088815260408083209383529290522054600160801b90046001600160801b0316915050949350505050565b600061148c84603d6111eb565b9050600061149b84603d6111eb565b90506114aa828285600061155c565b60006114b78660406111eb565b905060006114c68660406111eb565b90506114d5828287600161155c565b603b546001600160a01b0316801561155257604051634a39314960e01b81526001600160a01b038981166004830152888116602483015260448201889052821690634a39314990606401600060405180830381600087803b15801561153957600080fd5b505af115801561154d573d6000803e3d6000fd5b505050505b5050505050505050565b826001600160a01b0316846001600160a01b0316141561157b57610edf565b600080611587836111ab565b5090925090506001600160a01b03861615611688576001600160a01b0386166000908152602082905260408120548015611607576001600160a01b0388166000908152602085905260408120906115df600184611c9b565b8152602081019190915260400160002054600160801b90046001600160801b03169150611623565b6001600160a01b03881660009081526020819052604090205491505b61163984848a856116348b82611c9b565b611786565b6001600160a01b0388167fa0a19463ee116110c9b282012d9b65cc5522dc38a9520340cbaf3142e550127f61166e8885611c9b565b8760405161167d929190611cd4565b60405180910390a250505b6001600160a01b0385161561177e576001600160a01b0385166000908152602082905260408120548015611702576001600160a01b0387166000908152602085905260408120906116da600184611c9b565b8152602081019190915260400160002054600160801b90046001600160801b0316915061171e565b6001600160a01b03871660009081526020819052604090205491505b61172f848489856116348b82611bb0565b6001600160a01b0387167fa0a19463ee116110c9b282012d9b65cc5522dc38a9520340cbaf3142e550127f6117648885611bb0565b87604051611773929190611cd4565b60405180910390a250505b505050505050565b6001600160a01b038316600090815260208581526040808320549188905290912043919081158015906117e857506001600160801b0383168160006117cc600186611c9b565b81526020810191909152604001600020546001600160801b0316145b1561182c57838160006117fc600186611c9b565b8152602081019190915260400160002080546001600160801b03928316600160801b029216919091179055611552565b6040805180820182526001600160801b038086168252868116602080840191825260008781529086905293909320915192518116600160801b029216919091179055611879826001611bb0565b6001600160a01b0387166000908152602089905260409020555050505050505050565b6000815180845260005b818110156118c2576020818501810151868301820152016118a6565b818111156118d4576000602083870101525b50601f01601f19169290920160200192915050565b6020815260006105cc602083018461189c565b80356001600160a01b038116811461191357600080fd5b919050565b6000806040838503121561192b57600080fd5b611934836118fc565b946020939093013593505050565b60008060006060848603121561195757600080fd5b611960846118fc565b925061196e602085016118fc565b9150604084013590509250925092565b60006020828403121561199057600080fd5b6105cc826118fc565b80356002811061191357600080fd5b600080604083850312156119bb57600080fd5b6119c4836118fc565b91506119d260208401611999565b90509250929050565b6000602082840312156119ed57600080fd5b5035919050565b600080600060608486031215611a0957600080fd5b611a12846118fc565b925060208401359150611a2760408501611999565b90509250925092565b803560ff8116811461191357600080fd5b60008060008060008060c08789031215611a5a57600080fd5b611a63876118fc565b95506020870135945060408701359350611a7f60608801611a30565b92506080870135915060a087013590509295509295509295565b600080600080600080600060e0888a031215611ab457600080fd5b611abd886118fc565b9650611acb602089016118fc565b95506040880135945060608801359350611ae760808901611a30565b925060a0880135915060c0880135905092959891949750929550565b60008060408385031215611b1657600080fd5b611b1f836118fc565b91506119d2602084016118fc565b600080600080600080600060e0888a031215611b4857600080fd5b611b51886118fc565b9650611acb60208901611999565b600181811c90821680611b7357607f821691505b60208210811415611b9457634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b60008219821115611bc357611bc3611b9a565b500190565b61190160f01b81526002810192909252602282015260420190565b602080825260119082015270494e56414c49445f5349474e415455524560781b604082015260600190565b6000600019821415611c2257611c22611b9a565b5060010190565b60208082526012908201527124a72b20a624a22fa2ac2824a920aa24a7a760711b604082015260600190565b634e487b7160e01b600052602160045260246000fd5b60028110611c8957634e487b7160e01b600052602160045260246000fd5b9052565b602081016105a78284611c6b565b600082821015611cad57611cad611b9a565b500390565b600082611ccf57634e487b7160e01b600052601260045260246000fd5b500490565b828152604081016105cc6020830184611c6b56fea264697066735822122005446f275bf81ac8c7b738fd45810e492413f03b6ece148c3f24abe6e6c8c52264736f6c634300080a0033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101e55760003560e01c80638129fc1c1161010f578063c2ffbb91116100a2578063dc937e1c11610071578063dc937e1c146104c0578063dd62ed3e146104d3578063dde43cba146104e6578063f713d8a8146104ee57600080fd5b8063c2ffbb9114610474578063c3863ada14610487578063c3cda5201461049a578063d505accf146104ad57600080fd5b8063a9059cbb116100de578063a9059cbb14610407578063aa9fbe021461041a578063b2f4201d14610441578063b9844d8d1461045457600080fd5b80638129fc1c146103d157806395d89b41146103d9578063981b24d0146103e1578063a457c2d7146103f457600080fd5b806339509351116101875780636f50458d116101565780636f50458d1461033d57806370a082311461036857806378160376146103915780637bb73c97146103b157600080fd5b8063395093511461028f57806341cbf54a146102a25780635b3cc0cf146102c95780635c19a95c1461032857600080fd5b806323b872dd116101c357806323b872dd1461023d57806330adf81f14610250578063313ce567146102775780633644e5151461028657600080fd5b806306fdde03146101ea578063095ea7b31461020857806318160ddd1461022b575b600080fd5b6101f2610501565b6040516101ff91906118e9565b60405180910390f35b61021b610216366004611918565b610593565b60405190151581526020016101ff565b6002545b6040519081526020016101ff565b61021b61024b366004611942565b6105ad565b61022f7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b604051601281526020016101ff565b61022f603c5481565b61021b61029d366004611918565b6105d3565b61022f7f9a9a49b990ba9bb39f8048c490a40ab25c18f55d208d5fbcf958261a9b48716d81565b6103086102d7366004611918565b60396020908152600092835260408084209091529082529020546001600160801b0380821691600160801b90041682565b604080516001600160801b039384168152929091166020830152016101ff565b61033b61033636600461197e565b6105f5565b005b61035061034b3660046119a8565b610610565b6040516001600160a01b0390911681526020016101ff565b61022f61037636600461197e565b6001600160a01b031660009081526020819052604090205490565b6101f2604051806040016040528060018152602001603160f81b81525081565b61022f6103bf36600461197e565b603a6020526000908152604090205481565b61033b610632565b6101f26106a7565b61022f6103ef3660046119db565b6106b6565b61021b610402366004611918565b6106c1565b61021b610415366004611918565b610747565b61022f7f10d8d059343739efce7dad10d09f0806da52b252b3e6a7951920d2d6ec4102e581565b61022f61044f3660046119a8565b610755565b61022f61046236600461197e565b60386020526000908152604090205481565b61022f6104823660046119f4565b61077d565b603b54610350906001600160a01b031681565b61033b6104a8366004611a41565b6107a6565b61033b6104bb366004611a99565b61096b565b61033b6104ce3660046119a8565b610b39565b61022f6104e1366004611b03565b610b48565b61022f600281565b61033b6104fc366004611b2d565b610b73565b60606003805461051090611b5f565b80601f016020809104026020016040519081016040528092919081815260200182805461053c90611b5f565b80156105895780601f1061055e57610100808354040283529160200191610589565b820191906000526020600020905b81548152906001019060200180831161056c57829003601f168201915b5050505050905090565b6000336105a1818585610d47565b60019150505b92915050565b6000336105bb858285610e6b565b6105c6858585610ee5565b60019150505b9392505050565b6000336105a18185856105e68383610b48565b6105f09190611bb0565b610d47565b61060133826000611094565b61060d33826001611094565b50565b60008061061c836111ab565b9250505061062a84826111eb565b949350505050565b60055460029081116106a25760405162461bcd60e51b815260206004820152602e60248201527f436f6e747261637420696e7374616e63652068617320616c726561647920626560448201526d195b881a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b600555565b60606004805461051090611b5f565b60006105a760025490565b600033816106cf8286610b48565b90508381101561072f5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610699565b61073c8286868403610d47565b506001949350505050565b6000336105a1818585610ee5565b6000806000610763846111ab565b509150915061077482828743611216565b95945050505050565b600080600061078b846111ab565b509150915061079c82828888611216565b9695505050505050565b604080517f9a9a49b990ba9bb39f8048c490a40ab25c18f55d208d5fbcf958261a9b48716d60208201526001600160a01b03881691810191909152606081018690526080810185905260009060a0016040516020818303038152906040528051906020012090506000603c5482604051602001610824929190611bc8565b60408051601f198184030181528282528051602091820120600080855291840180845281905260ff89169284019290925260608301879052608083018690529092509060019060a0016020604051602081039080840390855afa15801561088f573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166108c25760405162461bcd60e51b815260040161069990611be3565b6001600160a01b03811660009081526038602052604081208054916108e683611c0e565b9190505588146109285760405162461bcd60e51b815260206004820152600d60248201526c494e56414c49445f4e4f4e434560981b6044820152606401610699565b864211156109485760405162461bcd60e51b815260040161069990611c29565b610954818a6000611094565b610960818a6001611094565b505050505050505050565b6001600160a01b0387166109b15760405162461bcd60e51b815260206004820152600d60248201526c24a72b20a624a22fa7aba722a960991b6044820152606401610699565b834211156109d15760405162461bcd60e51b815260040161069990611c29565b6001600160a01b03878116600081815260386020908152604080832054603c5482517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98186015280840196909652958c166060860152608085018b905260a0850181905260c08086018b90528251808703909101815260e086019092528151919092012090939192610a6892919061010001611bc8565b60408051601f1981840301815282825280516020918201206000845290830180835281905260ff8816918301919091526060820186905260808201859052915060019060a0016020604051602081039080840390855afa158015610ad0573d6000803e3d6000fd5b505050602060405103516001600160a01b0316896001600160a01b031614610b0a5760405162461bcd60e51b815260040161069990611be3565b610b15826001611bb0565b6001600160a01b038a16600090815260386020526040902055610960898989610d47565b610b44338383611094565b5050565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b60007f10d8d059343739efce7dad10d09f0806da52b252b3e6a7951920d2d6ec4102e588886001811115610ba957610ba9611c55565b6040805160208101949094526001600160a01b039092169183019190915260608201526080810187905260a0810186905260c0016040516020818303038152906040528051906020012090506000603c5482604051602001610c0c929190611bc8565b60408051601f198184030181528282528051602091820120600080855291840180845281905260ff89169284019290925260608301879052608083018690529092509060019060a0016020604051602081039080840390855afa158015610c77573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610caa5760405162461bcd60e51b815260040161069990611be3565b6001600160a01b0381166000908152603860205260408120805491610cce83611c0e565b919050558814610d105760405162461bcd60e51b815260206004820152600d60248201526c494e56414c49445f4e4f4e434560981b6044820152606401610699565b86421115610d305760405162461bcd60e51b815260040161069990611c29565b610d3b818b8b611094565b50505050505050505050565b6001600160a01b038316610da95760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610699565b6001600160a01b038216610e0a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610699565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6000610e778484610b48565b90506000198114610edf5781811015610ed25760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610699565b610edf8484848403610d47565b50505050565b6001600160a01b038316610f495760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610699565b6001600160a01b038216610fab5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610699565b610fb683838361147f565b6001600160a01b0383166000908152602081905260409020548181101561102e5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610699565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3610edf565b6001600160a01b0382166110de5760405162461bcd60e51b8152602060048201526011602482015270494e56414c49445f44454c45474154454560781b6044820152606401610699565b60006110e9826111ab565b92505050600061110e856001600160a01b031660009081526020819052604090205490565b9050600061111c86846111eb565b6001600160a01b03878116600090815260208690526040902080546001600160a01b03191691881691909117905590506111588186848761155c565b846001600160a01b0316866001600160a01b03167fe8d51c8e11bd570db1734c8ec775785330e77007feed45c43b608ef33ff914bd8660405161119b9190611c8d565b60405180910390a3505050505050565b60008080808460018111156111c2576111c2611c55565b14156111d8575060399150603a9050603d6111e4565b50603e9150603f905060405b9193909250565b6001600160a01b03808316600090815260208390526040812054909116806105cc57839150506105a7565b60004382111561125f5760405162461bcd60e51b815260206004820152601460248201527324a72b20a624a22fa12627a1a5afa72aa6a122a960611b6044820152606401610699565b6001600160a01b0383166000908152602085905260409020548061129d5750506001600160a01b03821660009081526020819052604090205461062a565b6001600160a01b038416600090815260208790526040812084916112c2600185611c9b565b81526020810191909152604001600020546001600160801b03161161132f576001600160a01b038416600090815260208790526040812090611305600184611c9b565b8152602081019190915260400160002054600160801b90046001600160801b0316915061062a9050565b6001600160a01b0384166000908152602087815260408083208380529091529020546001600160801b031683101561136b57600091505061062a565b600080611379600184611c9b565b90505b8181111561144257600060026113928484611c9b565b61139c9190611cb2565b6113a69083611c9b565b6001600160a01b038816600090815260208b815260408083208484528252918290208251808401909352546001600160801b03808216808552600160801b90920416918301919091529192509087141561141357602001516001600160801b0316945061062a9350505050565b80516001600160801b031687111561142d5781935061143b565b611438600183611c9b565b92505b505061137c565b506001600160a01b0385166000908152602088815260408083209383529290522054600160801b90046001600160801b0316915050949350505050565b600061148c84603d6111eb565b9050600061149b84603d6111eb565b90506114aa828285600061155c565b60006114b78660406111eb565b905060006114c68660406111eb565b90506114d5828287600161155c565b603b546001600160a01b0316801561155257604051634a39314960e01b81526001600160a01b038981166004830152888116602483015260448201889052821690634a39314990606401600060405180830381600087803b15801561153957600080fd5b505af115801561154d573d6000803e3d6000fd5b505050505b5050505050505050565b826001600160a01b0316846001600160a01b0316141561157b57610edf565b600080611587836111ab565b5090925090506001600160a01b03861615611688576001600160a01b0386166000908152602082905260408120548015611607576001600160a01b0388166000908152602085905260408120906115df600184611c9b565b8152602081019190915260400160002054600160801b90046001600160801b03169150611623565b6001600160a01b03881660009081526020819052604090205491505b61163984848a856116348b82611c9b565b611786565b6001600160a01b0388167fa0a19463ee116110c9b282012d9b65cc5522dc38a9520340cbaf3142e550127f61166e8885611c9b565b8760405161167d929190611cd4565b60405180910390a250505b6001600160a01b0385161561177e576001600160a01b0385166000908152602082905260408120548015611702576001600160a01b0387166000908152602085905260408120906116da600184611c9b565b8152602081019190915260400160002054600160801b90046001600160801b0316915061171e565b6001600160a01b03871660009081526020819052604090205491505b61172f848489856116348b82611bb0565b6001600160a01b0387167fa0a19463ee116110c9b282012d9b65cc5522dc38a9520340cbaf3142e550127f6117648885611bb0565b87604051611773929190611cd4565b60405180910390a250505b505050505050565b6001600160a01b038316600090815260208581526040808320549188905290912043919081158015906117e857506001600160801b0383168160006117cc600186611c9b565b81526020810191909152604001600020546001600160801b0316145b1561182c57838160006117fc600186611c9b565b8152602081019190915260400160002080546001600160801b03928316600160801b029216919091179055611552565b6040805180820182526001600160801b038086168252868116602080840191825260008781529086905293909320915192518116600160801b029216919091179055611879826001611bb0565b6001600160a01b0387166000908152602089905260409020555050505050505050565b6000815180845260005b818110156118c2576020818501810151868301820152016118a6565b818111156118d4576000602083870101525b50601f01601f19169290920160200192915050565b6020815260006105cc602083018461189c565b80356001600160a01b038116811461191357600080fd5b919050565b6000806040838503121561192b57600080fd5b611934836118fc565b946020939093013593505050565b60008060006060848603121561195757600080fd5b611960846118fc565b925061196e602085016118fc565b9150604084013590509250925092565b60006020828403121561199057600080fd5b6105cc826118fc565b80356002811061191357600080fd5b600080604083850312156119bb57600080fd5b6119c4836118fc565b91506119d260208401611999565b90509250929050565b6000602082840312156119ed57600080fd5b5035919050565b600080600060608486031215611a0957600080fd5b611a12846118fc565b925060208401359150611a2760408501611999565b90509250925092565b803560ff8116811461191357600080fd5b60008060008060008060c08789031215611a5a57600080fd5b611a63876118fc565b95506020870135945060408701359350611a7f60608801611a30565b92506080870135915060a087013590509295509295509295565b600080600080600080600060e0888a031215611ab457600080fd5b611abd886118fc565b9650611acb602089016118fc565b95506040880135945060608801359350611ae760808901611a30565b925060a0880135915060c0880135905092959891949750929550565b60008060408385031215611b1657600080fd5b611b1f836118fc565b91506119d2602084016118fc565b600080600080600080600060e0888a031215611b4857600080fd5b611b51886118fc565b9650611acb60208901611999565b600181811c90821680611b7357607f821691505b60208210811415611b9457634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b60008219821115611bc357611bc3611b9a565b500190565b61190160f01b81526002810192909252602282015260420190565b602080825260119082015270494e56414c49445f5349474e415455524560781b604082015260600190565b6000600019821415611c2257611c22611b9a565b5060010190565b60208082526012908201527124a72b20a624a22fa2ac2824a920aa24a7a760711b604082015260600190565b634e487b7160e01b600052602160045260246000fd5b60028110611c8957634e487b7160e01b600052602160045260246000fd5b9052565b602081016105a78284611c6b565b600082821015611cad57611cad611b9a565b500390565b600082611ccf57634e487b7160e01b600052601260045260246000fd5b500490565b828152604081016105cc6020830184611c6b56fea264697066735822122005446f275bf81ac8c7b738fd45810e492413f03b6ece148c3f24abe6e6c8c52264736f6c634300080a0033
Loading...
Loading
Loading...
Loading
Loading...
Loading
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.