More Info
Private Name Tags
ContractCreator
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
UsdzMigrator
Compiler Version
v0.8.21+commit.d9974bed
Optimization Enabled:
Yes with 100 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: GPL-3.0 // ███╗ ███╗ █████╗ ██╗ ██╗ █████╗ // ████╗ ████║██╔══██╗██║ ██║██╔══██╗ // ██╔████╔██║███████║███████║███████║ // ██║╚██╔╝██║██╔══██║██╔══██║██╔══██║ // ██║ ╚═╝ ██║██║ ██║██║ ██║██║ ██║ // ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝ // Website: https://maha.xyz // Discord: https://discord.gg/mahadao // Twitter: https://twitter.com/mahaxyz_ pragma solidity 0.8.21; import {IERC20} from "@openzeppelin/contracts/interfaces/IERC20.sol"; contract UsdzMigrator { IERC20 public old; IERC20 public zai; constructor(address _old, address _zai) { old = IERC20(_old); zai = IERC20(_zai); } function migrate(uint256 amount) external { require(old.transferFrom(msg.sender, address(this), amount), "Transfer failed"); require(zai.transfer(msg.sender, amount), "Transfer failed"); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC20.sol) pragma solidity ^0.8.20; import {IERC20} from "../token/ERC20/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); }
{ "optimizer": { "enabled": true, "runs": 100 }, "evmVersion": "paris", "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "metadata": { "useLiteralContent": true }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_old","type":"address"},{"internalType":"address","name":"_zai","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"migrate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"old","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"zai","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b5060405161033038038061033083398101604081905261002f9161007c565b600080546001600160a01b039384166001600160a01b031991821617909155600180549290931691161790556100af565b80516001600160a01b038116811461007757600080fd5b919050565b6000806040838503121561008f57600080fd5b61009883610060565b91506100a660208401610060565b90509250929050565b610272806100be6000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c806307140b3414610046578063454b060814610075578063b83f86631461008a575b600080fd5b600154610059906001600160a01b031681565b6040516001600160a01b03909116815260200160405180910390f35b6100886100833660046101d1565b61009d565b005b600054610059906001600160a01b031681565b6000546040516323b872dd60e01b8152336004820152306024820152604481018390526001600160a01b03909116906323b872dd906064016020604051808303816000875af11580156100f4573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061011891906101ea565b61013d5760405162461bcd60e51b815260040161013490610213565b60405180910390fd5b60015460405163a9059cbb60e01b8152336004820152602481018390526001600160a01b039091169063a9059cbb906044016020604051808303816000875af115801561018e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101b291906101ea565b6101ce5760405162461bcd60e51b815260040161013490610213565b50565b6000602082840312156101e357600080fd5b5035919050565b6000602082840312156101fc57600080fd5b8151801515811461020c57600080fd5b9392505050565b6020808252600f908201526e151c985b9cd9995c8819985a5b1959608a1b60408201526060019056fea264697066735822122070a07e593ef53a377f241e940d9a84bed7099b3b377cf88aa1319f0300d892fd64736f6c6343000815003300000000000000000000000069000405f9dce69bd4cbf4f2865b79144a69bfe000000000000000000000000069000dfd5025e82f48eb28325a2b88a241182ced
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100415760003560e01c806307140b3414610046578063454b060814610075578063b83f86631461008a575b600080fd5b600154610059906001600160a01b031681565b6040516001600160a01b03909116815260200160405180910390f35b6100886100833660046101d1565b61009d565b005b600054610059906001600160a01b031681565b6000546040516323b872dd60e01b8152336004820152306024820152604481018390526001600160a01b03909116906323b872dd906064016020604051808303816000875af11580156100f4573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061011891906101ea565b61013d5760405162461bcd60e51b815260040161013490610213565b60405180910390fd5b60015460405163a9059cbb60e01b8152336004820152602481018390526001600160a01b039091169063a9059cbb906044016020604051808303816000875af115801561018e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101b291906101ea565b6101ce5760405162461bcd60e51b815260040161013490610213565b50565b6000602082840312156101e357600080fd5b5035919050565b6000602082840312156101fc57600080fd5b8151801515811461020c57600080fd5b9392505050565b6020808252600f908201526e151c985b9cd9995c8819985a5b1959608a1b60408201526060019056fea264697066735822122070a07e593ef53a377f241e940d9a84bed7099b3b377cf88aa1319f0300d892fd64736f6c63430008150033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000069000405f9dce69bd4cbf4f2865b79144a69bfe000000000000000000000000069000dfd5025e82f48eb28325a2b88a241182ced
-----Decoded View---------------
Arg [0] : _old (address): 0x69000405f9DcE69BD4Cbf4f2865b79144A69BFE0
Arg [1] : _zai (address): 0x69000dFD5025E82f48Eb28325A2B88a241182CEd
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 00000000000000000000000069000405f9dce69bd4cbf4f2865b79144a69bfe0
Arg [1] : 00000000000000000000000069000dfd5025e82f48eb28325a2b88a241182ced
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 31 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|---|---|---|---|---|
ETH | 100.00% | $0.998465 | 99,792 | $99,638.82 |
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.