Source Code
Latest 25 from a total of 3,039 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Swap Wrld1To Top... | 23385298 | 141 days ago | IN | 0 ETH | 0.00011081 | ||||
| Swap Wrld1To Top... | 23271239 | 157 days ago | IN | 0 ETH | 0.00015214 | ||||
| Swap Wrld1To Top... | 23271076 | 157 days ago | IN | 0 ETH | 0.00025945 | ||||
| Swap Wrld1To Top... | 23270285 | 157 days ago | IN | 0 ETH | 0.00016181 | ||||
| Swap Wrld1To Top... | 23266554 | 157 days ago | IN | 0 ETH | 0.00008571 | ||||
| Swap Wrld1To Top... | 23263099 | 158 days ago | IN | 0 ETH | 0.00001939 | ||||
| Swap Wrld1To Top... | 23262701 | 158 days ago | IN | 0 ETH | 0.0000764 | ||||
| Swap Wrld1To Top... | 23258434 | 158 days ago | IN | 0 ETH | 0.00006801 | ||||
| Swap Wrld1To Top... | 23256354 | 159 days ago | IN | 0 ETH | 0.00006426 | ||||
| Swap Wrld1To Top... | 23252827 | 159 days ago | IN | 0 ETH | 0.00008497 | ||||
| Swap Wrld1To Top... | 23211672 | 165 days ago | IN | 0 ETH | 0.00002583 | ||||
| Swap Wrld1To Top... | 23183137 | 169 days ago | IN | 0 ETH | 0.00048322 | ||||
| Swap Wrld1To Top... | 23169494 | 171 days ago | IN | 0 ETH | 0.00018194 | ||||
| Swap Wrld1To Top... | 23169379 | 171 days ago | IN | 0 ETH | 0.0001768 | ||||
| Swap Wrld1To Top... | 23168047 | 171 days ago | IN | 0 ETH | 0.00003711 | ||||
| Swap Wrld1To Top... | 23165671 | 171 days ago | IN | 0 ETH | 0.00016528 | ||||
| Swap Wrld1To Top... | 23164270 | 171 days ago | IN | 0 ETH | 0.0001203 | ||||
| Swap Wrld1To Top... | 23164243 | 171 days ago | IN | 0 ETH | 0.00011915 | ||||
| Swap Wrld1To Top... | 23163111 | 172 days ago | IN | 0 ETH | 0.00016265 | ||||
| Swap Wrld1To Top... | 23163070 | 172 days ago | IN | 0 ETH | 0.00015993 | ||||
| Swap Wrld1To Top... | 23161581 | 172 days ago | IN | 0 ETH | 0.00013231 | ||||
| Swap Wrld1To Top... | 23157967 | 172 days ago | IN | 0 ETH | 0.00000877 | ||||
| Swap Wrld1To Top... | 23157951 | 172 days ago | IN | 0 ETH | 0.00001171 | ||||
| Swap Wrld1To Top... | 23156897 | 173 days ago | IN | 0 ETH | 0.00012298 | ||||
| Swap Wrld1To Top... | 23156738 | 173 days ago | IN | 0 ETH | 0.00012253 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
WRLD_To_TOPIA_Migration
Compiler Version
v0.8.18+commit.87f61d96
Optimization Enabled:
Yes with 1000000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
//
// ............... ............... ............... ..... ...............
// :==============. =============== :==============: -==== .==============-
// :==============. =============== :==============: -==== .==============-
// :==============. =============== :==============: -==== .==============-
// :==============. =============== :==============: -==== .==============-
// .::::-====-::::. =============== :====-:::::::::. -==== .====-::::-====-
// :====. =============== :====: -==== .====: .====-
// :====. =============== :====: -==== .====: .====-
//
// Learn more at https://topia.gg or Twitter @TOPIAgg
pragma solidity 0.8.18;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
contract WRLD_To_TOPIA_Migration is Ownable {
IERC20 private immutable wrld1Token;
IERC20 private immutable wrld2Token;
IERC20 private immutable topiaToken;
constructor(address wrld1TokenAddress, address wrld2TokenAddress, address topiaTokenAddress) {
wrld1Token = IERC20(wrld1TokenAddress);
wrld2Token = IERC20(wrld2TokenAddress);
topiaToken = IERC20(topiaTokenAddress);
}
function swapWrld1ToTopia(uint256 amount) external {
require(topiaToken.balanceOf(address(this)) >= amount, "Migration contract requires $TOPIA refill");
wrld1Token.transferFrom(msg.sender, address(this), amount);
topiaToken.transfer(msg.sender, amount);
}
function swapWrld2ToTopia(uint256 amount) external {
uint256 swapAmount = amount * 952381 / 1000000; // reversion of the prior 5% wrld 1.0 -> 2.0 bonus.
require(topiaToken.balanceOf(address(this)) >= swapAmount, "Migration contract requires $TOPIA refill");
wrld2Token.transferFrom(msg.sender, address(this), amount);
topiaToken.transfer(msg.sender, swapAmount);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @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 amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` 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 amount) 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 `amount` 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 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` 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 amount
) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}{
"optimizer": {
"enabled": true,
"runs": 1000000
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"wrld1TokenAddress","type":"address"},{"internalType":"address","name":"wrld2TokenAddress","type":"address"},{"internalType":"address","name":"topiaTokenAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"swapWrld1ToTopia","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"swapWrld2ToTopia","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
60e060405234801561001057600080fd5b50604051610abe380380610abe83398101604081905261002f916100c1565b61003833610055565b6001600160a01b0392831660805290821660a0521660c052610104565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b03811681146100bc57600080fd5b919050565b6000806000606084860312156100d657600080fd5b6100df846100a5565b92506100ed602085016100a5565b91506100fb604085016100a5565b90509250925092565b60805160a05160c0516109766101486000396000818161014001528181610331015281816103e801526105e9015260006102790152600061053101526109766000f3fe608060405234801561001057600080fd5b50600436106100675760003560e01c8063715018a611610050578063715018a6146100945780638da5cb5b1461009c578063f2fde38b146100c857600080fd5b806326a17a071461006c578063550c673a14610081575b600080fd5b61007f61007a366004610830565b6100db565b005b61007f61008f366004610830565b6103b8565b61007f61066f565b6000546040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b61007f6100d6366004610849565b610683565b6000620f42406100ee83620e883d610886565b6100f891906108ca565b6040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152909150819073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906370a0823190602401602060405180830381865afa158015610187573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101ab9190610905565b101561023e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f4d6967726174696f6e20636f6e74726163742072657175697265732024544f5060448201527f494120726566696c6c000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6040517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018390527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906323b872dd906064016020604051808303816000875af11580156102d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102fb919061091e565b506040517fa9059cbb000000000000000000000000000000000000000000000000000000008152336004820152602481018290527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169063a9059cbb906044016020604051808303816000875af115801561038f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103b3919061091e565b505050565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015281907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa158015610444573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104689190610905565b10156104f6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f4d6967726174696f6e20636f6e74726163742072657175697265732024544f5060448201527f494120726566696c6c00000000000000000000000000000000000000000000006064820152608401610235565b6040517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018290527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906323b872dd906064016020604051808303816000875af115801561058f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105b3919061091e565b506040517fa9059cbb000000000000000000000000000000000000000000000000000000008152336004820152602481018290527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169063a9059cbb906044016020604051808303816000875af1158015610647573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061066b919061091e565b5050565b61067761073a565b61068160006107bb565b565b61068b61073a565b73ffffffffffffffffffffffffffffffffffffffff811661072e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610235565b610737816107bb565b50565b60005473ffffffffffffffffffffffffffffffffffffffff163314610681576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610235565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006020828403121561084257600080fd5b5035919050565b60006020828403121561085b57600080fd5b813573ffffffffffffffffffffffffffffffffffffffff8116811461087f57600080fd5b9392505050565b80820281158282048414176108c4577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b92915050565b600082610900577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b60006020828403121561091757600080fd5b5051919050565b60006020828403121561093057600080fd5b8151801515811461087f57600080fdfea2646970667358221220166f2924b458689c0890df7cc4d5a196b0823805d5bece9eed9da4689a6a945c64736f6c63430008120033000000000000000000000000d5d86fc8d5c0ea1ac1ac5dfab6e529c9967a45e9000000000000000000000000ff2d6934fb49e3e883dc03871d081a1c21ad7984000000000000000000000000ccccb68e1a848cbdb5b60a974e07aae143ed40c3
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100675760003560e01c8063715018a611610050578063715018a6146100945780638da5cb5b1461009c578063f2fde38b146100c857600080fd5b806326a17a071461006c578063550c673a14610081575b600080fd5b61007f61007a366004610830565b6100db565b005b61007f61008f366004610830565b6103b8565b61007f61066f565b6000546040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b61007f6100d6366004610849565b610683565b6000620f42406100ee83620e883d610886565b6100f891906108ca565b6040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152909150819073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ccccb68e1a848cbdb5b60a974e07aae143ed40c316906370a0823190602401602060405180830381865afa158015610187573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101ab9190610905565b101561023e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f4d6967726174696f6e20636f6e74726163742072657175697265732024544f5060448201527f494120726566696c6c000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6040517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018390527f000000000000000000000000ff2d6934fb49e3e883dc03871d081a1c21ad798473ffffffffffffffffffffffffffffffffffffffff16906323b872dd906064016020604051808303816000875af11580156102d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102fb919061091e565b506040517fa9059cbb000000000000000000000000000000000000000000000000000000008152336004820152602481018290527f000000000000000000000000ccccb68e1a848cbdb5b60a974e07aae143ed40c373ffffffffffffffffffffffffffffffffffffffff169063a9059cbb906044016020604051808303816000875af115801561038f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103b3919061091e565b505050565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015281907f000000000000000000000000ccccb68e1a848cbdb5b60a974e07aae143ed40c373ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa158015610444573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104689190610905565b10156104f6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f4d6967726174696f6e20636f6e74726163742072657175697265732024544f5060448201527f494120726566696c6c00000000000000000000000000000000000000000000006064820152608401610235565b6040517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018290527f000000000000000000000000d5d86fc8d5c0ea1ac1ac5dfab6e529c9967a45e973ffffffffffffffffffffffffffffffffffffffff16906323b872dd906064016020604051808303816000875af115801561058f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105b3919061091e565b506040517fa9059cbb000000000000000000000000000000000000000000000000000000008152336004820152602481018290527f000000000000000000000000ccccb68e1a848cbdb5b60a974e07aae143ed40c373ffffffffffffffffffffffffffffffffffffffff169063a9059cbb906044016020604051808303816000875af1158015610647573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061066b919061091e565b5050565b61067761073a565b61068160006107bb565b565b61068b61073a565b73ffffffffffffffffffffffffffffffffffffffff811661072e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610235565b610737816107bb565b50565b60005473ffffffffffffffffffffffffffffffffffffffff163314610681576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610235565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006020828403121561084257600080fd5b5035919050565b60006020828403121561085b57600080fd5b813573ffffffffffffffffffffffffffffffffffffffff8116811461087f57600080fd5b9392505050565b80820281158282048414176108c4577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b92915050565b600082610900577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b60006020828403121561091757600080fd5b5051919050565b60006020828403121561093057600080fd5b8151801515811461087f57600080fdfea2646970667358221220166f2924b458689c0890df7cc4d5a196b0823805d5bece9eed9da4689a6a945c64736f6c63430008120033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000d5d86fc8d5c0ea1ac1ac5dfab6e529c9967a45e9000000000000000000000000ff2d6934fb49e3e883dc03871d081a1c21ad7984000000000000000000000000ccccb68e1a848cbdb5b60a974e07aae143ed40c3
-----Decoded View---------------
Arg [0] : wrld1TokenAddress (address): 0xD5d86FC8d5C0Ea1aC1Ac5Dfab6E529c9967a45E9
Arg [1] : wrld2TokenAddress (address): 0xFF2d6934fb49e3e883Dc03871D081a1C21ad7984
Arg [2] : topiaTokenAddress (address): 0xcccCb68e1A848CBDB5b60a974E07aAE143ed40C3
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000d5d86fc8d5c0ea1ac1ac5dfab6e529c9967a45e9
Arg [1] : 000000000000000000000000ff2d6934fb49e3e883dc03871d081a1c21ad7984
Arg [2] : 000000000000000000000000ccccb68e1a848cbdb5b60a974e07aae143ed40c3
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.