Commit 576b0203 by Nicolás Venturo

Merge branch 'release-v2.1.0-solc-0.5' into release-v2.1.0

parents 13eff701 4b8fcbce
...@@ -37,3 +37,6 @@ build/ ...@@ -37,3 +37,6 @@ build/
# truffle # truffle
.node-xmlhttprequest-* .node-xmlhttprequest-*
# Temporary directory for 0.5.x compilation
solc-0.5
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
/** /**
* @title Roles * @title Roles
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../Roles.sol"; import "../Roles.sol";
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../Roles.sol"; import "../Roles.sol";
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../Roles.sol"; import "../Roles.sol";
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../Roles.sol"; import "../Roles.sol";
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../Roles.sol"; import "../Roles.sol";
import "./WhitelisterRole.sol"; import "./WhitelisterRole.sol";
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../Roles.sol"; import "../Roles.sol";
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../token/ERC20/IERC20.sol"; import "../token/ERC20/IERC20.sol";
import "../math/SafeMath.sol"; import "../math/SafeMath.sol";
...@@ -25,7 +25,7 @@ contract Crowdsale is ReentrancyGuard { ...@@ -25,7 +25,7 @@ contract Crowdsale is ReentrancyGuard {
IERC20 private _token; IERC20 private _token;
// Address where funds are collected // Address where funds are collected
address private _wallet; address payable private _wallet;
// How many token units a buyer gets per wei. // How many token units a buyer gets per wei.
// The rate is the conversion between wei and the smallest and indivisible token unit. // The rate is the conversion between wei and the smallest and indivisible token unit.
...@@ -53,10 +53,10 @@ contract Crowdsale is ReentrancyGuard { ...@@ -53,10 +53,10 @@ contract Crowdsale is ReentrancyGuard {
* @param wallet Address where collected funds will be forwarded to * @param wallet Address where collected funds will be forwarded to
* @param token Address of the token being sold * @param token Address of the token being sold
*/ */
constructor (uint256 rate, address wallet, IERC20 token) public { constructor (uint256 rate, address payable wallet, IERC20 token) public {
require(rate > 0); require(rate > 0);
require(wallet != address(0)); require(wallet != address(0));
require(token != address(0)); require(address(token) != address(0));
_rate = rate; _rate = rate;
_wallet = wallet; _wallet = wallet;
...@@ -87,7 +87,7 @@ contract Crowdsale is ReentrancyGuard { ...@@ -87,7 +87,7 @@ contract Crowdsale is ReentrancyGuard {
/** /**
* @return the address where funds are collected. * @return the address where funds are collected.
*/ */
function wallet() public view returns (address) { function wallet() public view returns (address payable) {
return _wallet; return _wallet;
} }
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../../math/SafeMath.sol"; import "../../math/SafeMath.sol";
import "../validation/TimedCrowdsale.sol"; import "../validation/TimedCrowdsale.sol";
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../validation/TimedCrowdsale.sol"; import "../validation/TimedCrowdsale.sol";
import "../../math/SafeMath.sol"; import "../../math/SafeMath.sol";
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../../math/SafeMath.sol"; import "../../math/SafeMath.sol";
import "./FinalizableCrowdsale.sol"; import "./FinalizableCrowdsale.sol";
...@@ -44,7 +44,7 @@ contract RefundableCrowdsale is FinalizableCrowdsale { ...@@ -44,7 +44,7 @@ contract RefundableCrowdsale is FinalizableCrowdsale {
* @dev Investors can claim refunds here if crowdsale is unsuccessful * @dev Investors can claim refunds here if crowdsale is unsuccessful
* @param refundee Whose refund will be claimed. * @param refundee Whose refund will be claimed.
*/ */
function claimRefund(address refundee) public { function claimRefund(address payable refundee) public {
require(finalized()); require(finalized());
require(!goalReached()); require(!goalReached());
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "./RefundableCrowdsale.sol"; import "./RefundableCrowdsale.sol";
import "./PostDeliveryCrowdsale.sol"; import "./PostDeliveryCrowdsale.sol";
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../Crowdsale.sol"; import "../Crowdsale.sol";
import "../../token/ERC20/IERC20.sol"; import "../../token/ERC20/IERC20.sol";
...@@ -37,7 +37,7 @@ contract AllowanceCrowdsale is Crowdsale { ...@@ -37,7 +37,7 @@ contract AllowanceCrowdsale is Crowdsale {
* @return Amount of tokens left in the allowance * @return Amount of tokens left in the allowance
*/ */
function remainingTokens() public view returns (uint256) { function remainingTokens() public view returns (uint256) {
return Math.min(token().balanceOf(_tokenWallet), token().allowance(_tokenWallet, this)); return Math.min(token().balanceOf(_tokenWallet), token().allowance(_tokenWallet, address(this)));
} }
/** /**
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../Crowdsale.sol"; import "../Crowdsale.sol";
import "../../token/ERC20/ERC20Mintable.sol"; import "../../token/ERC20/ERC20Mintable.sol";
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../validation/TimedCrowdsale.sol"; import "../validation/TimedCrowdsale.sol";
import "../../math/SafeMath.sol"; import "../../math/SafeMath.sol";
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../../math/SafeMath.sol"; import "../../math/SafeMath.sol";
import "../Crowdsale.sol"; import "../Crowdsale.sol";
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../../math/SafeMath.sol"; import "../../math/SafeMath.sol";
import "../Crowdsale.sol"; import "../Crowdsale.sol";
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../Crowdsale.sol"; import "../Crowdsale.sol";
import "../../lifecycle/Pausable.sol"; import "../../lifecycle/Pausable.sol";
/** /**
* @title PausableCrowdsale * @title PausableCrowdsale
* @dev Extension of Crowdsale contract where purchases can be paused and unpaused by the pauser role. * @dev Extension of Crowdsale contract where purchases can be paused and unpaused by the pauser role.
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../../math/SafeMath.sol"; import "../../math/SafeMath.sol";
import "../Crowdsale.sol"; import "../Crowdsale.sol";
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../Crowdsale.sol"; import "../Crowdsale.sol";
import "../../access/roles/WhitelistedRole.sol"; import "../../access/roles/WhitelistedRole.sol";
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
/** /**
* @title Elliptic curve signature operations * @title Elliptic curve signature operations
...@@ -13,7 +13,7 @@ library ECDSA { ...@@ -13,7 +13,7 @@ library ECDSA {
* @param hash bytes32 message, the hash is the signed message. What is recovered is the signer address. * @param hash bytes32 message, the hash is the signed message. What is recovered is the signer address.
* @param signature bytes signature, the signature is generated using web3.eth.sign() * @param signature bytes signature, the signature is generated using web3.eth.sign()
*/ */
function recover(bytes32 hash, bytes signature) internal pure returns (address) { function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
bytes32 r; bytes32 r;
bytes32 s; bytes32 s;
uint8 v; uint8 v;
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
/** /**
* @title MerkleProof * @title MerkleProof
...@@ -13,7 +13,7 @@ library MerkleProof { ...@@ -13,7 +13,7 @@ library MerkleProof {
* @param root Merkle root * @param root Merkle root
* @param leaf Leaf of Merkle tree * @param leaf Leaf of Merkle tree
*/ */
function verify(bytes32[] proof, bytes32 root, bytes32 leaf) internal pure returns (bool) { function verify(bytes32[] memory proof, bytes32 root, bytes32 leaf) internal pure returns (bool) {
bytes32 computedHash = leaf; bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) { for (uint256 i = 0; i < proof.length; i++) {
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
/** /**
* @title Counter * @title Counter
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../../token/ERC20/IERC20.sol"; import "../../token/ERC20/IERC20.sol";
...@@ -9,17 +9,17 @@ import "../../token/ERC20/IERC20.sol"; ...@@ -9,17 +9,17 @@ import "../../token/ERC20/IERC20.sol";
* @dev TODO - update https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/token/ERC721/IERC721.sol#L17 when 1046 is finalized * @dev TODO - update https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/token/ERC721/IERC721.sol#L17 when 1046 is finalized
*/ */
contract ERC20TokenMetadata is IERC20 { contract ERC20TokenMetadata is IERC20 {
function tokenURI() external view returns (string); function tokenURI() external view returns (string memory);
} }
contract ERC20WithMetadata is ERC20TokenMetadata { contract ERC20WithMetadata is ERC20TokenMetadata {
string private _tokenURI; string private _tokenURI;
constructor (string tokenURI) public { constructor (string memory tokenURI) public {
_tokenURI = tokenURI; _tokenURI = tokenURI;
} }
function tokenURI() external view returns (string) { function tokenURI() external view returns (string memory) {
return _tokenURI; return _tokenURI;
} }
} }
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../token/ERC20/IERC20.sol"; import "../token/ERC20/IERC20.sol";
import "../token/ERC20/ERC20Mintable.sol"; import "../token/ERC20/ERC20Mintable.sol";
...@@ -44,7 +44,7 @@ contract ERC20Migrator { ...@@ -44,7 +44,7 @@ contract ERC20Migrator {
* @param legacyToken address of the old token contract * @param legacyToken address of the old token contract
*/ */
constructor (IERC20 legacyToken) public { constructor (IERC20 legacyToken) public {
require(legacyToken != address(0)); require(address(legacyToken) != address(0));
_legacyToken = legacyToken; _legacyToken = legacyToken;
} }
...@@ -68,9 +68,9 @@ contract ERC20Migrator { ...@@ -68,9 +68,9 @@ contract ERC20Migrator {
* @param newToken the token that will be minted * @param newToken the token that will be minted
*/ */
function beginMigration(ERC20Mintable newToken) public { function beginMigration(ERC20Mintable newToken) public {
require(_newToken == address(0)); require(address(_newToken) == address(0));
require(newToken != address(0)); require(address(newToken) != address(0));
require(newToken.isMinter(this)); require(newToken.isMinter(address(this)));
_newToken = newToken; _newToken = newToken;
} }
...@@ -82,7 +82,7 @@ contract ERC20Migrator { ...@@ -82,7 +82,7 @@ contract ERC20Migrator {
* @param amount amount of tokens to be migrated * @param amount amount of tokens to be migrated
*/ */
function migrate(address account, uint256 amount) public { function migrate(address account, uint256 amount) public {
_legacyToken.safeTransferFrom(account, this, amount); _legacyToken.safeTransferFrom(account, address(this), amount);
_newToken.mint(account, amount); _newToken.mint(account, amount);
} }
...@@ -93,7 +93,7 @@ contract ERC20Migrator { ...@@ -93,7 +93,7 @@ contract ERC20Migrator {
*/ */
function migrateAll(address account) public { function migrateAll(address account) public {
uint256 balance = _legacyToken.balanceOf(account); uint256 balance = _legacyToken.balanceOf(account);
uint256 allowance = _legacyToken.allowance(account, this); uint256 allowance = _legacyToken.allowance(account, address(this));
uint256 amount = Math.min(balance, allowance); uint256 amount = Math.min(balance, allowance);
migrate(account, amount); migrate(account, amount);
} }
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../access/roles/SignerRole.sol"; import "../access/roles/SignerRole.sol";
import "../cryptography/ECDSA.sol"; import "../cryptography/ECDSA.sol";
...@@ -48,7 +48,7 @@ contract SignatureBouncer is SignerRole { ...@@ -48,7 +48,7 @@ contract SignatureBouncer is SignerRole {
/** /**
* @dev requires that a valid signature of a signer was provided * @dev requires that a valid signature of a signer was provided
*/ */
modifier onlyValidSignature(bytes signature) { modifier onlyValidSignature(bytes memory signature) {
require(_isValidSignature(msg.sender, signature)); require(_isValidSignature(msg.sender, signature));
_; _;
} }
...@@ -56,7 +56,7 @@ contract SignatureBouncer is SignerRole { ...@@ -56,7 +56,7 @@ contract SignatureBouncer is SignerRole {
/** /**
* @dev requires that a valid signature with a specifed method of a signer was provided * @dev requires that a valid signature with a specifed method of a signer was provided
*/ */
modifier onlyValidSignatureAndMethod(bytes signature) { modifier onlyValidSignatureAndMethod(bytes memory signature) {
require(_isValidSignatureAndMethod(msg.sender, signature)); require(_isValidSignatureAndMethod(msg.sender, signature));
_; _;
} }
...@@ -64,7 +64,7 @@ contract SignatureBouncer is SignerRole { ...@@ -64,7 +64,7 @@ contract SignatureBouncer is SignerRole {
/** /**
* @dev requires that a valid signature with a specifed method and params of a signer was provided * @dev requires that a valid signature with a specifed method and params of a signer was provided
*/ */
modifier onlyValidSignatureAndData(bytes signature) { modifier onlyValidSignatureAndData(bytes memory signature) {
require(_isValidSignatureAndData(msg.sender, signature)); require(_isValidSignatureAndData(msg.sender, signature));
_; _;
} }
...@@ -73,7 +73,7 @@ contract SignatureBouncer is SignerRole { ...@@ -73,7 +73,7 @@ contract SignatureBouncer is SignerRole {
* @dev is the signature of `this + sender` from a signer? * @dev is the signature of `this + sender` from a signer?
* @return bool * @return bool
*/ */
function _isValidSignature(address account, bytes signature) internal view returns (bool) { function _isValidSignature(address account, bytes memory signature) internal view returns (bool) {
return _isValidDataHash(keccak256(abi.encodePacked(address(this), account)), signature); return _isValidDataHash(keccak256(abi.encodePacked(address(this), account)), signature);
} }
...@@ -81,7 +81,7 @@ contract SignatureBouncer is SignerRole { ...@@ -81,7 +81,7 @@ contract SignatureBouncer is SignerRole {
* @dev is the signature of `this + sender + methodId` from a signer? * @dev is the signature of `this + sender + methodId` from a signer?
* @return bool * @return bool
*/ */
function _isValidSignatureAndMethod(address account, bytes signature) internal view returns (bool) { function _isValidSignatureAndMethod(address account, bytes memory signature) internal view returns (bool) {
bytes memory data = new bytes(_METHOD_ID_SIZE); bytes memory data = new bytes(_METHOD_ID_SIZE);
for (uint i = 0; i < data.length; i++) { for (uint i = 0; i < data.length; i++) {
data[i] = msg.data[i]; data[i] = msg.data[i];
...@@ -94,7 +94,7 @@ contract SignatureBouncer is SignerRole { ...@@ -94,7 +94,7 @@ contract SignatureBouncer is SignerRole {
* @notice the signature parameter of the method being validated must be the "last" parameter * @notice the signature parameter of the method being validated must be the "last" parameter
* @return bool * @return bool
*/ */
function _isValidSignatureAndData(address account, bytes signature) internal view returns (bool) { function _isValidSignatureAndData(address account, bytes memory signature) internal view returns (bool) {
require(msg.data.length > _SIGNATURE_SIZE); require(msg.data.length > _SIGNATURE_SIZE);
bytes memory data = new bytes(msg.data.length - _SIGNATURE_SIZE); bytes memory data = new bytes(msg.data.length - _SIGNATURE_SIZE);
...@@ -110,7 +110,7 @@ contract SignatureBouncer is SignerRole { ...@@ -110,7 +110,7 @@ contract SignatureBouncer is SignerRole {
* and then recover the signature and check it against the signer role * and then recover the signature and check it against the signer role
* @return bool * @return bool
*/ */
function _isValidDataHash(bytes32 hash, bytes signature) internal view returns (bool) { function _isValidDataHash(bytes32 hash, bytes memory signature) internal view returns (bool) {
address signer = hash.toEthSignedMessageHash().recover(signature); address signer = hash.toEthSignedMessageHash().recover(signature);
return signer != address(0) && isSigner(signer); return signer != address(0) && isSigner(signer);
......
/* solium-disable security/no-block-members */ /* solium-disable security/no-block-members */
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../token/ERC20/SafeERC20.sol"; import "../token/ERC20/SafeERC20.sol";
import "../ownership/Ownable.sol"; import "../ownership/Ownable.sol";
...@@ -112,11 +112,11 @@ contract TokenVesting is Ownable { ...@@ -112,11 +112,11 @@ contract TokenVesting is Ownable {
require(unreleased > 0); require(unreleased > 0);
_released[token] = _released[token].add(unreleased); _released[address(token)] = _released[address(token)].add(unreleased);
token.safeTransfer(_beneficiary, unreleased); token.safeTransfer(_beneficiary, unreleased);
emit TokensReleased(token, unreleased); emit TokensReleased(address(token), unreleased);
} }
/** /**
...@@ -126,18 +126,18 @@ contract TokenVesting is Ownable { ...@@ -126,18 +126,18 @@ contract TokenVesting is Ownable {
*/ */
function revoke(IERC20 token) public onlyOwner { function revoke(IERC20 token) public onlyOwner {
require(_revocable); require(_revocable);
require(!_revoked[token]); require(!_revoked[address(token)]);
uint256 balance = token.balanceOf(address(this)); uint256 balance = token.balanceOf(address(this));
uint256 unreleased = _releasableAmount(token); uint256 unreleased = _releasableAmount(token);
uint256 refund = balance.sub(unreleased); uint256 refund = balance.sub(unreleased);
_revoked[token] = true; _revoked[address(token)] = true;
token.safeTransfer(owner(), refund); token.safeTransfer(owner(), refund);
emit TokenVestingRevoked(token); emit TokenVestingRevoked(address(token));
} }
/** /**
...@@ -145,7 +145,7 @@ contract TokenVesting is Ownable { ...@@ -145,7 +145,7 @@ contract TokenVesting is Ownable {
* @param token ERC20 token which is being vested * @param token ERC20 token which is being vested
*/ */
function _releasableAmount(IERC20 token) private view returns (uint256) { function _releasableAmount(IERC20 token) private view returns (uint256) {
return _vestedAmount(token).sub(_released[token]); return _vestedAmount(token).sub(_released[address(token)]);
} }
/** /**
...@@ -154,11 +154,11 @@ contract TokenVesting is Ownable { ...@@ -154,11 +154,11 @@ contract TokenVesting is Ownable {
*/ */
function _vestedAmount(IERC20 token) private view returns (uint256) { function _vestedAmount(IERC20 token) private view returns (uint256) {
uint256 currentBalance = token.balanceOf(address(this)); uint256 currentBalance = token.balanceOf(address(this));
uint256 totalBalance = currentBalance.add(_released[token]); uint256 totalBalance = currentBalance.add(_released[address(token)]);
if (block.timestamp < _cliff) { if (block.timestamp < _cliff) {
return 0; return 0;
} else if (block.timestamp >= _start.add(_duration) || _revoked[token]) { } else if (block.timestamp >= _start.add(_duration) || _revoked[address(token)]) {
return totalBalance; return totalBalance;
} else { } else {
return totalBalance.mul(block.timestamp.sub(_start)).div(_duration); return totalBalance.mul(block.timestamp.sub(_start)).div(_duration);
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../crowdsale/validation/CappedCrowdsale.sol"; import "../crowdsale/validation/CappedCrowdsale.sol";
import "../crowdsale/distribution/RefundableCrowdsale.sol"; import "../crowdsale/distribution/RefundableCrowdsale.sol";
...@@ -38,7 +38,7 @@ contract SampleCrowdsale is CappedCrowdsale, RefundableCrowdsale, MintedCrowdsal ...@@ -38,7 +38,7 @@ contract SampleCrowdsale is CappedCrowdsale, RefundableCrowdsale, MintedCrowdsal
uint256 openingTime, uint256 openingTime,
uint256 closingTime, uint256 closingTime,
uint256 rate, uint256 rate,
address wallet, address payable wallet,
uint256 cap, uint256 cap,
ERC20Mintable token, ERC20Mintable token,
uint256 goal uint256 goal
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../token/ERC20/ERC20.sol"; import "../token/ERC20/ERC20.sol";
import "../token/ERC20/ERC20Detailed.sol"; import "../token/ERC20/ERC20Detailed.sol";
...@@ -10,12 +10,13 @@ import "../token/ERC20/ERC20Detailed.sol"; ...@@ -10,12 +10,13 @@ import "../token/ERC20/ERC20Detailed.sol";
* `ERC20` functions. * `ERC20` functions.
*/ */
contract SimpleToken is ERC20, ERC20Detailed { contract SimpleToken is ERC20, ERC20Detailed {
uint256 public constant INITIAL_SUPPLY = 10000 * (10 ** uint256(decimals())); uint8 public constant DECIMALS = 18;
uint256 public constant INITIAL_SUPPLY = 10000 * (10 ** uint256(DECIMALS));
/** /**
* @dev Constructor that gives msg.sender all of existing tokens. * @dev Constructor that gives msg.sender all of existing tokens.
*/ */
constructor () public ERC20Detailed("SimpleToken", "SIM", 18) { constructor () public ERC20Detailed("SimpleToken", "SIM", DECIMALS) {
_mint(msg.sender, INITIAL_SUPPLY); _mint(msg.sender, INITIAL_SUPPLY);
} }
} }
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "./IERC165.sol"; import "./IERC165.sol";
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
/** /**
* @title ERC165Checker * @title ERC165Checker
...@@ -49,7 +49,7 @@ library ERC165Checker { ...@@ -49,7 +49,7 @@ library ERC165Checker {
* interfaceIds list, false otherwise * interfaceIds list, false otherwise
* @dev Interface identification is specified in ERC-165. * @dev Interface identification is specified in ERC-165.
*/ */
function _supportsAllInterfaces(address account, bytes4[] interfaceIds) internal view returns (bool) { function _supportsAllInterfaces(address account, bytes4[] memory interfaceIds) internal view returns (bool) {
// query support of ERC165 itself // query support of ERC165 itself
if (!_supportsERC165(account)) { if (!_supportsERC165(account)) {
return false; return false;
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
/** /**
* @title IERC165 * @title IERC165
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../access/roles/PauserRole.sol"; import "../access/roles/PauserRole.sol";
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
/** /**
* @title Math * @title Math
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
/** /**
* @title SafeMath * @title SafeMath
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
contract Acknowledger { contract Acknowledger {
event AcknowledgeFoo(uint256 a); event AcknowledgeFoo(uint256 a);
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../utils/Address.sol"; import "../utils/Address.sol";
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../token/ERC20/IERC20.sol"; import "../token/ERC20/IERC20.sol";
import "../crowdsale/emission/AllowanceCrowdsale.sol"; import "../crowdsale/emission/AllowanceCrowdsale.sol";
contract AllowanceCrowdsaleImpl is AllowanceCrowdsale { contract AllowanceCrowdsaleImpl is AllowanceCrowdsale {
constructor (uint256 rate, address wallet, IERC20 token, address tokenWallet) constructor (uint256 rate, address payable wallet, IERC20 token, address tokenWallet)
public public
Crowdsale(rate, wallet, token) Crowdsale(rate, wallet, token)
AllowanceCrowdsale(tokenWallet) AllowanceCrowdsale(tokenWallet)
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../utils/Arrays.sol"; import "../utils/Arrays.sol";
...@@ -7,7 +7,7 @@ contract ArraysImpl { ...@@ -7,7 +7,7 @@ contract ArraysImpl {
uint256[] private array; uint256[] private array;
constructor (uint256[] _array) public { constructor (uint256[] memory _array) public {
array = _array; array = _array;
} }
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../token/ERC20/IERC20.sol"; import "../token/ERC20/IERC20.sol";
import "../crowdsale/validation/CappedCrowdsale.sol"; import "../crowdsale/validation/CappedCrowdsale.sol";
contract CappedCrowdsaleImpl is CappedCrowdsale { contract CappedCrowdsaleImpl is CappedCrowdsale {
constructor (uint256 rate, address wallet, IERC20 token, uint256 cap) constructor (uint256 rate, address payable wallet, IERC20 token, uint256 cap)
public public
Crowdsale(rate, wallet, token) Crowdsale(rate, wallet, token)
CappedCrowdsale(cap) CappedCrowdsale(cap)
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../access/roles/CapperRole.sol"; import "../access/roles/CapperRole.sol";
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../payment/escrow/ConditionalEscrow.sol"; import "../payment/escrow/ConditionalEscrow.sol";
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../drafts/Counter.sol"; import "../drafts/Counter.sol";
...@@ -10,7 +10,7 @@ contract CounterImpl { ...@@ -10,7 +10,7 @@ contract CounterImpl {
// use whatever key you want to track your counters // use whatever key you want to track your counters
mapping(string => Counter.Counter) private _counters; mapping(string => Counter.Counter) private _counters;
function doThing(string key) public returns (uint256) { function doThing(string memory key) public returns (uint256) {
theId = _counters[key].next(); theId = _counters[key].next();
return theId; return theId;
} }
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../crowdsale/Crowdsale.sol"; import "../crowdsale/Crowdsale.sol";
contract CrowdsaleMock is Crowdsale { contract CrowdsaleMock is Crowdsale {
constructor (uint256 rate, address wallet, IERC20 token) public Crowdsale(rate, wallet, token) {} constructor (uint256 rate, address payable wallet, IERC20 token) public Crowdsale(rate, wallet, token) {}
} }
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../token/ERC20/ERC20.sol"; import "../token/ERC20/ERC20.sol";
import "../token/ERC20/ERC20Detailed.sol"; import "../token/ERC20/ERC20Detailed.sol";
contract ERC20DetailedMock is ERC20, ERC20Detailed { contract ERC20DetailedMock is ERC20, ERC20Detailed {
constructor (string name, string symbol, uint8 decimals) ERC20Detailed(name, symbol, decimals) public {} constructor (string memory name, string memory symbol, uint8 decimals) ERC20Detailed(name, symbol, decimals) public {}
} }
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../cryptography/ECDSA.sol"; import "../cryptography/ECDSA.sol";
contract ECDSAMock { contract ECDSAMock {
using ECDSA for bytes32; using ECDSA for bytes32;
function recover(bytes32 hash, bytes signature) public pure returns (address) { function recover(bytes32 hash, bytes memory signature) public pure returns (address) {
return hash.recover(signature); return hash.recover(signature);
} }
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../../introspection/IERC165.sol"; import "../../introspection/IERC165.sol";
...@@ -47,7 +47,7 @@ contract SupportsInterfaceWithLookupMock is IERC165 { ...@@ -47,7 +47,7 @@ contract SupportsInterfaceWithLookupMock is IERC165 {
} }
contract ERC165InterfacesSupported is SupportsInterfaceWithLookupMock { contract ERC165InterfacesSupported is SupportsInterfaceWithLookupMock {
constructor (bytes4[] interfaceIds) public { constructor (bytes4[] memory interfaceIds) public {
for (uint256 i = 0; i < interfaceIds.length; i++) { for (uint256 i = 0; i < interfaceIds.length; i++) {
_registerInterface(interfaceIds[i]); _registerInterface(interfaceIds[i]);
} }
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
contract ERC165NotSupported {} contract ERC165NotSupported {}
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../introspection/ERC165Checker.sol"; import "../introspection/ERC165Checker.sol";
...@@ -13,7 +13,7 @@ contract ERC165CheckerMock { ...@@ -13,7 +13,7 @@ contract ERC165CheckerMock {
return account._supportsInterface(interfaceId); return account._supportsInterface(interfaceId);
} }
function supportsAllInterfaces(address account, bytes4[] interfaceIds) public view returns (bool) { function supportsAllInterfaces(address account, bytes4[] memory interfaceIds) public view returns (bool) {
return account._supportsAllInterfaces(interfaceIds); return account._supportsAllInterfaces(interfaceIds);
} }
} }
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../introspection/ERC165.sol"; import "../introspection/ERC165.sol";
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../token/ERC20/ERC20Burnable.sol"; import "../token/ERC20/ERC20Burnable.sol";
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../token/ERC20/ERC20Mintable.sol"; import "../token/ERC20/ERC20Mintable.sol";
import "./MinterRoleMock.sol"; import "./MinterRoleMock.sol";
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../token/ERC20/ERC20.sol"; import "../token/ERC20/ERC20.sol";
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../token/ERC20/ERC20Pausable.sol"; import "../token/ERC20/ERC20Pausable.sol";
import "./PauserRoleMock.sol"; import "./PauserRoleMock.sol";
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../token/ERC20/ERC20.sol"; import "../token/ERC20/ERC20.sol";
import "../drafts/ERC1046/TokenMetadata.sol"; import "../drafts/ERC1046/TokenMetadata.sol";
contract ERC20WithMetadataMock is ERC20, ERC20WithMetadata { contract ERC20WithMetadataMock is ERC20, ERC20WithMetadata {
constructor (string tokenURI) public ERC20WithMetadata(tokenURI) {} constructor (string memory tokenURI) public ERC20WithMetadata(tokenURI) {}
} }
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../token/ERC721/ERC721Full.sol"; import "../token/ERC721/ERC721Full.sol";
import "../token/ERC721/ERC721Mintable.sol"; import "../token/ERC721/ERC721Mintable.sol";
...@@ -11,7 +11,7 @@ import "../token/ERC721/ERC721Burnable.sol"; ...@@ -11,7 +11,7 @@ import "../token/ERC721/ERC721Burnable.sol";
* checking token existence, removal of a token from an address * checking token existence, removal of a token from an address
*/ */
contract ERC721FullMock is ERC721Full, ERC721Mintable, ERC721MetadataMintable, ERC721Burnable { contract ERC721FullMock is ERC721Full, ERC721Mintable, ERC721MetadataMintable, ERC721Burnable {
constructor (string name, string symbol) public ERC721Mintable() ERC721Full(name, symbol) {} constructor (string memory name, string memory symbol) public ERC721Mintable() ERC721Full(name, symbol) {}
function exists(uint256 tokenId) public view returns (bool) { function exists(uint256 tokenId) public view returns (bool) {
return _exists(tokenId); return _exists(tokenId);
...@@ -21,7 +21,7 @@ contract ERC721FullMock is ERC721Full, ERC721Mintable, ERC721MetadataMintable, E ...@@ -21,7 +21,7 @@ contract ERC721FullMock is ERC721Full, ERC721Mintable, ERC721MetadataMintable, E
return _tokensOfOwner(owner); return _tokensOfOwner(owner);
} }
function setTokenURI(uint256 tokenId, string uri) public { function setTokenURI(uint256 tokenId, string memory uri) public {
_setTokenURI(tokenId, uri); _setTokenURI(tokenId, uri);
} }
} }
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../token/ERC721/ERC721Full.sol"; import "../token/ERC721/ERC721Full.sol";
import "../token/ERC721/ERC721Mintable.sol"; import "../token/ERC721/ERC721Mintable.sol";
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../token/ERC721/ERC721.sol"; import "../token/ERC721/ERC721.sol";
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../token/ERC721/ERC721Pausable.sol"; import "../token/ERC721/ERC721Pausable.sol";
import "./PauserRoleMock.sol"; import "./PauserRoleMock.sol";
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../token/ERC721/IERC721Receiver.sol"; import "../token/ERC721/IERC721Receiver.sol";
...@@ -13,7 +13,7 @@ contract ERC721ReceiverMock is IERC721Receiver { ...@@ -13,7 +13,7 @@ contract ERC721ReceiverMock is IERC721Receiver {
_reverts = reverts; _reverts = reverts;
} }
function onERC721Received(address operator, address from, uint256 tokenId, bytes data) public returns (bytes4) { function onERC721Received(address operator, address from, uint256 tokenId, bytes memory data) public returns (bytes4) {
require(!_reverts); require(!_reverts);
emit Received(operator, from, tokenId, data, gasleft()); emit Received(operator, from, tokenId, data, gasleft());
return _retval; return _retval;
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
contract EventEmitter { contract EventEmitter {
event Argumentless(); event Argumentless();
...@@ -11,7 +11,7 @@ contract EventEmitter { ...@@ -11,7 +11,7 @@ contract EventEmitter {
event String(string value); event String(string value);
event LongUintBooleanString(uint256 uintValue, bool booleanValue, string stringValue); event LongUintBooleanString(uint256 uintValue, bool booleanValue, string stringValue);
constructor (uint8 uintValue, bool booleanValue, string stringValue) public { constructor (uint8 uintValue, bool booleanValue, string memory stringValue) public {
emit ShortUint(uintValue); emit ShortUint(uintValue);
emit Boolean(booleanValue); emit Boolean(booleanValue);
emit String(stringValue); emit String(stringValue);
...@@ -45,11 +45,11 @@ contract EventEmitter { ...@@ -45,11 +45,11 @@ contract EventEmitter {
emit Boolean(value); emit Boolean(value);
} }
function emitString(string value) public { function emitString(string memory value) public {
emit String(value); emit String(value);
} }
function emitLongUintBooleanString(uint256 uintValue, bool booleanValue, string stringValue) public { function emitLongUintBooleanString(uint256 uintValue, bool booleanValue, string memory stringValue) public {
emit LongUintBooleanString(uintValue, booleanValue, stringValue); emit LongUintBooleanString(uintValue, booleanValue, stringValue);
} }
...@@ -58,7 +58,7 @@ contract EventEmitter { ...@@ -58,7 +58,7 @@ contract EventEmitter {
emit Boolean(boolValue); emit Boolean(boolValue);
} }
function emitStringAndEmitIndirectly(string value, IndirectEventEmitter emitter) public { function emitStringAndEmitIndirectly(string memory value, IndirectEventEmitter emitter) public {
emit String(value); emit String(value);
emitter.emitStringIndirectly(value); emitter.emitStringIndirectly(value);
} }
...@@ -67,7 +67,7 @@ contract EventEmitter { ...@@ -67,7 +67,7 @@ contract EventEmitter {
contract IndirectEventEmitter { contract IndirectEventEmitter {
event IndirectString(string value); event IndirectString(string value);
function emitStringIndirectly(string value) public { function emitStringIndirectly(string memory value) public {
emit IndirectString(value); emit IndirectString(value);
} }
} }
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
contract Failer { contract Failer {
uint256[] private array; uint256[] private array;
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../token/ERC20/IERC20.sol"; import "../token/ERC20/IERC20.sol";
import "../crowdsale/distribution/FinalizableCrowdsale.sol"; import "../crowdsale/distribution/FinalizableCrowdsale.sol";
contract FinalizableCrowdsaleImpl is FinalizableCrowdsale { contract FinalizableCrowdsaleImpl is FinalizableCrowdsale {
constructor (uint256 openingTime, uint256 closingTime, uint256 rate, address wallet, IERC20 token) constructor (uint256 openingTime, uint256 closingTime, uint256 rate, address payable wallet, IERC20 token)
public public
Crowdsale(rate, wallet, token) Crowdsale(rate, wallet, token)
TimedCrowdsale(openingTime, closingTime) TimedCrowdsale(openingTime, closingTime)
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../crowdsale/price/IncreasingPriceCrowdsale.sol"; import "../crowdsale/price/IncreasingPriceCrowdsale.sol";
import "../math/SafeMath.sol"; import "../math/SafeMath.sol";
...@@ -7,7 +7,7 @@ contract IncreasingPriceCrowdsaleImpl is IncreasingPriceCrowdsale { ...@@ -7,7 +7,7 @@ contract IncreasingPriceCrowdsaleImpl is IncreasingPriceCrowdsale {
constructor ( constructor (
uint256 openingTime, uint256 openingTime,
uint256 closingTime, uint256 closingTime,
address wallet, address payable wallet,
IERC20 token, IERC20 token,
uint256 initialRate, uint256 initialRate,
uint256 finalRate uint256 finalRate
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../token/ERC20/IERC20.sol"; import "../token/ERC20/IERC20.sol";
import "../crowdsale/validation/IndividuallyCappedCrowdsale.sol"; import "../crowdsale/validation/IndividuallyCappedCrowdsale.sol";
import "./CapperRoleMock.sol"; import "./CapperRoleMock.sol";
contract IndividuallyCappedCrowdsaleImpl is IndividuallyCappedCrowdsale, CapperRoleMock { contract IndividuallyCappedCrowdsaleImpl is IndividuallyCappedCrowdsale, CapperRoleMock {
constructor (uint256 rate, address wallet, IERC20 token) public Crowdsale(rate, wallet, token) constructor (uint256 rate, address payable wallet, IERC20 token) public Crowdsale(rate, wallet, token)
{} {}
} }
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../math/Math.sol"; import "../math/Math.sol";
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import { MerkleProof } from "../cryptography/MerkleProof.sol"; import { MerkleProof } from "../cryptography/MerkleProof.sol";
contract MerkleProofWrapper { contract MerkleProofWrapper {
function verify(bytes32[] proof, bytes32 root, bytes32 leaf) public pure returns (bool) { function verify(bytes32[] memory proof, bytes32 root, bytes32 leaf) public pure returns (bool) {
return MerkleProof.verify(proof, root, leaf); return MerkleProof.verify(proof, root, leaf);
} }
} }
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../token/ERC20/ERC20Mintable.sol"; import "../token/ERC20/ERC20Mintable.sol";
import "../crowdsale/emission/MintedCrowdsale.sol"; import "../crowdsale/emission/MintedCrowdsale.sol";
contract MintedCrowdsaleImpl is MintedCrowdsale { contract MintedCrowdsaleImpl is MintedCrowdsale {
constructor (uint256 rate, address wallet, ERC20Mintable token) public Crowdsale(rate, wallet, token) {} constructor (uint256 rate, address payable wallet, ERC20Mintable token) public Crowdsale(rate, wallet, token) {}
} }
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../access/roles/MinterRole.sol"; import "../access/roles/MinterRole.sol";
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../ownership/Ownable.sol"; import "../ownership/Ownable.sol";
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../ownership/Ownable.sol"; import "../ownership/Ownable.sol";
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../token/ERC20/ERC20.sol"; import "../token/ERC20/ERC20.sol";
import "../crowdsale/validation/PausableCrowdsale.sol"; import "../crowdsale/validation/PausableCrowdsale.sol";
contract PausableCrowdsaleImpl is PausableCrowdsale { contract PausableCrowdsaleImpl is PausableCrowdsale {
constructor (uint256 _rate, address _wallet, ERC20 _token) public Crowdsale(_rate, _wallet, _token) { constructor (uint256 _rate, address payable _wallet, ERC20 _token) public Crowdsale(_rate, _wallet, _token) {
} }
} }
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../lifecycle/Pausable.sol"; import "../lifecycle/Pausable.sol";
import "./PauserRoleMock.sol"; import "./PauserRoleMock.sol";
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../access/roles/PauserRole.sol"; import "../access/roles/PauserRole.sol";
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../token/ERC20/IERC20.sol"; import "../token/ERC20/IERC20.sol";
import "../crowdsale/distribution/PostDeliveryCrowdsale.sol"; import "../crowdsale/distribution/PostDeliveryCrowdsale.sol";
contract PostDeliveryCrowdsaleImpl is PostDeliveryCrowdsale { contract PostDeliveryCrowdsaleImpl is PostDeliveryCrowdsale {
constructor (uint256 openingTime, uint256 closingTime, uint256 rate, address wallet, IERC20 token) constructor (uint256 openingTime, uint256 closingTime, uint256 rate, address payable wallet, IERC20 token)
public public
TimedCrowdsale(openingTime, closingTime) TimedCrowdsale(openingTime, closingTime)
Crowdsale(rate, wallet, token) Crowdsale(rate, wallet, token)
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../payment/PullPayment.sol"; import "../payment/PullPayment.sol";
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
contract ReentrancyAttack { contract ReentrancyAttack {
function callSender(bytes4 data) public { function callSender(bytes4 data) public {
// solium-disable-next-line security/no-low-level-calls // solium-disable-next-line security/no-low-level-calls
require(msg.sender.call(abi.encodeWithSelector(data))); (bool success,) = msg.sender.call(abi.encodeWithSelector(data));
require(success);
} }
} }
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../utils/ReentrancyGuard.sol"; import "../utils/ReentrancyGuard.sol";
import "./ReentrancyAttack.sol"; import "./ReentrancyAttack.sol";
...@@ -25,8 +25,8 @@ contract ReentrancyMock is ReentrancyGuard { ...@@ -25,8 +25,8 @@ contract ReentrancyMock is ReentrancyGuard {
if (n > 0) { if (n > 0) {
count(); count();
// solium-disable-next-line security/no-low-level-calls // solium-disable-next-line security/no-low-level-calls
bool result = address(this).call(abi.encodeWithSignature("countThisRecursive(uint256)", n - 1)); (bool success,) = address(this).call(abi.encodeWithSignature("countThisRecursive(uint256)", n - 1));
require(result == true); require(success);
} }
} }
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../token/ERC20/IERC20.sol"; import "../token/ERC20/IERC20.sol";
import "../crowdsale/distribution/RefundableCrowdsale.sol"; import "../crowdsale/distribution/RefundableCrowdsale.sol";
...@@ -8,7 +8,7 @@ contract RefundableCrowdsaleImpl is RefundableCrowdsale { ...@@ -8,7 +8,7 @@ contract RefundableCrowdsaleImpl is RefundableCrowdsale {
uint256 openingTime, uint256 openingTime,
uint256 closingTime, uint256 closingTime,
uint256 rate, uint256 rate,
address wallet, address payable wallet,
IERC20 token, IERC20 token,
uint256 goal uint256 goal
) )
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../token/ERC20/IERC20.sol"; import "../token/ERC20/IERC20.sol";
import "../crowdsale/distribution/RefundablePostDeliveryCrowdsale.sol"; import "../crowdsale/distribution/RefundablePostDeliveryCrowdsale.sol";
...@@ -8,7 +8,7 @@ contract RefundablePostDeliveryCrowdsaleImpl is RefundablePostDeliveryCrowdsale ...@@ -8,7 +8,7 @@ contract RefundablePostDeliveryCrowdsaleImpl is RefundablePostDeliveryCrowdsale
uint256 openingTime, uint256 openingTime,
uint256 closingTime, uint256 closingTime,
uint256 rate, uint256 rate,
address wallet, address payable wallet,
IERC20 token, IERC20 token,
uint256 goal uint256 goal
) )
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../access/Roles.sol"; import "../access/Roles.sol";
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../token/ERC20/IERC20.sol"; import "../token/ERC20/IERC20.sol";
import "../token/ERC20/SafeERC20.sol"; import "../token/ERC20/SafeERC20.sol";
...@@ -54,8 +54,8 @@ contract SafeERC20Helper { ...@@ -54,8 +54,8 @@ contract SafeERC20Helper {
IERC20 private _succeeding; IERC20 private _succeeding;
constructor () public { constructor () public {
_failing = IERC20(new ERC20FailingMock()); _failing = IERC20(address(new ERC20FailingMock()));
_succeeding = IERC20(new ERC20SucceedingMock()); _succeeding = IERC20(address(new ERC20SucceedingMock()));
} }
// Using _failing // Using _failing
...@@ -103,7 +103,7 @@ contract SafeERC20Helper { ...@@ -103,7 +103,7 @@ contract SafeERC20Helper {
} }
function setAllowance(uint256 allowance_) public { function setAllowance(uint256 allowance_) public {
ERC20SucceedingMock(_succeeding).setAllowance(allowance_); ERC20SucceedingMock(address(_succeeding)).setAllowance(allowance_);
} }
function allowance() public view returns (uint256) { function allowance() public view returns (uint256) {
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../math/SafeMath.sol"; import "../math/SafeMath.sol";
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../ownership/Secondary.sol"; import "../ownership/Secondary.sol";
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../drafts/SignatureBouncer.sol"; import "../drafts/SignatureBouncer.sol";
import "./SignerRoleMock.sol"; import "./SignerRoleMock.sol";
contract SignatureBouncerMock is SignatureBouncer, SignerRoleMock { contract SignatureBouncerMock is SignatureBouncer, SignerRoleMock {
function checkValidSignature(address account, bytes signature) public view returns (bool) { function checkValidSignature(address account, bytes memory signature) public view returns (bool) {
return _isValidSignature(account, signature); return _isValidSignature(account, signature);
} }
function onlyWithValidSignature(bytes signature) public onlyValidSignature(signature) view {} function onlyWithValidSignature(bytes memory signature) public onlyValidSignature(signature) view {}
function checkValidSignatureAndMethod(address account, bytes signature) public view returns (bool) { function checkValidSignatureAndMethod(address account, bytes memory signature) public view returns (bool) {
return _isValidSignatureAndMethod(account, signature); return _isValidSignatureAndMethod(account, signature);
} }
function onlyWithValidSignatureAndMethod(bytes signature) public onlyValidSignatureAndMethod(signature) view {} function onlyWithValidSignatureAndMethod(bytes memory signature) public onlyValidSignatureAndMethod(signature) view {}
function checkValidSignatureAndData(address account, bytes, uint, bytes signature) public view returns (bool) { function checkValidSignatureAndData(address account, bytes memory, uint, bytes memory signature) public view returns (bool) {
return _isValidSignatureAndData(account, signature); return _isValidSignatureAndData(account, signature);
} }
function onlyWithValidSignatureAndData(uint, bytes signature) public onlyValidSignatureAndData(signature) view {} function onlyWithValidSignatureAndData(uint, bytes memory signature) public onlyValidSignatureAndData(signature) view {}
function theWrongMethod(bytes) public pure {} function theWrongMethod(bytes memory) public pure {}
function tooShortMsgData() public onlyValidSignatureAndData("") view {} function tooShortMsgData() public onlyValidSignatureAndData("") view {}
} }
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../access/roles/SignerRole.sol"; import "../access/roles/SignerRole.sol";
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../token/ERC20/IERC20.sol"; import "../token/ERC20/IERC20.sol";
import "../crowdsale/validation/TimedCrowdsale.sol"; import "../crowdsale/validation/TimedCrowdsale.sol";
contract TimedCrowdsaleImpl is TimedCrowdsale { contract TimedCrowdsaleImpl is TimedCrowdsale {
constructor (uint256 openingTime, uint256 closingTime, uint256 rate, address wallet, IERC20 token) constructor (uint256 openingTime, uint256 closingTime, uint256 rate, address payable wallet, IERC20 token)
public public
Crowdsale(rate, wallet, token) Crowdsale(rate, wallet, token)
TimedCrowdsale(openingTime, closingTime) TimedCrowdsale(openingTime, closingTime)
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../token/ERC20/IERC20.sol"; import "../token/ERC20/IERC20.sol";
import "../crowdsale/validation/WhitelistCrowdsale.sol"; import "../crowdsale/validation/WhitelistCrowdsale.sol";
...@@ -6,5 +6,5 @@ import "../crowdsale/Crowdsale.sol"; ...@@ -6,5 +6,5 @@ import "../crowdsale/Crowdsale.sol";
contract WhitelistCrowdsaleImpl is Crowdsale, WhitelistCrowdsale { contract WhitelistCrowdsaleImpl is Crowdsale, WhitelistCrowdsale {
constructor (uint256 _rate, address _wallet, IERC20 _token) Crowdsale(_rate, _wallet, _token) public {} constructor (uint256 _rate, address payable _wallet, IERC20 _token) Crowdsale(_rate, _wallet, _token) public {}
} }
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../access/roles/WhitelistedRole.sol"; import "../access/roles/WhitelistedRole.sol";
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../access/roles/WhitelisterRole.sol"; import "../access/roles/WhitelisterRole.sol";
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
/** /**
* @title Ownable * @title Ownable
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
/** /**
* @title Secondary * @title Secondary
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../math/SafeMath.sol"; import "../math/SafeMath.sol";
...@@ -24,7 +24,7 @@ contract PaymentSplitter { ...@@ -24,7 +24,7 @@ contract PaymentSplitter {
/** /**
* @dev Constructor * @dev Constructor
*/ */
constructor (address[] payees, uint256[] shares) public payable { constructor (address[] memory payees, uint256[] memory shares) public payable {
require(payees.length == shares.length); require(payees.length == shares.length);
require(payees.length > 0); require(payees.length > 0);
...@@ -79,7 +79,7 @@ contract PaymentSplitter { ...@@ -79,7 +79,7 @@ contract PaymentSplitter {
* @dev Release one of the payee's proportional payment. * @dev Release one of the payee's proportional payment.
* @param account Whose payments will be released. * @param account Whose payments will be released.
*/ */
function release(address account) public { function release(address payable account) public {
require(_shares[account] > 0); require(_shares[account] > 0);
uint256 totalReceived = address(this).balance.add(_totalReleased); uint256 totalReceived = address(this).balance.add(_totalReleased);
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "./escrow/Escrow.sol"; import "./escrow/Escrow.sol";
...@@ -18,7 +18,7 @@ contract PullPayment { ...@@ -18,7 +18,7 @@ contract PullPayment {
* @dev Withdraw accumulated balance. * @dev Withdraw accumulated balance.
* @param payee Whose balance will be withdrawn. * @param payee Whose balance will be withdrawn.
*/ */
function withdrawPayments(address payee) public { function withdrawPayments(address payable payee) public {
_escrow.withdraw(payee); _escrow.withdraw(payee);
} }
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "./Escrow.sol"; import "./Escrow.sol";
...@@ -15,7 +15,7 @@ contract ConditionalEscrow is Escrow { ...@@ -15,7 +15,7 @@ contract ConditionalEscrow is Escrow {
*/ */
function withdrawalAllowed(address payee) public view returns (bool); function withdrawalAllowed(address payee) public view returns (bool);
function withdraw(address payee) public { function withdraw(address payable payee) public {
require(withdrawalAllowed(payee)); require(withdrawalAllowed(payee));
super.withdraw(payee); super.withdraw(payee);
} }
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../../math/SafeMath.sol"; import "../../math/SafeMath.sol";
import "../../ownership/Secondary.sol"; import "../../ownership/Secondary.sol";
...@@ -42,7 +42,7 @@ contract Escrow is Secondary { ...@@ -42,7 +42,7 @@ contract Escrow is Secondary {
* @dev Withdraw accumulated balance for a payee. * @dev Withdraw accumulated balance for a payee.
* @param payee The address whose funds will be withdrawn and transferred to. * @param payee The address whose funds will be withdrawn and transferred to.
*/ */
function withdraw(address payee) public onlyPrimary { function withdraw(address payable payee) public onlyPrimary {
uint256 payment = _deposits[payee]; uint256 payment = _deposits[payee];
_deposits[payee] = 0; _deposits[payee] = 0;
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "./ConditionalEscrow.sol"; import "./ConditionalEscrow.sol";
...@@ -20,13 +20,13 @@ contract RefundEscrow is ConditionalEscrow { ...@@ -20,13 +20,13 @@ contract RefundEscrow is ConditionalEscrow {
event RefundsEnabled(); event RefundsEnabled();
State private _state; State private _state;
address private _beneficiary; address payable private _beneficiary;
/** /**
* @dev Constructor. * @dev Constructor.
* @param beneficiary The beneficiary of the deposits. * @param beneficiary The beneficiary of the deposits.
*/ */
constructor (address beneficiary) public { constructor (address payable beneficiary) public {
require(beneficiary != address(0)); require(beneficiary != address(0));
_beneficiary = beneficiary; _beneficiary = beneficiary;
_state = State.Active; _state = State.Active;
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "./IERC20.sol"; import "./IERC20.sol";
import "../../math/SafeMath.sol"; import "../../math/SafeMath.sol";
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "./ERC20.sol"; import "./ERC20.sol";
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "./ERC20Mintable.sol"; import "./ERC20Mintable.sol";
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "./IERC20.sol"; import "./IERC20.sol";
...@@ -13,7 +13,7 @@ contract ERC20Detailed is IERC20 { ...@@ -13,7 +13,7 @@ contract ERC20Detailed is IERC20 {
string private _symbol; string private _symbol;
uint8 private _decimals; uint8 private _decimals;
constructor (string name, string symbol, uint8 decimals) public { constructor (string memory name, string memory symbol, uint8 decimals) public {
_name = name; _name = name;
_symbol = symbol; _symbol = symbol;
_decimals = decimals; _decimals = decimals;
...@@ -22,14 +22,14 @@ contract ERC20Detailed is IERC20 { ...@@ -22,14 +22,14 @@ contract ERC20Detailed is IERC20 {
/** /**
* @return the name of the token. * @return the name of the token.
*/ */
function name() public view returns (string) { function name() public view returns (string memory) {
return _name; return _name;
} }
/** /**
* @return the symbol of the token. * @return the symbol of the token.
*/ */
function symbol() public view returns (string) { function symbol() public view returns (string memory) {
return _symbol; return _symbol;
} }
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "./ERC20.sol"; import "./ERC20.sol";
import "../../access/roles/MinterRole.sol"; import "../../access/roles/MinterRole.sol";
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "./ERC20.sol"; import "./ERC20.sol";
import "../../lifecycle/Pausable.sol"; import "../../lifecycle/Pausable.sol";
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
/** /**
* @title ERC20 interface * @title ERC20 interface
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "./IERC20.sol"; import "./IERC20.sol";
import "../../math/SafeMath.sol"; import "../../math/SafeMath.sol";
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "./SafeERC20.sol"; import "./SafeERC20.sol";
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "./IERC721.sol"; import "./IERC721.sol";
import "./IERC721Receiver.sol"; import "./IERC721Receiver.sol";
...@@ -163,7 +163,7 @@ contract ERC721 is ERC165, IERC721 { ...@@ -163,7 +163,7 @@ contract ERC721 is ERC165, IERC721 {
* @param tokenId uint256 ID of the token to be transferred * @param tokenId uint256 ID of the token to be transferred
* @param _data bytes data to send along with a safe transfer check * @param _data bytes data to send along with a safe transfer check
*/ */
function safeTransferFrom(address from, address to, uint256 tokenId, bytes _data) public { function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) public {
transferFrom(from, to, tokenId); transferFrom(from, to, tokenId);
// solium-disable-next-line arg-overflow // solium-disable-next-line arg-overflow
require(_checkOnERC721Received(from, to, tokenId, _data)); require(_checkOnERC721Received(from, to, tokenId, _data));
...@@ -267,7 +267,7 @@ contract ERC721 is ERC165, IERC721 { ...@@ -267,7 +267,7 @@ contract ERC721 is ERC165, IERC721 {
* @param _data bytes optional data to send along with the call * @param _data bytes optional data to send along with the call
* @return whether the call correctly returned the expected magic value * @return whether the call correctly returned the expected magic value
*/ */
function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes _data) internal returns (bool) { function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory _data) internal returns (bool) {
if (!to.isContract()) { if (!to.isContract()) {
return true; return true;
} }
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "./ERC721.sol"; import "./ERC721.sol";
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "./IERC721Enumerable.sol"; import "./IERC721Enumerable.sol";
import "./ERC721.sol"; import "./ERC721.sol";
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "./ERC721.sol"; import "./ERC721.sol";
import "./ERC721Enumerable.sol"; import "./ERC721Enumerable.sol";
...@@ -11,5 +11,5 @@ import "./ERC721Metadata.sol"; ...@@ -11,5 +11,5 @@ import "./ERC721Metadata.sol";
* @dev see https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md * @dev see https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md
*/ */
contract ERC721Full is ERC721, ERC721Enumerable, ERC721Metadata { contract ERC721Full is ERC721, ERC721Enumerable, ERC721Metadata {
constructor (string name, string symbol) ERC721Metadata(name, symbol) public {} constructor (string memory name, string memory symbol) ERC721Metadata(name, symbol) public {}
} }
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "./IERC721Receiver.sol"; import "./IERC721Receiver.sol";
contract ERC721Holder is IERC721Receiver { contract ERC721Holder is IERC721Receiver {
function onERC721Received(address, address, uint256, bytes) public returns (bytes4) { function onERC721Received(address, address, uint256, bytes memory) public returns (bytes4) {
return this.onERC721Received.selector; return this.onERC721Received.selector;
} }
} }
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "./ERC721.sol"; import "./ERC721.sol";
import "./IERC721Metadata.sol"; import "./IERC721Metadata.sol";
...@@ -25,7 +25,7 @@ contract ERC721Metadata is ERC165, ERC721, IERC721Metadata { ...@@ -25,7 +25,7 @@ contract ERC721Metadata is ERC165, ERC721, IERC721Metadata {
/** /**
* @dev Constructor function * @dev Constructor function
*/ */
constructor (string name, string symbol) public { constructor (string memory name, string memory symbol) public {
_name = name; _name = name;
_symbol = symbol; _symbol = symbol;
...@@ -37,7 +37,7 @@ contract ERC721Metadata is ERC165, ERC721, IERC721Metadata { ...@@ -37,7 +37,7 @@ contract ERC721Metadata is ERC165, ERC721, IERC721Metadata {
* @dev Gets the token name * @dev Gets the token name
* @return string representing the token name * @return string representing the token name
*/ */
function name() external view returns (string) { function name() external view returns (string memory) {
return _name; return _name;
} }
...@@ -45,7 +45,7 @@ contract ERC721Metadata is ERC165, ERC721, IERC721Metadata { ...@@ -45,7 +45,7 @@ contract ERC721Metadata is ERC165, ERC721, IERC721Metadata {
* @dev Gets the token symbol * @dev Gets the token symbol
* @return string representing the token symbol * @return string representing the token symbol
*/ */
function symbol() external view returns (string) { function symbol() external view returns (string memory) {
return _symbol; return _symbol;
} }
...@@ -54,7 +54,7 @@ contract ERC721Metadata is ERC165, ERC721, IERC721Metadata { ...@@ -54,7 +54,7 @@ contract ERC721Metadata is ERC165, ERC721, IERC721Metadata {
* Throws if the token ID does not exist. May return an empty string. * Throws if the token ID does not exist. May return an empty string.
* @param tokenId uint256 ID of the token to query * @param tokenId uint256 ID of the token to query
*/ */
function tokenURI(uint256 tokenId) external view returns (string) { function tokenURI(uint256 tokenId) external view returns (string memory) {
require(_exists(tokenId)); require(_exists(tokenId));
return _tokenURIs[tokenId]; return _tokenURIs[tokenId];
} }
...@@ -65,7 +65,7 @@ contract ERC721Metadata is ERC165, ERC721, IERC721Metadata { ...@@ -65,7 +65,7 @@ contract ERC721Metadata is ERC165, ERC721, IERC721Metadata {
* @param tokenId uint256 ID of the token to set its URI * @param tokenId uint256 ID of the token to set its URI
* @param uri string URI to assign * @param uri string URI to assign
*/ */
function _setTokenURI(uint256 tokenId, string uri) internal { function _setTokenURI(uint256 tokenId, string memory uri) internal {
require(_exists(tokenId)); require(_exists(tokenId));
_tokenURIs[tokenId] = uri; _tokenURIs[tokenId] = uri;
} }
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "./ERC721Metadata.sol"; import "./ERC721Metadata.sol";
import "../../access/roles/MinterRole.sol"; import "../../access/roles/MinterRole.sol";
...@@ -16,7 +16,7 @@ contract ERC721MetadataMintable is ERC721, ERC721Metadata, MinterRole { ...@@ -16,7 +16,7 @@ contract ERC721MetadataMintable is ERC721, ERC721Metadata, MinterRole {
* @param tokenURI The token URI of the minted token. * @param tokenURI The token URI of the minted token.
* @return A boolean that indicates if the operation was successful. * @return A boolean that indicates if the operation was successful.
*/ */
function mintWithTokenURI(address to, uint256 tokenId, string tokenURI) public onlyMinter returns (bool) { function mintWithTokenURI(address to, uint256 tokenId, string memory tokenURI) public onlyMinter returns (bool) {
_mint(to, tokenId); _mint(to, tokenId);
_setTokenURI(tokenId, tokenURI); _setTokenURI(tokenId, tokenURI);
return true; return true;
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "./ERC721.sol"; import "./ERC721.sol";
import "../../access/roles/MinterRole.sol"; import "../../access/roles/MinterRole.sol";
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "./ERC721.sol"; import "./ERC721.sol";
import "../../lifecycle/Pausable.sol"; import "../../lifecycle/Pausable.sol";
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../../introspection/IERC165.sol"; import "../../introspection/IERC165.sol";
...@@ -23,5 +23,5 @@ contract IERC721 is IERC165 { ...@@ -23,5 +23,5 @@ contract IERC721 is IERC165 {
function transferFrom(address from, address to, uint256 tokenId) public; function transferFrom(address from, address to, uint256 tokenId) public;
function safeTransferFrom(address from, address to, uint256 tokenId) public; function safeTransferFrom(address from, address to, uint256 tokenId) public;
function safeTransferFrom(address from, address to, uint256 tokenId, bytes data) public; function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public;
} }
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "./IERC721.sol"; import "./IERC721.sol";
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "./IERC721.sol"; import "./IERC721.sol";
import "./IERC721Enumerable.sol"; import "./IERC721Enumerable.sol";
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "./IERC721.sol"; import "./IERC721.sol";
...@@ -7,7 +7,7 @@ import "./IERC721.sol"; ...@@ -7,7 +7,7 @@ import "./IERC721.sol";
* @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md * @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md
*/ */
contract IERC721Metadata is IERC721 { contract IERC721Metadata is IERC721 {
function name() external view returns (string); function name() external view returns (string memory);
function symbol() external view returns (string); function symbol() external view returns (string memory);
function tokenURI(uint256 tokenId) external view returns (string); function tokenURI(uint256 tokenId) external view returns (string memory);
} }
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
/** /**
* @title ERC721 token receiver interface * @title ERC721 token receiver interface
...@@ -20,5 +20,5 @@ contract IERC721Receiver { ...@@ -20,5 +20,5 @@ contract IERC721Receiver {
* @param data Additional data with no specified format * @param data Additional data with no specified format
* @return `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))` * @return `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
*/ */
function onERC721Received(address operator, address from, uint256 tokenId, bytes data) public returns (bytes4); function onERC721Received(address operator, address from, uint256 tokenId, bytes memory data) public returns (bytes4);
} }
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
/** /**
* Utility library of inline functions on addresses * Utility library of inline functions on addresses
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
import "../math/Math.sol"; import "../math/Math.sol";
......
pragma solidity ^0.4.24; pragma solidity ^0.5.0;
/** /**
* @title Helps contracts guard against reentrancy attacks. * @title Helps contracts guard against reentrancy attacks.
......
...@@ -8,18 +8,19 @@ ...@@ -8,18 +8,19 @@
"test" "test"
], ],
"scripts": { "scripts": {
"test": "scripts/test.sh", "build": "scripts/build.sh",
"compile": "scripts/compile.sh",
"console": "truffle console",
"coverage": "scripts/coverage.sh",
"lint": "npm run lint:js && npm run lint:sol",
"lint:fix": "npm run lint:js:fix && npm run lint:sol:fix",
"lint:js": "eslint .", "lint:js": "eslint .",
"lint:js:fix": "eslint . --fix", "lint:js:fix": "eslint . --fix",
"lint:sol": "solium -d .", "lint:sol": "solium -d .",
"lint:sol:fix": "solium -d . --fix", "lint:sol:fix": "solium -d . --fix",
"lint": "npm run lint:js && npm run lint:sol", "prepack": "npm run build",
"lint:fix": "npm run lint:js:fix && npm run lint:sol:fix", "test": "npm run compile && scripts/test.sh",
"console": "truffle console", "version": "scripts/version.js"
"coverage": "scripts/coverage.sh",
"version": "scripts/version.js",
"build": "scripts/build.sh",
"prepack": "npm run build"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
......
...@@ -7,7 +7,8 @@ set -o errexit ...@@ -7,7 +7,8 @@ set -o errexit
rm -rf build rm -rf build
# Create a temporary directory to place ignored files (e.g. examples). # Create a temporary directory to place ignored files (e.g. examples).
tmp_dir="$(mktemp -dp.)" tmp_dir="ignored_contracts"
mkdir "$tmp_dir"
# Move the ignored files to the temporary directory. # Move the ignored files to the temporary directory.
while IFS="" read -r ignored while IFS="" read -r ignored
...@@ -16,7 +17,7 @@ do ...@@ -16,7 +17,7 @@ do
done < contracts/.npmignore done < contracts/.npmignore
# Compile everything else. # Compile everything else.
node_modules/.bin/truffle compile npm run compile
# Return ignored files to their place. # Return ignored files to their place.
mv "$tmp_dir/"* contracts/ mv "$tmp_dir/"* contracts/
......
#!/usr/bin/env bash
# Configure to exit script as soon as a command fails.
set -o errexit
SOLC_05_DIR=solc-0.5
# Delete any previous build artifacts
rm -rf build/
# Create a subproject where 0.5.x compilation will take place
mkdir -p "$SOLC_05_DIR"
cd "$SOLC_05_DIR"
npm init --yes
npm install --save-dev truffle@5.0.0
rm -rf contracts
ln --symbolic ../contracts contracts
# Delete any previous build artifacts
rm -rf build/
# Compile
echo "
module.exports = {
compilers: {
solc: {
version: \"0.5.0\",
},
},
};
" > truffle-config.js
npx truffle compile
# Modify the paths in the artifacts to make it look as if they were built in the root
sed --in-place --expression "s/\/$SOLC_05_DIR//g" build/contracts/*.json
# Copy them back into the root
cd ..
cp --recursive "$SOLC_05_DIR"/build build
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment