Contract 0x0c8fc7a71C28c768FDC1f7d75835229beBEB1573 11

 
Txn Hash Method
Block
From
To
Value
0xa3834c15c3467df61658e74e55998ee7e7fe0cb53c6965ae73adf4f44442460fAdd Markets82010022023-12-21 20:42:3167 days 6 hrs ago0x56e44874f624ebde6efcc783efd685f0fbdc6dcf IN  0x0c8fc7a71c28c768fdc1f7d75835229bebeb15730 ETH0.0000879162030.000000151
[ Download CSV Export 
Latest 2 internal transactions
Parent Txn Hash Block From To Value
0x6616bfb8d1276a680f9cb25402d8060641861b1d6a156aa3a2a5e2f92535afa282009942023-12-21 20:42:1567 days 6 hrs ago 0xed047531e059eaa73c6baf917ca0a2b45c66cd4d 0x0c8fc7a71c28c768fdc1f7d75835229bebeb15730 ETH
0x6616bfb8d1276a680f9cb25402d8060641861b1d6a156aa3a2a5e2f92535afa282009942023-12-21 20:42:1567 days 6 hrs ago 0xed047531e059eaa73c6baf917ca0a2b45c66cd4d  Contract Creation0 ETH
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
AaveWrapperV3

Compiler Version
v0.8.23+commit.f704f362

Optimization Enabled:
Yes with 1000000 runs

Other Settings:
paris EvmVersion
File 1 of 4 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.20;

/**
 * @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 value of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the value of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves a `value` amount of 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 value) 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 a `value` amount of tokens 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 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the
     * allowance mechanism. `value` 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 value) external returns (bool);
}

File 2 of 4 : ILendingPoolV3.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.23;

// AaveProtocolDataProvider
interface ILendingPoolV3 {
    function getReserveTokensAddresses(address asset) external view returns (address aTokenAddress, address stableDebtTokenAddress, address variableDebtTokenAddress);

    struct TokenData {
        string symbol;
        address tokenAddress;
    }

    function getAllReservesTokens() external view returns (TokenData[] memory);
}

File 3 of 4 : IWrapper.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.23;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

interface IWrapper {
    error NotSupportedToken();
    error NotAddedMarket();
    error NotRemovedMarket();

    function wrap(IERC20 token) external view returns (IERC20 wrappedToken, uint256 rate);
}

File 4 of 4 : AaveWrapperV3.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.23;

import "../interfaces/ILendingPoolV3.sol";
import "../interfaces/IWrapper.sol";

contract AaveWrapperV3 is IWrapper {
    // solhint-disable-next-line var-name-mixedcase
    ILendingPoolV3 private immutable _LENDING_POOL;

    mapping(IERC20 => IERC20) public aTokenToToken;
    mapping(IERC20 => IERC20) public tokenToaToken;

    constructor(ILendingPoolV3 lendingPool) {
        _LENDING_POOL = lendingPool;
    }

    function addMarkets(IERC20[] memory tokens) external {
        unchecked {
            for (uint256 i = 0; i < tokens.length; i++) {
                (address aTokenAddress,,) = _LENDING_POOL.getReserveTokensAddresses(address(tokens[i]));
                IERC20 aToken = IERC20(aTokenAddress);
                if(aToken == IERC20(address(0))) revert NotAddedMarket();
                aTokenToToken[aToken] = tokens[i];
                tokenToaToken[tokens[i]] = aToken;
            }
        }
    }

    function removeMarkets(IERC20[] memory tokens) external {
        unchecked {
            for (uint256 i = 0; i < tokens.length; i++) {
                (address aTokenAddress,,) = _LENDING_POOL.getReserveTokensAddresses(address(tokens[i]));
                IERC20 aToken = IERC20(aTokenAddress);
                if(aToken == IERC20(address(0))) revert NotRemovedMarket();
                delete aTokenToToken[aToken];
                delete tokenToaToken[tokens[i]];
            }
        }
    }

    function wrap(IERC20 token) external view override returns (IERC20 wrappedToken, uint256 rate) {
        IERC20 underlying = aTokenToToken[token];
        IERC20 aToken = tokenToaToken[token];
        if (underlying != IERC20(address(0))) {
            return (underlying, 1e18);
        } else if (aToken != IERC20(address(0))) {
            return (aToken, 1e18);
        } else {
            revert NotSupportedToken();
        }
    }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 1000000
  },
  "evmVersion": "paris",
  "viaIR": true,
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "metadata": {
    "useLiteralContent": true
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract ILendingPoolV3","name":"lendingPool","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"NotAddedMarket","type":"error"},{"inputs":[],"name":"NotRemovedMarket","type":"error"},{"inputs":[],"name":"NotSupportedToken","type":"error"},{"inputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"name":"aTokenToToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20[]","name":"tokens","type":"address[]"}],"name":"addMarkets","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20[]","name":"tokens","type":"address[]"}],"name":"removeMarkets","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"name":"tokenToaToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"}],"name":"wrap","outputs":[{"internalType":"contract IERC20","name":"wrappedToken","type":"address"},{"internalType":"uint256","name":"rate","type":"uint256"}],"stateMutability":"view","type":"function"}]

60a03461007057601f6107a238819003918201601f19168301916001600160401b038311848410176100755780849260209460405283398101031261007057516001600160a01b038116810361007057608052604051610716908161008c8239608051818181608201526102060152f35b600080fd5b634e487b7160e01b600052604160045260246000fdfe604060808152600490600436101561001657600080fd5b6000803560e01c8063023276f01461040757806394a32b4b146103a2578063a928058b1461033e578063bfef7bdf146101db5763da40385d1461005857600080fd5b346101d85761006636610502565b92819273ffffffffffffffffffffffffffffffffffffffff92837f000000000000000000000000000000000000000000000000000000000000000016945b86518110156101d457846100b8828961064c565b51168351907fd2493b6c0000000000000000000000000000000000000000000000000000000082528582015260609081816024818b5afa9182156101ca5790879291859261019b575b5050168015610172579060019186610119838b61064c565b511690808552838a8961015d866020938a85528b8b207fffffffffffffffffffffffff0000000000000000000000000000000000000000988982541617905561064c565b511687525285852091825416179055016100a4565b505050517f54279e74000000000000000000000000000000000000000000000000000000008152fd5b6101ba9250803d106101c3575b6101b28183610492565b8101906106b0565b50503880610101565b503d6101a8565b85513d86823e3d90fd5b5080f35b80fd5b50903461033a576101eb36610502565b908273ffffffffffffffffffffffffffffffffffffffff94857f000000000000000000000000000000000000000000000000000000000000000016945b8451811015610336578661023c828761064c565b51168451907fd2493b6c0000000000000000000000000000000000000000000000000000000082528382015260609081816024818b5afa91821561032c5790899291869261030d575b50501680156102e557906001918452602084815282868620917fffffffffffffffffffffffff0000000000000000000000000000000000000000928381541690558a6102d1858b61064c565b511687525285852090815416905501610228565b8285517f7b609a5b000000000000000000000000000000000000000000000000000000008152fd5b6103239250803d106101c3576101b28183610492565b50503880610285565b86513d87823e3d90fd5b8280f35b5080fd5b50903461033a5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261033a576020918173ffffffffffffffffffffffffffffffffffffffff918261039261046a565b1681528085522054169051908152f35b50903461033a5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261033a576020918173ffffffffffffffffffffffffffffffffffffffff91826103f661046a565b168152600185522054169051908152f35b50346101d85760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101d8575061044861044361046a565b6105c0565b73ffffffffffffffffffffffffffffffffffffffff8351921682526020820152f35b6004359073ffffffffffffffffffffffffffffffffffffffff8216820361048d57565b600080fd5b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176104d357604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6020807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc83011261048d5767ffffffffffffffff9160043583811161048d578160238201121561048d5780600401359384116104d3578360051b906040519461056e6020840187610492565b85526024602086019282010192831161048d57602401905b828210610594575050505090565b813573ffffffffffffffffffffffffffffffffffffffff8116810361048d578152908301908301610586565b73ffffffffffffffffffffffffffffffffffffffff809116600052600060205280604060002054169060016020526040600020541681151560001461060d575090670de0b6b3a764000090565b905080156106225790670de0b6b3a764000090565b60046040517fc8a08d6f000000000000000000000000000000000000000000000000000000008152fd5b80518210156106605760209160051b010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b519073ffffffffffffffffffffffffffffffffffffffff8216820361048d57565b9081606091031261048d576106c48161068f565b916106dd60406106d66020850161068f565b930161068f565b9056fea2646970667358221220065609fae4446b57eb6c7cb87814770721ab01b22f7d08c925d98ecbd1ef993564736f6c634300081700330000000000000000000000002d8a3c5677189723c4cb8873cfc9c8976fdf38ac

Deployed Bytecode

0x604060808152600490600436101561001657600080fd5b6000803560e01c8063023276f01461040757806394a32b4b146103a2578063a928058b1461033e578063bfef7bdf146101db5763da40385d1461005857600080fd5b346101d85761006636610502565b92819273ffffffffffffffffffffffffffffffffffffffff92837f0000000000000000000000002d8a3c5677189723c4cb8873cfc9c8976fdf38ac16945b86518110156101d457846100b8828961064c565b51168351907fd2493b6c0000000000000000000000000000000000000000000000000000000082528582015260609081816024818b5afa9182156101ca5790879291859261019b575b5050168015610172579060019186610119838b61064c565b511690808552838a8961015d866020938a85528b8b207fffffffffffffffffffffffff0000000000000000000000000000000000000000988982541617905561064c565b511687525285852091825416179055016100a4565b505050517f54279e74000000000000000000000000000000000000000000000000000000008152fd5b6101ba9250803d106101c3575b6101b28183610492565b8101906106b0565b50503880610101565b503d6101a8565b85513d86823e3d90fd5b5080f35b80fd5b50903461033a576101eb36610502565b908273ffffffffffffffffffffffffffffffffffffffff94857f0000000000000000000000002d8a3c5677189723c4cb8873cfc9c8976fdf38ac16945b8451811015610336578661023c828761064c565b51168451907fd2493b6c0000000000000000000000000000000000000000000000000000000082528382015260609081816024818b5afa91821561032c5790899291869261030d575b50501680156102e557906001918452602084815282868620917fffffffffffffffffffffffff0000000000000000000000000000000000000000928381541690558a6102d1858b61064c565b511687525285852090815416905501610228565b8285517f7b609a5b000000000000000000000000000000000000000000000000000000008152fd5b6103239250803d106101c3576101b28183610492565b50503880610285565b86513d87823e3d90fd5b8280f35b5080fd5b50903461033a5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261033a576020918173ffffffffffffffffffffffffffffffffffffffff918261039261046a565b1681528085522054169051908152f35b50903461033a5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261033a576020918173ffffffffffffffffffffffffffffffffffffffff91826103f661046a565b168152600185522054169051908152f35b50346101d85760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101d8575061044861044361046a565b6105c0565b73ffffffffffffffffffffffffffffffffffffffff8351921682526020820152f35b6004359073ffffffffffffffffffffffffffffffffffffffff8216820361048d57565b600080fd5b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176104d357604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6020807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc83011261048d5767ffffffffffffffff9160043583811161048d578160238201121561048d5780600401359384116104d3578360051b906040519461056e6020840187610492565b85526024602086019282010192831161048d57602401905b828210610594575050505090565b813573ffffffffffffffffffffffffffffffffffffffff8116810361048d578152908301908301610586565b73ffffffffffffffffffffffffffffffffffffffff809116600052600060205280604060002054169060016020526040600020541681151560001461060d575090670de0b6b3a764000090565b905080156106225790670de0b6b3a764000090565b60046040517fc8a08d6f000000000000000000000000000000000000000000000000000000008152fd5b80518210156106605760209160051b010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b519073ffffffffffffffffffffffffffffffffffffffff8216820361048d57565b9081606091031261048d576106c48161068f565b916106dd60406106d66020850161068f565b930161068f565b9056fea2646970667358221220065609fae4446b57eb6c7cb87814770721ab01b22f7d08c925d98ecbd1ef993564736f6c63430008170033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

0000000000000000000000002d8a3c5677189723c4cb8873cfc9c8976fdf38ac

-----Decoded View---------------
Arg [0] : lendingPool (address): 0x2d8A3C5677189723C4cB8873CfC9C8976FDF38Ac

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000002d8a3c5677189723c4cb8873cfc9c8976fdf38ac


Block Transaction Difficulty Gas Used Reward
Block Uncle Number Difficulty Gas Used Reward
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.