Request form
Flash loan Attacker
  • Utility
  • No-Code Deploy
Docs
Source
ChefGPT

Flash loan Attacker

This contract is an attacker contract that utilizes flash loans to borrow assets from a lending pool, supply assets to the pool, and execute operations to mint and return tokens with a premium.

FlashloanAttacker :
SafeMath :
IERC20 :
Interface of the ERC20 standard as defined in the EIP.
Approval(address,address,uint256) :
Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance.
Transfer(address,address,uint256) :
Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero.
allowance(address,address) :
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.
approve(address,uint256) :
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.
balanceOf(address) :
Returns the amount of tokens owned by `account`.
totalSupply() :
Returns the amount of tokens in existence.
transfer(address,uint256) :
Moves `amount` tokens from the caller's account to `recipient`. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event.
transferFrom(address,address,uint256) :
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.
GPv2SafeERC20 :
Gas-efficient version of Openzeppelin's SafeERC20 contract.
IPoolAddressesProvider :
ACLAdminUpdated(address,address) :
Emitted when the ACL admin is updated.
ACLManagerUpdated(address,address) :
Emitted when the ACL manager is updated.
AddressSet(bytes32,address,address) :
Emitted when a new non-proxied contract address is registered.
AddressSetAsProxy(bytes32,address,address,address) :
Emitted when the implementation of the proxy registered with id is updated
MarketIdSet(string,string) :
Emitted when the market identifier is updated.
PoolConfiguratorUpdated(address,address) :
Emitted when the pool configurator is updated.
PoolDataProviderUpdated(address,address) :
Emitted when the pool data provider is updated.
PoolUpdated(address,address) :
Emitted when the pool is updated.
PriceOracleSentinelUpdated(address,address) :
Emitted when the price oracle sentinel is updated.
PriceOracleUpdated(address,address) :
Emitted when the price oracle is updated.
ProxyCreated(bytes32,address,address) :
Emitted when a new proxy is created.
getAddress(bytes32) :
The returned address might be an EOA or a contract, potentially proxiedIt returns ZERO if there is no registered address with the given id
setAddress(bytes32,address) :
IMPORTANT Use this function carefully, as it will do a hard replacement
setAddressAsProxy(bytes32,address) :
IMPORTANT Use this function carefully, only for ids that don't have an explicit setter function, in order to avoid unexpected consequences
setMarketId(string) :
This can be used to create an onchain registry of PoolAddressesProviders to identify and validate multiple Aave markets.
FlashLoanSimpleReceiverBase :
executeOperation(address,uint256,uint256,address,bytes) :
Ensure that the contract can return the debt + premium, e.g., has enough funds to repay and has approved the Pool to pull the total amount
IFlashLoanSimpleReceiver :
Implement this interface to develop a flashloan-compatible flashLoanReceiver contract
executeOperation(address,uint256,uint256,address,bytes) :
Ensure that the contract can return the debt + premium, e.g., has enough funds to repay and has approved the Pool to pull the total amount
IPool :
BackUnbacked(address,address,uint256,uint256) :
Emitted on backUnbacked()
Borrow(address,address,address,uint256,uint8,uint256,uint16) :
Emitted on borrow() and flashLoan() when debt needs to be opened
FlashLoan(address,address,address,uint256,uint8,uint256,uint16) :
Emitted on flashLoan()
IsolationModeTotalDebtUpdated(address,uint256) :
Emitted on borrow(), repay() and liquidationCall() when using isolated assets
LiquidationCall(address,address,address,uint256,uint256,address,bool) :
Emitted when a borrower is liquidated.
MintUnbacked(address,address,address,uint256,uint16) :
Emitted on mintUnbacked()
MintedToTreasury(address,uint256) :
Emitted when the protocol treasury receives minted aTokens from the accrued interest.
RebalanceStableBorrowRate(address,address) :
Emitted on rebalanceStableBorrowRate()
Repay(address,address,address,uint256,bool) :
Emitted on repay()
ReserveDataUpdated(address,uint256,uint256,uint256,uint256,uint256) :
Emitted when the state of a reserve is updated.
ReserveUsedAsCollateralDisabled(address,address) :
Emitted on setUserUseReserveAsCollateral()
ReserveUsedAsCollateralEnabled(address,address) :
Emitted on setUserUseReserveAsCollateral()
Supply(address,address,address,uint256,uint16) :
Emitted on supply()
SwapBorrowRateMode(address,address,uint8) :
Emitted on swapBorrowRateMode()
UserEModeSet(address,uint8) :
Emitted when the user selects a certain asset category for eMode
Withdraw(address,address,address,uint256) :
Emitted on withdraw()
configureEModeCategory(uint8,(uint16,uint16,uint16,address,string)) :
In eMode, the protocol allows very high borrowing power to borrow assets of the same category. The category 0 is reserved as it's the default for volatile assets
deposit(address,uint256,address,uint16) :
Deprecated: Use the `supply` function instead
dropReserve(address) :
Only callable by the PoolConfigurator contract
finalizeTransfer(address,address,address,uint256,uint256,uint256) :
Only callable by the overlying aToken of the `asset`
flashLoan(address,address[],uint256[],uint256[],address,bytes,uint16) :
IMPORTANT There are security concerns for developers of flashloan receiver contracts that must be kept into consideration. For further details please visit https://docs.aave.com/developers/
flashLoanSimple(address,address,uint256,bytes,uint16) :
IMPORTANT There are security concerns for developers of flashloan receiver contracts that must be kept into consideration. For further details please visit https://docs.aave.com/developers/
getReserveNormalizedVariableDebt(address) :
WARNING: This function is intended to be used primarily by the protocol itself to get a "dynamic" variable index based on time, current stored index and virtual rate at the current moment (approx. a borrower would get if opening a position). This means that is always used in combination with variable debt supply/balances. If using this function externally, consider that is possible to have an increasing normalized variable debt that is not equivalent to how the variable debt index would be updated in storage (e.g. only updates with non-zero variable debt supply)
getReservesList() :
It does not include dropped reserves
initReserve(address,address,address,address,address) :
Only callable by the PoolConfigurator contract
repayWithATokens(address,uint256,uint256) :
Passing uint256.max as amount will clean up any residual aToken dust balance, if the user aToken balance is not enough to cover the whole debt
resetIsolationModeTotalDebt(address) :
It requires the given asset has zero debt ceiling
setConfiguration(address,(uint256)) :
Only callable by the PoolConfigurator contract
setReserveInterestRateStrategyAddress(address,address) :
Only callable by the PoolConfigurator contract
updateFlashloanPremiums(uint128,uint128) :
The total premium is calculated on the total borrowed amountThe premium to protocol is calculated on the total premium, being a percentage of `flashLoanPremiumTotal`Only callable by the PoolConfigurator contract
DataTypes :
MintableERC20 :
ERC20 minting logic
allowance(address,address) :
See {IERC20-allowance}.
approve(address,uint256) :
See {IERC20-approve}. Requirements: - `spender` cannot be the zero address.
balanceOf(address) :
See {IERC20-balanceOf}.
decimals() :
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}.
decreaseAllowance(address,uint256) :
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`.
increaseAllowance(address,uint256) :
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.
mint(address,uint256) :
Function to mint tokens to address
mint(uint256) :
Function to mint tokens
name() :
Returns the name of the token.
permit(address,address,uint256,uint256,uint8,bytes32,bytes32) :
implements the permit function as for https://github.com/ethereum/EIPs/blob/8a34d644aacf0f9f8f00815307fd7dd5da07655f/EIPS/eip-2612.md
symbol() :
Returns the symbol of the token, usually a shorter version of the name.
totalSupply() :
See {IERC20-totalSupply}.
transfer(address,uint256) :
See {IERC20-transfer}. Requirements: - `recipient` cannot be the zero address. - the caller must have a balance of at least `amount`.
transferFrom(address,address,uint256) :
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`.
ERC20 :
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}.
allowance(address,address) :
See {IERC20-allowance}.
approve(address,uint256) :
See {IERC20-approve}. Requirements: - `spender` cannot be the zero address.
balanceOf(address) :
See {IERC20-balanceOf}.
constructor :
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.
decimals() :
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}.
decreaseAllowance(address,uint256) :
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`.
increaseAllowance(address,uint256) :
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.
name() :
Returns the name of the token.
symbol() :
Returns the symbol of the token, usually a shorter version of the name.
totalSupply() :
See {IERC20-totalSupply}.
transfer(address,uint256) :
See {IERC20-transfer}. Requirements: - `recipient` cannot be the zero address. - the caller must have a balance of at least `amount`.
transferFrom(address,address,uint256) :
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`.
Context :
Address :
Collection of functions related to the address type
IERC20WithPermit :
allowance(address,address) :
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.
approve(address,uint256) :
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.
balanceOf(address) :
Returns the amount of tokens owned by `account`.
permit(address,address,uint256,uint256,uint8,bytes32,bytes32) :
implements the permit function as for https://github.com/ethereum/EIPs/blob/8a34d644aacf0f9f8f00815307fd7dd5da07655f/EIPS/eip-2612.md
totalSupply() :
Returns the amount of tokens in existence.
transfer(address,uint256) :
Moves `amount` tokens from the caller's account to `recipient`. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event.
transferFrom(address,address,uint256) :
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.
FlashloanAttacker.sol
SafeMath.sol
IERC20.sol
GPv2SafeERC20.sol
IPoolAddressesProvider.sol
FlashLoanSimpleReceiverBase.sol
IFlashLoanSimpleReceiver.sol
IPool.sol
DataTypes.sol
MintableERC20.sol
ERC20.sol
Context.sol
Address.sol
IERC20WithPermit.sol

4077 downloads

Creator

Aave
Aave / Flash loan Attacker
  • Utility
  • No-Code Deploy
Docs
Source
ChefGPT
Expand
Share

Get Cookin'
star icon4077

4077 downloads

Creator

Aave

Flash loan Attacker

This contract is an attacker contract that utilizes flash loans to borrow assets from a lending pool, supply assets to the pool, and execute operations to mint and return tokens with a premium.

FlashloanAttacker :
SafeMath :
IERC20 :
Interface of the ERC20 standard as defined in the EIP.
Approval(address,address,uint256) :
Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance.
Transfer(address,address,uint256) :
Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero.
allowance(address,address) :
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.
approve(address,uint256) :
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.
balanceOf(address) :
Returns the amount of tokens owned by `account`.
totalSupply() :
Returns the amount of tokens in existence.
transfer(address,uint256) :
Moves `amount` tokens from the caller's account to `recipient`. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event.
transferFrom(address,address,uint256) :
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.
GPv2SafeERC20 :
Gas-efficient version of Openzeppelin's SafeERC20 contract.
IPoolAddressesProvider :
ACLAdminUpdated(address,address) :
Emitted when the ACL admin is updated.
ACLManagerUpdated(address,address) :
Emitted when the ACL manager is updated.
AddressSet(bytes32,address,address) :
Emitted when a new non-proxied contract address is registered.
AddressSetAsProxy(bytes32,address,address,address) :
Emitted when the implementation of the proxy registered with id is updated
MarketIdSet(string,string) :
Emitted when the market identifier is updated.
PoolConfiguratorUpdated(address,address) :
Emitted when the pool configurator is updated.
PoolDataProviderUpdated(address,address) :
Emitted when the pool data provider is updated.
PoolUpdated(address,address) :
Emitted when the pool is updated.
PriceOracleSentinelUpdated(address,address) :
Emitted when the price oracle sentinel is updated.
PriceOracleUpdated(address,address) :
Emitted when the price oracle is updated.
ProxyCreated(bytes32,address,address) :
Emitted when a new proxy is created.
getAddress(bytes32) :
The returned address might be an EOA or a contract, potentially proxiedIt returns ZERO if there is no registered address with the given id
setAddress(bytes32,address) :
IMPORTANT Use this function carefully, as it will do a hard replacement
setAddressAsProxy(bytes32,address) :
IMPORTANT Use this function carefully, only for ids that don't have an explicit setter function, in order to avoid unexpected consequences
setMarketId(string) :
This can be used to create an onchain registry of PoolAddressesProviders to identify and validate multiple Aave markets.
FlashLoanSimpleReceiverBase :
executeOperation(address,uint256,uint256,address,bytes) :
Ensure that the contract can return the debt + premium, e.g., has enough funds to repay and has approved the Pool to pull the total amount
IFlashLoanSimpleReceiver :
Implement this interface to develop a flashloan-compatible flashLoanReceiver contract
executeOperation(address,uint256,uint256,address,bytes) :
Ensure that the contract can return the debt + premium, e.g., has enough funds to repay and has approved the Pool to pull the total amount
IPool :
BackUnbacked(address,address,uint256,uint256) :
Emitted on backUnbacked()
Borrow(address,address,address,uint256,uint8,uint256,uint16) :
Emitted on borrow() and flashLoan() when debt needs to be opened
FlashLoan(address,address,address,uint256,uint8,uint256,uint16) :
Emitted on flashLoan()
IsolationModeTotalDebtUpdated(address,uint256) :
Emitted on borrow(), repay() and liquidationCall() when using isolated assets
LiquidationCall(address,address,address,uint256,uint256,address,bool) :
Emitted when a borrower is liquidated.
MintUnbacked(address,address,address,uint256,uint16) :
Emitted on mintUnbacked()
MintedToTreasury(address,uint256) :
Emitted when the protocol treasury receives minted aTokens from the accrued interest.
RebalanceStableBorrowRate(address,address) :
Emitted on rebalanceStableBorrowRate()
Repay(address,address,address,uint256,bool) :
Emitted on repay()
ReserveDataUpdated(address,uint256,uint256,uint256,uint256,uint256) :
Emitted when the state of a reserve is updated.
ReserveUsedAsCollateralDisabled(address,address) :
Emitted on setUserUseReserveAsCollateral()
ReserveUsedAsCollateralEnabled(address,address) :
Emitted on setUserUseReserveAsCollateral()
Supply(address,address,address,uint256,uint16) :
Emitted on supply()
SwapBorrowRateMode(address,address,uint8) :
Emitted on swapBorrowRateMode()
UserEModeSet(address,uint8) :
Emitted when the user selects a certain asset category for eMode
Withdraw(address,address,address,uint256) :
Emitted on withdraw()
configureEModeCategory(uint8,(uint16,uint16,uint16,address,string)) :
In eMode, the protocol allows very high borrowing power to borrow assets of the same category. The category 0 is reserved as it's the default for volatile assets
deposit(address,uint256,address,uint16) :
Deprecated: Use the `supply` function instead
dropReserve(address) :
Only callable by the PoolConfigurator contract
finalizeTransfer(address,address,address,uint256,uint256,uint256) :
Only callable by the overlying aToken of the `asset`
flashLoan(address,address[],uint256[],uint256[],address,bytes,uint16) :
IMPORTANT There are security concerns for developers of flashloan receiver contracts that must be kept into consideration. For further details please visit https://docs.aave.com/developers/
flashLoanSimple(address,address,uint256,bytes,uint16) :
IMPORTANT There are security concerns for developers of flashloan receiver contracts that must be kept into consideration. For further details please visit https://docs.aave.com/developers/
getReserveNormalizedVariableDebt(address) :
WARNING: This function is intended to be used primarily by the protocol itself to get a "dynamic" variable index based on time, current stored index and virtual rate at the current moment (approx. a borrower would get if opening a position). This means that is always used in combination with variable debt supply/balances. If using this function externally, consider that is possible to have an increasing normalized variable debt that is not equivalent to how the variable debt index would be updated in storage (e.g. only updates with non-zero variable debt supply)
getReservesList() :
It does not include dropped reserves
initReserve(address,address,address,address,address) :
Only callable by the PoolConfigurator contract
repayWithATokens(address,uint256,uint256) :
Passing uint256.max as amount will clean up any residual aToken dust balance, if the user aToken balance is not enough to cover the whole debt
resetIsolationModeTotalDebt(address) :
It requires the given asset has zero debt ceiling
setConfiguration(address,(uint256)) :
Only callable by the PoolConfigurator contract
setReserveInterestRateStrategyAddress(address,address) :
Only callable by the PoolConfigurator contract
updateFlashloanPremiums(uint128,uint128) :
The total premium is calculated on the total borrowed amountThe premium to protocol is calculated on the total premium, being a percentage of `flashLoanPremiumTotal`Only callable by the PoolConfigurator contract
DataTypes :
MintableERC20 :
ERC20 minting logic
allowance(address,address) :
See {IERC20-allowance}.
approve(address,uint256) :
See {IERC20-approve}. Requirements: - `spender` cannot be the zero address.
balanceOf(address) :
See {IERC20-balanceOf}.
decimals() :
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}.
decreaseAllowance(address,uint256) :
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`.
increaseAllowance(address,uint256) :
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.
mint(address,uint256) :
Function to mint tokens to address
mint(uint256) :
Function to mint tokens
name() :
Returns the name of the token.
permit(address,address,uint256,uint256,uint8,bytes32,bytes32) :
implements the permit function as for https://github.com/ethereum/EIPs/blob/8a34d644aacf0f9f8f00815307fd7dd5da07655f/EIPS/eip-2612.md
symbol() :
Returns the symbol of the token, usually a shorter version of the name.
totalSupply() :
See {IERC20-totalSupply}.
transfer(address,uint256) :
See {IERC20-transfer}. Requirements: - `recipient` cannot be the zero address. - the caller must have a balance of at least `amount`.
transferFrom(address,address,uint256) :
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`.
ERC20 :
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}.
allowance(address,address) :
See {IERC20-allowance}.
approve(address,uint256) :
See {IERC20-approve}. Requirements: - `spender` cannot be the zero address.
balanceOf(address) :
See {IERC20-balanceOf}.
constructor :
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.
decimals() :
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}.
decreaseAllowance(address,uint256) :
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`.
increaseAllowance(address,uint256) :
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.
name() :
Returns the name of the token.
symbol() :
Returns the symbol of the token, usually a shorter version of the name.
totalSupply() :
See {IERC20-totalSupply}.
transfer(address,uint256) :
See {IERC20-transfer}. Requirements: - `recipient` cannot be the zero address. - the caller must have a balance of at least `amount`.
transferFrom(address,address,uint256) :
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`.
Context :
Address :
Collection of functions related to the address type
IERC20WithPermit :
allowance(address,address) :
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.
approve(address,uint256) :
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.
balanceOf(address) :
Returns the amount of tokens owned by `account`.
permit(address,address,uint256,uint256,uint8,bytes32,bytes32) :
implements the permit function as for https://github.com/ethereum/EIPs/blob/8a34d644aacf0f9f8f00815307fd7dd5da07655f/EIPS/eip-2612.md
totalSupply() :
Returns the amount of tokens in existence.
transfer(address,uint256) :
Moves `amount` tokens from the caller's account to `recipient`. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event.
transferFrom(address,address,uint256) :
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.
FlashloanAttacker.sol
SafeMath.sol
IERC20.sol
GPv2SafeERC20.sol
IPoolAddressesProvider.sol
FlashLoanSimpleReceiverBase.sol
IFlashLoanSimpleReceiver.sol
IPool.sol
DataTypes.sol
MintableERC20.sol
ERC20.sol
Context.sol
Address.sol
IERC20WithPermit.sol