diff --git a/contracts/crowdsale/validation/IndividuallyCappedCrowdsale.sol b/contracts/crowdsale/validation/IndividuallyCappedCrowdsale.sol index d2033984f..db088acd2 100644 --- a/contracts/crowdsale/validation/IndividuallyCappedCrowdsale.sol +++ b/contracts/crowdsale/validation/IndividuallyCappedCrowdsale.sol @@ -1,5 +1,6 @@ pragma solidity ^0.4.24; +import "../../Initializable.sol"; import "../../math/SafeMath.sol"; import "../Crowdsale.sol"; import "../../access/roles/CapperRole.sol"; @@ -9,12 +10,16 @@ import "../../access/roles/CapperRole.sol"; * @title IndividuallyCappedCrowdsale * @dev Crowdsale with per-beneficiary caps. */ -contract IndividuallyCappedCrowdsale is Crowdsale, CapperRole { +contract IndividuallyCappedCrowdsale is Initializable, Crowdsale, CapperRole { using SafeMath for uint256; mapping(address => uint256) private _contributions; mapping(address => uint256) private _caps; + function initialize() public initializer { + CapperRole.initialize(); + } + /** * @dev Sets a specific beneficiary's maximum contribution. * @param beneficiary Address to be capped diff --git a/contracts/mocks/IndividuallyCappedCrowdsaleImpl.sol b/contracts/mocks/IndividuallyCappedCrowdsaleImpl.sol index d47600f8d..cfcdfed3c 100644 --- a/contracts/mocks/IndividuallyCappedCrowdsaleImpl.sol +++ b/contracts/mocks/IndividuallyCappedCrowdsaleImpl.sol @@ -1,12 +1,13 @@ pragma solidity ^0.4.24; +import "../Initializable.sol"; import "../token/ERC20/IERC20.sol"; import "../crowdsale/validation/IndividuallyCappedCrowdsale.sol"; import "./CapperRoleMock.sol"; contract IndividuallyCappedCrowdsaleImpl - is IndividuallyCappedCrowdsale, CapperRoleMock { + is Initializable, Crowdsale, IndividuallyCappedCrowdsale, CapperRoleMock { constructor( uint256 rate, @@ -16,5 +17,7 @@ contract IndividuallyCappedCrowdsaleImpl public Crowdsale(rate, wallet, token) { + Crowdsale.initialize(rate, wallet, token); + IndividuallyCappedCrowdsale.initialize(); } } diff --git a/test/crowdsale/IndividuallyCappedCrowdsale.test.js b/test/crowdsale/IndividuallyCappedCrowdsale.test.js index 70c01a6b9..a416f2a5e 100644 --- a/test/crowdsale/IndividuallyCappedCrowdsale.test.js +++ b/test/crowdsale/IndividuallyCappedCrowdsale.test.js @@ -9,7 +9,7 @@ require('chai') .should(); const IndividuallyCappedCrowdsaleImpl = artifacts.require('IndividuallyCappedCrowdsaleImpl'); -const SimpleToken = artifacts.require('SimpleToken'); +const SimpleToken = artifacts.require('SimpleTokenMock'); const { shouldBehaveLikePublicRole } = require('../access/roles/PublicRole.behavior'); contract('IndividuallyCappedCrowdsale', function (