Contract Overview
Balance:
0 ETH
ETH Value:
$0.00
My Name Tag:
Not Available
[ Download CSV Export ]
Latest 25 internal transaction
[ Download CSV Export ]
Contract Name:
ElleriaERC20Bridge
Compiler Version
v0.8.0+commit.c7dfd78e
Optimization Enabled:
No with 200 runs
Other Settings:
byzantium EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
pragma solidity ^0.8.0; //SPDX-License-Identifier: MIT import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "./interfaces/ISignature.sol"; import "./interfaces/IElleriumTokenERC20.sol"; /** * Tales of Elleria */ contract ElleriaERC20Bridge is Ownable { ISignature private signatureAbi; address private signerAddr; IElleriumTokenERC20 private elleriumAbi; address private elleriumAddr; mapping(uint256 => bool) private _isProcessed; uint256 private withdrawCounter; uint256 private depositsCounter; /** * Counts the number of * withdraw transactions. */ function withdrawCount() external view returns (uint256) { return withdrawCounter; } /** * Sets references to the other contracts. */ function SetReferences(address _signatureAddr, address _signerAddr, address _elmAddr) external onlyOwner { signatureAbi = ISignature(_signatureAddr); signerAddr = _signerAddr; elleriumAbi = IElleriumTokenERC20(_elmAddr); elleriumAddr = _elmAddr; } /** * Allows someone to bridge ELM into Elleria for in-game usage. */ function BridgeIntoGame(uint256 _amountInWEI, address _erc20Addr) external { IERC20(_erc20Addr).transferFrom(msg.sender, address(0), _amountInWEI); emit ERC20Deposit(msg.sender, _erc20Addr, _amountInWEI, ++depositsCounter); } /** * Allows someone to withdraw $ELLERIUM from Elleria (sent out from contract). */ function RetrieveElleriumFromGame(bytes memory _signature, uint256 _amountInWEI, uint256 _txnCount) external { require(!_isProcessed[_txnCount], "Duplicate TXN Count!"); elleriumAbi.mint(msg.sender, _amountInWEI); _isProcessed[_txnCount] = true; emit ERC20Withdraw(msg.sender, elleriumAddr, _amountInWEI, ++withdrawCounter); require(signatureAbi.verify(signerAddr, msg.sender, _amountInWEI, "elm withdrawal", _txnCount, _signature), "Invalid withdraw"); } /** * Allows the owner to withdraw ERC20 tokens * from this contract. */ function withdrawERC20(address _erc20Addr, address _recipient) external onlyOwner { IERC20(_erc20Addr).transfer(_recipient, IERC20(_erc20Addr).balanceOf(address(this))); } // Events event ERC20Deposit(address indexed sender, address indexed erc20Addr, uint256 value, uint256 counter); event ERC20Withdraw(address indexed recipient, address indexed erc20Addr, uint256 value, uint256 counter); }
pragma solidity ^0.8.0; //SPDX-License-Identifier: MIT // Interface for the signature verifier. contract ISignature { function verify( address _signer, address _to, uint256 _amount, string memory _message, uint256 _nonce, bytes memory signature) public pure returns (bool) { } function bigVerify( address _signer, address _to, uint256[] memory _data, bytes memory signature ) public pure returns (bool) {} }
pragma solidity ^0.8.0; //SPDX-License-Identifier: MIT // Interface for $ELLERIUM. contract IElleriumTokenERC20 { function mint(address _recipient, uint256 _amount) public {} function SetBlacklistedAddress(address[] memory _addresses, bool _blacklisted) public {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ 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); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
{ "remappings": [], "optimizer": { "enabled": false, "runs": 200 }, "evmVersion": "byzantium", "libraries": {}, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"erc20Addr","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"counter","type":"uint256"}],"name":"ERC20Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":true,"internalType":"address","name":"erc20Addr","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"counter","type":"uint256"}],"name":"ERC20Withdraw","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"},{"inputs":[{"internalType":"uint256","name":"_amountInWEI","type":"uint256"},{"internalType":"address","name":"_erc20Addr","type":"address"}],"name":"BridgeIntoGame","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"_signature","type":"bytes"},{"internalType":"uint256","name":"_amountInWEI","type":"uint256"},{"internalType":"uint256","name":"_txnCount","type":"uint256"}],"name":"RetrieveElleriumFromGame","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_signatureAddr","type":"address"},{"internalType":"address","name":"_signerAddr","type":"address"},{"internalType":"address","name":"_elmAddr","type":"address"}],"name":"SetReferences","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_erc20Addr","type":"address"},{"internalType":"address","name":"_recipient","type":"address"}],"name":"withdrawERC20","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b5061003f61002b610044640100000000026401000000009004565b61004c640100000000026401000000009004565b610110565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b61139d8061011f6000396000f3fe608060405234801561001057600080fd5b50600436106100a5576000357c0100000000000000000000000000000000000000000000000000000000900480639456fbcc116100785780639456fbcc1461010c578063d4ad78c114610128578063e148ce6a14610144578063f2fde38b14610160576100a5565b80630e389ccc146100aa5780634cc05a71146100c6578063715018a6146100e45780638da5cb5b146100ee575b600080fd5b6100c460048036038101906100bf9190610dad565b61017c565b005b6100ce6102a8565b6040516100db919061110e565b60405180910390f35b6100ec6102b2565b005b6100f661033a565b6040516101039190610fa6565b60405180910390f35b61012660048036038101906101219190610c69565b610363565b005b610142600480360381019061013d9190610ca5565b610531565b005b61015e60048036038101906101599190610d1d565b6106b6565b005b61017a60048036038101906101759190610c40565b6109c0565b005b8073ffffffffffffffffffffffffffffffffffffffff166323b872dd336000856040518463ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004016101d693929190610fc1565b602060405180830381600087803b1580156101f057600080fd5b505af1158015610204573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102289190610cf4565b508073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f11c19af334e9b7bdc595473fa4618bf89fddb438f552066c8e154bc8ff904136846007600081546102889061126a565b91905081905560405161029c929190611129565b60405180910390a35050565b6000600654905090565b6102ba610ab8565b73ffffffffffffffffffffffffffffffffffffffff166102d861033a565b73ffffffffffffffffffffffffffffffffffffffff161461032e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610325906110ce565b60405180910390fd5b6103386000610ac0565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b61036b610ab8565b73ffffffffffffffffffffffffffffffffffffffff1661038961033a565b73ffffffffffffffffffffffffffffffffffffffff16146103df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103d6906110ce565b60405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb828473ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004016104519190610fa6565b60206040518083038186803b15801561046957600080fd5b505afa15801561047d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104a19190610d84565b6040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004016104da929190611065565b602060405180830381600087803b1580156104f457600080fd5b505af1158015610508573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061052c9190610cf4565b505050565b610539610ab8565b73ffffffffffffffffffffffffffffffffffffffff1661055761033a565b73ffffffffffffffffffffffffffffffffffffffff16146105ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105a4906110ce565b60405180910390fd5b82600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505050565b6005600082815260200190815260200160002060009054906101000a900460ff1615610717576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161070e906110ee565b60405180910390fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340c10f1933846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401610790929190611065565b600060405180830381600087803b1580156107aa57600080fd5b505af11580156107be573d6000803e3d6000fd5b5050505060016005600083815260200190815260200160002060006101000a81548160ff021916908315150217905550600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f5a5d1633fcac6cfd5c327a1586fe8228e0b201f965b7ec99dee786417a9cf2f18460066000815461086f9061126a565b919050819055604051610883929190611129565b60405180910390a3600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663abe5026a600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16338585886040518663ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040161092c959493929190610ff8565b60206040518083038186803b15801561094457600080fd5b505afa158015610958573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061097c9190610cf4565b6109bb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109b2906110ae565b60405180910390fd5b505050565b6109c8610ab8565b73ffffffffffffffffffffffffffffffffffffffff166109e661033a565b73ffffffffffffffffffffffffffffffffffffffff1614610a3c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a33906110ce565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610aac576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aa39061108e565b60405180910390fd5b610ab581610ac0565b50565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000610b97610b9284611183565b611152565b905082815260208101848484011115610baf57600080fd5b610bba848285611228565b509392505050565b600081359050610bd181611322565b92915050565b600081519050610be681611339565b92915050565b600082601f830112610bfd57600080fd5b8135610c0d848260208601610b84565b91505092915050565b600081359050610c2581611350565b92915050565b600081519050610c3a81611350565b92915050565b600060208284031215610c5257600080fd5b6000610c6084828501610bc2565b91505092915050565b60008060408385031215610c7c57600080fd5b6000610c8a85828601610bc2565b9250506020610c9b85828601610bc2565b9150509250929050565b600080600060608486031215610cba57600080fd5b6000610cc886828701610bc2565b9350506020610cd986828701610bc2565b9250506040610cea86828701610bc2565b9150509250925092565b600060208284031215610d0657600080fd5b6000610d1484828501610bd7565b91505092915050565b600080600060608486031215610d3257600080fd5b600084013567ffffffffffffffff811115610d4c57600080fd5b610d5886828701610bec565b9350506020610d6986828701610c16565b9250506040610d7a86828701610c16565b9150509250925092565b600060208284031215610d9657600080fd5b6000610da484828501610c2b565b91505092915050565b60008060408385031215610dc057600080fd5b6000610dce85828601610c16565b9250506020610ddf85828601610bc2565b9150509250929050565b610df2816111e0565b82525050565b6000610e03826111b3565b610e0d81856111be565b9350610e1d818560208601611237565b610e2681611311565b840191505092915050565b6000610e3e6026836111cf565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000610ea46010836111cf565b91507f496e76616c6964207769746864726177000000000000000000000000000000006000830152602082019050919050565b6000610ee4600e836111cf565b91507f656c6d207769746864726177616c0000000000000000000000000000000000006000830152602082019050919050565b6000610f246020836111cf565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b6000610f646014836111cf565b91507f4475706c69636174652054584e20436f756e74210000000000000000000000006000830152602082019050919050565b610fa08161121e565b82525050565b6000602082019050610fbb6000830184610de9565b92915050565b6000606082019050610fd66000830186610de9565b610fe36020830185610de9565b610ff06040830184610f97565b949350505050565b600060c08201905061100d6000830188610de9565b61101a6020830187610de9565b6110276040830186610f97565b818103606083015261103881610ed7565b90506110476080830185610f97565b81810360a08301526110598184610df8565b90509695505050505050565b600060408201905061107a6000830185610de9565b6110876020830184610f97565b9392505050565b600060208201905081810360008301526110a781610e31565b9050919050565b600060208201905081810360008301526110c781610e97565b9050919050565b600060208201905081810360008301526110e781610f17565b9050919050565b6000602082019050818103600083015261110781610f57565b9050919050565b60006020820190506111236000830184610f97565b92915050565b600060408201905061113e6000830185610f97565b61114b6020830184610f97565b9392505050565b6000604051905081810181811067ffffffffffffffff82111715611179576111786112e2565b5b8060405250919050565b600067ffffffffffffffff82111561119e5761119d6112e2565b5b601f19601f8301169050602081019050919050565b600081519050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006111eb826111fe565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b60005b8381101561125557808201518184015260208101905061123a565b83811115611264576000848401525b50505050565b60006112758261121e565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156112a8576112a76112b3565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b61132b816111e0565b811461133657600080fd5b50565b611342816111f2565b811461134d57600080fd5b50565b6113598161121e565b811461136457600080fd5b5056fea2646970667358221220fede6eb397d7cd5fb600b154147ab1dcb30c4b5fd91ce87b34da69f740b88b1464736f6c63430008000033
Age | Block | Fee Address | BC Fee Address | Voting Power | Jailed | Incoming |
---|
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.