ETH Price: $3,432.36 (-2.38%)

Contract

0x1A75DF59f464a70Cc8f7383983852FF72e5F5167
 

Overview

ETH Balance

0 ETH

ETH Value

$0.00

Sponsored

Transaction Hash
Method
Block
From
To
Value
Add Markets1185099762024-04-08 23:25:2970 days ago1712618729IN
0x1A75DF59...72e5F5167
0 ETH0.000046380.0646836

Latest 2 internal transactions

Advanced mode:
Parent Transaction Hash Block From To Value
1185099562024-04-08 23:24:4970 days ago1712618689
0x1A75DF59...72e5F5167
0 ETH
1185099562024-04-08 23:24:4970 days ago1712618689  Contract Creation0 ETH

Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
StataTokenWrapper

Compiler Version
v0.8.23+commit.f704f362

Optimization Enabled:
Yes with 1000000 runs

Other Settings:
shanghai EvmVersion
File 1 of 4 : StataTokenWrapper.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.23;

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

contract StataTokenWrapper is IWrapper {
    IStaticATokenFactory public immutable FACTORY;

    mapping(IERC20 => IERC20) public stataTokenToToken;
    mapping(IERC20 => IERC20) public tokenToStataToken;

    constructor(IStaticATokenFactory staticATokenFactory) {
        FACTORY = staticATokenFactory;
    }

    function addMarkets(IERC20[] memory tokens) external {
        unchecked {
            for (uint256 i = 0; i < tokens.length; i++) {
                IERC20 stataToken = IERC20(FACTORY.getStaticAToken(address(tokens[i])));
                if(stataToken == IERC20(address(0))) revert NotAddedMarket();
                stataTokenToToken[stataToken] = tokens[i];
                tokenToStataToken[tokens[i]] = stataToken;
            }
        }
    }

    function removeMarkets(IERC20[] memory tokens) external {
        unchecked {
            for (uint256 i = 0; i < tokens.length; i++) {
                IERC20 stataToken = IERC20(FACTORY.getStaticAToken(address(tokens[i])));
                if(stataToken == IERC20(address(0))) revert NotRemovedMarket();
                delete stataTokenToToken[stataToken];
                delete tokenToStataToken[tokens[i]];
            }
        }
    }

    function wrap(IERC20 token) external view override returns (IERC20 wrappedToken, uint256 rate) {
        IERC20 underlying = stataTokenToToken[token];
        IERC20 stataToken = tokenToStataToken[token];
        if (underlying != IERC20(address(0))) {
            return (underlying, IStaticATokenLM(address(token)).rate() / 1e9);
        } else if (stataToken != IERC20(address(0))) {
            return (stataToken, 1e45 / IStaticATokenLM(address(stataToken)).rate());
        } else {
            revert NotSupportedToken();
        }
    }
}

File 2 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 3 of 4 : IStaticATokenLM.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.23;

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

// STATA_TOKENS in AaveV3
interface IStaticATokenLM {
    function aToken() external view returns (IERC20);
    function rate() external view returns (uint256);
}

interface IStaticATokenFactory {
    function getStaticAToken(address underlying) external view returns (address);
    function getStaticATokens() external view returns (address[] memory);
}

File 4 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);
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract IStaticATokenFactory","name":"staticATokenFactory","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"NotAddedMarket","type":"error"},{"inputs":[],"name":"NotRemovedMarket","type":"error"},{"inputs":[],"name":"NotSupportedToken","type":"error"},{"inputs":[],"name":"FACTORY","outputs":[{"internalType":"contract IStaticATokenFactory","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":"stataTokenToToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"name":"tokenToStataToken","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"}]

60a03461007757601f6108fc38819003918201601f19168301916001600160401b0383118484101761007b5780849260209460405283398101031261007757516001600160a01b03811681036100775760805260405161086c9081610090823960805181818160870152818161020201526103db0152f35b5f80fd5b634e487b7160e01b5f52604160045260245ffdfe604060808152600480361015610013575f80fd5b5f3560e01c8063023276f0146104635780630b4fe5b1146103ff5780632dd310001461039157806337edb4861461032e578063bfef7bdf146101d95763da40385d1461005d575f80fd5b346101d5579061006c36610556565b5f9273ffffffffffffffffffffffffffffffffffffffff92837f000000000000000000000000000000000000000000000000000000000000000016945b83518110156101d357846100bd82866107c9565b51168251907fed5d0f580000000000000000000000000000000000000000000000000000000082528482015260209081816024818b5afa9081156101c9579087915f9161019c575b501680156101735790829160018861011e82968a6107c9565b511692825f525f8152865f207fffffffffffffffffffffffff000000000000000000000000000000000000000094858254161790558961015e868b6107c9565b51165f5252845f2091825416179055016100a9565b505050517f54279e74000000000000000000000000000000000000000000000000000000008152fd5b6101bc9150833d85116101c2575b6101b481836104e8565b81019061080a565b5f610105565b503d6101aa565b84513d5f823e3d90fd5b005b5f80fd5b5090346101d557906101ea36610556565b73ffffffffffffffffffffffffffffffffffffffff927f000000000000000000000000000000000000000000000000000000000000000084165f5b83518110156101d3578561023982866107c9565b51168351907fed5d0f58000000000000000000000000000000000000000000000000000000008252868201526020908181602481875afa908115610324579088915f91610307575b501680156102df5790600192915f525f815282855f20917fffffffffffffffffffffffff000000000000000000000000000000000000000092838154169055896102cb858a6107c9565b51165f5252845f2090815416905501610225565b8685517f7b609a5b000000000000000000000000000000000000000000000000000000008152fd5b61031e9150833d85116101c2576101b481836104e8565b5f610281565b85513d5f823e3d90fd5b82346101d55760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101d55760209073ffffffffffffffffffffffffffffffffffffffff8061037f6104c5565b165f525f8352815f2054169051908152f35b82346101d5575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101d5576020905173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b82346101d55760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101d55760209073ffffffffffffffffffffffffffffffffffffffff806104506104c5565b165f5260018352815f2054169051908152f35b82346101d55760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101d5576104a361049e6104c5565b610614565b73ffffffffffffffffffffffffffffffffffffffff8351921682526020820152f35b6004359073ffffffffffffffffffffffffffffffffffffffff821682036101d557565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761052957604052565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6020807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc8301126101d55767ffffffffffffffff916004358381116101d557816023820112156101d5578060040135938411610529578360051b90604051946105c260208401876104e8565b8552602460208601928201019283116101d557602401905b8282106105e8575050505090565b813573ffffffffffffffffffffffffffffffffffffffff811681036101d55781529083019083016105da565b9073ffffffffffffffffffffffffffffffffffffffff80921691825f5260205f815260409382855f2054169260018352855f2054168315155f146106dc575090806004928651938480927f2c4e722e0000000000000000000000000000000000000000000000000000000082525afa9485156106d357505f9461069f575b5050633b9aca0090920490565b9080929450813d83116106cc575b6106b781836104e8565b810103126101d5575191633b9aca005f610692565b503d6106ad565b513d5f823e3d90fd5b92505081156107a0578351907f2c4e722e0000000000000000000000000000000000000000000000000000000082528082600481865afa9485156106d357505f94610770575b505082156107435791722cd76fe086b93ce2f768a00b22a000000000000490565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b9080929450813d8311610799575b61078881836104e8565b810103126101d55751915f80610722565b503d61077e565b600484517fc8a08d6f000000000000000000000000000000000000000000000000000000008152fd5b80518210156107dd5760209160051b010190565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b908160209103126101d5575173ffffffffffffffffffffffffffffffffffffffff811681036101d5579056fea26469706673582212202fab605e6b2559de74e11780ea881c19089ea2eed20cb79e2af9f1de1e63e2d264736f6c6343000817003300000000000000000000000022d76094730fa377184100efb8cefc673b89b372

Deployed Bytecode

0x604060808152600480361015610013575f80fd5b5f3560e01c8063023276f0146104635780630b4fe5b1146103ff5780632dd310001461039157806337edb4861461032e578063bfef7bdf146101d95763da40385d1461005d575f80fd5b346101d5579061006c36610556565b5f9273ffffffffffffffffffffffffffffffffffffffff92837f00000000000000000000000022d76094730fa377184100efb8cefc673b89b37216945b83518110156101d357846100bd82866107c9565b51168251907fed5d0f580000000000000000000000000000000000000000000000000000000082528482015260209081816024818b5afa9081156101c9579087915f9161019c575b501680156101735790829160018861011e82968a6107c9565b511692825f525f8152865f207fffffffffffffffffffffffff000000000000000000000000000000000000000094858254161790558961015e868b6107c9565b51165f5252845f2091825416179055016100a9565b505050517f54279e74000000000000000000000000000000000000000000000000000000008152fd5b6101bc9150833d85116101c2575b6101b481836104e8565b81019061080a565b5f610105565b503d6101aa565b84513d5f823e3d90fd5b005b5f80fd5b5090346101d557906101ea36610556565b73ffffffffffffffffffffffffffffffffffffffff927f00000000000000000000000022d76094730fa377184100efb8cefc673b89b37284165f5b83518110156101d3578561023982866107c9565b51168351907fed5d0f58000000000000000000000000000000000000000000000000000000008252868201526020908181602481875afa908115610324579088915f91610307575b501680156102df5790600192915f525f815282855f20917fffffffffffffffffffffffff000000000000000000000000000000000000000092838154169055896102cb858a6107c9565b51165f5252845f2090815416905501610225565b8685517f7b609a5b000000000000000000000000000000000000000000000000000000008152fd5b61031e9150833d85116101c2576101b481836104e8565b5f610281565b85513d5f823e3d90fd5b82346101d55760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101d55760209073ffffffffffffffffffffffffffffffffffffffff8061037f6104c5565b165f525f8352815f2054169051908152f35b82346101d5575f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101d5576020905173ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000022d76094730fa377184100efb8cefc673b89b372168152f35b82346101d55760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101d55760209073ffffffffffffffffffffffffffffffffffffffff806104506104c5565b165f5260018352815f2054169051908152f35b82346101d55760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101d5576104a361049e6104c5565b610614565b73ffffffffffffffffffffffffffffffffffffffff8351921682526020820152f35b6004359073ffffffffffffffffffffffffffffffffffffffff821682036101d557565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761052957604052565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6020807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc8301126101d55767ffffffffffffffff916004358381116101d557816023820112156101d5578060040135938411610529578360051b90604051946105c260208401876104e8565b8552602460208601928201019283116101d557602401905b8282106105e8575050505090565b813573ffffffffffffffffffffffffffffffffffffffff811681036101d55781529083019083016105da565b9073ffffffffffffffffffffffffffffffffffffffff80921691825f5260205f815260409382855f2054169260018352855f2054168315155f146106dc575090806004928651938480927f2c4e722e0000000000000000000000000000000000000000000000000000000082525afa9485156106d357505f9461069f575b5050633b9aca0090920490565b9080929450813d83116106cc575b6106b781836104e8565b810103126101d5575191633b9aca005f610692565b503d6106ad565b513d5f823e3d90fd5b92505081156107a0578351907f2c4e722e0000000000000000000000000000000000000000000000000000000082528082600481865afa9485156106d357505f94610770575b505082156107435791722cd76fe086b93ce2f768a00b22a000000000000490565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b9080929450813d8311610799575b61078881836104e8565b810103126101d55751915f80610722565b503d61077e565b600484517fc8a08d6f000000000000000000000000000000000000000000000000000000008152fd5b80518210156107dd5760209160051b010190565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b908160209103126101d5575173ffffffffffffffffffffffffffffffffffffffff811681036101d5579056fea26469706673582212202fab605e6b2559de74e11780ea881c19089ea2eed20cb79e2af9f1de1e63e2d264736f6c63430008170033

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

00000000000000000000000022d76094730fa377184100efb8cefc673b89b372

-----Decoded View---------------
Arg [0] : staticATokenFactory (address): 0x22D76094730fA377184100EFB8CEfC673B89B372

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 00000000000000000000000022d76094730fa377184100efb8cefc673b89b372


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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.