Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00Latest 25 from a total of 161 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Finish Migration | 9083306 | 2275 days ago | IN | 0 ETH | 0.00016102 | ||||
| Migrate Batch | 9083305 | 2275 days ago | IN | 0 ETH | 0.00678546 | ||||
| Migrate Batch | 9083303 | 2275 days ago | IN | 0 ETH | 0.02236067 | ||||
| Migrate Batch | 9083300 | 2275 days ago | IN | 0 ETH | 0.02236049 | ||||
| Migrate Batch | 9083296 | 2275 days ago | IN | 0 ETH | 0.02236043 | ||||
| Migrate Batch | 9083289 | 2275 days ago | IN | 0 ETH | 0.02236037 | ||||
| Migrate Batch | 9083287 | 2275 days ago | IN | 0 ETH | 0.02236031 | ||||
| Migrate Batch | 9083285 | 2275 days ago | IN | 0 ETH | 0.02236037 | ||||
| Migrate Batch | 9083283 | 2275 days ago | IN | 0 ETH | 0.02236049 | ||||
| Migrate Batch | 9083281 | 2275 days ago | IN | 0 ETH | 0.02236061 | ||||
| Migrate Batch | 9083278 | 2275 days ago | IN | 0 ETH | 0.02236037 | ||||
| Migrate Batch | 9083276 | 2275 days ago | IN | 0 ETH | 0.02236055 | ||||
| Migrate Batch | 9083274 | 2275 days ago | IN | 0 ETH | 0.02236049 | ||||
| Migrate Batch | 9083272 | 2275 days ago | IN | 0 ETH | 0.02236055 | ||||
| Migrate Batch | 9083268 | 2275 days ago | IN | 0 ETH | 0.02236007 | ||||
| Migrate Batch | 9083265 | 2275 days ago | IN | 0 ETH | 0.02236061 | ||||
| Migrate Batch | 9083263 | 2275 days ago | IN | 0 ETH | 0.02236055 | ||||
| Migrate Batch | 9083250 | 2275 days ago | IN | 0 ETH | 0.02236031 | ||||
| Migrate Batch | 9083248 | 2275 days ago | IN | 0 ETH | 0.02236043 | ||||
| Migrate Batch | 9083244 | 2275 days ago | IN | 0 ETH | 0.02236067 | ||||
| Migrate Batch | 9083242 | 2275 days ago | IN | 0 ETH | 0.02236025 | ||||
| Migrate Batch | 9083240 | 2275 days ago | IN | 0 ETH | 0.02236079 | ||||
| Migrate Batch | 9083237 | 2275 days ago | IN | 0 ETH | 0.02236049 | ||||
| Migrate Batch | 9083235 | 2275 days ago | IN | 0 ETH | 0.02236049 | ||||
| Migrate Batch | 9083233 | 2275 days ago | IN | 0 ETH | 0.02236019 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
ERC20Migrator
Compiler Version
v0.5.12+commit.7709ece9
Contract Source Code (Solidity)
/**
*Submitted for verification at Etherscan.io on 2019-12-10
*/
// File: @openzeppelin/contracts/token/ERC20/IERC20.sol
pragma solidity ^0.5.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP. Does not include
* the optional functions; to access them see {ERC20Detailed}.
*/
interface IERC20 {
/**
* @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 `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, 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 `sender` to `recipient` 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 sender, address recipient, uint256 amount) external returns (bool);
/**
* @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);
}
// File: @openzeppelin/contracts/token/ERC20/ERC20Detailed.sol
pragma solidity ^0.5.0;
/**
* @dev Optional functions from the ERC20 standard.
*/
contract ERC20Detailed is IERC20 {
string private _name;
string private _symbol;
uint8 private _decimals;
/**
* @dev Sets the values for `name`, `symbol`, and `decimals`. All three of
* these values are immutable: they can only be set once during
* construction.
*/
constructor (string memory name, string memory symbol, uint8 decimals) public {
_name = name;
_symbol = symbol;
_decimals = decimals;
}
/**
* @dev Returns the name of the token.
*/
function name() public view returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5,05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei.
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view returns (uint8) {
return _decimals;
}
}
// File: @openzeppelin/contracts/GSN/Context.sol
pragma solidity ^0.5.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 GSN 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.
*/
contract Context {
// Empty internal constructor, to prevent people from mistakenly deploying
// an instance of this contract, which should be used via inheritance.
constructor () internal { }
// solhint-disable-previous-line no-empty-blocks
function _msgSender() internal view returns (address payable) {
return msg.sender;
}
function _msgData() internal view returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
// File: @openzeppelin/contracts/math/SafeMath.sol
pragma solidity ^0.5.0;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*
* _Available since v2.4.0._
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*
* _Available since v2.4.0._
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*
* _Available since v2.4.0._
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
// File: @openzeppelin/contracts/token/ERC20/ERC20.sol
pragma solidity ^0.5.0;
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20Mintable}.
*
* TIP: For a detailed writeup see our guide
* https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* We have followed general OpenZeppelin guidelines: functions revert instead
* of returning `false` on failure. This behavior is nonetheless conventional
* and does not conflict with the expectations of ERC20 applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*
* Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
* functions have been added to mitigate the well-known issues around setting
* allowances. See {IERC20-approve}.
*/
contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20};
*
* Requirements:
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for `sender`'s tokens of at least
* `amount`.
*/
function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
/**
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements
*
* - `to` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal {
require(account != address(0), "ERC20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal {
require(account != address(0), "ERC20: burn from the zero address");
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens.
*
* This is internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(address owner, address spender, uint256 amount) internal {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @dev Destroys `amount` tokens from `account`.`amount` is then deducted
* from the caller's allowance.
*
* See {_burn} and {_approve}.
*/
function _burnFrom(address account, uint256 amount) internal {
_burn(account, amount);
_approve(account, _msgSender(), _allowances[account][_msgSender()].sub(amount, "ERC20: burn amount exceeds allowance"));
}
}
// File: @openzeppelin/contracts/access/Roles.sol
pragma solidity ^0.5.0;
/**
* @title Roles
* @dev Library for managing addresses assigned to a Role.
*/
library Roles {
struct Role {
mapping (address => bool) bearer;
}
/**
* @dev Give an account access to this role.
*/
function add(Role storage role, address account) internal {
require(!has(role, account), "Roles: account already has role");
role.bearer[account] = true;
}
/**
* @dev Remove an account's access to this role.
*/
function remove(Role storage role, address account) internal {
require(has(role, account), "Roles: account does not have role");
role.bearer[account] = false;
}
/**
* @dev Check if an account has this role.
* @return bool
*/
function has(Role storage role, address account) internal view returns (bool) {
require(account != address(0), "Roles: account is the zero address");
return role.bearer[account];
}
}
// File: @openzeppelin/contracts/access/roles/MinterRole.sol
pragma solidity ^0.5.0;
contract MinterRole is Context {
using Roles for Roles.Role;
event MinterAdded(address indexed account);
event MinterRemoved(address indexed account);
Roles.Role private _minters;
constructor () internal {
_addMinter(_msgSender());
}
modifier onlyMinter() {
require(isMinter(_msgSender()), "MinterRole: caller does not have the Minter role");
_;
}
function isMinter(address account) public view returns (bool) {
return _minters.has(account);
}
function addMinter(address account) public onlyMinter {
_addMinter(account);
}
function renounceMinter() public {
_removeMinter(_msgSender());
}
function _addMinter(address account) internal {
_minters.add(account);
emit MinterAdded(account);
}
function _removeMinter(address account) internal {
_minters.remove(account);
emit MinterRemoved(account);
}
}
// File: @openzeppelin/contracts/token/ERC20/ERC20Mintable.sol
pragma solidity ^0.5.0;
/**
* @dev Extension of {ERC20} that adds a set of accounts with the {MinterRole},
* which have permission to mint (create) new tokens as they see fit.
*
* At construction, the deployer of the contract is the only minter.
*/
contract ERC20Mintable is ERC20, MinterRole {
/**
* @dev See {ERC20-_mint}.
*
* Requirements:
*
* - the caller must have the {MinterRole}.
*/
function mint(address account, uint256 amount) public onlyMinter returns (bool) {
_mint(account, amount);
return true;
}
}
// File: @openzeppelin/contracts/math/Math.sol
pragma solidity ^0.5.0;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a >= b ? a : b;
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two numbers. The result is rounded towards
* zero.
*/
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow, so we distribute
return (a / 2) + (b / 2) + ((a % 2 + b % 2) / 2);
}
}
// File: @openzeppelin/contracts/ownership/Ownable.sol
pragma solidity ^0.5.0;
/**
* @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.
*
* 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.
*/
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 () internal {
_owner = _msgSender();
emit OwnershipTransferred(address(0), _owner);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(isOwner(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Returns true if the caller is the current owner.
*/
function isOwner() public view returns (bool) {
return _msgSender() == _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 onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = 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 onlyOwner {
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
*/
function _transferOwnership(address newOwner) internal {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
// File: contracts/ERC20Migrator.sol
pragma solidity ^0.5.12;
/**
* @title ERC20Migrator
* @dev This contract can be used to migrate an ERC20 paused token from one
* contract to another, using a push strategy.
* This contract checks the balance of an address in the legacy token and mints
* the same amount at the new token.
* One entity can do an airdrop without the need of trusting a csv backup of a token
* snapshot.
* For the precise interface refer to
* OpenZeppelin's {ERC20Mintable},{ERC20} but the only functions that are needed are
* {MinterRole-isMinter} and {ERC20Mintable-mint}. The migrator will check
* that it is a minter for the token.
* The balance from the legacy token will NOT be transfered.
*
* Example of usage to batch airdrop:
* ```
* const addresses = ['0x1...', '0x2...', '0x1...', '0x2...', '0x1...', '0x2...']
* const migrator = await ERC20Migrator.new(legacyToken.address);
* await newToken.new(legacyToken.address, migrator.address);
* await migrator.beginMigration(newToken.address);
* const batches = _.chunck(addresses, 20);
* await Promise.mapSeries(batches, (batch) => migrator.batchMigration(batch).send())
* ```
*/
contract ERC20Migrator is Ownable {
// Address of the old token contract
ERC20Detailed private _legacyToken;
// Address of the new token contract
ERC20Mintable private _newToken;
// Flag to determinate when migration finished
bool private _migrationFinished;
/**
* Special migration rule:
*
* There is no way to migrate old DepositContract token to the new DepositContract,
* due the old deployed DepositContract.sol have no setters to change the token address.
*
* So instead of mint tokens to the same address, it will be
* minted to the new DepositContract address.
*
* Without this special rule, the minted tokens would be locked forever in the old DepositContract.
*/
address private _legacyDepositAddress;
address private _newDepositAddress;
// A mapping to keep track addresses that have migrated
mapping(address => bool) public accountMigrated;
// A cap of number of addresses per batch
uint16 public constant ARRAY_LENGTH_LIMIT = 100;
event MigrationStarted(address legacyToken, address newToken);
event MigrationFinished(address legacyToken, address newToken);
/**
* @param legacyToken_ address of the old token contract
* @param legacyDepositAddress_ address of the old token contract
*/
constructor(ERC20Detailed legacyToken_, address legacyDepositAddress_) public {
require(
address(legacyToken_) != address(0),
"ERC20Migrator: legacy token is the zero address"
);
require(
bytes(legacyToken_.symbol()).length > 0,
"ERC20Migrator: legacyToken should be initialized"
);
require(
legacyDepositAddress_ != address(0),
"ERC20Migrator: legacyDepositAddress_ is the zero address"
);
_legacyToken = legacyToken_;
_newToken = ERC20Mintable(address(0));
_legacyDepositAddress = legacyDepositAddress_;
}
/**
* @dev Returns the legacy token that is being migrated.
*/
function legacyToken() external view returns (address) {
return address(_legacyToken);
}
/**
* @dev Returns the new token to which we are migrating.
*/
function newToken() external view returns (address) {
return address(_newToken);
}
/**
* @dev Returns the new token to which we are migrating.
*/
function migrationFinished() external view returns (bool) {
return _migrationFinished;
}
/**
* @dev Returns the new deposit contract address to which we are migrating.
*/
function newContractAddress() external view returns (address) {
return _newDepositAddress;
}
/**
* @dev Returns the new deposit contract address to which we are migrating.
*/
function legacyContractAddress() external view returns (address) {
return _legacyDepositAddress;
}
/**
* @dev Modifier to make a function callable only when the contract is allowed to migrate
*/
modifier onlyMigrating() {
require(_migrationFinished == false, "ERC20Migrator: Migration finished");
require(address(_newToken) != address(0), "ERC20Migrator: token is not set");
require(_newDepositAddress != address(0), "ERC20Migrator: DepositContract address is not set");
require(_newToken.isMinter(address(this)) == true, "ERC20Migrator: im not allowed to mint");
_;
}
/**
* @dev Begins the migration by setting which is the new token that will be
* minted. This contract must be a minter for the new token.
* @param newToken_ the token that will be minted
*/
function beginMigration(ERC20Mintable newToken_, address newDepositAddress_) external onlyOwner returns (bool) {
require(address(_newToken) == address(0), "ERC20Migrator: migration already started");
require(address(_newDepositAddress) == address(0), "ERC20Migrator: newDepositAddress set and already started");
require(address(newToken_) != address(0), "ERC20Migrator: new token is the zero address");
require(address(newDepositAddress_) != address(0), "ERC20Migrator: depositContractAddress is the zero address");
require(
address(newToken_) != address(_legacyToken),
"ERC20Migrator: new token should not be legacy token"
);
//solhint-disable-next-line max-line-length
require(newToken_.isMinter(address(this)), "ERC20Migrator: not a minter for new token");
//require(_legacyToken.paused(), "ERC20Migrator: legacy token not paused");
_newToken = newToken_;
_newDepositAddress = newDepositAddress_;
emit MigrationStarted(address(_legacyToken), address(_newToken));
return true;
}
/**
* @dev Transfers part of an account's balance in the old token to this
* contract, and mints the same amount of new tokens for that account.
* @param account whose tokens will be migrated
* @param amount amount of tokens to be migrated
*/
function mint(address account, uint256 amount) private returns (bool) {
require(accountMigrated[account] == false, "ERC20Migrator: Account already migrated");
accountMigrated[account] = true;
require(_newToken.mint(account, amount), "ERC20Migrator: Error calling mint");
return true;
}
/**
* @dev Transfers all of an account's allowed balance in the old token to
* this contract, and mints the same amount of new tokens for that account.
* @param account whose tokens will be migrated
*/
function migrateBalance(address account) private onlyMigrating returns (bool) {
uint256 balance = _legacyToken.balanceOf(account);
// Start of Special rule for migrating _newDepositAddress, check at the top about why this is needed.
if (account == _legacyDepositAddress) {
return mint(_newDepositAddress, balance);
}
// End of special rule
return mint(account, balance);
}
/**
* @dev Function to migrate a batch of addreses
* @param _to An array of addresses that will receive the minted tokens.
* @return A boolean that indicates whether the operation was successful.
*/
function migrateBatch(address[] memory _to) public returns (bool) {
require(_to.length <= ARRAY_LENGTH_LIMIT, "ERC20Migrator: max array length reached");
for (uint256 i = 0; i < _to.length; i++) {
require(migrateBalance(_to[i]), "ERC20Migrator: batch error");
}
return true;
}
/**
* @dev Finish the migration process and renounce this contract as a minter.
*/
function finishMigration() external onlyOwner onlyMigrating {
_migrationFinished = true;
_newToken.renounceMinter();
emit MigrationFinished(address(_legacyToken), address(_newToken));
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"contract ERC20Detailed","name":"legacyToken_","type":"address"},{"internalType":"address","name":"legacyDepositAddress_","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"legacyToken","type":"address"},{"indexed":false,"internalType":"address","name":"newToken","type":"address"}],"name":"MigrationFinished","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"legacyToken","type":"address"},{"indexed":false,"internalType":"address","name":"newToken","type":"address"}],"name":"MigrationStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"constant":true,"inputs":[],"name":"ARRAY_LENGTH_LIMIT","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"accountMigrated","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"contract ERC20Mintable","name":"newToken_","type":"address"},{"internalType":"address","name":"newDepositAddress_","type":"address"}],"name":"beginMigration","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"finishMigration","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"isOwner","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"legacyContractAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"legacyToken","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address[]","name":"_to","type":"address[]"}],"name":"migrateBatch","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"migrationFinished","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"newContractAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"newToken","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"renounceOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
60806040523480156200001157600080fd5b506040516200150838038062001508833981810160405260408110156200003757600080fd5b508051602090910151620000536001600160e01b036200032116565b600080546001600160a01b0319166001600160a01b03928316178082556040519216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a36001600160a01b038216620000fc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602f815260200180620014a1602f913960400191505060405180910390fd5b6000826001600160a01b03166395d89b416040518163ffffffff1660e01b815260040160006040518083038186803b1580156200013857600080fd5b505afa1580156200014d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405260208110156200017757600080fd5b81019080805160405193929190846401000000008211156200019857600080fd5b908301906020820185811115620001ae57600080fd5b8251640100000000811182820188101715620001c957600080fd5b82525081516020918201929091019080838360005b83811015620001f8578181015183820152602001620001de565b50505050905090810190601f168015620002265780820380516001836020036101000a031916815260200191505b50604052505050511162000286576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526030815260200180620014716030913960400191505060405180910390fd5b6001600160a01b038116620002e7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526038815260200180620014d06038913960400191505060405180910390fd5b600180546001600160a01b039384166001600160a01b03199182161790915560028054821690556003805492909316911617905562000325565b3390565b61113c80620003356000396000f3fe608060405234801561001057600080fd5b50600436106100ea5760003560e01c806388d761f21161008c578063c42bd05a11610066578063c42bd05a14610250578063f2fde38b14610258578063f69fcee01461027e578063fd6c10d314610286576100ea565b806388d761f2146102385780638da5cb5b146102405780638f32d59b14610248576100ea565b806346e04866116100c857806346e04866146101555780636af04a5714610183578063715018a61461018b5780638062939014610195576100ea565b806313155455146100ef578063365b8868146101135780633f9e23e51461014d575b600080fd5b6100f76102a5565b604080516001600160a01b039092168252519081900360200190f35b6101396004803603602081101561012957600080fd5b50356001600160a01b03166102b4565b604080519115158252519081900360200190f35b6101396102c9565b6101396004803603604081101561016b57600080fd5b506001600160a01b03813581169160200135166102d9565b6100f76105b1565b6101936105c0565b005b610139600480360360208110156101ab57600080fd5b8101906020810181356401000000008111156101c657600080fd5b8201836020820111156101d857600080fd5b803590602001918460208302840111640100000000831117156101fa57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610651945050505050565b610193610724565b6100f76109cc565b6101396109db565b6100f76109ff565b6101936004803603602081101561026e57600080fd5b50356001600160a01b0316610a0e565b6100f7610a61565b61028e610a70565b6040805161ffff9092168252519081900360200190f35b6001546001600160a01b031690565b60056020526000908152604090205460ff1681565b600254600160a01b900460ff1690565b60006102e36109db565b610322576040805162461bcd60e51b81526020600482018190526024820152600080516020610ff9833981519152604482015290519081900360640190fd5b6002546001600160a01b03161561036a5760405162461bcd60e51b8152600401808060200182810382526028815260200180610f606028913960400191505060405180910390fd5b6004546001600160a01b0316156103b25760405162461bcd60e51b81526004018080602001828103825260388152602001806110836038913960400191505060405180910390fd5b6001600160a01b0383166103f75760405162461bcd60e51b815260040180806020018281038252602c8152602001806110bb602c913960400191505060405180910390fd5b6001600160a01b03821661043c5760405162461bcd60e51b81526004018080602001828103825260398152602001806110196039913960400191505060405180910390fd5b6001546001600160a01b03848116911614156104895760405162461bcd60e51b8152600401808060200182810382526033815260200180610ee26033913960400191505060405180910390fd5b604080516355138f0d60e11b815230600482015290516001600160a01b0385169163aa271e1a916024808301926020929190829003018186803b1580156104cf57600080fd5b505afa1580156104e3573d6000803e3d6000fd5b505050506040513d60208110156104f957600080fd5b50516105365760405162461bcd60e51b8152600401808060200182810382526029815260200180610fd06029913960400191505060405180910390fd5b600280546001600160a01b038086166001600160a01b031992831617928390556004805486831693169290921790915560015460408051918316825292909116602082015281517fcb867aacde0a366be34dd5a67c52d14fe1a849217e927e74b490e2a12427c182929181900390910190a150600192915050565b6004546001600160a01b031690565b6105c86109db565b610607576040805162461bcd60e51b81526020600482018190526024820152600080516020610ff9833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000606461ffff16825111156106985760405162461bcd60e51b8152600401808060200182810382526027815260200180610f886027913960400191505060405180910390fd5b60005b8251811015610719576106c08382815181106106b357fe5b6020026020010151610a75565b610711576040805162461bcd60e51b815260206004820152601a60248201527f45524332304d69677261746f723a206261746368206572726f72000000000000604482015290519081900360640190fd5b60010161069b565b50600190505b919050565b61072c6109db565b61076b576040805162461bcd60e51b81526020600482018190526024820152600080516020610ff9833981519152604482015290519081900360640190fd5b600254600160a01b900460ff16156107b45760405162461bcd60e51b81526004018080602001828103825260218152602001806110e76021913960400191505060405180910390fd5b6002546001600160a01b0316610811576040805162461bcd60e51b815260206004820152601f60248201527f45524332304d69677261746f723a20746f6b656e206973206e6f742073657400604482015290519081900360640190fd5b6004546001600160a01b03166108585760405162461bcd60e51b81526004018080602001828103825260318152602001806110526031913960400191505060405180910390fd5b600254604080516355138f0d60e11b815230600482015290516001600160a01b039092169163aa271e1a91602480820192602092909190829003018186803b1580156108a357600080fd5b505afa1580156108b7573d6000803e3d6000fd5b505050506040513d60208110156108cd57600080fd5b5051151560011461090f5760405162461bcd60e51b8152600401808060200182810382526025815260200180610f3b6025913960400191505060405180910390fd5b6002805460ff60a01b1916600160a01b179081905560408051639865027560e01b815290516001600160a01b039092169163986502759160048082019260009290919082900301818387803b15801561096757600080fd5b505af115801561097b573d6000803e3d6000fd5b5050600154600254604080516001600160a01b03938416815292909116602083015280517f5772df6fce2ad7755e125559c68518e36ddceab5b6bb6f7bfec1ef845ea1c2ae945091829003019150a1565b6000546001600160a01b031690565b600080546001600160a01b03166109f0610ce1565b6001600160a01b031614905090565b6002546001600160a01b031690565b610a166109db565b610a55576040805162461bcd60e51b81526020600482018190526024820152600080516020610ff9833981519152604482015290519081900360640190fd5b610a5e81610ce5565b50565b6003546001600160a01b031690565b606481565b600254600090600160a01b900460ff1615610ac15760405162461bcd60e51b81526004018080602001828103825260218152602001806110e76021913960400191505060405180910390fd5b6002546001600160a01b0316610b1e576040805162461bcd60e51b815260206004820152601f60248201527f45524332304d69677261746f723a20746f6b656e206973206e6f742073657400604482015290519081900360640190fd5b6004546001600160a01b0316610b655760405162461bcd60e51b81526004018080602001828103825260318152602001806110526031913960400191505060405180910390fd5b600254604080516355138f0d60e11b815230600482015290516001600160a01b039092169163aa271e1a91602480820192602092909190829003018186803b158015610bb057600080fd5b505afa158015610bc4573d6000803e3d6000fd5b505050506040513d6020811015610bda57600080fd5b50511515600114610c1c5760405162461bcd60e51b8152600401808060200182810382526025815260200180610f3b6025913960400191505060405180910390fd5b600154604080516370a0823160e01b81526001600160a01b038581166004830152915160009392909216916370a0823191602480820192602092909190829003018186803b158015610c6d57600080fd5b505afa158015610c81573d6000803e3d6000fd5b505050506040513d6020811015610c9757600080fd5b50516003549091506001600160a01b0384811691161415610cd057600454610cc8906001600160a01b031682610d85565b91505061071f565b610cda8382610d85565b9392505050565b3390565b6001600160a01b038116610d2a5760405162461bcd60e51b8152600401808060200182810382526026815260200180610f156026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b03821660009081526005602052604081205460ff1615610ddd5760405162461bcd60e51b8152600401808060200182810382526027815260200180610ebb6027913960400191505060405180910390fd5b6001600160a01b038084166000818152600560209081526040808320805460ff1916600117905560025481516340c10f1960e01b815260048101959095526024850188905290519416936340c10f1993604480820194918390030190829087803b158015610e4a57600080fd5b505af1158015610e5e573d6000803e3d6000fd5b505050506040513d6020811015610e7457600080fd5b5051610eb15760405162461bcd60e51b8152600401808060200182810382526021815260200180610faf6021913960400191505060405180910390fd5b5060019291505056fe45524332304d69677261746f723a204163636f756e7420616c7265616479206d6967726174656445524332304d69677261746f723a206e657720746f6b656e2073686f756c64206e6f74206265206c656761637920746f6b656e4f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332304d69677261746f723a20696d206e6f7420616c6c6f77656420746f206d696e7445524332304d69677261746f723a206d6967726174696f6e20616c7265616479207374617274656445524332304d69677261746f723a206d6178206172726179206c656e677468207265616368656445524332304d69677261746f723a204572726f722063616c6c696e67206d696e7445524332304d69677261746f723a206e6f742061206d696e74657220666f72206e657720746f6b656e4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657245524332304d69677261746f723a206465706f736974436f6e74726163744164647265737320697320746865207a65726f206164647265737345524332304d69677261746f723a204465706f736974436f6e74726163742061646472657373206973206e6f742073657445524332304d69677261746f723a206e65774465706f736974416464726573732073657420616e6420616c7265616479207374617274656445524332304d69677261746f723a206e657720746f6b656e20697320746865207a65726f206164647265737345524332304d69677261746f723a204d6967726174696f6e2066696e6973686564a265627a7a7231582056365413fee8c71b39f407cebaff47eebf5e370fd429b3231c873b2855eab66c64736f6c634300050c003245524332304d69677261746f723a206c6567616379546f6b656e2073686f756c6420626520696e697469616c697a656445524332304d69677261746f723a206c656761637920746f6b656e20697320746865207a65726f206164647265737345524332304d69677261746f723a206c65676163794465706f736974416464726573735f20697320746865207a65726f206164647265737300000000000000000000000002585e4a14da274d02df09b222d4606b10a4e9400000000000000000000000007f8b86b112cf0389b1ba125c4011d096b86fbaab
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100ea5760003560e01c806388d761f21161008c578063c42bd05a11610066578063c42bd05a14610250578063f2fde38b14610258578063f69fcee01461027e578063fd6c10d314610286576100ea565b806388d761f2146102385780638da5cb5b146102405780638f32d59b14610248576100ea565b806346e04866116100c857806346e04866146101555780636af04a5714610183578063715018a61461018b5780638062939014610195576100ea565b806313155455146100ef578063365b8868146101135780633f9e23e51461014d575b600080fd5b6100f76102a5565b604080516001600160a01b039092168252519081900360200190f35b6101396004803603602081101561012957600080fd5b50356001600160a01b03166102b4565b604080519115158252519081900360200190f35b6101396102c9565b6101396004803603604081101561016b57600080fd5b506001600160a01b03813581169160200135166102d9565b6100f76105b1565b6101936105c0565b005b610139600480360360208110156101ab57600080fd5b8101906020810181356401000000008111156101c657600080fd5b8201836020820111156101d857600080fd5b803590602001918460208302840111640100000000831117156101fa57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610651945050505050565b610193610724565b6100f76109cc565b6101396109db565b6100f76109ff565b6101936004803603602081101561026e57600080fd5b50356001600160a01b0316610a0e565b6100f7610a61565b61028e610a70565b6040805161ffff9092168252519081900360200190f35b6001546001600160a01b031690565b60056020526000908152604090205460ff1681565b600254600160a01b900460ff1690565b60006102e36109db565b610322576040805162461bcd60e51b81526020600482018190526024820152600080516020610ff9833981519152604482015290519081900360640190fd5b6002546001600160a01b03161561036a5760405162461bcd60e51b8152600401808060200182810382526028815260200180610f606028913960400191505060405180910390fd5b6004546001600160a01b0316156103b25760405162461bcd60e51b81526004018080602001828103825260388152602001806110836038913960400191505060405180910390fd5b6001600160a01b0383166103f75760405162461bcd60e51b815260040180806020018281038252602c8152602001806110bb602c913960400191505060405180910390fd5b6001600160a01b03821661043c5760405162461bcd60e51b81526004018080602001828103825260398152602001806110196039913960400191505060405180910390fd5b6001546001600160a01b03848116911614156104895760405162461bcd60e51b8152600401808060200182810382526033815260200180610ee26033913960400191505060405180910390fd5b604080516355138f0d60e11b815230600482015290516001600160a01b0385169163aa271e1a916024808301926020929190829003018186803b1580156104cf57600080fd5b505afa1580156104e3573d6000803e3d6000fd5b505050506040513d60208110156104f957600080fd5b50516105365760405162461bcd60e51b8152600401808060200182810382526029815260200180610fd06029913960400191505060405180910390fd5b600280546001600160a01b038086166001600160a01b031992831617928390556004805486831693169290921790915560015460408051918316825292909116602082015281517fcb867aacde0a366be34dd5a67c52d14fe1a849217e927e74b490e2a12427c182929181900390910190a150600192915050565b6004546001600160a01b031690565b6105c86109db565b610607576040805162461bcd60e51b81526020600482018190526024820152600080516020610ff9833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000606461ffff16825111156106985760405162461bcd60e51b8152600401808060200182810382526027815260200180610f886027913960400191505060405180910390fd5b60005b8251811015610719576106c08382815181106106b357fe5b6020026020010151610a75565b610711576040805162461bcd60e51b815260206004820152601a60248201527f45524332304d69677261746f723a206261746368206572726f72000000000000604482015290519081900360640190fd5b60010161069b565b50600190505b919050565b61072c6109db565b61076b576040805162461bcd60e51b81526020600482018190526024820152600080516020610ff9833981519152604482015290519081900360640190fd5b600254600160a01b900460ff16156107b45760405162461bcd60e51b81526004018080602001828103825260218152602001806110e76021913960400191505060405180910390fd5b6002546001600160a01b0316610811576040805162461bcd60e51b815260206004820152601f60248201527f45524332304d69677261746f723a20746f6b656e206973206e6f742073657400604482015290519081900360640190fd5b6004546001600160a01b03166108585760405162461bcd60e51b81526004018080602001828103825260318152602001806110526031913960400191505060405180910390fd5b600254604080516355138f0d60e11b815230600482015290516001600160a01b039092169163aa271e1a91602480820192602092909190829003018186803b1580156108a357600080fd5b505afa1580156108b7573d6000803e3d6000fd5b505050506040513d60208110156108cd57600080fd5b5051151560011461090f5760405162461bcd60e51b8152600401808060200182810382526025815260200180610f3b6025913960400191505060405180910390fd5b6002805460ff60a01b1916600160a01b179081905560408051639865027560e01b815290516001600160a01b039092169163986502759160048082019260009290919082900301818387803b15801561096757600080fd5b505af115801561097b573d6000803e3d6000fd5b5050600154600254604080516001600160a01b03938416815292909116602083015280517f5772df6fce2ad7755e125559c68518e36ddceab5b6bb6f7bfec1ef845ea1c2ae945091829003019150a1565b6000546001600160a01b031690565b600080546001600160a01b03166109f0610ce1565b6001600160a01b031614905090565b6002546001600160a01b031690565b610a166109db565b610a55576040805162461bcd60e51b81526020600482018190526024820152600080516020610ff9833981519152604482015290519081900360640190fd5b610a5e81610ce5565b50565b6003546001600160a01b031690565b606481565b600254600090600160a01b900460ff1615610ac15760405162461bcd60e51b81526004018080602001828103825260218152602001806110e76021913960400191505060405180910390fd5b6002546001600160a01b0316610b1e576040805162461bcd60e51b815260206004820152601f60248201527f45524332304d69677261746f723a20746f6b656e206973206e6f742073657400604482015290519081900360640190fd5b6004546001600160a01b0316610b655760405162461bcd60e51b81526004018080602001828103825260318152602001806110526031913960400191505060405180910390fd5b600254604080516355138f0d60e11b815230600482015290516001600160a01b039092169163aa271e1a91602480820192602092909190829003018186803b158015610bb057600080fd5b505afa158015610bc4573d6000803e3d6000fd5b505050506040513d6020811015610bda57600080fd5b50511515600114610c1c5760405162461bcd60e51b8152600401808060200182810382526025815260200180610f3b6025913960400191505060405180910390fd5b600154604080516370a0823160e01b81526001600160a01b038581166004830152915160009392909216916370a0823191602480820192602092909190829003018186803b158015610c6d57600080fd5b505afa158015610c81573d6000803e3d6000fd5b505050506040513d6020811015610c9757600080fd5b50516003549091506001600160a01b0384811691161415610cd057600454610cc8906001600160a01b031682610d85565b91505061071f565b610cda8382610d85565b9392505050565b3390565b6001600160a01b038116610d2a5760405162461bcd60e51b8152600401808060200182810382526026815260200180610f156026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b03821660009081526005602052604081205460ff1615610ddd5760405162461bcd60e51b8152600401808060200182810382526027815260200180610ebb6027913960400191505060405180910390fd5b6001600160a01b038084166000818152600560209081526040808320805460ff1916600117905560025481516340c10f1960e01b815260048101959095526024850188905290519416936340c10f1993604480820194918390030190829087803b158015610e4a57600080fd5b505af1158015610e5e573d6000803e3d6000fd5b505050506040513d6020811015610e7457600080fd5b5051610eb15760405162461bcd60e51b8152600401808060200182810382526021815260200180610faf6021913960400191505060405180910390fd5b5060019291505056fe45524332304d69677261746f723a204163636f756e7420616c7265616479206d6967726174656445524332304d69677261746f723a206e657720746f6b656e2073686f756c64206e6f74206265206c656761637920746f6b656e4f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332304d69677261746f723a20696d206e6f7420616c6c6f77656420746f206d696e7445524332304d69677261746f723a206d6967726174696f6e20616c7265616479207374617274656445524332304d69677261746f723a206d6178206172726179206c656e677468207265616368656445524332304d69677261746f723a204572726f722063616c6c696e67206d696e7445524332304d69677261746f723a206e6f742061206d696e74657220666f72206e657720746f6b656e4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657245524332304d69677261746f723a206465706f736974436f6e74726163744164647265737320697320746865207a65726f206164647265737345524332304d69677261746f723a204465706f736974436f6e74726163742061646472657373206973206e6f742073657445524332304d69677261746f723a206e65774465706f736974416464726573732073657420616e6420616c7265616479207374617274656445524332304d69677261746f723a206e657720746f6b656e20697320746865207a65726f206164647265737345524332304d69677261746f723a204d6967726174696f6e2066696e6973686564a265627a7a7231582056365413fee8c71b39f407cebaff47eebf5e370fd429b3231c873b2855eab66c64736f6c634300050c0032
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000002585e4a14da274d02df09b222d4606b10a4e9400000000000000000000000007f8b86b112cf0389b1ba125c4011d096b86fbaab
-----Decoded View---------------
Arg [0] : legacyToken_ (address): 0x02585E4A14dA274D02dF09b222D4606B10a4E940
Arg [1] : legacyDepositAddress_ (address): 0x7f8b86B112Cf0389B1Ba125C4011D096b86FBAAB
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 00000000000000000000000002585e4a14da274d02df09b222d4606b10a4e940
Arg [1] : 0000000000000000000000007f8b86b112cf0389b1ba125c4011d096b86fbaab
Deployed Bytecode Sourcemap
26908:7138:0:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;26908:7138:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;29049:102;;;:::i;:::-;;;;-1:-1:-1;;;;;29049:102:0;;;;;;;;;;;;;;27837:47;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;27837:47:0;-1:-1:-1;;;;;27837:47:0;;:::i;:::-;;;;;;;;;;;;;;;;;;29423:102;;;:::i;30727:1130::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;;30727:1130:0;;;;;;;;;;:::i;29632:106::-;;;:::i;24948:140::-;;;:::i;:::-;;33388:330;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;33388:330:0;;;;;;;;21:11:-1;5:28;;2:2;;;46:1;43;36:12;2:2;33388:330:0;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;33388:330:0;;;;;;101:9:-1;95:2;81:12;77:21;67:8;63:36;60:51;39:11;25:12;22:29;11:108;8:2;;;132:1;129;122:12;8:2;33388:330:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;81:16;;74:27;;;;-1:-1;33388:330:0;;-1:-1:-1;33388:330:0;;-1:-1:-1;;;;;33388:330:0:i;33826:217::-;;;:::i;24137:79::-;;;:::i;24503:94::-;;;:::i;29239:96::-;;;:::i;25243:109::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;25243:109:0;-1:-1:-1;;;;;25243:109:0;;:::i;29845:112::-;;;:::i;27940:47::-;;;:::i;:::-;;;;;;;;;;;;;;;;;;;29049:102;29130:12;;-1:-1:-1;;;;;29130:12:0;29049:102;:::o;27837:47::-;;;;;;;;;;;;;;;:::o;29423:102::-;29499:18;;-1:-1:-1;;;29499:18:0;;;;;29423:102::o;30727:1130::-;30832:4;24349:9;:7;:9::i;:::-;24341:54;;;;;-1:-1:-1;;;24341:54:0;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;24341:54:0;;;;;;;;;;;;;;;30865:9;;-1:-1:-1;;;;;30865:9:0;30857:32;30849:85;;;;-1:-1:-1;;;30849:85:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30961:18;;-1:-1:-1;;;;;30961:18:0;30953:41;30945:110;;;;-1:-1:-1;;;30945:110:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;31074:32:0;;31066:89;;;;-1:-1:-1;;;31066:89:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;31174:41:0;;31166:111;;;;-1:-1:-1;;;31166:111:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;31340:12;;-1:-1:-1;;;;;31310:43:0;;;31340:12;;31310:43;;31288:144;;;;-1:-1:-1;;;31288:144:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;31504:33;;;-1:-1:-1;;;31504:33:0;;31531:4;31504:33;;;;;;-1:-1:-1;;;;;31504:18:0;;;;;:33;;;;;;;;;;;;;;:18;:33;;;5:2:-1;;;;30:1;27;20:12;5:2;31504:33:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;31504:33:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;31504:33:0;31496:87;;;;-1:-1:-1;;;31496:87:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;31681:9;:21;;-1:-1:-1;;;;;31681:21:0;;;-1:-1:-1;;;;;;31681:21:0;;;;;;;;31713:18;:39;;;;;;;;;;;;;;31681:21;31793:12;31768:59;;;31793:12;;;31768:59;;31816:9;;;;31768:59;;;;;;;;;;;;;;;;;-1:-1:-1;31845:4:0;30727:1130;;;;:::o;29632:106::-;29712:18;;-1:-1:-1;;;;;29712:18:0;29632:106;:::o;24948:140::-;24349:9;:7;:9::i;:::-;24341:54;;;;;-1:-1:-1;;;24341:54:0;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;24341:54:0;;;;;;;;;;;;;;;25047:1;25031:6;;25010:40;;-1:-1:-1;;;;;25031:6:0;;;;25010:40;;25047:1;;25010:40;25078:1;25061:19;;-1:-1:-1;;;;;;25061:19:0;;;24948:140::o;33388:330::-;33448:4;27984:3;33473:32;;:3;:10;:32;;33465:84;;;;-1:-1:-1;;;33465:84:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;33565:9;33560:129;33584:3;:10;33580:1;:14;33560:129;;;33624:22;33639:3;33643:1;33639:6;;;;;;;;;;;;;;33624:14;:22::i;:::-;33616:61;;;;;-1:-1:-1;;;33616:61:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;33596:3;;33560:129;;;;33706:4;33699:11;;33388:330;;;;:::o;33826:217::-;24349:9;:7;:9::i;:::-;24341:54;;;;;-1:-1:-1;;;24341:54:0;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;24341:54:0;;;;;;;;;;;;;;;30120:18;;-1:-1:-1;;;30120:18:0;;;;:27;30112:73;;;;-1:-1:-1;;;30112:73:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30212:9;;-1:-1:-1;;;;;30212:9:0;30196:76;;;;;-1:-1:-1;;;30196:76:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;30291:18;;-1:-1:-1;;;;;30291:18:0;30283:94;;;;-1:-1:-1;;;30283:94:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30396:9;;:33;;;-1:-1:-1;;;30396:33:0;;30423:4;30396:33;;;;;;-1:-1:-1;;;;;30396:9:0;;;;:18;;:33;;;;;;;;;;;;;;;:9;:33;;;5:2:-1;;;;30:1;27;20:12;5:2;30396:33:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;30396:33:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;30396:33:0;:41;;30433:4;30396:41;30388:91;;;;-1:-1:-1;;;30388:91:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;33897:18;:25;;-1:-1:-1;;;;33897:25:0;-1:-1:-1;;;33897:25:0;;;;;33933:26;;;-1:-1:-1;;;33933:26:0;;;;-1:-1:-1;;;;;33933:9:0;;;;:24;;:26;;;;;33897:25;;33933:26;;;;;;;;33897:25;33933:9;:26;;;5:2:-1;;;;30:1;27;20:12;5:2;33933:26:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;-1:-1;;34001:12:0;;34024:9;;33975:60;;;-1:-1:-1;;;;;34001:12:0;;;33975:60;;34024:9;;;;33975:60;;;;;;;;-1:-1:-1;33975:60:0;;;;;;-1:-1:-1;33975:60:0;33826:217::o;24137:79::-;24175:7;24202:6;-1:-1:-1;;;;;24202:6:0;24137:79;:::o;24503:94::-;24543:4;24583:6;;-1:-1:-1;;;;;24583:6:0;24567:12;:10;:12::i;:::-;-1:-1:-1;;;;;24567:22:0;;24560:29;;24503:94;:::o;29239:96::-;29317:9;;-1:-1:-1;;;;;29317:9:0;29239:96;:::o;25243:109::-;24349:9;:7;:9::i;:::-;24341:54;;;;;-1:-1:-1;;;24341:54:0;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;24341:54:0;;;;;;;;;;;;;;;25316:28;25335:8;25316:18;:28::i;:::-;25243:109;:::o;29845:112::-;29928:21;;-1:-1:-1;;;;;29928:21:0;29845:112;:::o;27940:47::-;27984:3;27940:47;:::o;32708:444::-;30120:18;;32780:4;;-1:-1:-1;;;30120:18:0;;;;:27;30112:73;;;;-1:-1:-1;;;30112:73:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30212:9;;-1:-1:-1;;;;;30212:9:0;30196:76;;;;;-1:-1:-1;;;30196:76:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;30291:18;;-1:-1:-1;;;;;30291:18:0;30283:94;;;;-1:-1:-1;;;30283:94:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30396:9;;:33;;;-1:-1:-1;;;30396:33:0;;30423:4;30396:33;;;;;;-1:-1:-1;;;;;30396:9:0;;;;:18;;:33;;;;;;;;;;;;;;;:9;:33;;;5:2:-1;;;;30:1;27;20:12;5:2;30396:33:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;30396:33:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;30396:33:0;:41;;30433:4;30396:41;30388:91;;;;-1:-1:-1;;;30388:91:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;32815:12;;:31;;;-1:-1:-1;;;32815:31:0;;-1:-1:-1;;;;;32815:31:0;;;;;;;;;32797:15;;32815:12;;;;;:22;;:31;;;;;;;;;;;;;;;:12;:31;;;5:2:-1;;;;30:1;27;20:12;5:2;32815:31:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;32815:31:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;32815:31:0;32983:21;;32815:31;;-1:-1:-1;;;;;;32972:32:0;;;32983:21;;32972:32;32968:105;;;33033:18;;33028:33;;-1:-1:-1;;;;;33033:18:0;33053:7;33028:4;:33::i;:::-;33021:40;;;;;32968:105;33122:22;33127:7;33136;33122:4;:22::i;:::-;33115:29;32708:444;-1:-1:-1;;;32708:444:0:o;5392:98::-;5472:10;5392:98;:::o;25458:229::-;-1:-1:-1;;;;;25532:22:0;;25524:73;;;;-1:-1:-1;;;25524:73:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;25634:6;;;25613:38;;-1:-1:-1;;;;;25613:38:0;;;;25634:6;;;25613:38;;;25662:6;:17;;-1:-1:-1;;;;;;25662:17:0;-1:-1:-1;;;;;25662:17:0;;;;;;;;;;25458:229::o;32143:326::-;-1:-1:-1;;;;;32232:24:0;;32207:4;32232:24;;;:15;:24;;;;;;;;:33;32224:85;;;;-1:-1:-1;;;32224:85:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;32320:24:0;;;;;;;:15;:24;;;;;;;;:31;;-1:-1:-1;;32320:31:0;32347:4;32320:31;;;32370:9;;:31;;-1:-1:-1;;;32370:31:0;;;;;;;;;;;;;;;;;:9;;;:14;;:31;;;;;;;;;;;;;:9;:31;;;5:2:-1;;;;30:1;27;20:12;5:2;32370:31:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;32370:31:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;32370:31:0;32362:77;;;;-1:-1:-1;;;32362:77:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;32457:4:0;32143:326;;;;:::o
Swarm Source
bzzr://56365413fee8c71b39f407cebaff47eebf5e370fd429b3231c873b2855eab66c
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 33 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
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.