More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 631 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Convert V1 | 21384951 | 13 days ago | IN | 0 ETH | 0.00046279 | ||||
Convert V1 | 21384950 | 13 days ago | IN | 0 ETH | 0.00101799 | ||||
Convert V1 | 21362282 | 16 days ago | IN | 0 ETH | 0.00076405 | ||||
Convert V1 | 21355448 | 17 days ago | IN | 0 ETH | 0.00063288 | ||||
Convert V1 | 21337224 | 20 days ago | IN | 0 ETH | 0.00247248 | ||||
Convert V1 | 21336411 | 20 days ago | IN | 0 ETH | 0.00186468 | ||||
Convert V1 | 21332520 | 20 days ago | IN | 0 ETH | 0.00202765 | ||||
Convert V1 | 21200343 | 39 days ago | IN | 0 ETH | 0.00088759 | ||||
Convert V1 | 21182333 | 41 days ago | IN | 0 ETH | 0.00218673 | ||||
Convert V1 | 21181237 | 41 days ago | IN | 0 ETH | 0.00562727 | ||||
Convert V1 | 21049609 | 60 days ago | IN | 0 ETH | 0.00068112 | ||||
Convert V1 | 20688078 | 110 days ago | IN | 0 ETH | 0.00009048 | ||||
Convert V1 | 20264083 | 169 days ago | IN | 0 ETH | 0.00019714 | ||||
Convert V1 | 19408063 | 289 days ago | IN | 0 ETH | 0.00371157 | ||||
Convert V1 | 19364459 | 295 days ago | IN | 0 ETH | 0.00682156 | ||||
Convert V1 | 19273303 | 308 days ago | IN | 0 ETH | 0.00259383 | ||||
Convert V1 | 19258312 | 310 days ago | IN | 0 ETH | 0.00163148 | ||||
Convert V1 | 19079325 | 335 days ago | IN | 0 ETH | 0.00072198 | ||||
Convert V1 | 19078939 | 335 days ago | IN | 0 ETH | 0.00098343 | ||||
Convert V1 | 19061903 | 338 days ago | IN | 0 ETH | 0.00124065 | ||||
Convert V1 | 19047018 | 340 days ago | IN | 0 ETH | 0.00134315 | ||||
Convert V1 | 18964719 | 351 days ago | IN | 0 ETH | 0.00199358 | ||||
Convert V1 | 18936612 | 355 days ago | IN | 0 ETH | 0.00189799 | ||||
Convert V1 | 18909284 | 359 days ago | IN | 0 ETH | 0.00084964 | ||||
Convert V1 | 18851418 | 367 days ago | IN | 0 ETH | 0.00135197 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
Swapper
Compiler Version
v0.8.17+commit.8df45f5f
Contract Source Code (Solidity Standard Json-Input format)
// 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 } }
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; }
// 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); } }
// 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; } }
{ "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
- No Contract Security Audit Submitted- Submit Audit Here
[{"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"}]
Contract Creation Code
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
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|---|---|---|---|---|
ETH | 100.00% | $0.000716 | 139,213,113.4713 | $99,742.02 |
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.