ETH Price: $3,413.92 (-0.22%)

Contract

0x6B44d94ECDFaF0cb00dEF55212e226603BB68793
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
0x60806040135372062021-11-02 11:16:341120 days ago1635851794IN
 Create: USTLevSwapper
0 ETH0.08400283143.91735377

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
USTLevSwapper

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion
File 1 of 1 : USTLevSwapper.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.4;
interface IERC20 {
    function totalSupply() external view returns (uint256);

    function balanceOf(address account) external view returns (uint256);

    function allowance(address owner, address spender) external view returns (uint256);

    function approve(address spender, uint256 amount) external returns (bool);

    event Transfer(address indexed from, address indexed to, uint256 value);
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /// @notice EIP 2612
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;
}
interface CurvePool {
    function exchange_underlying(int128 i, int128 j, uint256 dx, uint256 min_dy, address receiver) external returns (uint256);
    function exchange(int128 i, int128 j, uint256 dx, uint256 min_dy, address receiver) external returns (uint256);
    function approve(address _spender, uint256 _value) external returns (bool);
    function add_liquidity(uint256[3] memory amounts, uint256 _min_mint_amount) external;
}

interface IBentoBoxV1 {
    function withdraw(IERC20 token, address from, address to, uint256 amount, uint256 share) external returns(uint256, uint256);
    function deposit(IERC20 token, address from, address to, uint256 amount, uint256 share) external returns(uint256, uint256);
}

contract USTLevSwapper {

     // Local variables
    IBentoBoxV1 public constant degenBox = IBentoBoxV1(0xd96f48665a1410C0cd669A88898ecA36B9Fc2cce);
    CurvePool constant public UST2POOL = CurvePool(0x55A8a39bc9694714E2874c1ce77aa1E599461E18);
    IERC20 public constant MIM = IERC20(0x99D8a9C45b2ecA8864373A26D1459e3Dff1e17F3);
    IERC20 public constant UST = IERC20(0xa47c8bf37f92aBed4A126BDA807A7b7498661acD);

    constructor() public {
        MIM.approve(address(UST2POOL), type(uint256).max);
        UST.approve(address(degenBox), type(uint256).max);
    }


    // Swaps to a flexible amount, from an exact input amount
    function swap(
        address recipient,
        uint256 shareToMin,
        uint256 shareFrom
    ) public returns (uint256 extraShare, uint256 shareReturned) {

        (uint256 amountFrom, ) = degenBox.withdraw(MIM, address(this), address(this), 0, shareFrom);

        uint256 amountTo = UST2POOL.exchange(0, 1, amountFrom, 0, address(degenBox));

        (, shareReturned) = degenBox.deposit(UST, address(degenBox), recipient, amountTo, 0);
        extraShare = shareReturned - shareToMin;
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"MIM","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"UST","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"UST2POOL","outputs":[{"internalType":"contract CurvePool","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"degenBox","outputs":[{"internalType":"contract IBentoBoxV1","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"shareToMin","type":"uint256"},{"internalType":"uint256","name":"shareFrom","type":"uint256"}],"name":"swap","outputs":[{"internalType":"uint256","name":"extraShare","type":"uint256"},{"internalType":"uint256","name":"shareReturned","type":"uint256"}],"stateMutability":"nonpayable","type":"function"}]

60806040523480156200001157600080fd5b507399d8a9c45b2eca8864373a26d1459e3dff1e17f373ffffffffffffffffffffffffffffffffffffffff1663095ea7b37355a8a39bc9694714e2874c1ce77aa1e599461e187fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016200009792919062000235565b602060405180830381600087803b158015620000b257600080fd5b505af1158015620000c7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000ed9190620001e7565b5073a47c8bf37f92abed4a126bda807a7b7498661acd73ffffffffffffffffffffffffffffffffffffffff1663095ea7b373d96f48665a1410c0cd669a88898eca36b9fc2cce7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016200017392919062000235565b602060405180830381600087803b1580156200018e57600080fd5b505af1158015620001a3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001c99190620001e7565b50620002c6565b600081519050620001e181620002ac565b92915050565b600060208284031215620001fa57600080fd5b60006200020a84828501620001d0565b91505092915050565b6200021e8162000262565b82525050565b6200022f81620002a2565b82525050565b60006040820190506200024c600083018562000213565b6200025b602083018462000224565b9392505050565b60006200026f8262000282565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b620002b78162000276565b8114620002c357600080fd5b50565b61086780620002d66000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c8063931893f21461005c5780639f1d0f591461007a5780639f495c15146100ab578063daec383d146100c9578063e7ec9f30146100e7575b600080fd5b610064610105565b6040516100719190610542565b60405180910390f35b610094600480360381019061008f9190610416565b61011d565b6040516100a292919061068c565b60405180910390f35b6100b361038f565b6040516100c0919061055d565b60405180910390f35b6100d16103a7565b6040516100de9190610578565b60405180910390f35b6100ef6103bf565b6040516100fc9190610578565b60405180910390f35b7355a8a39bc9694714e2874c1ce77aa1e599461e1881565b600080600073d96f48665a1410c0cd669a88898eca36b9fc2cce73ffffffffffffffffffffffffffffffffffffffff166397da6d307399d8a9c45b2eca8864373a26d1459e3dff1e17f330306000896040518663ffffffff1660e01b815260040161018c959493929190610593565b6040805180830381600087803b1580156101a557600080fd5b505af11580156101b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101dd919061048e565b50905060007355a8a39bc9694714e2874c1ce77aa1e599461e1873ffffffffffffffffffffffffffffffffffffffff1663ddc1f59d6000600185600073d96f48665a1410c0cd669a88898eca36b9fc2cce6040518663ffffffff1660e01b815260040161024e959493929190610639565b602060405180830381600087803b15801561026857600080fd5b505af115801561027c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102a09190610465565b905073d96f48665a1410c0cd669a88898eca36b9fc2cce73ffffffffffffffffffffffffffffffffffffffff166302b9446c73a47c8bf37f92abed4a126bda807a7b7498661acd73d96f48665a1410c0cd669a88898eca36b9fc2cce8a8560006040518663ffffffff1660e01b81526004016103209594939291906105e6565b6040805180830381600087803b15801561033957600080fd5b505af115801561034d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610371919061048e565b905080935050858361038391906106b5565b93505050935093915050565b73d96f48665a1410c0cd669a88898eca36b9fc2cce81565b7399d8a9c45b2eca8864373a26d1459e3dff1e17f381565b73a47c8bf37f92abed4a126bda807a7b7498661acd81565b6000813590506103e681610803565b92915050565b6000813590506103fb8161081a565b92915050565b6000815190506104108161081a565b92915050565b60008060006060848603121561042b57600080fd5b6000610439868287016103d7565b935050602061044a868287016103ec565b925050604061045b868287016103ec565b9150509250925092565b60006020828403121561047757600080fd5b600061048584828501610401565b91505092915050565b600080604083850312156104a157600080fd5b60006104af85828601610401565b92505060206104c085828601610401565b9150509250929050565b6104d3816106e9565b82525050565b6104e281610732565b82525050565b6104f181610756565b82525050565b6105008161077a565b82525050565b61050f8161079e565b82525050565b61051e816107b0565b82525050565b61052d816107c2565b82525050565b61053c81610728565b82525050565b600060208201905061055760008301846104d9565b92915050565b600060208201905061057260008301846104e8565b92915050565b600060208201905061058d60008301846104f7565b92915050565b600060a0820190506105a860008301886104f7565b6105b560208301876104ca565b6105c260408301866104ca565b6105cf6060830185610515565b6105dc6080830184610533565b9695505050505050565b600060a0820190506105fb60008301886104f7565b61060860208301876104ca565b61061560408301866104ca565b6106226060830185610533565b61062f6080830184610515565b9695505050505050565b600060a08201905061064e6000830188610506565b61065b6020830187610524565b6106686040830186610533565b6106756060830185610515565b61068260808301846104ca565b9695505050505050565b60006040820190506106a16000830185610533565b6106ae6020830184610533565b9392505050565b60006106c082610728565b91506106cb83610728565b9250828210156106de576106dd6107d4565b5b828203905092915050565b60006106f482610708565b9050919050565b600081600f0b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061073d82610744565b9050919050565b600061074f82610708565b9050919050565b600061076182610768565b9050919050565b600061077382610708565b9050919050565b60006107858261078c565b9050919050565b600061079782610708565b9050919050565b60006107a9826106fb565b9050919050565b60006107bb82610728565b9050919050565b60006107cd826106fb565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b61080c816106e9565b811461081757600080fd5b50565b61082381610728565b811461082e57600080fd5b5056fea264697066735822122090043a681f93723ac01a1fc09365a9cddc44111d6cbdd164216753a3bcd68bf164736f6c63430008040033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100575760003560e01c8063931893f21461005c5780639f1d0f591461007a5780639f495c15146100ab578063daec383d146100c9578063e7ec9f30146100e7575b600080fd5b610064610105565b6040516100719190610542565b60405180910390f35b610094600480360381019061008f9190610416565b61011d565b6040516100a292919061068c565b60405180910390f35b6100b361038f565b6040516100c0919061055d565b60405180910390f35b6100d16103a7565b6040516100de9190610578565b60405180910390f35b6100ef6103bf565b6040516100fc9190610578565b60405180910390f35b7355a8a39bc9694714e2874c1ce77aa1e599461e1881565b600080600073d96f48665a1410c0cd669a88898eca36b9fc2cce73ffffffffffffffffffffffffffffffffffffffff166397da6d307399d8a9c45b2eca8864373a26d1459e3dff1e17f330306000896040518663ffffffff1660e01b815260040161018c959493929190610593565b6040805180830381600087803b1580156101a557600080fd5b505af11580156101b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101dd919061048e565b50905060007355a8a39bc9694714e2874c1ce77aa1e599461e1873ffffffffffffffffffffffffffffffffffffffff1663ddc1f59d6000600185600073d96f48665a1410c0cd669a88898eca36b9fc2cce6040518663ffffffff1660e01b815260040161024e959493929190610639565b602060405180830381600087803b15801561026857600080fd5b505af115801561027c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102a09190610465565b905073d96f48665a1410c0cd669a88898eca36b9fc2cce73ffffffffffffffffffffffffffffffffffffffff166302b9446c73a47c8bf37f92abed4a126bda807a7b7498661acd73d96f48665a1410c0cd669a88898eca36b9fc2cce8a8560006040518663ffffffff1660e01b81526004016103209594939291906105e6565b6040805180830381600087803b15801561033957600080fd5b505af115801561034d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610371919061048e565b905080935050858361038391906106b5565b93505050935093915050565b73d96f48665a1410c0cd669a88898eca36b9fc2cce81565b7399d8a9c45b2eca8864373a26d1459e3dff1e17f381565b73a47c8bf37f92abed4a126bda807a7b7498661acd81565b6000813590506103e681610803565b92915050565b6000813590506103fb8161081a565b92915050565b6000815190506104108161081a565b92915050565b60008060006060848603121561042b57600080fd5b6000610439868287016103d7565b935050602061044a868287016103ec565b925050604061045b868287016103ec565b9150509250925092565b60006020828403121561047757600080fd5b600061048584828501610401565b91505092915050565b600080604083850312156104a157600080fd5b60006104af85828601610401565b92505060206104c085828601610401565b9150509250929050565b6104d3816106e9565b82525050565b6104e281610732565b82525050565b6104f181610756565b82525050565b6105008161077a565b82525050565b61050f8161079e565b82525050565b61051e816107b0565b82525050565b61052d816107c2565b82525050565b61053c81610728565b82525050565b600060208201905061055760008301846104d9565b92915050565b600060208201905061057260008301846104e8565b92915050565b600060208201905061058d60008301846104f7565b92915050565b600060a0820190506105a860008301886104f7565b6105b560208301876104ca565b6105c260408301866104ca565b6105cf6060830185610515565b6105dc6080830184610533565b9695505050505050565b600060a0820190506105fb60008301886104f7565b61060860208301876104ca565b61061560408301866104ca565b6106226060830185610533565b61062f6080830184610515565b9695505050505050565b600060a08201905061064e6000830188610506565b61065b6020830187610524565b6106686040830186610533565b6106756060830185610515565b61068260808301846104ca565b9695505050505050565b60006040820190506106a16000830185610533565b6106ae6020830184610533565b9392505050565b60006106c082610728565b91506106cb83610728565b9250828210156106de576106dd6107d4565b5b828203905092915050565b60006106f482610708565b9050919050565b600081600f0b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061073d82610744565b9050919050565b600061074f82610708565b9050919050565b600061076182610768565b9050919050565b600061077382610708565b9050919050565b60006107858261078c565b9050919050565b600061079782610708565b9050919050565b60006107a9826106fb565b9050919050565b60006107bb82610728565b9050919050565b60006107cd826106fb565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b61080c816106e9565b811461081757600080fd5b50565b61082381610728565b811461082e57600080fd5b5056fea264697066735822122090043a681f93723ac01a1fc09365a9cddc44111d6cbdd164216753a3bcd68bf164736f6c63430008040033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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