POL Price: $0.300325 (-0.72%)
Gas: 30 GWei
 

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Swap Bridged Dfx...677139502025-02-09 7:40:0410 days ago1739086804IN
0xF626AcB0...4Cc225fe4
0 POL0.004347750
Swap Bridged Dfx...676406882025-02-07 9:25:1612 days ago1738920316IN
0xF626AcB0...4Cc225fe4
0 POL0.00948334109.06168098
Swap Bridged Dfx...674977412025-02-03 18:23:4615 days ago1738607026IN
0xF626AcB0...4Cc225fe4
0 POL0.00782362111.99961114
Swap Bridged Dfx...666954722025-01-14 17:04:4935 days ago1736874289IN
0xF626AcB0...4Cc225fe4
0 POL0.004348350
Swap Bridged Dfx...666950082025-01-14 16:47:2535 days ago1736873245IN
0xF626AcB0...4Cc225fe4
0 POL0.004347750
Swap Bridged Dfx...666948892025-01-14 16:43:1135 days ago1736872991IN
0xF626AcB0...4Cc225fe4
0 POL0.003492750
Swap Bridged Dfx...666948532025-01-14 16:41:3435 days ago1736872894IN
0xF626AcB0...4Cc225fe4
0 POL0.004347150
Swap Bridged Dfx...664916012025-01-09 13:49:1141 days ago1736430551IN
0xF626AcB0...4Cc225fe4
0 POL0.01231814176.34127626
Swap Bridged Dfx...664589552025-01-08 18:07:5841 days ago1736359678IN
0xF626AcB0...4Cc225fe4
0 POL0.0090353103.90901553
Swap Bridged Dfx...664587652025-01-08 18:01:1441 days ago1736359274IN
0xF626AcB0...4Cc225fe4
0 POL0.0061732788.37403181
Swap Bridged Dfx...664584882025-01-08 17:51:1841 days ago1736358678IN
0xF626AcB0...4Cc225fe4
0 POL0.01223416140.69696805
Swap Bridged Dfx...663008022025-01-04 16:15:5345 days ago1736007353IN
0xF626AcB0...4Cc225fe4
0 POL0.0031246435.93445445
Swap Bridged Dfx...661866852025-01-01 17:02:2848 days ago1735750948IN
0xF626AcB0...4Cc225fe4
0 POL0.0031308947.91260548
Swap Bridged Dfx...659357992024-12-26 5:47:0755 days ago1735192027IN
0xF626AcB0...4Cc225fe4
0 POL0.0025282633.87728202
Swap Bridged Dfx...659325812024-12-26 3:43:5455 days ago1735184634IN
0xF626AcB0...4Cc225fe4
0 POL0.0074394877.06912302
Swap Bridged Dfx...657232812024-12-20 19:01:1560 days ago1734721275IN
0xF626AcB0...4Cc225fe4
0 POL0.0067988678.17840279
Swap Bridged Dfx...652906122024-12-10 0:06:1871 days ago1733789178IN
0xF626AcB0...4Cc225fe4
0 POL0.0080921493.06235188
Swap Bridged Dfx...652904982024-12-10 0:02:1671 days ago1733788936IN
0xF626AcB0...4Cc225fe4
0 POL0.004346550
Swap Bridged Dfx...652406452024-12-08 17:59:1072 days ago1733680750IN
0xF626AcB0...4Cc225fe4
0 POL0.004346550
Swap Bridged Dfx...652405032024-12-08 17:53:5872 days ago1733680438IN
0xF626AcB0...4Cc225fe4
0 POL0.004346550
Swap Bridged Dfx...652404022024-12-08 17:49:5272 days ago1733680192IN
0xF626AcB0...4Cc225fe4
0 POL0.004346550
Swap Bridged Dfx...652403182024-12-08 17:46:5172 days ago1733680011IN
0xF626AcB0...4Cc225fe4
0 POL0.004346550
Swap Bridged Dfx...652402392024-12-08 17:43:3172 days ago1733679811IN
0xF626AcB0...4Cc225fe4
0 POL0.004346550
Swap Bridged Dfx...651921602024-12-07 12:09:1474 days ago1733573354IN
0xF626AcB0...4Cc225fe4
0 POL0.004346550
Swap Bridged Dfx...651920292024-12-07 12:04:3474 days ago1733573074IN
0xF626AcB0...4Cc225fe4
0 POL0.004346550
View all transactions

Parent Transaction Hash Block From To
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Migrator

Compiler Version
v0.8.22+commit.4fc1097e

Optimization Enabled:
Yes with 200 runs

Other Settings:
istanbul EvmVersion, MIT license
File 1 of 2 : Migrator.sol
// 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);
    }
}

File 2 of 2 : IERC20.sol
// 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);
}

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

Contract Security Audit

Contract ABI

[{"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"}]

608060405234801561001057600080fd5b5060405161065938038061065983398101604081905261002f91610087565b600080546001600160a01b03199081163317909155600180546001600160a01b03948516908316179055600280549290931691161790556100ba565b80516001600160a01b038116811461008257600080fd5b919050565b6000806040838503121561009a57600080fd5b6100a38361006b565b91506100b16020840161006b565b90509250929050565b610590806100c96000396000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c806311c532d61461006757806313af403514610096578063401d4482146100ab57806357916a27146100be5780638da5cb5b146100d1578063cc095ee5146100e4575b600080fd5b60025461007a906001600160a01b031681565b6040516001600160a01b03909116815260200160405180910390f35b6100a96100a43660046104d3565b6100f7565b005b6100a96100b93660046104f5565b6101a4565b60015461007a906001600160a01b031681565b60005461007a906001600160a01b031681565b6100a96100f236600461051f565b6102f9565b6000546001600160a01b0316331461014f5760405162461bcd60e51b81526020600482015260166024820152752737ba103a34329031b7b73a3930b1ba1037bbb732b960511b60448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0383169081179091556040519081527ff285329298fd841af46eb83bbe90d1ebe2951c975a65b19a02f965f842ee69c5906020015b60405180910390a150565b6000546001600160a01b031633146101f75760405162461bcd60e51b81526020600482015260166024820152752737ba103a34329031b7b73a3930b1ba1037bbb732b960511b6044820152606401610146565b60005460405163a9059cbb60e01b81526001600160a01b03918216600482015260248101839052839182169063a9059cbb906044016020604051808303816000875af115801561024b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061026f9190610538565b6102bb5760405162461bcd60e51b815260206004820152601960248201527f456d657267656e6379207769746864726177206661696c6564000000000000006044820152606401610146565b60408051338152602081018490527f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364910160405180910390a1505050565b6001546040516323b872dd60e01b8152336004820152306024820152604481018390526001600160a01b03909116906323b872dd906064016020604051808303816000875af1158015610350573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103749190610538565b6103c05760405162461bcd60e51b815260206004820152601e60248201527f5472616e73666572206f66206272696467656420444658206661696c656400006044820152606401610146565b60025460405163a9059cbb60e01b8152336004820152602481018390526001600160a01b039091169063a9059cbb906044016020604051808303816000875af1158015610411573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104359190610538565b6104815760405162461bcd60e51b815260206004820152601b60248201527f5472616e73666572206f66204343495020444658206661696c656400000000006044820152606401610146565b60408051338152602081018390527f5988e4c12f4844b895de0739f562558435dca9602fd8b970720ee3cf8dff39be9101610199565b80356001600160a01b03811681146104ce57600080fd5b919050565b6000602082840312156104e557600080fd5b6104ee826104b7565b9392505050565b6000806040838503121561050857600080fd5b610511836104b7565b946020939093013593505050565b60006020828403121561053157600080fd5b5035919050565b60006020828403121561054a57600080fd5b815180151581146104ee57600080fdfea264697066735822122073a1318b0023408829a970f7d9b75d5294d5258251ea9371a6db2c2a9ca558d164736f6c63430008160033000000000000000000000000e7804d91dfcde7f776c90043e03eaa6df87e639500000000000000000000000027f485b62c4a7e635f561a87560adf5090239e93

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100625760003560e01c806311c532d61461006757806313af403514610096578063401d4482146100ab57806357916a27146100be5780638da5cb5b146100d1578063cc095ee5146100e4575b600080fd5b60025461007a906001600160a01b031681565b6040516001600160a01b03909116815260200160405180910390f35b6100a96100a43660046104d3565b6100f7565b005b6100a96100b93660046104f5565b6101a4565b60015461007a906001600160a01b031681565b60005461007a906001600160a01b031681565b6100a96100f236600461051f565b6102f9565b6000546001600160a01b0316331461014f5760405162461bcd60e51b81526020600482015260166024820152752737ba103a34329031b7b73a3930b1ba1037bbb732b960511b60448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0383169081179091556040519081527ff285329298fd841af46eb83bbe90d1ebe2951c975a65b19a02f965f842ee69c5906020015b60405180910390a150565b6000546001600160a01b031633146101f75760405162461bcd60e51b81526020600482015260166024820152752737ba103a34329031b7b73a3930b1ba1037bbb732b960511b6044820152606401610146565b60005460405163a9059cbb60e01b81526001600160a01b03918216600482015260248101839052839182169063a9059cbb906044016020604051808303816000875af115801561024b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061026f9190610538565b6102bb5760405162461bcd60e51b815260206004820152601960248201527f456d657267656e6379207769746864726177206661696c6564000000000000006044820152606401610146565b60408051338152602081018490527f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364910160405180910390a1505050565b6001546040516323b872dd60e01b8152336004820152306024820152604481018390526001600160a01b03909116906323b872dd906064016020604051808303816000875af1158015610350573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103749190610538565b6103c05760405162461bcd60e51b815260206004820152601e60248201527f5472616e73666572206f66206272696467656420444658206661696c656400006044820152606401610146565b60025460405163a9059cbb60e01b8152336004820152602481018390526001600160a01b039091169063a9059cbb906044016020604051808303816000875af1158015610411573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104359190610538565b6104815760405162461bcd60e51b815260206004820152601b60248201527f5472616e73666572206f66204343495020444658206661696c656400000000006044820152606401610146565b60408051338152602081018390527f5988e4c12f4844b895de0739f562558435dca9602fd8b970720ee3cf8dff39be9101610199565b80356001600160a01b03811681146104ce57600080fd5b919050565b6000602082840312156104e557600080fd5b6104ee826104b7565b9392505050565b6000806040838503121561050857600080fd5b610511836104b7565b946020939093013593505050565b60006020828403121561053157600080fd5b5035919050565b60006020828403121561054a57600080fd5b815180151581146104ee57600080fdfea264697066735822122073a1318b0023408829a970f7d9b75d5294d5258251ea9371a6db2c2a9ca558d164736f6c63430008160033

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

000000000000000000000000e7804d91dfcde7f776c90043e03eaa6df87e639500000000000000000000000027f485b62c4a7e635f561a87560adf5090239e93

-----Decoded View---------------
Arg [0] : _dfx (address): 0xE7804D91dfCDE7F776c90043E03eAa6Df87E6395
Arg [1] : _ccipDfx (address): 0x27f485b62C4A7E635F561A87560Adf5090239E93

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000e7804d91dfcde7f776c90043e03eaa6df87e6395
Arg [1] : 00000000000000000000000027f485b62c4a7e635f561a87560adf5090239e93


Block Transaction 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
[ 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.