start
This commit is contained in:
22
src/IERC20Metadata.sol
Normal file
22
src/IERC20Metadata.sol
Normal file
@@ -0,0 +1,22 @@
|
||||
// SPDX-License-Identifier: UNLICENSED
|
||||
pragma solidity =0.7.6;
|
||||
|
||||
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
|
||||
|
||||
// the version of OpenZeppelin required by Uniswap v3 doesn't have IERC20Metadata yet, so we copy it here.
|
||||
interface IERC20Metadata is IERC20 {
|
||||
/**
|
||||
* @dev Returns the name of the token.
|
||||
*/
|
||||
function name() external view returns (string memory);
|
||||
|
||||
/**
|
||||
* @dev Returns the symbol of the token.
|
||||
*/
|
||||
function symbol() external view returns (string memory);
|
||||
|
||||
/**
|
||||
* @dev Returns the decimals places of the token.
|
||||
*/
|
||||
function decimals() external view returns (uint8);
|
||||
}
|
||||
17
src/MockERC20.sol
Normal file
17
src/MockERC20.sol
Normal file
@@ -0,0 +1,17 @@
|
||||
import "openzeppelin/contracts/token/ERC20/ERC20.sol";
|
||||
import "./IERC20Metadata.sol";
|
||||
|
||||
|
||||
contract MockERC20 is ERC20, IERC20Metadata {
|
||||
|
||||
constructor(string name, string symbol, uint8 decimals)
|
||||
ERC20(name, symbol)
|
||||
{
|
||||
_setupDecimals(decimals);
|
||||
}
|
||||
|
||||
|
||||
function mint(address account, uint256 amount) external {
|
||||
_mint(account, amount);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user