Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
openzeppelin-contracts-upgradeable
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
俞永鹏
openzeppelin-contracts-upgradeable
Commits
877f07f0
Commit
877f07f0
authored
Jan 18, 2019
by
Francisco Giordano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix all compilation errors
parent
e808a646
Hide whitespace changes
Inline
Side-by-side
Showing
36 changed files
with
108 additions
and
68 deletions
+108
-68
WhitelistAdminRole.sol
contracts/access/roles/WhitelistAdminRole.sol
+7
-3
WhitelistedRole.sol
contracts/access/roles/WhitelistedRole.sol
+7
-1
Crowdsale.sol
contracts/crowdsale/Crowdsale.sol
+2
-2
WhitelistCrowdsale.sol
contracts/crowdsale/validation/WhitelistCrowdsale.sol
+5
-1
TokenVesting.sol
contracts/drafts/TokenVesting.sol
+1
-1
StandardToken.sol
contracts/examples/StandardToken.sol
+4
-4
ERC165.sol
contracts/introspection/ERC165.sol
+2
-2
ERC20CappedMock.sol
contracts/mocks/ERC20CappedMock.sol
+1
-1
ERC20MigratorMock.sol
contracts/mocks/ERC20MigratorMock.sol
+1
-1
ERC721PausableMock.sol
contracts/mocks/ERC721PausableMock.sol
+1
-1
EscrowMock.sol
contracts/mocks/EscrowMock.sol
+2
-2
ForceEther.sol
contracts/mocks/ForceEther.sol
+2
-2
MessageHelper.sol
contracts/mocks/MessageHelper.sol
+6
-5
OwnableMock.sol
contracts/mocks/OwnableMock.sol
+1
-1
PausableCrowdsaleImpl.sol
contracts/mocks/PausableCrowdsaleImpl.sol
+2
-2
PaymentSplitterMock.sol
contracts/mocks/PaymentSplitterMock.sol
+2
-2
PostDeliveryCrowdsaleImpl.sol
contracts/mocks/PostDeliveryCrowdsaleImpl.sol
+0
-2
PullPaymentMock.sol
contracts/mocks/PullPaymentMock.sol
+1
-1
RefundEscrowMock.sol
contracts/mocks/RefundEscrowMock.sol
+3
-3
RefundablePostDeliveryCrowdsaleImpl.sol
contracts/mocks/RefundablePostDeliveryCrowdsaleImpl.sol
+3
-4
SampleCrowdsaleMock.sol
contracts/mocks/SampleCrowdsaleMock.sol
+2
-2
SignatureBouncerMock.sol
contracts/mocks/SignatureBouncerMock.sol
+1
-1
SimpleTokenMock.sol
contracts/mocks/SimpleTokenMock.sol
+1
-1
TokenTimelockMock.sol
contracts/mocks/TokenTimelockMock.sol
+1
-1
TokenVestingMock.sol
contracts/mocks/TokenVestingMock.sol
+1
-1
WhitelistAdminRoleMock.sol
contracts/mocks/WhitelistAdminRoleMock.sol
+4
-0
WhitelistCrowdsaleImpl.sol
contracts/mocks/WhitelistCrowdsaleImpl.sol
+3
-2
PaymentSplitter.sol
contracts/payment/PaymentSplitter.sol
+4
-2
ConditionalEscrow.sol
contracts/payment/escrow/ConditionalEscrow.sol
+5
-1
Escrow.sol
contracts/payment/escrow/Escrow.sol
+5
-1
RefundEscrow.sol
contracts/payment/escrow/RefundEscrow.sol
+6
-2
StandaloneERC20.sol
contracts/token/ERC20/StandaloneERC20.sol
+6
-8
ERC721Enumerable.sol
contracts/token/ERC721/ERC721Enumerable.sol
+2
-2
ERC721Metadata.sol
contracts/token/ERC721/ERC721Metadata.sol
+3
-0
StandaloneERC721.sol
contracts/token/ERC721/StandaloneERC721.sol
+3
-3
package-lock.json
package-lock.json
+8
-0
No files found.
contracts/access/roles/WhitelistAdminRole.sol
View file @
877f07f0
pragma solidity ^0.5.0;
pragma solidity ^0.5.0;
import "zos-lib/contracts/Initializable.sol";
import "../Roles.sol";
import "../Roles.sol";
/**
/**
* @title WhitelistAdminRole
* @title WhitelistAdminRole
* @dev WhitelistAdmins are responsible for assigning and removing Whitelisted accounts.
* @dev WhitelistAdmins are responsible for assigning and removing Whitelisted accounts.
*/
*/
contract WhitelistAdminRole {
contract WhitelistAdminRole
is Initializable
{
using Roles for Roles.Role;
using Roles for Roles.Role;
event WhitelistAdminAdded(address indexed account);
event WhitelistAdminAdded(address indexed account);
...
@@ -14,8 +16,10 @@ contract WhitelistAdminRole {
...
@@ -14,8 +16,10 @@ contract WhitelistAdminRole {
Roles.Role private _whitelistAdmins;
Roles.Role private _whitelistAdmins;
constructor () internal {
function _initialize(address sender) internal initializer {
_addWhitelistAdmin(msg.sender);
if (!isWhitelistAdmin(sender)) {
_addWhitelistAdmin(sender);
}
}
}
modifier onlyWhitelistAdmin() {
modifier onlyWhitelistAdmin() {
...
...
contracts/access/roles/WhitelistedRole.sol
View file @
877f07f0
pragma solidity ^0.5.0;
pragma solidity ^0.5.0;
import "zos-lib/contracts/Initializable.sol";
import "../Roles.sol";
import "../Roles.sol";
import "./WhitelistAdminRole.sol";
import "./WhitelistAdminRole.sol";
...
@@ -9,7 +11,7 @@ import "./WhitelistAdminRole.sol";
...
@@ -9,7 +11,7 @@ import "./WhitelistAdminRole.sol";
* crowdsale). This role is special in that the only accounts that can add it are WhitelistAdmins (who can also remove
* crowdsale). This role is special in that the only accounts that can add it are WhitelistAdmins (who can also remove
* it), and not Whitelisteds themselves.
* it), and not Whitelisteds themselves.
*/
*/
contract WhitelistedRole is WhitelistAdminRole {
contract WhitelistedRole is
Initializable,
WhitelistAdminRole {
using Roles for Roles.Role;
using Roles for Roles.Role;
event WhitelistedAdded(address indexed account);
event WhitelistedAdded(address indexed account);
...
@@ -22,6 +24,10 @@ contract WhitelistedRole is WhitelistAdminRole {
...
@@ -22,6 +24,10 @@ contract WhitelistedRole is WhitelistAdminRole {
_;
_;
}
}
function _initialize(address sender) internal initializer {
WhitelistAdminRole._initialize(sender);
}
function isWhitelisted(address account) public view returns (bool) {
function isWhitelisted(address account) public view returns (bool) {
return _whitelisteds.has(account);
return _whitelisteds.has(account);
}
}
...
...
contracts/crowdsale/Crowdsale.sol
View file @
877f07f0
...
@@ -54,7 +54,7 @@ contract Crowdsale is Initializable, ReentrancyGuard {
...
@@ -54,7 +54,7 @@ contract Crowdsale is Initializable, 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
*/
*/
function initialize(uint256 rate, address wallet, IERC20 token) public initializer {
function initialize(uint256 rate, address
payable
wallet, IERC20 token) public initializer {
require(rate > 0);
require(rate > 0);
require(wallet != address(0));
require(wallet != address(0));
require(address(token) != address(0));
require(address(token) != address(0));
...
@@ -128,7 +128,7 @@ contract Crowdsale is Initializable, ReentrancyGuard {
...
@@ -128,7 +128,7 @@ contract Crowdsale is Initializable, ReentrancyGuard {
}
}
function _hasBeenInitialized() internal view returns (bool) {
function _hasBeenInitialized() internal view returns (bool) {
return ((_rate > 0) && (_wallet != address(0)) && (
_token
!= address(0)));
return ((_rate > 0) && (_wallet != address(0)) && (
address(_token)
!= address(0)));
}
}
/**
/**
...
...
contracts/crowdsale/validation/WhitelistCrowdsale.sol
View file @
877f07f0
...
@@ -7,7 +7,11 @@ import "../../access/roles/WhitelistedRole.sol";
...
@@ -7,7 +7,11 @@ import "../../access/roles/WhitelistedRole.sol";
* @title WhitelistCrowdsale
* @title WhitelistCrowdsale
* @dev Crowdsale in which only whitelisted users can contribute.
* @dev Crowdsale in which only whitelisted users can contribute.
*/
*/
contract WhitelistCrowdsale is WhitelistedRole, Crowdsale {
contract WhitelistCrowdsale is Initializable, WhitelistedRole, Crowdsale {
function initialize(address sender) public initializer {
WhitelistedRole._initialize(sender);
}
/**
/**
* @dev Extend parent behavior requiring beneficiary to be whitelisted. Note that no
* @dev Extend parent behavior requiring beneficiary to be whitelisted. Note that no
* restriction is imposed on the account sending the transaction.
* restriction is imposed on the account sending the transaction.
...
...
contracts/drafts/TokenVesting.sol
View file @
877f07f0
...
@@ -47,7 +47,7 @@ contract TokenVesting is Initializable, Ownable {
...
@@ -47,7 +47,7 @@ contract TokenVesting is Initializable, Ownable {
* @param duration duration in seconds of the period in which the tokens will vest
* @param duration duration in seconds of the period in which the tokens will vest
* @param revocable whether the vesting is revocable or not
* @param revocable whether the vesting is revocable or not
*/
*/
constructor
(address beneficiary, uint256 start, uint256 cliffDuration, uint256 duration, bool revocable, address sender) public initializer {
function initialize
(address beneficiary, uint256 start, uint256 cliffDuration, uint256 duration, bool revocable, address sender) public initializer {
Ownable.initialize(sender);
Ownable.initialize(sender);
require(beneficiary != address(0));
require(beneficiary != address(0));
...
...
contracts/examples/StandardToken.sol
View file @
877f07f0
pragma solidity ^0.
4.24
;
pragma solidity ^0.
5.0
;
import "zos-lib/contracts/Initializable.sol";
import "zos-lib/contracts/Initializable.sol";
import "../token/ERC20/ERC20Detailed.sol";
import "../token/ERC20/ERC20Detailed.sol";
...
@@ -12,8 +12,8 @@ import "../token/ERC20/ERC20Pausable.sol";
...
@@ -12,8 +12,8 @@ import "../token/ERC20/ERC20Pausable.sol";
*/
*/
contract StandardToken is Initializable, ERC20Detailed, ERC20Mintable, ERC20Pausable {
contract StandardToken is Initializable, ERC20Detailed, ERC20Mintable, ERC20Pausable {
function initialize(
function initialize(
string
name, string
symbol, uint8 decimals, uint256 initialSupply, address initialHolder,
string
memory name, string memory
symbol, uint8 decimals, uint256 initialSupply, address initialHolder,
address[] m
inters, address[]
pausers
address[] m
emory minters, address[] memory
pausers
) public initializer {
) public initializer {
ERC20Detailed.initialize(name, symbol, decimals);
ERC20Detailed.initialize(name, symbol, decimals);
...
@@ -35,7 +35,7 @@ contract StandardToken is Initializable, ERC20Detailed, ERC20Mintable, ERC20Paus
...
@@ -35,7 +35,7 @@ contract StandardToken is Initializable, ERC20Detailed, ERC20Mintable, ERC20Paus
_addMinter(minters[i]);
_addMinter(minters[i]);
}
}
for (i = 0; i < pausers.length; ++i) {
for (
uint256
i = 0; i < pausers.length; ++i) {
_addPauser(pausers[i]);
_addPauser(pausers[i]);
}
}
}
}
...
...
contracts/introspection/ERC165.sol
View file @
877f07f0
...
@@ -25,13 +25,13 @@ contract ERC165 is Initializable, IERC165 {
...
@@ -25,13 +25,13 @@ contract ERC165 is Initializable, IERC165 {
* implement ERC165 itself
* implement ERC165 itself
*/
*/
function initialize() public initializer {
function initialize() public initializer {
_registerInterface(_I
nterfaceId
_ERC165);
_registerInterface(_I
NTERFACE_ID
_ERC165);
}
}
/**
/**
* @dev implement supportsInterface(bytes4) using a lookup table
* @dev implement supportsInterface(bytes4) using a lookup table
*/
*/
function supportsInterface(bytes4 interfaceId)
external
view returns (bool) {
function supportsInterface(bytes4 interfaceId)
public
view returns (bool) {
return _supportedInterfaces[interfaceId];
return _supportedInterfaces[interfaceId];
}
}
...
...
contracts/mocks/ERC20CappedMock.sol
View file @
877f07f0
pragma solidity ^0.
4.24
;
pragma solidity ^0.
5.0
;
import "../token/ERC20/ERC20Capped.sol";
import "../token/ERC20/ERC20Capped.sol";
import "./MinterRoleMock.sol";
import "./MinterRoleMock.sol";
...
...
contracts/mocks/ERC20MigratorMock.sol
View file @
877f07f0
pragma solidity ^0.
4.24
;
pragma solidity ^0.
5.0
;
import "../drafts/ERC20Migrator.sol";
import "../drafts/ERC20Migrator.sol";
...
...
contracts/mocks/ERC721PausableMock.sol
View file @
877f07f0
...
@@ -8,7 +8,7 @@ import "./PauserRoleMock.sol";
...
@@ -8,7 +8,7 @@ import "./PauserRoleMock.sol";
* This mock just provides a public mint, burn and exists functions for testing purposes
* This mock just provides a public mint, burn and exists functions for testing purposes
*/
*/
contract ERC721PausableMock is ERC721Pausable, PauserRoleMock {
contract ERC721PausableMock is ERC721Pausable, PauserRoleMock {
constructor() {
constructor()
public
{
ERC721.initialize();
ERC721.initialize();
ERC721Pausable.initialize(msg.sender);
ERC721Pausable.initialize(msg.sender);
}
}
...
...
contracts/mocks/EscrowMock.sol
View file @
877f07f0
pragma solidity ^0.
4.24
;
pragma solidity ^0.
5.0
;
import "../payment/Escrow.sol";
import "../payment/
escrow/
Escrow.sol";
contract EscrowMock is Escrow {
contract EscrowMock is Escrow {
constructor() public {
constructor() public {
...
...
contracts/mocks/ForceEther.sol
View file @
877f07f0
pragma solidity ^0.
4.24
;
pragma solidity ^0.
5.0
;
// @title Force Ether into a contract.
// @title Force Ether into a contract.
...
@@ -10,7 +10,7 @@ contract ForceEther {
...
@@ -10,7 +10,7 @@ contract ForceEther {
constructor() public payable { }
constructor() public payable { }
function destroyAndSend(address recipient) public {
function destroyAndSend(address
payable
recipient) public {
selfdestruct(recipient);
selfdestruct(recipient);
}
}
}
}
contracts/mocks/MessageHelper.sol
View file @
877f07f0
pragma solidity ^0.
4.24
;
pragma solidity ^0.
5.0
;
contract MessageHelper {
contract MessageHelper {
...
@@ -9,7 +9,7 @@ contract MessageHelper {
...
@@ -9,7 +9,7 @@ contract MessageHelper {
function showMessage(
function showMessage(
bytes32 _message,
bytes32 _message,
uint256 _number,
uint256 _number,
string _text
string
memory
_text
)
)
public
public
returns (bool)
returns (bool)
...
@@ -21,7 +21,7 @@ contract MessageHelper {
...
@@ -21,7 +21,7 @@ contract MessageHelper {
function buyMessage(
function buyMessage(
bytes32 _message,
bytes32 _message,
uint256 _number,
uint256 _number,
string _text
string
memory
_text
)
)
public
public
payable
payable
...
@@ -39,9 +39,10 @@ contract MessageHelper {
...
@@ -39,9 +39,10 @@ contract MessageHelper {
require(false);
require(false);
}
}
function call(address _to, bytes _data) public returns (bool) {
function call(address _to, bytes
memory
_data) public returns (bool) {
// solium-disable-next-line security/no-low-level-calls
// solium-disable-next-line security/no-low-level-calls
if (_to.call(_data))
(bool success,) = _to.call(_data);
if (success)
return true;
return true;
else
else
return false;
return false;
...
...
contracts/mocks/OwnableMock.sol
View file @
877f07f0
...
@@ -3,7 +3,7 @@ pragma solidity ^0.5.0;
...
@@ -3,7 +3,7 @@ pragma solidity ^0.5.0;
import "../ownership/Ownable.sol";
import "../ownership/Ownable.sol";
contract OwnableMock is Ownable {
contract OwnableMock is Ownable {
constructor() {
constructor()
public
{
Ownable.initialize(msg.sender);
Ownable.initialize(msg.sender);
}
}
}
}
contracts/mocks/PausableCrowdsaleImpl.sol
View file @
877f07f0
...
@@ -4,7 +4,7 @@ import "../token/ERC20/ERC20.sol";
...
@@ -4,7 +4,7 @@ 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 payable _wallet, ERC20 _token) public
Crowdsale(_rate, _wallet, _token)
{
constructor (uint256 _rate, address payable _wallet, ERC20 _token) public {
// solhint-disable-previous-line no-empty-blocks
Crowdsale.initialize(_rate, _wallet, _token);
}
}
}
}
contracts/mocks/PaymentSplitterMock.sol
View file @
877f07f0
pragma solidity ^0.
4.24
;
pragma solidity ^0.
5.0
;
import "../payment/PaymentSplitter.sol";
import "../payment/PaymentSplitter.sol";
contract PaymentSplitterMock is PaymentSplitter {
contract PaymentSplitterMock is PaymentSplitter {
constructor(address[]
payees, uint256[]
shares) public {
constructor(address[]
memory payees, uint256[] memory
shares) public {
PaymentSplitter.initialize(payees, shares);
PaymentSplitter.initialize(payees, shares);
}
}
}
}
contracts/mocks/PostDeliveryCrowdsaleImpl.sol
View file @
877f07f0
...
@@ -6,8 +6,6 @@ import "../crowdsale/distribution/PostDeliveryCrowdsale.sol";
...
@@ -6,8 +6,6 @@ import "../crowdsale/distribution/PostDeliveryCrowdsale.sol";
contract PostDeliveryCrowdsaleImpl is PostDeliveryCrowdsale {
contract PostDeliveryCrowdsaleImpl is PostDeliveryCrowdsale {
constructor (uint256 openingTime, uint256 closingTime, uint256 rate, address payable wallet, IERC20 token)
constructor (uint256 openingTime, uint256 closingTime, uint256 rate, address payable wallet, IERC20 token)
public
public
TimedCrowdsale(openingTime, closingTime)
Crowdsale(rate, wallet, token)
{
{
Crowdsale.initialize(rate, wallet, token);
Crowdsale.initialize(rate, wallet, token);
TimedCrowdsale.initialize(openingTime, closingTime);
TimedCrowdsale.initialize(openingTime, closingTime);
...
...
contracts/mocks/PullPaymentMock.sol
View file @
877f07f0
...
@@ -5,7 +5,7 @@ import "../payment/PullPayment.sol";
...
@@ -5,7 +5,7 @@ import "../payment/PullPayment.sol";
// mock class using PullPayment
// mock class using PullPayment
contract PullPaymentMock is PullPayment {
contract PullPaymentMock is PullPayment {
constructor () public payable {
constructor () public payable {
PullPayment.initialize();
PullPayment.
_
initialize();
}
}
// test helper function to call asyncTransfer
// test helper function to call asyncTransfer
...
...
contracts/mocks/RefundEscrowMock.sol
View file @
877f07f0
pragma solidity ^0.
4.24
;
pragma solidity ^0.
5.0
;
import "../payment/RefundEscrow.sol";
import "../payment/
escrow/
RefundEscrow.sol";
contract RefundEscrowMock is RefundEscrow {
contract RefundEscrowMock is RefundEscrow {
constructor(address beneficiary) public {
constructor(address
payable
beneficiary) public {
RefundEscrow.initialize(beneficiary, msg.sender);
RefundEscrow.initialize(beneficiary, msg.sender);
}
}
}
}
contracts/mocks/RefundablePostDeliveryCrowdsaleImpl.sol
View file @
877f07f0
...
@@ -13,10 +13,9 @@ contract RefundablePostDeliveryCrowdsaleImpl is RefundablePostDeliveryCrowdsale
...
@@ -13,10 +13,9 @@ contract RefundablePostDeliveryCrowdsaleImpl is RefundablePostDeliveryCrowdsale
uint256 goal
uint256 goal
)
)
public
public
Crowdsale(rate, wallet, token)
TimedCrowdsale(openingTime, closingTime)
RefundableCrowdsale(goal)
{
{
// solhint-disable-previous-line no-empty-blocks
Crowdsale.initialize(rate, wallet, token);
TimedCrowdsale.initialize(openingTime, closingTime);
RefundableCrowdsale.initialize(goal);
}
}
}
}
contracts/mocks/SampleCrowdsaleMock.sol
View file @
877f07f0
pragma solidity ^0.
4.24
;
pragma solidity ^0.
5.0
;
import "../examples/SampleCrowdsale.sol";
import "../examples/SampleCrowdsale.sol";
...
@@ -14,7 +14,7 @@ contract SampleCrowdsaleMock is SampleCrowdsale {
...
@@ -14,7 +14,7 @@ contract SampleCrowdsaleMock is SampleCrowdsale {
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
...
...
contracts/mocks/SignatureBouncerMock.sol
View file @
877f07f0
...
@@ -5,7 +5,7 @@ import "./SignerRoleMock.sol";
...
@@ -5,7 +5,7 @@ import "./SignerRoleMock.sol";
contract SignatureBouncerMock is SignatureBouncer, SignerRoleMock {
contract SignatureBouncerMock is SignatureBouncer, SignerRoleMock {
constructor() public {
constructor() public {
SignatureBouncer.initialize(msg.sender);
SignatureBouncer.
_
initialize(msg.sender);
}
}
function checkValidSignature(address account, bytes memory signature)
function checkValidSignature(address account, bytes memory signature)
...
...
contracts/mocks/SimpleTokenMock.sol
View file @
877f07f0
pragma solidity ^0.
4.24
;
pragma solidity ^0.
5.0
;
import "../examples/SimpleToken.sol";
import "../examples/SimpleToken.sol";
...
...
contracts/mocks/TokenTimelockMock.sol
View file @
877f07f0
pragma solidity ^0.
4.24
;
pragma solidity ^0.
5.0
;
import "../token/ERC20/TokenTimelock.sol";
import "../token/ERC20/TokenTimelock.sol";
...
...
contracts/mocks/TokenVestingMock.sol
View file @
877f07f0
pragma solidity ^0.
4.24
;
pragma solidity ^0.
5.0
;
import "../drafts/TokenVesting.sol";
import "../drafts/TokenVesting.sol";
...
...
contracts/mocks/WhitelistAdminRoleMock.sol
View file @
877f07f0
...
@@ -3,6 +3,10 @@ pragma solidity ^0.5.0;
...
@@ -3,6 +3,10 @@ pragma solidity ^0.5.0;
import "../access/roles/WhitelistAdminRole.sol";
import "../access/roles/WhitelistAdminRole.sol";
contract WhitelistAdminRoleMock is WhitelistAdminRole {
contract WhitelistAdminRoleMock is WhitelistAdminRole {
constructor () public {
WhitelistAdminRole._initialize(msg.sender);
}
function removeWhitelistAdmin(address account) public {
function removeWhitelistAdmin(address account) public {
_removeWhitelistAdmin(account);
_removeWhitelistAdmin(account);
}
}
...
...
contracts/mocks/WhitelistCrowdsaleImpl.sol
View file @
877f07f0
...
@@ -6,7 +6,8 @@ import "../crowdsale/Crowdsale.sol";
...
@@ -6,7 +6,8 @@ import "../crowdsale/Crowdsale.sol";
contract WhitelistCrowdsaleImpl is Crowdsale, WhitelistCrowdsale {
contract WhitelistCrowdsaleImpl is Crowdsale, WhitelistCrowdsale {
constructor (uint256 _rate, address payable _wallet, IERC20 _token) public Crowdsale(_rate, _wallet, _token) {
constructor (uint256 _rate, address payable _wallet, IERC20 _token) public {
// solhint-disable-previous-line no-empty-blocks
Crowdsale.initialize(_rate, _wallet, _token);
WhitelistCrowdsale.initialize(msg.sender);
}
}
}
}
contracts/payment/PaymentSplitter.sol
View file @
877f07f0
pragma solidity ^0.5.0;
pragma solidity ^0.5.0;
import "zos-lib/contracts/Initializable.sol";
import "../math/SafeMath.sol";
import "../math/SafeMath.sol";
/**
/**
...
@@ -7,7 +9,7 @@ import "../math/SafeMath.sol";
...
@@ -7,7 +9,7 @@ import "../math/SafeMath.sol";
* @dev This contract can be used when payments need to be received by a group
* @dev This contract can be used when payments need to be received by a group
* of people and split proportionately to some number of shares they own.
* of people and split proportionately to some number of shares they own.
*/
*/
contract PaymentSplitter {
contract PaymentSplitter
is Initializable
{
using SafeMath for uint256;
using SafeMath for uint256;
event PayeeAdded(address account, uint256 shares);
event PayeeAdded(address account, uint256 shares);
...
@@ -24,7 +26,7 @@ contract PaymentSplitter {
...
@@ -24,7 +26,7 @@ contract PaymentSplitter {
/**
/**
* @dev Constructor
* @dev Constructor
*/
*/
constructor (address[] memory payees, uint256[] memory shares) public payable
{
function initialize(address[] memory payees, uint256[] memory shares) public payable initializer
{
require(payees.length == shares.length);
require(payees.length == shares.length);
require(payees.length > 0);
require(payees.length > 0);
...
...
contracts/payment/escrow/ConditionalEscrow.sol
View file @
877f07f0
...
@@ -7,7 +7,11 @@ import "./Escrow.sol";
...
@@ -7,7 +7,11 @@ import "./Escrow.sol";
* @dev Base abstract escrow to only allow withdrawal if a condition is met.
* @dev Base abstract escrow to only allow withdrawal if a condition is met.
* @dev Intended usage: See Escrow.sol. Same usage guidelines apply here.
* @dev Intended usage: See Escrow.sol. Same usage guidelines apply here.
*/
*/
contract ConditionalEscrow is Escrow {
contract ConditionalEscrow is Initializable, Escrow {
function initialize(address sender) public initializer {
Escrow.initialize(sender);
}
/**
/**
* @dev Returns whether an address is allowed to withdraw their funds. To be
* @dev Returns whether an address is allowed to withdraw their funds. To be
* implemented by derived contracts.
* implemented by derived contracts.
...
...
contracts/payment/escrow/Escrow.sol
View file @
877f07f0
...
@@ -15,7 +15,7 @@ import "../../ownership/Secondary.sol";
...
@@ -15,7 +15,7 @@ import "../../ownership/Secondary.sol";
* payment method should be its primary, and provide public methods redirecting
* payment method should be its primary, and provide public methods redirecting
* to the escrow's deposit and withdraw.
* to the escrow's deposit and withdraw.
*/
*/
contract Escrow is Secondary {
contract Escrow is
Initializable,
Secondary {
using SafeMath for uint256;
using SafeMath for uint256;
event Deposited(address indexed payee, uint256 weiAmount);
event Deposited(address indexed payee, uint256 weiAmount);
...
@@ -23,6 +23,10 @@ contract Escrow is Secondary {
...
@@ -23,6 +23,10 @@ contract Escrow is Secondary {
mapping(address => uint256) private _deposits;
mapping(address => uint256) private _deposits;
function initialize(address sender) public initializer {
Secondary.initialize(sender);
}
function depositsOf(address payee) public view returns (uint256) {
function depositsOf(address payee) public view returns (uint256) {
return _deposits[payee];
return _deposits[payee];
}
}
...
...
contracts/payment/escrow/RefundEscrow.sol
View file @
877f07f0
pragma solidity ^0.5.0;
pragma solidity ^0.5.0;
import 'zos-lib/contracts/Initializable.sol';
import "./ConditionalEscrow.sol";
import "./ConditionalEscrow.sol";
/**
/**
...
@@ -13,7 +15,7 @@ import "./ConditionalEscrow.sol";
...
@@ -13,7 +15,7 @@ import "./ConditionalEscrow.sol";
* with RefundEscrow will be made through the primary contract. See the
* with RefundEscrow will be made through the primary contract. See the
* RefundableCrowdsale contract for an example of RefundEscrow’s use.
* RefundableCrowdsale contract for an example of RefundEscrow’s use.
*/
*/
contract RefundEscrow is ConditionalEscrow {
contract RefundEscrow is
Initializable,
ConditionalEscrow {
enum State { Active, Refunding, Closed }
enum State { Active, Refunding, Closed }
event RefundsClosed();
event RefundsClosed();
...
@@ -26,7 +28,9 @@ contract RefundEscrow is ConditionalEscrow {
...
@@ -26,7 +28,9 @@ contract RefundEscrow is ConditionalEscrow {
* @dev Constructor.
* @dev Constructor.
* @param beneficiary The beneficiary of the deposits.
* @param beneficiary The beneficiary of the deposits.
*/
*/
constructor (address payable beneficiary) public {
function initialize(address payable beneficiary, address sender) public initializer {
ConditionalEscrow.initialize(sender);
require(beneficiary != address(0));
require(beneficiary != address(0));
_beneficiary = beneficiary;
_beneficiary = beneficiary;
_state = State.Active;
_state = State.Active;
...
...
contracts/token/ERC20/StandaloneERC20.sol
View file @
877f07f0
pragma solidity ^0.
4.24
;
pragma solidity ^0.
5.0
;
import "zos-lib/contracts/Initializable.sol";
import "zos-lib/contracts/Initializable.sol";
import "./ERC20Detailed.sol";
import "./ERC20Detailed.sol";
...
@@ -12,11 +12,9 @@ import "./ERC20Pausable.sol";
...
@@ -12,11 +12,9 @@ import "./ERC20Pausable.sol";
*/
*/
contract StandaloneERC20 is Initializable, ERC20Detailed, ERC20Mintable, ERC20Pausable {
contract StandaloneERC20 is Initializable, ERC20Detailed, ERC20Mintable, ERC20Pausable {
function initialize(
function initialize(
string
name, string
symbol, uint8 decimals, uint256 initialSupply, address initialHolder,
string
memory name, string memory
symbol, uint8 decimals, uint256 initialSupply, address initialHolder,
address[] m
inters, address[]
pausers
address[] m
emory minters, address[] memory
pausers
) public initializer {
) public initializer {
require(initialSupply > 0);
ERC20Detailed.initialize(name, symbol, decimals);
ERC20Detailed.initialize(name, symbol, decimals);
// Mint the initial supply
// Mint the initial supply
...
@@ -35,13 +33,13 @@ contract StandaloneERC20 is Initializable, ERC20Detailed, ERC20Mintable, ERC20Pa
...
@@ -35,13 +33,13 @@ contract StandaloneERC20 is Initializable, ERC20Detailed, ERC20Mintable, ERC20Pa
_addMinter(minters[i]);
_addMinter(minters[i]);
}
}
for (i = 0; i < pausers.length; ++i) {
for (
uint256
i = 0; i < pausers.length; ++i) {
_addPauser(pausers[i]);
_addPauser(pausers[i]);
}
}
}
}
function initialize(
function initialize(
string
name, string symbol, uint8 decimals, address[] minters, address[]
pausers
string
memory name, string memory symbol, uint8 decimals, address[] memory minters, address[] memory
pausers
) public initializer {
) public initializer {
ERC20Detailed.initialize(name, symbol, decimals);
ERC20Detailed.initialize(name, symbol, decimals);
...
@@ -58,7 +56,7 @@ contract StandaloneERC20 is Initializable, ERC20Detailed, ERC20Mintable, ERC20Pa
...
@@ -58,7 +56,7 @@ contract StandaloneERC20 is Initializable, ERC20Detailed, ERC20Mintable, ERC20Pa
_addMinter(minters[i]);
_addMinter(minters[i]);
}
}
for (i = 0; i < pausers.length; ++i) {
for (
uint256
i = 0; i < pausers.length; ++i) {
_addPauser(pausers[i]);
_addPauser(pausers[i]);
}
}
}
}
...
...
contracts/token/ERC721/ERC721Enumerable.sol
View file @
877f07f0
...
@@ -37,11 +37,11 @@ contract ERC721Enumerable is Initializable, ERC165, ERC721, IERC721Enumerable {
...
@@ -37,11 +37,11 @@ contract ERC721Enumerable is Initializable, ERC165, ERC721, IERC721Enumerable {
require(ERC721._hasBeenInitialized());
require(ERC721._hasBeenInitialized());
// register the supported interface to conform to ERC721 via ERC165
// register the supported interface to conform to ERC721 via ERC165
_registerInterface(_I
nterfaceId_ERC721Enumerable
);
_registerInterface(_I
NTERFACE_ID_ERC721_ENUMERABLE
);
}
}
function _hasBeenInitialized() internal view returns (bool) {
function _hasBeenInitialized() internal view returns (bool) {
return supportsInterface(_I
nterfaceId_ERC721Enumerable
);
return supportsInterface(_I
NTERFACE_ID_ERC721_ENUMERABLE
);
}
}
/**
/**
...
...
contracts/token/ERC721/ERC721Metadata.sol
View file @
877f07f0
...
@@ -36,6 +36,9 @@ contract ERC721Metadata is Initializable, ERC165, ERC721, IERC721Metadata {
...
@@ -36,6 +36,9 @@ contract ERC721Metadata is Initializable, ERC165, ERC721, IERC721Metadata {
_registerInterface(_INTERFACE_ID_ERC721_METADATA);
_registerInterface(_INTERFACE_ID_ERC721_METADATA);
}
}
function _hasBeenInitialized() internal view returns (bool) {
return supportsInterface(_INTERFACE_ID_ERC721_METADATA);
}
/**
/**
* @dev Gets the token name
* @dev Gets the token name
* @return string representing the token name
* @return string representing the token name
...
...
contracts/token/ERC721/StandaloneERC721.sol
View file @
877f07f0
pragma solidity ^0.
4.24
;
pragma solidity ^0.
5.0
;
import "zos-lib/contracts/Initializable.sol";
import "zos-lib/contracts/Initializable.sol";
import "./ERC721.sol";
import "./ERC721.sol";
...
@@ -15,7 +15,7 @@ import "./ERC721Pausable.sol";
...
@@ -15,7 +15,7 @@ import "./ERC721Pausable.sol";
contract StandaloneERC721
contract StandaloneERC721
is Initializable, ERC721, ERC721Enumerable, ERC721Metadata, ERC721MetadataMintable, ERC721Pausable
is Initializable, ERC721, ERC721Enumerable, ERC721Metadata, ERC721MetadataMintable, ERC721Pausable
{
{
function initialize(string
name, string symbol, address[] minters, address[]
pausers) public initializer {
function initialize(string
memory name, string memory symbol, address[] memory minters, address[] memory
pausers) public initializer {
ERC721.initialize();
ERC721.initialize();
ERC721Enumerable.initialize();
ERC721Enumerable.initialize();
ERC721Metadata.initialize(name, symbol);
ERC721Metadata.initialize(name, symbol);
...
@@ -33,7 +33,7 @@ contract StandaloneERC721
...
@@ -33,7 +33,7 @@ contract StandaloneERC721
_addMinter(minters[i]);
_addMinter(minters[i]);
}
}
for (i = 0; i < pausers.length; ++i) {
for (
uint256
i = 0; i < pausers.length; ++i) {
_addPauser(pausers[i]);
_addPauser(pausers[i]);
}
}
}
}
...
...
package-lock.json
View file @
877f07f0
...
@@ -4900,10 +4900,18 @@
...
@@ -4900,10 +4900,18 @@
"integrity"
:
"sha512-VU6/DSUX93d1fCzBz7WP/SGCQizO1rKZi4Px9j/3yRyfssHyFcZamMw2/sj4E8TlfMXONvZLoforR8B4bRoyTQ=="
,
"integrity"
:
"sha512-VU6/DSUX93d1fCzBz7WP/SGCQizO1rKZi4Px9j/3yRyfssHyFcZamMw2/sj4E8TlfMXONvZLoforR8B4bRoyTQ=="
,
"dev"
:
true
,
"dev"
:
true
,
"requires"
:
{
"requires"
:
{
"bignumber.js"
:
"git+https://github.com/frozeman/bignumber.js-nolookahead.git#57692b3ecfc98bbdd6b3a516cb2353652ea49934"
,
"crypto-js"
:
"^3.1.4"
,
"crypto-js"
:
"^3.1.4"
,
"utf8"
:
"^2.1.1"
,
"utf8"
:
"^2.1.1"
,
"xhr2-cookies"
:
"^1.1.0"
,
"xhr2-cookies"
:
"^1.1.0"
,
"xmlhttprequest"
:
"*"
"xmlhttprequest"
:
"*"
},
"dependencies"
:
{
"bignumber.js"
:
{
"version"
:
"git+https://github.com/frozeman/bignumber.js-nolookahead.git#57692b3ecfc98bbdd6b3a516cb2353652ea49934"
,
"from"
:
"git+https://github.com/frozeman/bignumber.js-nolookahead.git"
,
"dev"
:
true
}
}
}
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment