Skip to content

Commit

Permalink
Merge branch 'master' into refactor/1177/out-of-root
Browse files Browse the repository at this point in the history
  • Loading branch information
come-maiz committed Sep 1, 2018
2 parents 4d4c951 + 4385fd5 commit 746fccf
Show file tree
Hide file tree
Showing 87 changed files with 1,073 additions and 1,072 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ Interested in contributing to OpenZeppelin?
- Framework proposal and roadmap: https://medium.com/zeppelin-blog/zeppelin-framework-proposal-and-development-roadmap-fdfa9a3a32ab#.iain47pak
- Issue tracker: https://github.com/OpenZeppelin/openzeppelin-solidity/issues
- Contribution guidelines: https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/CONTRIBUTING.md
- Code-style guide: https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/CODE_STYLE.md
- Wiki: https://github.com/OpenZeppelin/openzeppelin-solidity/wiki

## License
Expand Down
4 changes: 2 additions & 2 deletions contracts/access/SignatureBouncer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ contract SignatureBouncer is Ownable, RBAC {
using ECDSA for bytes32;

string public constant ROLE_BOUNCER = "bouncer";
uint constant METHOD_ID_SIZE = 4;
uint internal constant METHOD_ID_SIZE = 4;
// signature size is 65 bytes (tightly packed v + r + s), but gets padded to 96 bytes
uint constant SIGNATURE_SIZE = 96;
uint internal constant SIGNATURE_SIZE = 96;

/**
* @dev requires that a valid signature of a bouncer was provided
Expand Down
10 changes: 5 additions & 5 deletions contracts/crowdsale/Crowdsale.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pragma solidity ^0.4.24;

import "../token/ERC20/ERC20.sol";
import "../token/ERC20/IERC20.sol";
import "../math/SafeMath.sol";
import "../token/ERC20/SafeERC20.sol";

Expand All @@ -19,17 +19,17 @@ 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
address public wallet;

// How many token units a buyer gets per wei.
// The rate is the conversion between wei and the smallest and indivisible token unit.
// So, if you are using a rate of 1 with a DetailedERC20 token with 3 decimals called TOK
// So, if you are using a rate of 1 with a ERC20Detailed token with 3 decimals called TOK
// 1 wei will give you 1 unit, or 0.001 TOK.
uint256 public rate;

Expand All @@ -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/distribution/PostDeliveryCrowdsale.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pragma solidity ^0.4.24;

import "../validation/TimedCrowdsale.sol";
import "../../token/ERC20/ERC20.sol";
import "../../token/ERC20/IERC20.sol";
import "../../math/SafeMath.sol";


Expand Down
4 changes: 2 additions & 2 deletions contracts/crowdsale/emission/AllowanceCrowdsale.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pragma solidity ^0.4.24;

import "../Crowdsale.sol";
import "../../token/ERC20/ERC20.sol";
import "../../token/ERC20/IERC20.sol";
import "../../token/ERC20/SafeERC20.sol";
import "../../math/SafeMath.sol";

Expand All @@ -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
4 changes: 2 additions & 2 deletions contracts/crowdsale/emission/MintedCrowdsale.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pragma solidity ^0.4.24;

import "../Crowdsale.sol";
import "../../token/ERC20/MintableToken.sol";
import "../../token/ERC20/ERC20Mintable.sol";


/**
Expand All @@ -23,6 +23,6 @@ contract MintedCrowdsale is Crowdsale {
internal
{
// Potentially dangerous assumption about the type of the token.
require(MintableToken(address(token)).mint(_beneficiary, _tokenAmount));
require(ERC20Mintable(address(token)).mint(_beneficiary, _tokenAmount));
}
}
6 changes: 3 additions & 3 deletions contracts/examples/SampleCrowdsale.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ pragma solidity ^0.4.24;
import "../crowdsale/validation/CappedCrowdsale.sol";
import "../crowdsale/distribution/RefundableCrowdsale.sol";
import "../crowdsale/emission/MintedCrowdsale.sol";
import "../token/ERC20/MintableToken.sol";
import "../token/ERC20/ERC20Mintable.sol";


/**
* @title SampleCrowdsaleToken
* @dev Very simple ERC20 Token that can be minted.
* It is meant to be used in a crowdsale contract.
*/
contract SampleCrowdsaleToken is MintableToken {
contract SampleCrowdsaleToken is ERC20Mintable {

string public constant name = "Sample Crowdsale Token";
string public constant symbol = "SCT";
Expand Down Expand Up @@ -44,7 +44,7 @@ contract SampleCrowdsale is CappedCrowdsale, RefundableCrowdsale, MintedCrowdsal
uint256 _rate,
address _wallet,
uint256 _cap,
MintableToken _token,
ERC20Mintable _token,
uint256 _goal
)
public
Expand Down
6 changes: 3 additions & 3 deletions contracts/examples/SimpleToken.sol
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
pragma solidity ^0.4.24;


import "../token/ERC20/StandardToken.sol";
import "../token/ERC20/ERC20.sol";


/**
* @title SimpleToken
* @dev Very simple ERC20 Token example, where all tokens are pre-assigned to the creator.
* Note they can later distribute these tokens as they wish using `transfer` and other
* `StandardToken` functions.
* `ERC20` functions.
*/
contract SimpleToken is StandardToken {
contract SimpleToken is ERC20 {

string public constant name = "SimpleToken";
string public constant symbol = "SIM";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ pragma solidity ^0.4.24;


/**
* @title ERC165
* @title IERC165
* @dev https://github.com/ethereum/EIPs/blob/master/EIPS/eip-165.md
*/
interface ERC165 {
interface IERC165 {

/**
* @notice Query if a contract implements an interface
Expand Down
4 changes: 2 additions & 2 deletions contracts/introspection/SupportsInterfaceWithLookup.sol
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
pragma solidity ^0.4.24;

import "./ERC165.sol";
import "./IERC165.sol";


/**
* @title SupportsInterfaceWithLookup
* @author Matt Condon (@shrugs)
* @dev Implements ERC165 using a lookup table.
*/
contract SupportsInterfaceWithLookup is ERC165 {
contract SupportsInterfaceWithLookup is IERC165 {

bytes4 public constant InterfaceId_ERC165 = 0x01ffc9a7;
/**
Expand Down
4 changes: 2 additions & 2 deletions contracts/lifecycle/TokenDestructible.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pragma solidity ^0.4.24;

import "../ownership/Ownable.sol";
import "../token/ERC20/ERC20.sol";
import "../token/ERC20/IERC20.sol";


/**
Expand All @@ -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
4 changes: 2 additions & 2 deletions contracts/mocks/AllowanceCrowdsaleImpl.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pragma solidity ^0.4.24;

import "../token/ERC20/ERC20.sol";
import "../token/ERC20/IERC20.sol";
import "../crowdsale/emission/AllowanceCrowdsale.sol";


Expand All @@ -9,7 +9,7 @@ contract AllowanceCrowdsaleImpl is AllowanceCrowdsale {
constructor (
uint256 _rate,
address _wallet,
ERC20 _token,
IERC20 _token,
address _tokenWallet
)
public
Expand Down
4 changes: 2 additions & 2 deletions contracts/mocks/CappedCrowdsaleImpl.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pragma solidity ^0.4.24;

import "../token/ERC20/ERC20.sol";
import "../token/ERC20/IERC20.sol";
import "../crowdsale/validation/CappedCrowdsale.sol";


Expand All @@ -9,7 +9,7 @@ contract CappedCrowdsaleImpl is CappedCrowdsale {
constructor (
uint256 _rate,
address _wallet,
ERC20 _token,
IERC20 _token,
uint256 _cap
)
public
Expand Down
8 changes: 4 additions & 4 deletions contracts/mocks/DetailedERC20Mock.sol
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
pragma solidity ^0.4.24;

import "../token/ERC20/StandardToken.sol";
import "../token/ERC20/DetailedERC20.sol";
import "../token/ERC20/ERC20.sol";
import "../token/ERC20/ERC20Detailed.sol";


contract DetailedERC20Mock is StandardToken, DetailedERC20 {
contract ERC20DetailedMock is ERC20, ERC20Detailed {
constructor(
string _name,
string _symbol,
uint8 _decimals
)
DetailedERC20(_name, _symbol, _decimals)
ERC20Detailed(_name, _symbol, _decimals)
public
{}
}
4 changes: 2 additions & 2 deletions contracts/mocks/ERC165/ERC165InterfacesSupported.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pragma solidity ^0.4.24;

import "../../introspection/ERC165.sol";
import "../../introspection/IERC165.sol";


/**
Expand All @@ -11,7 +11,7 @@ import "../../introspection/ERC165.sol";
* therefore, because this contract is staticcall'd we need to not emit events (which is how solidity-coverage works)
* solidity-coverage ignores the /mocks folder, so we duplicate its implementation here to avoid instrumenting it
*/
contract SupportsInterfaceWithLookupMock is ERC165 {
contract SupportsInterfaceWithLookupMock is IERC165 {

bytes4 public constant InterfaceId_ERC165 = 0x01ffc9a7;
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
pragma solidity ^0.4.24;

import "../token/ERC20/BurnableToken.sol";
import "../token/ERC20/ERC20Burnable.sol";


contract BurnableTokenMock is BurnableToken {
contract ERC20BurnableMock is ERC20Burnable {

constructor(address _initialAccount, uint256 _initialBalance) public {
_mint(_initialAccount, _initialBalance);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
pragma solidity ^0.4.24;

import "../token/ERC20/StandardToken.sol";
import "../token/ERC20/ERC20.sol";


// mock class using StandardToken
contract StandardTokenMock is StandardToken {
// mock class using ERC20
contract ERC20Mock is ERC20 {

constructor(address _initialAccount, uint256 _initialBalance) public {
_mint(_initialAccount, _initialBalance);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
pragma solidity ^0.4.24;

import "../token/ERC20/PausableToken.sol";
import "../token/ERC20/ERC20Pausable.sol";


// mock class using PausableToken
contract PausableTokenMock is PausableToken {
// mock class using ERC20Pausable
contract ERC20PausableMock is ERC20Pausable {

constructor(address _initialAccount, uint _initialBalance) public {
_mint(_initialAccount, _initialBalance);
Expand Down
4 changes: 2 additions & 2 deletions contracts/mocks/ERC20WithMetadataMock.sol
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
pragma solidity ^0.4.21;

import "../token/ERC20/StandardToken.sol";
import "../token/ERC20/ERC20.sol";
import "../proposals/ERC1046/TokenMetadata.sol";


contract ERC20WithMetadataMock is StandardToken, ERC20WithMetadata {
contract ERC20WithMetadataMock is ERC20, ERC20WithMetadata {
constructor(string _tokenURI) public
ERC20WithMetadata(_tokenURI)
{
Expand Down
4 changes: 2 additions & 2 deletions contracts/mocks/ERC223TokenMock.sol
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
pragma solidity ^0.4.24;

import "../token/ERC20/StandardToken.sol";
import "../token/ERC20/ERC20.sol";


contract ERC223ContractInterface {
function tokenFallback(address _from, uint256 _value, bytes _data) external;
}


contract ERC223TokenMock is StandardToken {
contract ERC223TokenMock is ERC20 {

constructor(address _initialAccount, uint256 _initialBalance) public {
_mint(_initialAccount, _initialBalance);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
pragma solidity ^0.4.24;

import "../token/ERC721/ERC721BasicToken.sol";
import "../token/ERC721/ERC721Basic.sol";


/**
* @title ERC721BasicTokenMock
* @title ERC721BasicMock
* This mock just provides a public mint and burn functions for testing purposes
*/
contract ERC721BasicTokenMock is ERC721BasicToken {
contract ERC721BasicMock is ERC721Basic {
function mint(address _to, uint256 _tokenId) public {
super._mint(_to, _tokenId);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
pragma solidity ^0.4.24;

import "../token/ERC721/ERC721Token.sol";
import "../token/ERC721/ERC721.sol";


/**
* @title ERC721TokenMock
* @title ERC721Mock
* This mock just provides a public mint and burn functions for testing purposes,
* and a public setter for metadata URI
*/
contract ERC721TokenMock is ERC721Token {
contract ERC721Mock is ERC721 {
constructor(string name, string symbol) public
ERC721Token(name, symbol)
ERC721(name, symbol)
{ }

function mint(address _to, uint256 _tokenId) public {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
pragma solidity ^0.4.24;

import "../token/ERC721/ERC721PausableToken.sol";
import "../token/ERC721/ERC721Pausable.sol";


/**
* @title ERC721PausableTokenMock
* @title ERC721PausableMock
* This mock just provides a public mint, burn and exists functions for testing purposes
*/
contract ERC721PausableTokenMock is ERC721PausableToken {
contract ERC721PausableMock is ERC721Pausable {
function mint(address _to, uint256 _tokenId) public {
super._mint(_to, _tokenId);
}
Expand Down
Loading

0 comments on commit 746fccf

Please sign in to comment.