diff --git a/README.md b/README.md index 0050501..d5b6d56 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ **DISCLAIMER: This code has NOT been externally audited and is actively being developed. Please do not use in production without taking the appropriate steps to ensure maximum security.** + Basic ERC-20 contract designed to be inherited and extended. Leveraging native overflow checks in solc 0.8 to simplify ERC-20 implementation. It should be noted that this ERC-20 implementation does not include some functionality that is commonly used in other tokens, such as: - `address(0)` checks on `_transfer` - `permit()` diff --git a/contracts/interfaces/IERC20Permit.sol b/contracts/interfaces/IERC20Permit.sol index c76f37a..9763375 100644 --- a/contracts/interfaces/IERC20Permit.sol +++ b/contracts/interfaces/IERC20Permit.sol @@ -1,24 +1,10 @@ // SPDX-License-Identifier: AGPL-3.0-only pragma solidity ^0.8.7; -/// @title Interface of the ERC20 standard with the addition of permit functionality outlined in EIP 2612 -interface IERC20Permit { +import { IERC20 } from "./IERC20.sol"; - /** - * @dev Emits an event indicating that tokens have moved from one account to another. - * @param owner_ Account that tokens have moved from. - * @param recipient_ Account that tokens have moved to. - * @param amount_ Amount of tokens that have been transferred. - */ - event Transfer(address indexed owner_, address indexed recipient_, uint256 amount_); - - /** - * @dev Emits an event indicating that one account has set the allowance of another account over their tokens. - * @param owner_ Account that tokens are approved from. - * @param spender_ Account that tokens are approved for. - * @param amount_ Amount of tokens that have been approved. - */ - event Approval(address indexed owner_, address indexed spender_, uint256 amount_); +/// @title Interface of the ERC20 standard with the addition of permit functionality outlined in EIP 2612 +interface IERC20Permit is IERC20 { /** @dev Approve by signature. @@ -51,66 +37,4 @@ interface IERC20Permit { */ function DOMAIN_SEPARATOR() external view returns (bytes32 domain_); - /** - * @dev Returns the name of the token. - */ - function name() external view returns (string memory name_); - - /** - * @dev Returns the symbol of the token. - */ - function symbol() external view returns (string memory symbol_); - - /** - * @dev Returns the decimal precision used by the token. - */ - function decimals() external view returns (uint8 decimals_); - - /** - * @dev Returns the total amount of tokens in existence. - */ - function totalSupply() external view returns (uint256 totalSupply_); - - /** - * @dev Returns the amount of tokens owned by a given account. - * @param account_ Account that owns the tokens. - */ - function balanceOf(address account_) external view returns (uint256 balance_); - - /** - * @dev Function that returns the allowance that one account has given another over their tokens. - * @param owner_ Account that tokens are approved from. - * @param spender_ Account that tokens are approved for. - */ - function allowance(address owner_, address spender_) external view returns (uint256 allowance_); - - /** - * @dev Function that allows one account to set the allowance of another account over their tokens. - * Emits an {Approval} event. - * @param spender_ Account that tokens are approved for. - * @param amount_ Amount of tokens that have been approved. - * @return success_ Boolean indicating whether the operation succeeded. - */ - function approve(address spender_, uint256 amount_) external returns (bool success_); - - /** - * @dev Moves an amount of tokens from `msg.sender` to a specified account. - * Emits a {Transfer} event. - * @param recipient_ Account that receives tokens. - * @param amount_ Amount of tokens that are transferred. - * @return success_ Boolean indicating whether the operation succeeded. - */ - function transfer(address recipient_, uint256 amount_) external returns (bool success_); - - /** - * @dev Moves a pre-approved amount of tokens from a sender to a specified account. - * Emits a {Transfer} event. - * Emits an {Approval} event. - * @param owner_ Account that tokens are moving from. - * @param recipient_ Account that receives tokens. - * @param amount_ Amount of tokens that are transferred. - * @return success_ Boolean indicating whether the operation succeeded. - */ - function transferFrom(address owner_, address recipient_, uint256 amount_) external returns (bool success_); - }