Source Code
Latest 25 from a total of 96 transactions
| Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Swap Bridged Dfx... | 273492177 | 391 days ago | IN | 0 ETH | 0.00000527 | ||||
| Swap Bridged Dfx... | 203899231 | 594 days ago | IN | 0 ETH | 0.00000092 | ||||
| Swap Bridged Dfx... | 201849925 | 600 days ago | IN | 0 ETH | 0.00000111 | ||||
| Swap Bridged Dfx... | 199289143 | 608 days ago | IN | 0 ETH | 0.00000182 | ||||
| Swap Bridged Dfx... | 198729475 | 609 days ago | IN | 0 ETH | 0.00000119 | ||||
| Swap Bridged Dfx... | 194449807 | 622 days ago | IN | 0 ETH | 0.00000226 | ||||
| Swap Bridged Dfx... | 193285183 | 625 days ago | IN | 0 ETH | 0.00000135 | ||||
| Swap Bridged Dfx... | 191354371 | 631 days ago | IN | 0 ETH | 0.00001465 | ||||
| Swap Bridged Dfx... | 190136903 | 634 days ago | IN | 0 ETH | 0.00008459 | ||||
| Swap Bridged Dfx... | 190088296 | 634 days ago | IN | 0 ETH | 0.00011198 | ||||
| Swap Bridged Dfx... | 189573086 | 636 days ago | IN | 0 ETH | 0.00009733 | ||||
| Swap Bridged Dfx... | 189455247 | 636 days ago | IN | 0 ETH | 0.00010567 | ||||
| Swap Bridged Dfx... | 189452514 | 636 days ago | IN | 0 ETH | 0.00008032 | ||||
| Swap Bridged Dfx... | 189432681 | 636 days ago | IN | 0 ETH | 0.00010622 | ||||
| Swap Bridged Dfx... | 188654654 | 639 days ago | IN | 0 ETH | 0.00007608 | ||||
| Swap Bridged Dfx... | 186914856 | 644 days ago | IN | 0 ETH | 0.00008751 | ||||
| Swap Bridged Dfx... | 185820945 | 647 days ago | IN | 0 ETH | 0.00009809 | ||||
| Swap Bridged Dfx... | 182822411 | 656 days ago | IN | 0 ETH | 0.00011092 | ||||
| Swap Bridged Dfx... | 181210635 | 661 days ago | IN | 0 ETH | 0.00005224 | ||||
| Swap Bridged Dfx... | 181209945 | 661 days ago | IN | 0 ETH | 0.00005421 | ||||
| Swap Bridged Dfx... | 180261690 | 664 days ago | IN | 0 ETH | 0.00003433 | ||||
| Swap Bridged Dfx... | 179144538 | 667 days ago | IN | 0 ETH | 0.00009255 | ||||
| Swap Bridged Dfx... | 177999616 | 671 days ago | IN | 0 ETH | 0.00006754 | ||||
| Swap Bridged Dfx... | 177038816 | 674 days ago | IN | 0 ETH | 0.00003564 | ||||
| Swap Bridged Dfx... | 176616553 | 675 days ago | IN | 0 ETH | 0.00003974 |
Cross-Chain Transactions
Loading...
Loading
Contract Name:
Migrator
Compiler Version
v0.8.22+commit.4fc1097e
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import "IERC20.sol";
/// @title Migrator
/// @dev This contract allows users to swap DFX for clDFX.
contract Migrator {
event ChangeOwner(address newOwner);
event Exchange(address user, uint256 amount);
event Withdraw(address admin, uint256 amount);
address public owner;
IERC20 public bridgedDfx;
IERC20 public ccipDfx;
/// @notice Ensures only the owner can call the function.
modifier onlyOwner() {
require(msg.sender == owner, "Not the contract owner");
_;
}
/// @param _dfx The address of bridged DFX.
/// @param _ccipDfx The address of CCIP DFX.
constructor(address _dfx, address _ccipDfx) {
owner = msg.sender;
bridgedDfx = IERC20(_dfx);
ccipDfx = IERC20(_ccipDfx);
}
/// @notice Swaps `amount` of bridged DFX for an equivalent amount of CCIP DFX.
/// @param amount The amount of bridged DFX to be swapped.
function swapBridgedDfxToCcipDfx(uint256 amount) external {
require(bridgedDfx.transferFrom(msg.sender, address(this), amount), "Transfer of bridged DFX failed");
require(ccipDfx.transfer(msg.sender, amount), "Transfer of CCIP DFX failed");
emit Exchange(msg.sender, amount);
}
/// @notice Allows the owner to withdraw any ERC20 token from the contract.
/// @param tokenAddress The address of the ERC20 token to be withdrawn.
function adminWithdraw(address tokenAddress, uint256 amount) external onlyOwner {
IERC20 token = IERC20(tokenAddress);
require(token.transfer(owner, amount), "Emergency withdraw failed");
emit Withdraw(msg.sender, amount);
}
/// @notice Allows the owner to set a new contract owner.
/// @param newOwner The address of the new contract owner.
function setOwner(address newOwner) external onlyOwner {
owner = newOwner;
emit ChangeOwner(newOwner);
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
interface IERC20 {
function transfer(address recipient, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
function balanceOf(address account) external view returns (uint256);
}{
"evmVersion": "istanbul",
"optimizer": {
"enabled": true,
"runs": 200
},
"libraries": {
"Migrator.sol": {}
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_dfx","type":"address"},{"internalType":"address","name":"_ccipDfx","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newOwner","type":"address"}],"name":"ChangeOwner","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Exchange","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"admin","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"adminWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"bridgedDfx","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ccipDfx","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"setOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"swapBridgedDfxToCcipDfx","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
608060405234801561001057600080fd5b5060405161065938038061065983398101604081905261002f91610087565b600080546001600160a01b03199081163317909155600180546001600160a01b03948516908316179055600280549290931691161790556100ba565b80516001600160a01b038116811461008257600080fd5b919050565b6000806040838503121561009a57600080fd5b6100a38361006b565b91506100b16020840161006b565b90509250929050565b610590806100c96000396000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c806311c532d61461006757806313af403514610096578063401d4482146100ab57806357916a27146100be5780638da5cb5b146100d1578063cc095ee5146100e4575b600080fd5b60025461007a906001600160a01b031681565b6040516001600160a01b03909116815260200160405180910390f35b6100a96100a43660046104d3565b6100f7565b005b6100a96100b93660046104f5565b6101a4565b60015461007a906001600160a01b031681565b60005461007a906001600160a01b031681565b6100a96100f236600461051f565b6102f9565b6000546001600160a01b0316331461014f5760405162461bcd60e51b81526020600482015260166024820152752737ba103a34329031b7b73a3930b1ba1037bbb732b960511b60448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0383169081179091556040519081527ff285329298fd841af46eb83bbe90d1ebe2951c975a65b19a02f965f842ee69c5906020015b60405180910390a150565b6000546001600160a01b031633146101f75760405162461bcd60e51b81526020600482015260166024820152752737ba103a34329031b7b73a3930b1ba1037bbb732b960511b6044820152606401610146565b60005460405163a9059cbb60e01b81526001600160a01b03918216600482015260248101839052839182169063a9059cbb906044016020604051808303816000875af115801561024b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061026f9190610538565b6102bb5760405162461bcd60e51b815260206004820152601960248201527f456d657267656e6379207769746864726177206661696c6564000000000000006044820152606401610146565b60408051338152602081018490527f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364910160405180910390a1505050565b6001546040516323b872dd60e01b8152336004820152306024820152604481018390526001600160a01b03909116906323b872dd906064016020604051808303816000875af1158015610350573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103749190610538565b6103c05760405162461bcd60e51b815260206004820152601e60248201527f5472616e73666572206f66206272696467656420444658206661696c656400006044820152606401610146565b60025460405163a9059cbb60e01b8152336004820152602481018390526001600160a01b039091169063a9059cbb906044016020604051808303816000875af1158015610411573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104359190610538565b6104815760405162461bcd60e51b815260206004820152601b60248201527f5472616e73666572206f66204343495020444658206661696c656400000000006044820152606401610146565b60408051338152602081018390527f5988e4c12f4844b895de0739f562558435dca9602fd8b970720ee3cf8dff39be9101610199565b80356001600160a01b03811681146104ce57600080fd5b919050565b6000602082840312156104e557600080fd5b6104ee826104b7565b9392505050565b6000806040838503121561050857600080fd5b610511836104b7565b946020939093013593505050565b60006020828403121561053157600080fd5b5035919050565b60006020828403121561054a57600080fd5b815180151581146104ee57600080fdfea264697066735822122073a1318b0023408829a970f7d9b75d5294d5258251ea9371a6db2c2a9ca558d164736f6c63430008160033000000000000000000000000a4914b824ef261d4ed0ccecec29500862d57c0a100000000000000000000000027f485b62c4a7e635f561a87560adf5090239e93
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100625760003560e01c806311c532d61461006757806313af403514610096578063401d4482146100ab57806357916a27146100be5780638da5cb5b146100d1578063cc095ee5146100e4575b600080fd5b60025461007a906001600160a01b031681565b6040516001600160a01b03909116815260200160405180910390f35b6100a96100a43660046104d3565b6100f7565b005b6100a96100b93660046104f5565b6101a4565b60015461007a906001600160a01b031681565b60005461007a906001600160a01b031681565b6100a96100f236600461051f565b6102f9565b6000546001600160a01b0316331461014f5760405162461bcd60e51b81526020600482015260166024820152752737ba103a34329031b7b73a3930b1ba1037bbb732b960511b60448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0383169081179091556040519081527ff285329298fd841af46eb83bbe90d1ebe2951c975a65b19a02f965f842ee69c5906020015b60405180910390a150565b6000546001600160a01b031633146101f75760405162461bcd60e51b81526020600482015260166024820152752737ba103a34329031b7b73a3930b1ba1037bbb732b960511b6044820152606401610146565b60005460405163a9059cbb60e01b81526001600160a01b03918216600482015260248101839052839182169063a9059cbb906044016020604051808303816000875af115801561024b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061026f9190610538565b6102bb5760405162461bcd60e51b815260206004820152601960248201527f456d657267656e6379207769746864726177206661696c6564000000000000006044820152606401610146565b60408051338152602081018490527f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364910160405180910390a1505050565b6001546040516323b872dd60e01b8152336004820152306024820152604481018390526001600160a01b03909116906323b872dd906064016020604051808303816000875af1158015610350573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103749190610538565b6103c05760405162461bcd60e51b815260206004820152601e60248201527f5472616e73666572206f66206272696467656420444658206661696c656400006044820152606401610146565b60025460405163a9059cbb60e01b8152336004820152602481018390526001600160a01b039091169063a9059cbb906044016020604051808303816000875af1158015610411573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104359190610538565b6104815760405162461bcd60e51b815260206004820152601b60248201527f5472616e73666572206f66204343495020444658206661696c656400000000006044820152606401610146565b60408051338152602081018390527f5988e4c12f4844b895de0739f562558435dca9602fd8b970720ee3cf8dff39be9101610199565b80356001600160a01b03811681146104ce57600080fd5b919050565b6000602082840312156104e557600080fd5b6104ee826104b7565b9392505050565b6000806040838503121561050857600080fd5b610511836104b7565b946020939093013593505050565b60006020828403121561053157600080fd5b5035919050565b60006020828403121561054a57600080fd5b815180151581146104ee57600080fdfea264697066735822122073a1318b0023408829a970f7d9b75d5294d5258251ea9371a6db2c2a9ca558d164736f6c63430008160033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000a4914b824ef261d4ed0ccecec29500862d57c0a100000000000000000000000027f485b62c4a7e635f561a87560adf5090239e93
-----Decoded View---------------
Arg [0] : _dfx (address): 0xA4914B824eF261D4ED0Ccecec29500862d57c0a1
Arg [1] : _ccipDfx (address): 0x27f485b62C4A7E635F561A87560Adf5090239E93
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000a4914b824ef261d4ed0ccecec29500862d57c0a1
Arg [1] : 00000000000000000000000027f485b62c4a7e635f561a87560adf5090239e93
Loading...
Loading
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|---|---|---|---|---|
| ARB | 100.00% | $0.002541 | 80,286.9975 | $203.97 |
Loading...
Loading
Loading...
Loading
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.