Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into remove-has-no-x
Browse files Browse the repository at this point in the history
  • Loading branch information
frangio committed Sep 3, 2018
2 parents f334bdf + 2441fd7 commit 0538ebd
Show file tree
Hide file tree
Showing 102 changed files with 1,172 additions and 1,262 deletions.
6 changes: 6 additions & 0 deletions CODE_STYLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ Any exception or additions specific to our project are documented below.
}
```
The exception are the parameters of events. There is no chance of ambiguity
with these, so they should not have underscores. Not even if they are
specified on an ERC with underscores; removing them doesn't change the ABI,
so we should be consistent with the rest of the events in this repository
and remove them.
* Internal and private state variables should have an underscore suffix.
```
Expand Down
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
31 changes: 0 additions & 31 deletions contracts/LimitBalance.sol

This file was deleted.

8 changes: 4 additions & 4 deletions contracts/access/SignatureBouncer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ pragma solidity ^0.4.24;

import "../ownership/Ownable.sol";
import "../access/rbac/RBAC.sol";
import "../ECRecovery.sol";
import "../cryptography/ECDSA.sol";


/**
Expand Down Expand Up @@ -30,12 +30,12 @@ import "../ECRecovery.sol";
* much more complex. See https://ethereum.stackexchange.com/a/50616 for more details.
*/
contract SignatureBouncer is Ownable, RBAC {
using ECRecovery for bytes32;
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
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
pragma solidity ^0.4.24;


import "./payment/PullPayment.sol";
import "../payment/PullPayment.sol";


/**
* @title Bounty
* @title BreakInvariantBounty
* @dev This bounty will pay out to a researcher if they break invariant logic of the contract.
*/
contract Bounty is PullPayment, Ownable {
contract BreakInvariantBounty is PullPayment, Ownable {
bool public claimed;
mapping(address => address) public researchers;

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));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pragma solidity ^0.4.24;
* See https://github.com/ethereum/solidity/issues/864
*/

library ECRecovery {
library ECDSA {

/**
* @dev Recover signer address from a message by using their signature
Expand Down
File renamed without changes.
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/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
2 changes: 1 addition & 1 deletion contracts/mocks/AutoIncrementingImpl.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pragma solidity ^0.4.24;

import "../AutoIncrementing.sol";
import "../utils/AutoIncrementing.sol";


contract AutoIncrementingImpl {
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
{}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
pragma solidity ^0.4.24;


import "../ECRecovery.sol";
import "../cryptography/ECDSA.sol";


contract ECRecoveryMock {
using ECRecovery for bytes32;
contract ECDSAMock {
using ECDSA for bytes32;

function recover(bytes32 _hash, bytes _signature)
public
Expand Down
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
Loading

0 comments on commit 0538ebd

Please sign in to comment.