Feature Tip: Add private address tag to any address under My Name Tag !
Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 3,270 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Burn Token | 15011538 | 986 days ago | IN | 0 ETH | 0.00107486 | ||||
Burn Token | 14997168 | 989 days ago | IN | 0 ETH | 0.00228895 | ||||
Burn Token | 14989212 | 990 days ago | IN | 0 ETH | 0.00062084 | ||||
Add Token | 14988916 | 990 days ago | IN | 0 ETH | 0.01520108 | ||||
Burn Token | 14961468 | 995 days ago | IN | 0 ETH | 0.00113281 | ||||
Burn Token | 14961409 | 995 days ago | IN | 0 ETH | 0.00138692 | ||||
Burn Token | 14958350 | 995 days ago | IN | 0 ETH | 0.00165035 | ||||
Burn Token | 14956795 | 996 days ago | IN | 0 ETH | 0.00358704 | ||||
Burn Token | 14924927 | 1001 days ago | IN | 0 ETH | 0.00213247 | ||||
Burn Token | 14924302 | 1001 days ago | IN | 0 ETH | 0.00156477 | ||||
Burn Token | 14924256 | 1001 days ago | IN | 0 ETH | 0.00209485 | ||||
Burn Token | 14923483 | 1001 days ago | IN | 0 ETH | 0.00190214 | ||||
Burn Token | 14920901 | 1002 days ago | IN | 0 ETH | 0.00244991 | ||||
Burn Token | 14919319 | 1002 days ago | IN | 0 ETH | 0.0009614 | ||||
Burn Token | 14914271 | 1003 days ago | IN | 0 ETH | 0.00092572 | ||||
Burn Token | 14912964 | 1003 days ago | IN | 0 ETH | 0.00112569 | ||||
Burn Token | 14891452 | 1007 days ago | IN | 0 ETH | 0.00220057 | ||||
Burn Token | 14889674 | 1007 days ago | IN | 0 ETH | 0.00225325 | ||||
Burn Token | 14885746 | 1008 days ago | IN | 0 ETH | 0.00572316 | ||||
Burn Token | 14875827 | 1009 days ago | IN | 0 ETH | 0.00073176 | ||||
Burn Token | 14870593 | 1010 days ago | IN | 0 ETH | 0.00070066 | ||||
Burn Token | 14869095 | 1010 days ago | IN | 0 ETH | 0.00126594 | ||||
Burn Token | 14861929 | 1011 days ago | IN | 0 ETH | 0.00280122 | ||||
Burn Token | 14861014 | 1012 days ago | IN | 0 ETH | 0.00119659 | ||||
Burn Token | 14858011 | 1012 days ago | IN | 0 ETH | 0.00121263 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
HRC20EthManager
Compiler Version
v0.5.17+commit.d19bba13
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2022-03-16 */ // 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/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/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 { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @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: @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/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/token/ERC20/ERC20Burnable.sol pragma solidity ^0.5.0; /** * @dev Extension of {ERC20} that allows token holders to destroy both their own * tokens and those that they have an allowance for, in a way that can be * recognized off-chain (via event analysis). */ contract ERC20Burnable is Context, ERC20 { /** * @dev Destroys `amount` tokens from the caller. * * See {ERC20-_burn}. */ function burn(uint256 amount) public { _burn(_msgSender(), amount); } /** * @dev See {ERC20-_burnFrom}. */ function burnFrom(address account, uint256 amount) public { _burnFrom(account, amount); } } // 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: contracts/lib/BridgedToken.sol pragma solidity 0.5.17; contract BridgedToken is ERC20Burnable, ERC20Detailed, ERC20Mintable { address public ethTokenAddr; constructor( address _ethTokenAddr, string memory name, string memory symbol, uint8 decimals ) public ERC20Detailed(name, symbol, decimals) { ethTokenAddr = _ethTokenAddr; } } // File: contracts/lib/TokenManager.sol pragma solidity 0.5.17; contract TokenManager is Ownable { // ethtoken to onetoken mapping mapping(address => address) public mappedTokens; event TokenMapAck(address indexed tokenReq, address indexed tokenAck); mapping(address => uint256) public wards; function rely(address guy) external onlyOwner { wards[guy] = 1; } function deny(address guy) external onlyOwner { require(guy != owner(), "TokenManager/cannot deny the owner"); wards[guy] = 0; } // both owner and admin must approve modifier auth { require(wards[msg.sender] == 1, "TokenManager/not-authorized"); _; } /** * @dev map ethereum token to harmony token and emit mintAddress * @param ethTokenAddr address of the ethereum token * @return mintAddress of the mapped token */ function addToken( address ethTokenAddr, string memory name, string memory symbol, uint8 decimals ) public auth returns (address) { require( ethTokenAddr != address(0), "TokenManager/ethToken is a zero address" ); require( mappedTokens[ethTokenAddr] == address(0), "TokenManager/ethToken already mapped" ); BridgedToken bridgedToken = new BridgedToken( ethTokenAddr, name, symbol, decimals ); address bridgedTokenAddr = address(bridgedToken); // store the mapping and created address mappedTokens[ethTokenAddr] = bridgedTokenAddr; // assign minter role to the caller bridgedToken.addMinter(msg.sender); emit TokenMapAck(ethTokenAddr, bridgedTokenAddr); return bridgedTokenAddr; } /** * @dev register an ethereum token to harmony token mapping * @param ethTokenAddr address of the ethereum token * @return oneToken of the mapped harmony token */ function registerToken(address ethTokenAddr, address oneTokenAddr) public auth returns (bool) { require( ethTokenAddr != address(0), "TokenManager/ethTokenAddr is a zero address" ); require( mappedTokens[ethTokenAddr] == address(0), "TokenManager/ethTokenAddr already mapped" ); // store the mapping and created address mappedTokens[ethTokenAddr] = oneTokenAddr; } /** * @dev remove an existing token mapping * @param ethTokenAddr address of the ethereum token * @param supply only allow removing mapping when supply, e.g., zero or 10**27 */ function removeToken(address ethTokenAddr, uint256 supply) public auth { require( mappedTokens[ethTokenAddr] != address(0), "TokenManager/ethToken mapping does not exists" ); IERC20 oneToken = IERC20(mappedTokens[ethTokenAddr]); require( oneToken.totalSupply() == supply, "TokenManager/remove has non-zero supply" ); delete mappedTokens[ethTokenAddr]; } } // File: contracts/hrc20/HRC20EthManager.sol pragma solidity 0.5.17; interface MintableToken { function mint(address beneficiary, uint256 amount) external returns (bool); } interface BurnableToken { function burnFrom(address account, uint256 amount) external; } contract HRC20EthManager { mapping(bytes32 => bool) public usedEvents_; mapping(address => address) public mappings; event Burned( address indexed token, address indexed sender, uint256 amount, address recipient ); event Minted( address ethToken, uint256 amount, address recipient, bytes32 receiptId ); address public wallet; modifier onlyWallet { require(msg.sender == wallet, "EthManager/not-authorized"); _; } /** * @dev constructor * @param _wallet is the multisig wallet */ constructor(address _wallet) public { wallet = _wallet; } /** * @dev map an harmony token to ethereum * @param tokenManager address to token manager * @param hmyTokenAddr harmony token address to map * @param name of the harmony token * @param symbol of the harmony token * @param decimals of the harmony token */ function addToken( address tokenManager, address hmyTokenAddr, string memory name, string memory symbol, uint8 decimals ) public { address ethTokenAddr = TokenManager(tokenManager).addToken( hmyTokenAddr, name, symbol, decimals ); mappings[hmyTokenAddr] = ethTokenAddr; } /** * @dev deregister token mapping in the token manager * @param tokenManager address to token manager * @param hmyTokenAddr address to remove token */ function removeToken(address tokenManager, address hmyTokenAddr) public { TokenManager(tokenManager).removeToken(hmyTokenAddr, 0); } /** * @dev burns tokens on ethereum to be unlocked on harmony * @param ethToken ethereum token address * @param amount amount of tokens to burn * @param recipient recipient of the unlock tokens on ethereum */ function burnToken( address ethToken, uint256 amount, address recipient ) public { BurnableToken(ethToken).burnFrom(msg.sender, amount); emit Burned(ethToken, msg.sender, amount, recipient); } /** * @dev mints tokens corresponding to the tokens locked in the harmony chain * @param ethToken is the token address for minting * @param amount amount of tokens for minting * @param recipient recipient of the minted tokens (ethereum address) * @param receiptId transaction hash of the lock event on harmony chain */ function mintToken( address ethToken, uint256 amount, address recipient, bytes32 receiptId ) public onlyWallet { require( !usedEvents_[receiptId], "EthManager/The lock event cannot be reused" ); usedEvents_[receiptId] = true; MintableToken(ethToken).mint(recipient, amount); emit Minted(ethToken, amount, recipient, receiptId); } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_wallet","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"address","name":"recipient","type":"address"}],"name":"Burned","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"ethToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"bytes32","name":"receiptId","type":"bytes32"}],"name":"Minted","type":"event"},{"constant":false,"inputs":[{"internalType":"address","name":"tokenManager","type":"address"},{"internalType":"address","name":"hmyTokenAddr","type":"address"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"uint8","name":"decimals","type":"uint8"}],"name":"addToken","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"ethToken","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"}],"name":"burnToken","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"mappings","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"ethToken","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"bytes32","name":"receiptId","type":"bytes32"}],"name":"mintToken","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"tokenManager","type":"address"},{"internalType":"address","name":"hmyTokenAddr","type":"address"}],"name":"removeToken","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"usedEvents_","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"wallet","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b5060405161083f38038061083f8339818101604052602081101561003357600080fd5b5051600280546001600160a01b0319166001600160a01b039092169190911790556107dc806100636000396000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c8063a0e3d1a01161005b578063a0e3d1a0146100fc578063bccc9fcf14610132578063e8162bda14610163578063f633be1e146102ae5761007d565b80634110261914610082578063521eb273146100c45780639735b0e3146100cc575b600080fd5b6100a86004803603602081101561009857600080fd5b50356001600160a01b03166102e8565b604080516001600160a01b039092168252519081900360200190f35b6100a8610303565b6100fa600480360360408110156100e257600080fd5b506001600160a01b0381358116916020013516610312565b005b6100fa6004803603606081101561011257600080fd5b506001600160a01b0381358116916020810135916040909101351661037d565b61014f6004803603602081101561014857600080fd5b5035610432565b604080519115158252519081900360200190f35b6100fa600480360360a081101561017957600080fd5b6001600160a01b0382358116926020810135909116918101906060810160408201356401000000008111156101ad57600080fd5b8201836020820111156101bf57600080fd5b803590602001918460018302840111640100000000831117156101e157600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929594936020810193503591505064010000000081111561023457600080fd5b82018360208201111561024657600080fd5b8035906020019184600183028401116401000000008311171561026857600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505050903560ff1691506104479050565b6100fa600480360360808110156102c457600080fd5b506001600160a01b03813581169160208101359160408201351690606001356105e3565b6001602052600090815260409020546001600160a01b031681565b6002546001600160a01b031681565b604080516309dd78f360e11b81526001600160a01b0383811660048301526000602483018190529251908516926313baf1e6926044808201939182900301818387803b15801561036157600080fd5b505af1158015610375573d6000803e3d6000fd5b505050505050565b6040805163079cc67960e41b81523360048201526024810184905290516001600160a01b038516916379cc679091604480830192600092919082900301818387803b1580156103cb57600080fd5b505af11580156103df573d6000803e3d6000fd5b5050604080518581526001600160a01b038581166020830152825133955090881693507f47b4128ad231bee46bdb1f8614450b5ffe6eb96340e87519a0c3a8b91ee714ec929181900390910190a3505050565b60006020819052908152604090205460ff1681565b6000856001600160a01b0316638e404e9c868686866040518563ffffffff1660e01b815260040180856001600160a01b03166001600160a01b0316815260200180602001806020018460ff1660ff168152602001838103835286818151815260200191508051906020019080838360005b838110156104d05781810151838201526020016104b8565b50505050905090810190601f1680156104fd5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610530578181015183820152602001610518565b50505050905090810190601f16801561055d5780820380516001836020036101000a031916815260200191505b509650505050505050602060405180830381600087803b15801561058057600080fd5b505af1158015610594573d6000803e3d6000fd5b505050506040513d60208110156105aa57600080fd5b50516001600160a01b03958616600090815260016020526040902080546001600160a01b03191696909116959095179094555050505050565b6002546001600160a01b03163314610642576040805162461bcd60e51b815260206004820152601960248201527f4574684d616e616765722f6e6f742d617574686f72697a656400000000000000604482015290519081900360640190fd5b60008181526020819052604090205460ff16156106905760405162461bcd60e51b815260040180806020018281038252602a81526020018061077e602a913960400191505060405180910390fd5b600081815260208181526040808320805460ff1916600117905580516340c10f1960e01b81526001600160a01b038681166004830152602482018890529151918816936340c10f199360448084019491939192918390030190829087803b1580156106fa57600080fd5b505af115801561070e573d6000803e3d6000fd5b505050506040513d602081101561072457600080fd5b5050604080516001600160a01b038087168252602082018690528416818301526060810183905290517ffdc0a3af821280dd73e4f6683e16c5afc31a629d07af623f9a4689d6855938869181900360800190a15050505056fe4574684d616e616765722f546865206c6f636b206576656e742063616e6e6f7420626520726575736564a265627a7a723158204d92b079d6880658d82066e2d0748bfd98e693638ce3545db4ed91f49d7d602364736f6c63430005110032000000000000000000000000715cdda5e9ad30a0ced14940f9997ee611496de6
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061007d5760003560e01c8063a0e3d1a01161005b578063a0e3d1a0146100fc578063bccc9fcf14610132578063e8162bda14610163578063f633be1e146102ae5761007d565b80634110261914610082578063521eb273146100c45780639735b0e3146100cc575b600080fd5b6100a86004803603602081101561009857600080fd5b50356001600160a01b03166102e8565b604080516001600160a01b039092168252519081900360200190f35b6100a8610303565b6100fa600480360360408110156100e257600080fd5b506001600160a01b0381358116916020013516610312565b005b6100fa6004803603606081101561011257600080fd5b506001600160a01b0381358116916020810135916040909101351661037d565b61014f6004803603602081101561014857600080fd5b5035610432565b604080519115158252519081900360200190f35b6100fa600480360360a081101561017957600080fd5b6001600160a01b0382358116926020810135909116918101906060810160408201356401000000008111156101ad57600080fd5b8201836020820111156101bf57600080fd5b803590602001918460018302840111640100000000831117156101e157600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929594936020810193503591505064010000000081111561023457600080fd5b82018360208201111561024657600080fd5b8035906020019184600183028401116401000000008311171561026857600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505050903560ff1691506104479050565b6100fa600480360360808110156102c457600080fd5b506001600160a01b03813581169160208101359160408201351690606001356105e3565b6001602052600090815260409020546001600160a01b031681565b6002546001600160a01b031681565b604080516309dd78f360e11b81526001600160a01b0383811660048301526000602483018190529251908516926313baf1e6926044808201939182900301818387803b15801561036157600080fd5b505af1158015610375573d6000803e3d6000fd5b505050505050565b6040805163079cc67960e41b81523360048201526024810184905290516001600160a01b038516916379cc679091604480830192600092919082900301818387803b1580156103cb57600080fd5b505af11580156103df573d6000803e3d6000fd5b5050604080518581526001600160a01b038581166020830152825133955090881693507f47b4128ad231bee46bdb1f8614450b5ffe6eb96340e87519a0c3a8b91ee714ec929181900390910190a3505050565b60006020819052908152604090205460ff1681565b6000856001600160a01b0316638e404e9c868686866040518563ffffffff1660e01b815260040180856001600160a01b03166001600160a01b0316815260200180602001806020018460ff1660ff168152602001838103835286818151815260200191508051906020019080838360005b838110156104d05781810151838201526020016104b8565b50505050905090810190601f1680156104fd5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610530578181015183820152602001610518565b50505050905090810190601f16801561055d5780820380516001836020036101000a031916815260200191505b509650505050505050602060405180830381600087803b15801561058057600080fd5b505af1158015610594573d6000803e3d6000fd5b505050506040513d60208110156105aa57600080fd5b50516001600160a01b03958616600090815260016020526040902080546001600160a01b03191696909116959095179094555050505050565b6002546001600160a01b03163314610642576040805162461bcd60e51b815260206004820152601960248201527f4574684d616e616765722f6e6f742d617574686f72697a656400000000000000604482015290519081900360640190fd5b60008181526020819052604090205460ff16156106905760405162461bcd60e51b815260040180806020018281038252602a81526020018061077e602a913960400191505060405180910390fd5b600081815260208181526040808320805460ff1916600117905580516340c10f1960e01b81526001600160a01b038681166004830152602482018890529151918816936340c10f199360448084019491939192918390030190829087803b1580156106fa57600080fd5b505af115801561070e573d6000803e3d6000fd5b505050506040513d602081101561072457600080fd5b5050604080516001600160a01b038087168252602082018690528416818301526060810183905290517ffdc0a3af821280dd73e4f6683e16c5afc31a629d07af623f9a4689d6855938869181900360800190a15050505056fe4574684d616e616765722f546865206c6f636b206576656e742063616e6e6f7420626520726575736564a265627a7a723158204d92b079d6880658d82066e2d0748bfd98e693638ce3545db4ed91f49d7d602364736f6c63430005110032
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000715cdda5e9ad30a0ced14940f9997ee611496de6
-----Decoded View---------------
Arg [0] : _wallet (address): 0x715CdDa5e9Ad30A0cEd14940F9997EE611496De6
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000715cdda5e9ad30a0ced14940f9997ee611496de6
Deployed Bytecode Sourcemap
29603:3089:0:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;29603:3089:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;29685:43;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;29685:43:0;-1:-1:-1;;;;;29685:43:0;;:::i;:::-;;;;-1:-1:-1;;;;;29685:43:0;;;;;;;;;;;;;;30019:21;;;:::i;31230:146::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;;31230:146:0;;;;;;;;;;:::i;:::-;;31628:247;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;;31628:247:0;;;;;;;;;;;;;;;;;:::i;29635:43::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;29635:43:0;;:::i;:::-;;;;;;;;;;;;;;;;;;30635:405;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;-1:-1;;;;;30635:405:0;;;;;;;;;;;;;;;;;;;;;;;21:11:-1;5:28;;2:2;;;46:1;43;36:12;2:2;30635:405:0;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;30635:405:0;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;39:11;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;30635:405:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;81:16;;74:27;;;;-1:-1;30635:405:0;;;;;;;;-1:-1:-1;30635:405:0;;-1:-1:-1;;21:11;5:28;;2:2;;;46:1;43;36:12;2:2;30635:405:0;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;30635:405:0;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;39:11;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;30635:405:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;81:16;;74:27;;;;-1:-1;30635:405:0;;-1:-1:-1;;;30635:405:0;;;;;-1:-1:-1;30635:405:0;;-1:-1:-1;30635:405:0:i;32243:446::-;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;-1:-1;;;;;;32243:446:0;;;;;;;;;;;;;;;;;;;;:::i;29685:43::-;;;;;;;;;;;;-1:-1:-1;;;;;29685:43:0;;:::o;30019:21::-;;;-1:-1:-1;;;;;30019:21:0;;:::o;31230:146::-;31313:55;;;-1:-1:-1;;;31313:55:0;;-1:-1:-1;;;;;31313:55:0;;;;;;;31366:1;31313:55;;;;;;;;:38;;;;;;:55;;;;;;;;;;;31366:1;31313:38;:55;;;5:2:-1;;;;30:1;27;20:12;5:2;31313:55:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;31313:55:0;;;;31230:146;;:::o;31628:247::-;31752:52;;;-1:-1:-1;;;31752:52:0;;31785:10;31752:52;;;;;;;;;;;;-1:-1:-1;;;;;31752:32:0;;;;;:52;;;;;-1:-1:-1;;31752:52:0;;;;;;;-1:-1:-1;31752:32:0;:52;;;5:2:-1;;;;30:1;27;20:12;5:2;31752:52:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;-1:-1;;31820:47:0;;;;;;-1:-1:-1;;;;;31820:47:0;;;;;;;;;31837:10;;-1:-1:-1;31820:47:0;;;;-1:-1:-1;31820:47:0;;;;;;;;;;;31628:247;;;:::o;29635:43::-;;;;;;;;;;;;;;;;:::o;30635:405::-;30825:20;30861:12;-1:-1:-1;;;;;30848:35:0;;30898:12;30925:4;30944:6;30965:8;30848:136;;;;;;;;;;;;;-1:-1:-1;;;;;30848:136:0;-1:-1:-1;;;;;30848:136:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;30848:136:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;30848:136:0;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;30848:136:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;30848:136:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;30848:136:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;30848:136:0;-1:-1:-1;;;;;30995:22:0;;;;;;;:8;30848:136;30995:22;;;;:37;;-1:-1:-1;;;;;;30995:37:0;;;;;;;;;;;;-1:-1:-1;;;;;30635:405:0:o;32243:446::-;30100:6;;-1:-1:-1;;;;;30100:6:0;30086:10;:20;30078:58;;;;;-1:-1:-1;;;30078:58:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;32429:11;:22;;;;;;;;;;;;;32428:23;32406:115;;;;-1:-1:-1;;;32406:115:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;32532:11;:22;;;;;;;;;;;:29;;-1:-1:-1;;32532:29:0;32557:4;32532:29;;;32572:47;;-1:-1:-1;;;32572:47:0;;-1:-1:-1;;;;;32572:47:0;;;;;;;;;;;;;;;:28;;;;;;:47;;;;;32532:22;;32572:47;;;;;;;;;;:28;:47;;;5:2:-1;;;;30:1;27;20:12;5:2;32572:47:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;32572:47:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;32635:46:0;;;-1:-1:-1;;;;;32635:46:0;;;;;32572:47;32635:46;;;;;;;;;;;;;;;;;;;;;;;;;;;;32243:446;;;;:::o
Swarm Source
bzzr://4d92b079d6880658d82066e2d0748bfd98e693638ce3545db4ed91f49d7d6023
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 31 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.