Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
743b54b
rename ERC20 to IERC20
frangio Aug 28, 2018
74ed563
move ERC20.sol to IERC20.sol
frangio Aug 28, 2018
e2cd31e
rename StandardToken to ERC20
frangio Aug 28, 2018
9891e06
rename StandardTokenMock to ERC20Mock
frangio Aug 29, 2018
9ff5308
move StandardToken.sol to ERC20.sol, likewise test and mock files
frangio Aug 29, 2018
0da0906
rename MintableToken to ERC20Mintable
frangio Aug 29, 2018
f0b10ed
move MintableToken.sol to ERC20Mintable.sol, likewise test and mock f…
frangio Aug 29, 2018
05a3484
rename BurnableToken to ERC20Burnable
frangio Aug 29, 2018
06cc72c
move BurnableToken.sol to ERC20Burnable.sol, likewise for related files
frangio Aug 29, 2018
d422ca0
rename CappedToken to ERC20Capped
frangio Aug 29, 2018
1b176ee
move CappedToken.sol to ERC20Capped.sol, likewise for related files
frangio Aug 29, 2018
b537307
rename PausableToken to ERC20Pausable
frangio Aug 29, 2018
890574c
move PausableToken.sol to ERC20Pausable.sol, likewise for related files
frangio Aug 29, 2018
f76cfae
rename DetailedERC20 to ERC20Detailed
frangio Aug 29, 2018
50c43fe
move DetailedERC20.sol to ERC20Detailed.sol, likewise for related files
frangio Aug 29, 2018
7f4cb7d
rename ERC721 to IERC721, and likewise for other related interfaces
frangio Aug 29, 2018
1e79c63
move ERC721.sol to IERC721.sol, likewise for other 721 interfaces
frangio Aug 29, 2018
af192a7
rename ERC721Token to ERC721
frangio Aug 29, 2018
47f542a
move ERC721Token.sol to ERC721.sol, likewise for related files
frangio Aug 29, 2018
276bfb9
rename ERC721BasicToken to ERC721Basic
frangio Aug 29, 2018
463a01b
move ERC721BasicToken.sol to ERC721Basic.sol, likewise for related files
frangio Aug 29, 2018
05d9ae8
rename ERC721PausableToken to ERC721Pausable
frangio Aug 29, 2018
6795ac4
move ERC721PausableToken.sol to ERC721Pausable.sol
frangio Aug 29, 2018
ef3bffe
rename ERC165 to IERC165
frangio Aug 29, 2018
81ea4a8
move ERC165.sol to IERC165.sol
frangio Aug 29, 2018
2cc6332
amend comment that ERC20 is based on FirstBlood
frangio Aug 29, 2018
bb65756
fix comments mentioning IERC721Receiver
frangio Aug 30, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions contracts/crowdsale/Crowdsale.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ import "../token/ERC20/SafeERC20.sol";
*/
contract Crowdsale {
using SafeMath for uint256;
using SafeERC20 for ERC20;
using SafeERC20 for IERC20;

// The token being sold
ERC20 public token;
IERC20 public token;

// Address where funds are collected
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment was marked as spam.

address public wallet;
Expand Down Expand Up @@ -55,7 +55,7 @@ contract Crowdsale {
* @param _wallet Address where collected funds will be forwarded to
* @param _token Address of the token being sold
*/
constructor(uint256 _rate, address _wallet, ERC20 _token) public {
constructor(uint256 _rate, address _wallet, IERC20 _token) public {
require(_rate > 0);
require(_wallet != address(0));
require(_token != address(0));
Expand Down
2 changes: 1 addition & 1 deletion contracts/crowdsale/emission/AllowanceCrowdsale.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import "../../math/SafeMath.sol";
*/
contract AllowanceCrowdsale is Crowdsale {
using SafeMath for uint256;
using SafeERC20 for ERC20;
using SafeERC20 for IERC20;

address public tokenWallet;

Expand Down
2 changes: 1 addition & 1 deletion contracts/lifecycle/TokenDestructible.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ contract TokenDestructible is Ownable {

// Transfer tokens to owner
for (uint256 i = 0; i < _tokens.length; i++) {
ERC20 token = ERC20(_tokens[i]);
IERC20 token = IERC20(_tokens[i]);
uint256 balance = token.balanceOf(this);
token.transfer(owner, balance);
}
Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/AllowanceCrowdsaleImpl.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ contract AllowanceCrowdsaleImpl is AllowanceCrowdsale {
constructor (
uint256 _rate,
address _wallet,
ERC20 _token,
IERC20 _token,
address _tokenWallet
)
public
Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/CappedCrowdsaleImpl.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ contract CappedCrowdsaleImpl is CappedCrowdsale {
constructor (
uint256 _rate,
address _wallet,
ERC20 _token,
IERC20 _token,
uint256 _cap
)
public
Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/IncreasingPriceCrowdsaleImpl.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ contract IncreasingPriceCrowdsaleImpl is IncreasingPriceCrowdsale {
uint256 _openingTime,
uint256 _closingTime,
address _wallet,
ERC20 _token,
IERC20 _token,
uint256 _initialRate,
uint256 _finalRate
)
Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/IndividuallyCappedCrowdsaleImpl.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ contract IndividuallyCappedCrowdsaleImpl is IndividuallyCappedCrowdsale {
constructor (
uint256 _rate,
address _wallet,
ERC20 _token
IERC20 _token
)
public
Crowdsale(_rate, _wallet, _token)
Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/PostDeliveryCrowdsaleImpl.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ contract PostDeliveryCrowdsaleImpl is PostDeliveryCrowdsale {
uint256 _closingTime,
uint256 _rate,
address _wallet,
ERC20 _token
IERC20 _token
)
public
TimedCrowdsale(_openingTime, _closingTime)
Expand Down
10 changes: 5 additions & 5 deletions contracts/mocks/SafeERC20Helper.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import "../token/ERC20/ERC20.sol";
import "../token/ERC20/SafeERC20.sol";


contract ERC20FailingMock is ERC20 {
contract ERC20FailingMock is IERC20 {
function totalSupply() public view returns (uint256) {
return 0;
}
Expand All @@ -31,7 +31,7 @@ contract ERC20FailingMock is ERC20 {
}


contract ERC20SucceedingMock is ERC20 {
contract ERC20SucceedingMock is IERC20 {
function totalSupply() public view returns (uint256) {
return 0;
}
Expand Down Expand Up @@ -59,10 +59,10 @@ contract ERC20SucceedingMock is ERC20 {


contract SafeERC20Helper {
using SafeERC20 for ERC20;
using SafeERC20 for IERC20;

ERC20 failing;
ERC20 succeeding;
IERC20 failing;
IERC20 succeeding;

constructor() public {
failing = new ERC20FailingMock();
Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/TimedCrowdsaleImpl.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ contract TimedCrowdsaleImpl is TimedCrowdsale {
uint256 _closingTime,
uint256 _rate,
address _wallet,
ERC20 _token
IERC20 _token
)
public
Crowdsale(_rate, _wallet, _token)
Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/WhitelistedCrowdsaleImpl.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ contract WhitelistedCrowdsaleImpl is Crowdsale, WhitelistedCrowdsale {
constructor (
uint256 _rate,
address _wallet,
ERC20 _token
IERC20 _token
)
Crowdsale(_rate, _wallet, _token)
public
Expand Down
4 changes: 2 additions & 2 deletions contracts/ownership/CanReclaimToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ import "../token/ERC20/SafeERC20.sol";
* This will prevent any accidental loss of tokens.
*/
contract CanReclaimToken is Ownable {
using SafeERC20 for ERC20;
using SafeERC20 for IERC20;

/**
* @dev Reclaim all ERC20 compatible tokens
* @param _token ERC20 The address of the token contract
*/
function reclaimToken(ERC20 _token) external onlyOwner {
function reclaimToken(IERC20 _token) external onlyOwner {
uint256 balance = _token.balanceOf(this);
_token.safeTransfer(owner, balance);
}
Expand Down
2 changes: 1 addition & 1 deletion contracts/proposals/ERC1046/TokenMetadata.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import "../../token/ERC20/ERC20.sol";
* @dev tokenURI must respond with a URI that implements https://eips.ethereum.org/EIPS/eip-1047
* @dev TODO - update https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/token/ERC721/ERC721.sol#L17 when 1046 is finalized
*/
contract ERC20TokenMetadata is ERC20 {
contract ERC20TokenMetadata is IERC20 {
function tokenURI() external view returns (string);
}

Expand Down
2 changes: 1 addition & 1 deletion contracts/token/ERC20/DetailedERC20.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import "./ERC20.sol";
* All the operations are done using the smallest and indivisible token unit,
* just as on Ethereum all the operations are done in wei.
*/
contract DetailedERC20 is ERC20 {
contract DetailedERC20 is IERC20 {
string public name;
string public symbol;
uint8 public decimals;
Expand Down
2 changes: 1 addition & 1 deletion contracts/token/ERC20/ERC20.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pragma solidity ^0.4.24;
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 {
interface IERC20 {
function totalSupply() public view returns (uint256);

function balanceOf(address _who) public view returns (uint256);
Expand Down
6 changes: 3 additions & 3 deletions contracts/token/ERC20/SafeERC20.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import "./ERC20.sol";
*/
library SafeERC20 {
function safeTransfer(
ERC20 _token,
IERC20 _token,
address _to,
uint256 _value
)
Expand All @@ -22,7 +22,7 @@ library SafeERC20 {
}

function safeTransferFrom(
ERC20 _token,
IERC20 _token,
address _from,
address _to,
uint256 _value
Expand All @@ -33,7 +33,7 @@ library SafeERC20 {
}

function safeApprove(
ERC20 _token,
IERC20 _token,
address _spender,
uint256 _value
)
Expand Down
2 changes: 1 addition & 1 deletion contracts/token/ERC20/StandardToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import "../../math/SafeMath.sol";
* https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
* Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20 {
contract StandardToken is IERC20 {
using SafeMath for uint256;

mapping (address => uint256) private balances_;
Expand Down
6 changes: 3 additions & 3 deletions contracts/token/ERC20/TokenTimelock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import "./SafeERC20.sol";
* beneficiary to extract the tokens after a given release time
*/
contract TokenTimelock {
using SafeERC20 for ERC20;
using SafeERC20 for IERC20;

// ERC20 basic token contract being held
ERC20 public token;
IERC20 public token;

// beneficiary of tokens after they are released
address public beneficiary;
Expand All @@ -21,7 +21,7 @@ contract TokenTimelock {
uint256 public releaseTime;

constructor(
ERC20 _token,
IERC20 _token,
address _beneficiary,
uint256 _releaseTime
)
Expand Down
10 changes: 5 additions & 5 deletions contracts/token/ERC20/TokenVesting.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import "../../math/SafeMath.sol";
*/
contract TokenVesting is Ownable {
using SafeMath for uint256;
using SafeERC20 for ERC20;
using SafeERC20 for IERC20;

event Released(uint256 amount);
event Revoked();
Expand Down Expand Up @@ -65,7 +65,7 @@ contract TokenVesting is Ownable {
* @notice Transfers vested tokens to beneficiary.
* @param _token ERC20 token which is being vested
*/
function release(ERC20 _token) public {
function release(IERC20 _token) public {
uint256 unreleased = releasableAmount(_token);

require(unreleased > 0);
Expand All @@ -82,7 +82,7 @@ contract TokenVesting is Ownable {
* remain in the contract, the rest are returned to the owner.
* @param _token ERC20 token which is being vested
*/
function revoke(ERC20 _token) public onlyOwner {
function revoke(IERC20 _token) public onlyOwner {
require(revocable);
require(!revoked[_token]);

Expand All @@ -102,15 +102,15 @@ contract TokenVesting is Ownable {
* @dev Calculates the amount that has already vested but hasn't been released yet.
* @param _token ERC20 token which is being vested
*/
function releasableAmount(ERC20 _token) public view returns (uint256) {
function releasableAmount(IERC20 _token) public view returns (uint256) {
return vestedAmount(_token).sub(released[_token]);
}

/**
* @dev Calculates the amount that has already vested.
* @param _token ERC20 token which is being vested
*/
function vestedAmount(ERC20 _token) public view returns (uint256) {
function vestedAmount(IERC20 _token) public view returns (uint256) {
uint256 currentBalance = _token.balanceOf(this);
uint256 totalBalance = currentBalance.add(released[_token]);

Expand Down