ETH Price: $2,995.34 (+4.68%)
Gas: 2 Gwei

Contract

0x235b30088E66d2D28F137b422B9349fBa51E0248
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Value
Convert V1194080632024-03-10 23:45:59117 days ago1710114359IN
0x235b3008...Ba51E0248
0 ETH0.0037115749.2323113
Convert V1193644592024-03-04 21:22:11123 days ago1709587331IN
0x235b3008...Ba51E0248
0 ETH0.0068215685.06862496
Convert V1192733032024-02-21 3:15:23136 days ago1708485323IN
0x235b3008...Ba51E0248
0 ETH0.0025938334.41148234
Convert V1192583122024-02-19 0:44:59138 days ago1708303499IN
0x235b3008...Ba51E0248
0 ETH0.0016314820.34546513
Convert V1190793252024-01-24 21:58:47163 days ago1706133527IN
0x235b3008...Ba51E0248
0 ETH0.000721989.0022399
Convert V1190789392024-01-24 20:40:35163 days ago1706128835IN
0x235b3008...Ba51E0248
0 ETH0.0009834313.04899319
Convert V1190619032024-01-22 11:12:23165 days ago1705921943IN
0x235b3008...Ba51E0248
0 ETH0.0012406516.46450835
Convert V1190470182024-01-20 8:55:47167 days ago1705740947IN
0x235b3008...Ba51E0248
0 ETH0.0013431516.74982389
Convert V1189647192024-01-08 20:39:23179 days ago1704746363IN
0x235b3008...Ba51E0248
0 ETH0.0019935824.86101739
Convert V1189366122024-01-04 21:23:11183 days ago1704403391IN
0x235b3008...Ba51E0248
0 ETH0.0018979923.668979
Convert V1189092842024-01-01 1:19:23187 days ago1704071963IN
0x235b3008...Ba51E0248
0 ETH0.0008496410.59399225
Convert V1188514182023-12-23 22:14:47195 days ago1703369687IN
0x235b3008...Ba51E0248
0 ETH0.0013519717.93041435
Convert V1188462932023-12-23 4:59:47196 days ago1703307587IN
0x235b3008...Ba51E0248
0 ETH0.0017464721.77943003
Convert V1187711882023-12-12 16:06:35206 days ago1702397195IN
0x235b3008...Ba51E0248
0 ETH0.0056859370.89609149
Convert V1187449732023-12-09 0:02:11210 days ago1702080131IN
0x235b3008...Ba51E0248
0 ETH0.0035468244.24408662
Convert V1187360802023-12-07 18:04:23211 days ago1701972263IN
0x235b3008...Ba51E0248
0 ETH0.0061929777.2296739
Convert V1187124192023-12-04 10:31:11214 days ago1701685871IN
0x235b3008...Ba51E0248
0 ETH0.0029982739.77072757
Convert V1185451852023-11-11 0:41:35238 days ago1699663295IN
0x235b3008...Ba51E0248
0 ETH0.0027832334.72406958
Convert V1185178292023-11-07 4:54:47242 days ago1699332887IN
0x235b3008...Ba51E0248
0 ETH0.0017185621.4378439
Convert V1185152872023-11-06 20:21:59242 days ago1699302119IN
0x235b3008...Ba51E0248
0 ETH0.0021001627.85326184
Convert V1184364132023-10-26 19:16:11253 days ago1698347771IN
0x235b3008...Ba51E0248
0 ETH0.0016347421.68418468
Convert V1184166422023-10-24 0:47:11256 days ago1698108431IN
0x235b3008...Ba51E0248
0 ETH0.0016319327.99158014
Convert V1183241432023-10-11 2:11:11269 days ago1696990271IN
0x235b3008...Ba51E0248
0 ETH0.000620587.73899794
Convert V1183176152023-10-10 4:17:11270 days ago1696911431IN
0x235b3008...Ba51E0248
0 ETH0.000369214.89981062
Convert V1183166312023-10-10 0:58:59270 days ago1696899539IN
0x235b3008...Ba51E0248
0 ETH0.000371954.63847623
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Swapper

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, Unlicense license
File 1 of 4 : Swapper.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

import "./IERC20BAO.sol";
import "../node_modules/solmate/src/tokens/ERC20.sol";
import "../node_modules/solmate/src/utils/ReentrancyGuard.sol";

contract Swapper is ReentrancyGuard {
    ERC20 public immutable baoV1;
    IERC20BAO public immutable baoV2;

    constructor(address _baoV2) {
        // BaoV1 Token is a hardcoded constant
        baoV1 = ERC20(0x374CB8C27130E2c9E04F44303f3c8351B9De61C1);
        baoV2 = IERC20BAO(_baoV2);
    }

    function convertV1(address _to, uint256 _amount) external nonReentrant {
        baoV1.transferFrom(msg.sender, address(0x000000000000000000000000000000000000dEaD), _amount); // Burn BaoV1
        baoV2.transfer(_to, _amount / 1000); // BaoV2's supply is reduced by a factor of 1000, FLOOR DIV
    }
}

File 2 of 4 : IERC20BAO.sol
pragma solidity ^0.8.13;

interface IERC20BAO {
    function balanceOf(address _addr) external view returns(uint256);
    function update_mining_parameters() external;
    function start_epoch_time_write() external;
    function future_epoch_time_write() external;
    function available_supply() external;
    function mintable_in_timeframe(uint256 start,uint256 end) external;
    function set_minters(address _minter, address _swapper) external;
    function set_admin(address _admin) external;
    function transfer(address _to, uint256 _value) external;
    function transferFrom(address _from, address _to, uint256 _value) external;
    function approve(address _spender, uint256 _value) external;
    function mint(address _to, uint256 _value) external returns (bool);
    function burn(uint256 _value) external;
}

File 3 of 4 : ERC20.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;

/// @notice Modern and gas efficient ERC20 + EIP-2612 implementation.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/tokens/ERC20.sol)
/// @author Modified from Uniswap (https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/UniswapV2ERC20.sol)
/// @dev Do not manually set balances without updating totalSupply, as the sum of all user balances must not exceed it.
abstract contract ERC20 {
    /*//////////////////////////////////////////////////////////////
                                 EVENTS
    //////////////////////////////////////////////////////////////*/

    event Transfer(address indexed from, address indexed to, uint256 amount);

    event Approval(address indexed owner, address indexed spender, uint256 amount);

    /*//////////////////////////////////////////////////////////////
                            METADATA STORAGE
    //////////////////////////////////////////////////////////////*/

    string public name;

    string public symbol;

    uint8 public immutable decimals;

    /*//////////////////////////////////////////////////////////////
                              ERC20 STORAGE
    //////////////////////////////////////////////////////////////*/

    uint256 public totalSupply;

    mapping(address => uint256) public balanceOf;

    mapping(address => mapping(address => uint256)) public allowance;

    /*//////////////////////////////////////////////////////////////
                            EIP-2612 STORAGE
    //////////////////////////////////////////////////////////////*/

    uint256 internal immutable INITIAL_CHAIN_ID;

    bytes32 internal immutable INITIAL_DOMAIN_SEPARATOR;

    mapping(address => uint256) public nonces;

    /*//////////////////////////////////////////////////////////////
                               CONSTRUCTOR
    //////////////////////////////////////////////////////////////*/

    constructor(
        string memory _name,
        string memory _symbol,
        uint8 _decimals
    ) {
        name = _name;
        symbol = _symbol;
        decimals = _decimals;

        INITIAL_CHAIN_ID = block.chainid;
        INITIAL_DOMAIN_SEPARATOR = computeDomainSeparator();
    }

    /*//////////////////////////////////////////////////////////////
                               ERC20 LOGIC
    //////////////////////////////////////////////////////////////*/

    function approve(address spender, uint256 amount) public virtual returns (bool) {
        allowance[msg.sender][spender] = amount;

        emit Approval(msg.sender, spender, amount);

        return true;
    }

    function transfer(address to, uint256 amount) public virtual returns (bool) {
        balanceOf[msg.sender] -= amount;

        // Cannot overflow because the sum of all user
        // balances can't exceed the max uint256 value.
        unchecked {
            balanceOf[to] += amount;
        }

        emit Transfer(msg.sender, to, amount);

        return true;
    }

    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) public virtual returns (bool) {
        uint256 allowed = allowance[from][msg.sender]; // Saves gas for limited approvals.

        if (allowed != type(uint256).max) allowance[from][msg.sender] = allowed - amount;

        balanceOf[from] -= amount;

        // Cannot overflow because the sum of all user
        // balances can't exceed the max uint256 value.
        unchecked {
            balanceOf[to] += amount;
        }

        emit Transfer(from, to, amount);

        return true;
    }

    /*//////////////////////////////////////////////////////////////
                             EIP-2612 LOGIC
    //////////////////////////////////////////////////////////////*/

    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) public virtual {
        require(deadline >= block.timestamp, "PERMIT_DEADLINE_EXPIRED");

        // Unchecked because the only math done is incrementing
        // the owner's nonce which cannot realistically overflow.
        unchecked {
            address recoveredAddress = ecrecover(
                keccak256(
                    abi.encodePacked(
                        "\x19\x01",
                        DOMAIN_SEPARATOR(),
                        keccak256(
                            abi.encode(
                                keccak256(
                                    "Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"
                                ),
                                owner,
                                spender,
                                value,
                                nonces[owner]++,
                                deadline
                            )
                        )
                    )
                ),
                v,
                r,
                s
            );

            require(recoveredAddress != address(0) && recoveredAddress == owner, "INVALID_SIGNER");

            allowance[recoveredAddress][spender] = value;
        }

        emit Approval(owner, spender, value);
    }

    function DOMAIN_SEPARATOR() public view virtual returns (bytes32) {
        return block.chainid == INITIAL_CHAIN_ID ? INITIAL_DOMAIN_SEPARATOR : computeDomainSeparator();
    }

    function computeDomainSeparator() internal view virtual returns (bytes32) {
        return
            keccak256(
                abi.encode(
                    keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"),
                    keccak256(bytes(name)),
                    keccak256("1"),
                    block.chainid,
                    address(this)
                )
            );
    }

    /*//////////////////////////////////////////////////////////////
                        INTERNAL MINT/BURN LOGIC
    //////////////////////////////////////////////////////////////*/

    function _mint(address to, uint256 amount) internal virtual {
        totalSupply += amount;

        // Cannot overflow because the sum of all user
        // balances can't exceed the max uint256 value.
        unchecked {
            balanceOf[to] += amount;
        }

        emit Transfer(address(0), to, amount);
    }

    function _burn(address from, uint256 amount) internal virtual {
        balanceOf[from] -= amount;

        // Cannot underflow because a user's balance
        // will never be larger than the total supply.
        unchecked {
            totalSupply -= amount;
        }

        emit Transfer(from, address(0), amount);
    }
}

File 4 of 4 : ReentrancyGuard.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;

/// @notice Gas optimized reentrancy protection for smart contracts.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/ReentrancyGuard.sol)
/// @author Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/security/ReentrancyGuard.sol)
abstract contract ReentrancyGuard {
    uint256 private locked = 1;

    modifier nonReentrant() virtual {
        require(locked == 1, "REENTRANCY");

        locked = 2;

        _;

        locked = 1;
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_baoV2","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"baoV1","outputs":[{"internalType":"contract ERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baoV2","outputs":[{"internalType":"contract IERC20BAO","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"convertV1","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60c0604052600160005534801561001557600080fd5b506040516103c13803806103c18339810160408190526100349161005d565b73374cb8c27130e2c9e04f44303f3c8351b9de61c16080526001600160a01b031660a05261008d565b60006020828403121561006f57600080fd5b81516001600160a01b038116811461008657600080fd5b9392505050565b60805160a0516103036100be6000396000818160a301526101b10152600081816060015261013101526103036000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c8063a4f3f05b14610046578063d9f55a971461005b578063eb4b24db1461009e575b600080fd5b61005961005436600461024a565b6100c5565b005b6100827f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200160405180910390f35b6100827f000000000000000000000000000000000000000000000000000000000000000081565b6000546001146101085760405162461bcd60e51b815260206004820152600a6024820152695245454e5452414e435960b01b604482015260640160405180910390fd5b60026000556040516323b872dd60e01b815233600482015261dead6024820152604481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906323b872dd906064016020604051808303816000875af1158015610182573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101a69190610282565b506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001663a9059cbb836101e36103e8856102ab565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401600060405180830381600087803b15801561022957600080fd5b505af115801561023d573d6000803e3d6000fd5b5050600160005550505050565b6000806040838503121561025d57600080fd5b82356001600160a01b038116811461027457600080fd5b946020939093013593505050565b60006020828403121561029457600080fd5b815180151581146102a457600080fd5b9392505050565b6000826102c857634e487b7160e01b600052601260045260246000fd5b50049056fea2646970667358221220c2933cbc0c99f610a5c1ca2d5225f9f79fd0fc23890673ccd87d92412d3b2daf64736f6c63430008110033000000000000000000000000ce391315b414d4c7555956120461d21808a69f3a

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100415760003560e01c8063a4f3f05b14610046578063d9f55a971461005b578063eb4b24db1461009e575b600080fd5b61005961005436600461024a565b6100c5565b005b6100827f000000000000000000000000374cb8c27130e2c9e04f44303f3c8351b9de61c181565b6040516001600160a01b03909116815260200160405180910390f35b6100827f000000000000000000000000ce391315b414d4c7555956120461d21808a69f3a81565b6000546001146101085760405162461bcd60e51b815260206004820152600a6024820152695245454e5452414e435960b01b604482015260640160405180910390fd5b60026000556040516323b872dd60e01b815233600482015261dead6024820152604481018290527f000000000000000000000000374cb8c27130e2c9e04f44303f3c8351b9de61c16001600160a01b0316906323b872dd906064016020604051808303816000875af1158015610182573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101a69190610282565b506001600160a01b037f000000000000000000000000ce391315b414d4c7555956120461d21808a69f3a1663a9059cbb836101e36103e8856102ab565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401600060405180830381600087803b15801561022957600080fd5b505af115801561023d573d6000803e3d6000fd5b5050600160005550505050565b6000806040838503121561025d57600080fd5b82356001600160a01b038116811461027457600080fd5b946020939093013593505050565b60006020828403121561029457600080fd5b815180151581146102a457600080fd5b9392505050565b6000826102c857634e487b7160e01b600052601260045260246000fd5b50049056fea2646970667358221220c2933cbc0c99f610a5c1ca2d5225f9f79fd0fc23890673ccd87d92412d3b2daf64736f6c63430008110033

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

000000000000000000000000ce391315b414d4c7555956120461d21808a69f3a

-----Decoded View---------------
Arg [0] : _baoV2 (address): 0xCe391315b414D4c7555956120461D21808A69F3A

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000ce391315b414d4c7555956120461d21808a69f3a


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.