* Strip erc20 package of legacy nonsense and add foundry basics * Make foundry build * Remove obsoleted test/UntransferrableDummyERC20Token.sol contract * Remove obsoleted ERC20 lib variant contracts * Remove obsoleted DummyMultipleReturnERC20Token and DummyNoReturnERC20Token contracts * Move test contract to dedicated folder and remove obsoleted TypeScript contract wrappers * Remove src/interfaces/IEtherToken.sol only used in v3 staking which is being obsoleted [skip ci] * Add foundry test for token * Migrate ZRX token tests to foundry * Fix paths to erc20 contracts * Remove obsoleted references * Pin erc20-contracts package on treasury * Ignore foundry imports in link checker * Run only forge tests for erc20 contracts * Remove DummyERC20Token and its dependencies * Merge IERC20TokenV06 and IERC20TokenV08 into range pragma to cover solidity 0.6.5 to 0.8.x * Merge IEtherTokenV06 and IEtherTokenV08 into range pragma to cover solidity 0.6.5 to 0.8.x * Migrate weth9 tests to foundry * Upload code coverage for erc20 package * Update changelog * Fix review comments Co-authored-by: duncancmt <1207590+duncancmt@users.noreply.github.com> --------- Co-authored-by: duncancmt <1207590+duncancmt@users.noreply.github.com>
64 lines
2.6 KiB
Solidity
64 lines
2.6 KiB
Solidity
// SPDX-License-Identifier: Apache-2.0
|
|
/*
|
|
|
|
Copyright 2023 ZeroEx Intl.
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
you may not use this file except in compliance with the License.
|
|
You may obtain a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
See the License for the specific language governing permissions and
|
|
limitations under the License.
|
|
|
|
*/
|
|
|
|
pragma solidity >=0.6.5 <0.9;
|
|
|
|
interface IERC20Token {
|
|
event Transfer(address indexed from, address indexed to, uint256 value);
|
|
|
|
event Approval(address indexed owner, address indexed spender, uint256 value);
|
|
|
|
/// @dev send `value` token to `to` from `msg.sender`
|
|
/// @param to The address of the recipient
|
|
/// @param value The amount of token to be transferred
|
|
/// @return True if transfer was successful
|
|
function transfer(address to, uint256 value) external returns (bool);
|
|
|
|
/// @dev send `value` token to `to` from `from` on the condition it is approved by `from`
|
|
/// @param from The address of the sender
|
|
/// @param to The address of the recipient
|
|
/// @param value The amount of token to be transferred
|
|
/// @return True if transfer was successful
|
|
function transferFrom(address from, address to, uint256 value) external returns (bool);
|
|
|
|
/// @dev `msg.sender` approves `spender` to spend `value` tokens
|
|
/// @param spender The address of the account able to transfer the tokens
|
|
/// @param value The amount of wei to be approved for transfer
|
|
/// @return Always true if the call has enough gas to complete execution
|
|
function approve(address spender, uint256 value) external returns (bool);
|
|
|
|
/// @dev Query total supply of token
|
|
/// @return Total supply of token
|
|
function totalSupply() external view returns (uint256);
|
|
|
|
/// @dev Get the balance of `owner`.
|
|
/// @param owner The address from which the balance will be retrieved
|
|
/// @return Balance of owner
|
|
function balanceOf(address owner) external view returns (uint256);
|
|
|
|
/// @dev Get the allowance for `spender` to spend from `owner`.
|
|
/// @param owner The address of the account owning tokens
|
|
/// @param spender The address of the account able to transfer the tokens
|
|
/// @return Amount of remaining tokens allowed to spent
|
|
function allowance(address owner, address spender) external view returns (uint256);
|
|
|
|
/// @dev Get the number of decimals this token has.
|
|
function decimals() external view returns (uint8);
|
|
}
|