Source Code
Overview
ETH Balance
0 ETH
Token Holdings
More Info
ContractCreator
Multi Chain
Multichain Addresses
0 address found via
Latest 25 from a total of 317,874 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
Value | ||||
---|---|---|---|---|---|---|---|---|---|
Mint | 9486551 | 120 days 22 hrs ago | IN | 0 ETH | 0.00004942 | ||||
Mint | 9486543 | 120 days 22 hrs ago | IN | 0 ETH | 0.00004947 | ||||
Mint | 9268704 | 160 days 3 hrs ago | IN | 0 ETH | 0.00004949 | ||||
Mint | 9218415 | 169 days 1 hr ago | IN | 0 ETH | 0.00006507 | ||||
Mint | 9218412 | 169 days 1 hr ago | IN | 0 ETH | 0.0000652 | ||||
Mint | 9217731 | 169 days 4 hrs ago | IN | 0 ETH | 0.00006376 | ||||
Mint | 9217369 | 169 days 6 hrs ago | IN | 0 ETH | 0.00006375 | ||||
Mint | 9215994 | 169 days 12 hrs ago | IN | 0 ETH | 0.00006375 | ||||
Mint | 9215703 | 169 days 13 hrs ago | IN | 0 ETH | 0.00006368 | ||||
Mint | 9215701 | 169 days 13 hrs ago | IN | 0 ETH | 0.00006375 | ||||
Mint | 9215700 | 169 days 13 hrs ago | IN | 0 ETH | 0.00006375 | ||||
Mint | 9215696 | 169 days 13 hrs ago | IN | 0 ETH | 0.00006377 | ||||
Mint | 9214714 | 169 days 18 hrs ago | IN | 0 ETH | 0.00006377 | ||||
Mint | 9210992 | 170 days 10 hrs ago | IN | 0 ETH | 0.00072367 | ||||
Mint | 9210898 | 170 days 10 hrs ago | IN | 0 ETH | 0.00012367 | ||||
Mint | 9210119 | 170 days 14 hrs ago | IN | 0 ETH | 0.00006379 | ||||
Mint | 9210115 | 170 days 14 hrs ago | IN | 0 ETH | 0.00006369 | ||||
Mint | 9210110 | 170 days 14 hrs ago | IN | 0 ETH | 0.00006379 | ||||
Mint | 9209277 | 170 days 17 hrs ago | IN | 0 ETH | 0.00006377 | ||||
Mint | 9209273 | 170 days 17 hrs ago | IN | 0 ETH | 0.00006368 | ||||
Mint | 9209270 | 170 days 17 hrs ago | IN | 0 ETH | 0.00006375 | ||||
Mint | 9209265 | 170 days 17 hrs ago | IN | 0 ETH | 0.00006375 | ||||
Mint | 9206789 | 171 days 4 hrs ago | IN | 0 ETH | 0.00008966 | ||||
Mint | 9206788 | 171 days 4 hrs ago | IN | 0 ETH | 0.00008959 | ||||
Mint | 9206443 | 171 days 6 hrs ago | IN | 0 ETH | 0.00009961 |
Latest 25 internal transactions (View All)
Advanced mode:
Parent Txn Hash | Block | From | To | Value | ||
---|---|---|---|---|---|---|
9218415 | 169 days 1 hr ago | 0 ETH | ||||
9218412 | 169 days 1 hr ago | 0 ETH | ||||
9217731 | 169 days 4 hrs ago | 0 ETH | ||||
9217369 | 169 days 6 hrs ago | 0 ETH | ||||
9215994 | 169 days 12 hrs ago | 0 ETH | ||||
9215703 | 169 days 13 hrs ago | 0 ETH | ||||
9215701 | 169 days 13 hrs ago | 0 ETH | ||||
9215700 | 169 days 13 hrs ago | 0 ETH | ||||
9215696 | 169 days 13 hrs ago | 0 ETH | ||||
9214714 | 169 days 18 hrs ago | 0 ETH | ||||
9210992 | 170 days 10 hrs ago | 0 ETH | ||||
9210898 | 170 days 10 hrs ago | 0 ETH | ||||
9210119 | 170 days 14 hrs ago | 0 ETH | ||||
9210115 | 170 days 14 hrs ago | 0 ETH | ||||
9210110 | 170 days 14 hrs ago | 0 ETH | ||||
9209277 | 170 days 17 hrs ago | 0 ETH | ||||
9209273 | 170 days 17 hrs ago | 0 ETH | ||||
9209270 | 170 days 17 hrs ago | 0 ETH | ||||
9209265 | 170 days 17 hrs ago | 0 ETH | ||||
9206789 | 171 days 4 hrs ago | 0 ETH | ||||
9206788 | 171 days 4 hrs ago | 0 ETH | ||||
9206443 | 171 days 6 hrs ago | 0 ETH | ||||
9206315 | 171 days 6 hrs ago | 0 ETH | ||||
9206309 | 171 days 6 hrs ago | 0 ETH | ||||
9206140 | 171 days 7 hrs ago | 0 ETH |
Loading...
Loading
Contract Name:
Faucet
Compiler Version
v0.8.10+commit.fc410830
Optimization Enabled:
Yes with 25000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.0; import {IFaucet} from './IFaucet.sol'; import {TestnetERC20} from './TestnetERC20.sol'; import {Ownable} from '@aave/core-v3/contracts/dependencies/openzeppelin/contracts/Ownable.sol'; /** * @title Faucet * @dev Ownable Faucet Contract */ contract Faucet is IFaucet, Ownable { // If _permissioned is enabled, then only owner can mint Testnet ERC20 tokens // If disabled, anyone can call mint at the faucet, for PoC environments bool internal _permissioned; constructor(address owner, bool permissioned) { require(owner != address(0)); transferOwnership(owner); _permissioned = permissioned; } /** * @dev Function modifier, if _permissioned is enabled then msg.sender is required to be the owner */ modifier onlyOwnerIfPermissioned() { if (_permissioned == true) { require(owner() == _msgSender(), 'Ownable: caller is not the owner'); } _; } /// @inheritdoc IFaucet function mint( address token, address to, uint256 amount ) external override onlyOwnerIfPermissioned returns (uint256) { TestnetERC20(token).mint(to, amount); return amount; } /// @inheritdoc IFaucet function setPermissioned(bool permissioned) external override onlyOwner { _permissioned = permissioned; } /// @inheritdoc IFaucet function isPermissioned() external view override returns (bool) { return _permissioned; } }
// SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.10; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, 'Address: insufficient balance'); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{value: amount}(''); require(success, 'Address: unable to send value, recipient may have reverted'); } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.10; /* * @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. */ abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return payable(msg.sender); } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.10; import './Context.sol'; import './IERC20.sol'; import './SafeMath.sol'; import './Address.sol'; /** * @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 {ERC20PresetMinterPauser}. * * 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; using Address for address; mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; /** * @dev Sets the values for {name} and {symbol}, initializes {decimals} with * a default value of 18. * * To select a different value for {decimals}, use {_setupDecimals}. * * All three of these values are immutable: they can only be set once during * construction. */ constructor(string memory name, string memory symbol) { _name = name; _symbol = symbol; _decimals = 18; } /** * @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. This is the value {ERC20} uses, unless {_setupDecimals} is * called. * * 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; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view override 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 virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override 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 virtual override 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 virtual 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 virtual 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 virtual { require(sender != address(0), 'ERC20: transfer from the zero address'); require(recipient != address(0), 'ERC20: transfer to the zero address'); _beforeTokenTransfer(sender, recipient, amount); _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 virtual { require(account != address(0), 'ERC20: mint to the zero address'); _beforeTokenTransfer(address(0), account, amount); _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 virtual { require(account != address(0), 'ERC20: burn from the zero address'); _beforeTokenTransfer(account, address(0), amount); _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 virtual { 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 Sets {decimals} to a value other than the default one of 18. * * WARNING: This function should only be called from the constructor. Most * applications that interact with token contracts will not expect * {decimals} to ever change, and may work incorrectly if it does. */ function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be to transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 amount ) internal virtual {} }
// SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.10; /** * @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 pragma solidity 0.8.10; import './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. */ 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() { 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(_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 { 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 virtual onlyOwner { require(newOwner != address(0), 'Ownable: new owner is the zero address'); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } }
// SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.10; /// @title Optimized overflow and underflow safe math operations /// @notice Contains methods for doing math operations that revert on overflow or underflow for minimal gas cost library SafeMath { /// @notice Returns x + y, reverts if sum overflows uint256 /// @param x The augend /// @param y The addend /// @return z The sum of x and y function add(uint256 x, uint256 y) internal pure returns (uint256 z) { unchecked { require((z = x + y) >= x); } } /// @notice Returns x - y, reverts if underflows /// @param x The minuend /// @param y The subtrahend /// @return z The difference of x and y function sub(uint256 x, uint256 y) internal pure returns (uint256 z) { unchecked { require((z = x - y) <= x); } } /// @notice Returns x - y, reverts if underflows /// @param x The minuend /// @param y The subtrahend /// @param message The error msg /// @return z The difference of x and y function sub( uint256 x, uint256 y, string memory message ) internal pure returns (uint256 z) { unchecked { require((z = x - y) <= x, message); } } /// @notice Returns x * y, reverts if overflows /// @param x The multiplicand /// @param y The multiplier /// @return z The product of x and y function mul(uint256 x, uint256 y) internal pure returns (uint256 z) { unchecked { require(x == 0 || (z = x * y) / x == y); } } /// @notice Returns x / y, reverts if overflows - no specific check, solidity reverts on division by 0 /// @param x The numerator /// @param y The denominator /// @return z The product of x and y function div(uint256 x, uint256 y) internal pure returns (uint256 z) { return x / y; } }
// SPDX-License-Identifier: AGPL-3.0 pragma solidity ^0.8.0; import {IERC20} from '../dependencies/openzeppelin/contracts/IERC20.sol'; /** * @title IERC20WithPermit * @author Aave * @notice Interface for the permit function (EIP-2612) */ interface IERC20WithPermit is IERC20 { /** * @notice Allow passing a signed message to approve spending * @dev implements the permit function as for * https://github.com/ethereum/EIPs/blob/8a34d644aacf0f9f8f00815307fd7dd5da07655f/EIPS/eip-2612.md * @param owner The owner of the funds * @param spender The spender * @param value The amount * @param deadline The deadline timestamp, type(uint256).max for max deadline * @param v Signature param * @param s Signature param * @param r Signature param */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.0; interface IFaucet { /** * @notice Function to mint Testnet tokens to the destination address * @param token The address of the token to perform the mint * @param to The address to send the minted tokens * @param amount The amount of tokens to mint * @return The amount minted **/ function mint( address token, address to, uint256 amount ) external returns (uint256); /** * @notice Enable or disable the need of authentication to call `mint` function * @param value If true, ask for authentication at `mint` function, if false, disable the authentication */ function setPermissioned(bool value) external; /** * @notice Getter to determine if permissioned mode is enabled or disabled * @return Returns a boolean, if true the mode is enabled, if false is disabled */ function isPermissioned() external view returns (bool); }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.0; import {Ownable} from '@aave/core-v3/contracts/dependencies/openzeppelin/contracts/Ownable.sol'; import {ERC20} from '@aave/core-v3/contracts/dependencies/openzeppelin/contracts/ERC20.sol'; import {IERC20WithPermit} from '@aave/core-v3/contracts/interfaces/IERC20WithPermit.sol'; /** * @title TestnetERC20 * @dev ERC20 minting logic */ contract TestnetERC20 is IERC20WithPermit, ERC20, Ownable { bytes public constant EIP712_REVISION = bytes('1'); bytes32 internal constant EIP712_DOMAIN = keccak256('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)'); bytes32 public constant PERMIT_TYPEHASH = keccak256('Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)'); // Map of address nonces (address => nonce) mapping(address => uint256) internal _nonces; bytes32 public DOMAIN_SEPARATOR; constructor( string memory name, string memory symbol, uint8 decimals, address owner ) ERC20(name, symbol) { uint256 chainId = block.chainid; DOMAIN_SEPARATOR = keccak256( abi.encode( EIP712_DOMAIN, keccak256(bytes(name)), keccak256(EIP712_REVISION), chainId, address(this) ) ); _setupDecimals(decimals); require(owner != address(0)); transferOwnership(owner); } /// @inheritdoc IERC20WithPermit function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external override { require(owner != address(0), 'INVALID_OWNER'); //solium-disable-next-line require(block.timestamp <= deadline, 'INVALID_EXPIRATION'); uint256 currentValidNonce = _nonces[owner]; bytes32 digest = keccak256( abi.encodePacked( '\x19\x01', DOMAIN_SEPARATOR, keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, currentValidNonce, deadline)) ) ); require(owner == ecrecover(digest, v, r, s), 'INVALID_SIGNATURE'); _nonces[owner] = currentValidNonce + 1; _approve(owner, spender, value); } /** * @dev Function to mint tokens * @param value The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(uint256 value) public virtual onlyOwner returns (bool) { _mint(_msgSender(), value); return true; } /** * @dev Function to mint tokens to address * @param account The account to mint tokens. * @param value The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address account, uint256 value) public virtual onlyOwner returns (bool) { _mint(account, value); return true; } function nonces(address owner) public view returns (uint256) { return _nonces[owner]; } }
{ "optimizer": { "enabled": true, "runs": 25000 }, "evmVersion": "london", "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "metadata": { "useLiteralContent": true }, "libraries": {} }
[{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"bool","name":"permissioned","type":"bool"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"isPermissioned","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"bool","name":"permissioned","type":"bool"}],"name":"setPermissioned","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b5060405161090b38038061090b83398101604081905261002f916101a9565b600080546001600160a01b031916339081178255604051909182916000805160206108eb833981519152908290a3506001600160a01b03821661007157600080fd5b61007a8261009c565b60008054911515600160a01b0260ff60a01b19909216919091179055506101f4565b6000546001600160a01b031633146100fb5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b6001600160a01b0381166101605760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016100f2565b600080546040516001600160a01b03808516939216916000805160206108eb83398151915291a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b600080604083850312156101bc57600080fd5b82516001600160a01b03811681146101d357600080fd5b602084015190925080151581146101e957600080fd5b809150509250929050565b6106e8806102036000396000f3fe608060405234801561001057600080fd5b50600436106100725760003560e01c8063c6c3bbe611610050578063c6c3bbe6146100c1578063e2a4157c146100e2578063f2fde38b1461011057600080fd5b80631a678cd314610077578063715018a61461008c5780638da5cb5b14610094575b600080fd5b61008a6100853660046105f1565b610123565b005b61008a6101f3565b60005460405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6100d46100cf36600461063e565b6102e3565b6040519081526020016100b8565b60005474010000000000000000000000000000000000000000900460ff1660405190151581526020016100b8565b61008a61011e36600461067a565b61042f565b60005473ffffffffffffffffffffffffffffffffffffffff1633146101a9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b6000805491151574010000000000000000000000000000000000000000027fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff909216919091179055565b60005473ffffffffffffffffffffffffffffffffffffffff163314610274576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016101a0565b6000805460405173ffffffffffffffffffffffffffffffffffffffff909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b6000805474010000000000000000000000000000000000000000900460ff1615156001141561038d5760005473ffffffffffffffffffffffffffffffffffffffff16331461038d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016101a0565b6040517f40c10f1900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8481166004830152602482018490528516906340c10f19906044016020604051808303816000875af1158015610402573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104269190610695565b50909392505050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146104b0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016101a0565b73ffffffffffffffffffffffffffffffffffffffff8116610553576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016101a0565b6000805460405173ffffffffffffffffffffffffffffffffffffffff808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b80151581146105ee57600080fd5b50565b60006020828403121561060357600080fd5b813561060e816105e0565b9392505050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461063957600080fd5b919050565b60008060006060848603121561065357600080fd5b61065c84610615565b925061066a60208501610615565b9150604084013590509250925092565b60006020828403121561068c57600080fd5b61060e82610615565b6000602082840312156106a757600080fd5b815161060e816105e056fea26469706673582212202c296c8634d1ef0941e7da83f8e0b4f3285fef1366c7e809513d2f89e79d8d5664736f6c634300080a00338be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e00000000000000000000000002892e37624ec31cc42502f2978211097002709710000000000000000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100725760003560e01c8063c6c3bbe611610050578063c6c3bbe6146100c1578063e2a4157c146100e2578063f2fde38b1461011057600080fd5b80631a678cd314610077578063715018a61461008c5780638da5cb5b14610094575b600080fd5b61008a6100853660046105f1565b610123565b005b61008a6101f3565b60005460405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6100d46100cf36600461063e565b6102e3565b6040519081526020016100b8565b60005474010000000000000000000000000000000000000000900460ff1660405190151581526020016100b8565b61008a61011e36600461067a565b61042f565b60005473ffffffffffffffffffffffffffffffffffffffff1633146101a9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b6000805491151574010000000000000000000000000000000000000000027fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff909216919091179055565b60005473ffffffffffffffffffffffffffffffffffffffff163314610274576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016101a0565b6000805460405173ffffffffffffffffffffffffffffffffffffffff909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b6000805474010000000000000000000000000000000000000000900460ff1615156001141561038d5760005473ffffffffffffffffffffffffffffffffffffffff16331461038d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016101a0565b6040517f40c10f1900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8481166004830152602482018490528516906340c10f19906044016020604051808303816000875af1158015610402573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104269190610695565b50909392505050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146104b0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016101a0565b73ffffffffffffffffffffffffffffffffffffffff8116610553576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016101a0565b6000805460405173ffffffffffffffffffffffffffffffffffffffff808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b80151581146105ee57600080fd5b50565b60006020828403121561060357600080fd5b813561060e816105e0565b9392505050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461063957600080fd5b919050565b60008060006060848603121561065357600080fd5b61065c84610615565b925061066a60208501610615565b9150604084013590509250925092565b60006020828403121561068c57600080fd5b61060e82610615565b6000602082840312156106a757600080fd5b815161060e816105e056fea26469706673582212202c296c8634d1ef0941e7da83f8e0b4f3285fef1366c7e809513d2f89e79d8d5664736f6c634300080a0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000002892e37624ec31cc42502f2978211097002709710000000000000000000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : owner (address): 0x2892e37624Ec31CC42502f297821109700270971
Arg [1] : permissioned (bool): False
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000002892e37624ec31cc42502f297821109700270971
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000000
Loading...
Loading
[ Download: CSV Export ]
[ 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.