|
|
|
const { shouldBehaveLikeMintedCrowdsale } = require('./MintedCrowdsale.behavior');
|
|
|
|
const { ether } = require('../helpers/ether');
|
|
|
|
const { assertRevert } = require('../helpers/assertRevert');
|
Crowdsale refactor and add new models (#744)
* Basic idea
* Fine tuning idea
* Add comments / tidy up Crowdsale base class
* fixed TimedCrowdsale constructor
* added simple crowdsale test
* added HODL directory under home to store unused contracts. ugly hack to solve Crowdsale selection in tests, better way?
* Capped no longer inherits from Timed, added capReached() method (replacing hasEnded())
* added SafeMath in TimedCrowdsale for safety, CHECK whether it is inherited from Crowdsale
* several fixes related to separating Capped from Timed. functions renamed, mocks changed. Capped tests passing
* added TimedCrowdsaleImpl.sol, TimedCrowdsale tests, passed
* added Whitelisted implementation and test, passed.
* removed unnecessary super constructor call in WhitelistedCrowdsale, removed unused dependencies in tests
* renamed UserCappedCrowdsale to IndividuallyCappedCrowdsale, implemented IndividuallyCappedCrowdsaleImpl.sol and corresponding tests, passed.
* homogeneized use of using SafeMath for uint256 across validation crowdsales. checked that it IS indeed inherited, but leaving it there as per Frans suggestion.
* adding questions.md where I track questions, bugs and progress
* modified VariablePriceCrowdsale, added Impl.
* finished VariablePrice, fixed sign, added test, passing.
* changed VariablePrice to IncreasingPrice, added corresponding require()
* MintedCrowdsale done, mock implemented, test passing
* PremintedCrowdsale done, mocks, tests passing
* checked FinalizableCrowdsale
* PostDeliveryCrowdsale done, mock, tests passing.
* RefundableCrowdsale done. Detached Vault. modified mock and test, passing
* renamed crowdsale-refactor to crowdsale in contracts and test
* deleted HODL old contracts
* polished variable names in tests
* fixed typos and removed comments in tests
* Renamed 'crowdsale-refactor' to 'crowdsale' in all imports
* Fix minor param naming issues in Crowdsale functions and added documentation to Crowdsale.sol
* Added documentation to Crowdsale extensions
* removed residual comments and progress tracking files
* added docs for validation crowdsales
* Made user promises in PostDeliveryCrowdsale public so that users can query their promised token balance.
* added docs for distribution crowdsales
* renamed PremintedCrowdsale to AllowanceCrowdsale
* added allowance check function and corresponding test. fixed filename in AllowanceCrowdsale mock.
* spilt Crowdsale _postValidatePurchase in _postValidatePurchase and _updatePurchasingState. changed IndividuallyCappedCrowdsale accordingly.
* polished tests for linter, salve Travis
* polished IncreasingPriceCrowdsale.sol for linter.
* renamed and polished for linter WhitelistedCrowdsale test.
* fixed indentation in IncreasingPriceCrowdsaleImpl.sol for linter
* fixed ignoring token.mint return value in MintedCrowdsale.sol
* expanded docs throughout, fixed minor issues
* extended test coverage for IndividuallyCappedCrowdsale
* Extended WhitelistedCrwodsale test coverage
* roll back decoupling of RefundVault in RefundableCrowdsale
* moved cap exceedance checks in Capped and IndividuallyCapped crowdsales to _preValidatePurchase to save gas
* revert name change, IndividuallyCapped to UserCapped
* extended docs.
* added crowd whitelisting with tests
* added group capping, plus tests
* added modifiers in TimedCrowdsale and WhitelistedCrowdsale
* polished tests for linter
* moved check of whitelisted to modifier, mainly for testing coverage
* fixed minor ordering/polishingafter review
* modified TimedCrowdsale modifier/constructor ordering
* unchanged truffle-config.js
* changed indentation of visibility modifier in mocks
* changed naming of modifier and function to use Open/Closed for TimedCrowdsale
* changed ordering of constructor calls in SampleCrowdsale
* changed startTime and endTime to openingTime and closingTime throughout
* fixed exceeding line lenght for linter
* renamed _emitTokens to _deliverTokens
* renamed addCrowdToWhitelist to addManyToWhitelist
* renamed UserCappedCrowdsale to IndividuallyCappedCrowdsale
7 years ago
|
|
|
|
|
|
|
const BigNumber = web3.BigNumber;
|
|
|
|
|
|
|
|
const MintedCrowdsale = artifacts.require('MintedCrowdsaleImpl');
|
Rename ERC interfaces to I prefix (#1252)
* rename ERC20 to IERC20
* move ERC20.sol to IERC20.sol
* rename StandardToken to ERC20
* rename StandardTokenMock to ERC20Mock
* move StandardToken.sol to ERC20.sol, likewise test and mock files
* rename MintableToken to ERC20Mintable
* move MintableToken.sol to ERC20Mintable.sol, likewise test and mock files
* rename BurnableToken to ERC20Burnable
* move BurnableToken.sol to ERC20Burnable.sol, likewise for related files
* rename CappedToken to ERC20Capped
* move CappedToken.sol to ERC20Capped.sol, likewise for related files
* rename PausableToken to ERC20Pausable
* move PausableToken.sol to ERC20Pausable.sol, likewise for related files
* rename DetailedERC20 to ERC20Detailed
* move DetailedERC20.sol to ERC20Detailed.sol, likewise for related files
* rename ERC721 to IERC721, and likewise for other related interfaces
* move ERC721.sol to IERC721.sol, likewise for other 721 interfaces
* rename ERC721Token to ERC721
* move ERC721Token.sol to ERC721.sol, likewise for related files
* rename ERC721BasicToken to ERC721Basic
* move ERC721BasicToken.sol to ERC721Basic.sol, likewise for related files
* rename ERC721PausableToken to ERC721Pausable
* move ERC721PausableToken.sol to ERC721Pausable.sol
* rename ERC165 to IERC165
* move ERC165.sol to IERC165.sol
* amend comment that ERC20 is based on FirstBlood
* fix comments mentioning IERC721Receiver
7 years ago
|
|
|
const ERC20Mintable = artifacts.require('ERC20Mintable');
|
|
|
|
const RBACMintableToken = artifacts.require('RBACMintableToken');
|
Rename ERC interfaces to I prefix (#1252)
* rename ERC20 to IERC20
* move ERC20.sol to IERC20.sol
* rename StandardToken to ERC20
* rename StandardTokenMock to ERC20Mock
* move StandardToken.sol to ERC20.sol, likewise test and mock files
* rename MintableToken to ERC20Mintable
* move MintableToken.sol to ERC20Mintable.sol, likewise test and mock files
* rename BurnableToken to ERC20Burnable
* move BurnableToken.sol to ERC20Burnable.sol, likewise for related files
* rename CappedToken to ERC20Capped
* move CappedToken.sol to ERC20Capped.sol, likewise for related files
* rename PausableToken to ERC20Pausable
* move PausableToken.sol to ERC20Pausable.sol, likewise for related files
* rename DetailedERC20 to ERC20Detailed
* move DetailedERC20.sol to ERC20Detailed.sol, likewise for related files
* rename ERC721 to IERC721, and likewise for other related interfaces
* move ERC721.sol to IERC721.sol, likewise for other 721 interfaces
* rename ERC721Token to ERC721
* move ERC721Token.sol to ERC721.sol, likewise for related files
* rename ERC721BasicToken to ERC721Basic
* move ERC721BasicToken.sol to ERC721Basic.sol, likewise for related files
* rename ERC721PausableToken to ERC721Pausable
* move ERC721PausableToken.sol to ERC721Pausable.sol
* rename ERC165 to IERC165
* move ERC165.sol to IERC165.sol
* amend comment that ERC20 is based on FirstBlood
* fix comments mentioning IERC721Receiver
7 years ago
|
|
|
const ERC20 = artifacts.require('ERC20');
|
Crowdsale refactor and add new models (#744)
* Basic idea
* Fine tuning idea
* Add comments / tidy up Crowdsale base class
* fixed TimedCrowdsale constructor
* added simple crowdsale test
* added HODL directory under home to store unused contracts. ugly hack to solve Crowdsale selection in tests, better way?
* Capped no longer inherits from Timed, added capReached() method (replacing hasEnded())
* added SafeMath in TimedCrowdsale for safety, CHECK whether it is inherited from Crowdsale
* several fixes related to separating Capped from Timed. functions renamed, mocks changed. Capped tests passing
* added TimedCrowdsaleImpl.sol, TimedCrowdsale tests, passed
* added Whitelisted implementation and test, passed.
* removed unnecessary super constructor call in WhitelistedCrowdsale, removed unused dependencies in tests
* renamed UserCappedCrowdsale to IndividuallyCappedCrowdsale, implemented IndividuallyCappedCrowdsaleImpl.sol and corresponding tests, passed.
* homogeneized use of using SafeMath for uint256 across validation crowdsales. checked that it IS indeed inherited, but leaving it there as per Frans suggestion.
* adding questions.md where I track questions, bugs and progress
* modified VariablePriceCrowdsale, added Impl.
* finished VariablePrice, fixed sign, added test, passing.
* changed VariablePrice to IncreasingPrice, added corresponding require()
* MintedCrowdsale done, mock implemented, test passing
* PremintedCrowdsale done, mocks, tests passing
* checked FinalizableCrowdsale
* PostDeliveryCrowdsale done, mock, tests passing.
* RefundableCrowdsale done. Detached Vault. modified mock and test, passing
* renamed crowdsale-refactor to crowdsale in contracts and test
* deleted HODL old contracts
* polished variable names in tests
* fixed typos and removed comments in tests
* Renamed 'crowdsale-refactor' to 'crowdsale' in all imports
* Fix minor param naming issues in Crowdsale functions and added documentation to Crowdsale.sol
* Added documentation to Crowdsale extensions
* removed residual comments and progress tracking files
* added docs for validation crowdsales
* Made user promises in PostDeliveryCrowdsale public so that users can query their promised token balance.
* added docs for distribution crowdsales
* renamed PremintedCrowdsale to AllowanceCrowdsale
* added allowance check function and corresponding test. fixed filename in AllowanceCrowdsale mock.
* spilt Crowdsale _postValidatePurchase in _postValidatePurchase and _updatePurchasingState. changed IndividuallyCappedCrowdsale accordingly.
* polished tests for linter, salve Travis
* polished IncreasingPriceCrowdsale.sol for linter.
* renamed and polished for linter WhitelistedCrowdsale test.
* fixed indentation in IncreasingPriceCrowdsaleImpl.sol for linter
* fixed ignoring token.mint return value in MintedCrowdsale.sol
* expanded docs throughout, fixed minor issues
* extended test coverage for IndividuallyCappedCrowdsale
* Extended WhitelistedCrwodsale test coverage
* roll back decoupling of RefundVault in RefundableCrowdsale
* moved cap exceedance checks in Capped and IndividuallyCapped crowdsales to _preValidatePurchase to save gas
* revert name change, IndividuallyCapped to UserCapped
* extended docs.
* added crowd whitelisting with tests
* added group capping, plus tests
* added modifiers in TimedCrowdsale and WhitelistedCrowdsale
* polished tests for linter
* moved check of whitelisted to modifier, mainly for testing coverage
* fixed minor ordering/polishingafter review
* modified TimedCrowdsale modifier/constructor ordering
* unchanged truffle-config.js
* changed indentation of visibility modifier in mocks
* changed naming of modifier and function to use Open/Closed for TimedCrowdsale
* changed ordering of constructor calls in SampleCrowdsale
* changed startTime and endTime to openingTime and closingTime throughout
* fixed exceeding line lenght for linter
* renamed _emitTokens to _deliverTokens
* renamed addCrowdToWhitelist to addManyToWhitelist
* renamed UserCappedCrowdsale to IndividuallyCappedCrowdsale
7 years ago
|
|
|
|
|
|
|
contract('MintedCrowdsale', function ([_, investor, wallet, purchaser]) {
|
|
|
|
const rate = new BigNumber(1000);
|
|
|
|
const value = ether(5);
|
Crowdsale refactor and add new models (#744)
* Basic idea
* Fine tuning idea
* Add comments / tidy up Crowdsale base class
* fixed TimedCrowdsale constructor
* added simple crowdsale test
* added HODL directory under home to store unused contracts. ugly hack to solve Crowdsale selection in tests, better way?
* Capped no longer inherits from Timed, added capReached() method (replacing hasEnded())
* added SafeMath in TimedCrowdsale for safety, CHECK whether it is inherited from Crowdsale
* several fixes related to separating Capped from Timed. functions renamed, mocks changed. Capped tests passing
* added TimedCrowdsaleImpl.sol, TimedCrowdsale tests, passed
* added Whitelisted implementation and test, passed.
* removed unnecessary super constructor call in WhitelistedCrowdsale, removed unused dependencies in tests
* renamed UserCappedCrowdsale to IndividuallyCappedCrowdsale, implemented IndividuallyCappedCrowdsaleImpl.sol and corresponding tests, passed.
* homogeneized use of using SafeMath for uint256 across validation crowdsales. checked that it IS indeed inherited, but leaving it there as per Frans suggestion.
* adding questions.md where I track questions, bugs and progress
* modified VariablePriceCrowdsale, added Impl.
* finished VariablePrice, fixed sign, added test, passing.
* changed VariablePrice to IncreasingPrice, added corresponding require()
* MintedCrowdsale done, mock implemented, test passing
* PremintedCrowdsale done, mocks, tests passing
* checked FinalizableCrowdsale
* PostDeliveryCrowdsale done, mock, tests passing.
* RefundableCrowdsale done. Detached Vault. modified mock and test, passing
* renamed crowdsale-refactor to crowdsale in contracts and test
* deleted HODL old contracts
* polished variable names in tests
* fixed typos and removed comments in tests
* Renamed 'crowdsale-refactor' to 'crowdsale' in all imports
* Fix minor param naming issues in Crowdsale functions and added documentation to Crowdsale.sol
* Added documentation to Crowdsale extensions
* removed residual comments and progress tracking files
* added docs for validation crowdsales
* Made user promises in PostDeliveryCrowdsale public so that users can query their promised token balance.
* added docs for distribution crowdsales
* renamed PremintedCrowdsale to AllowanceCrowdsale
* added allowance check function and corresponding test. fixed filename in AllowanceCrowdsale mock.
* spilt Crowdsale _postValidatePurchase in _postValidatePurchase and _updatePurchasingState. changed IndividuallyCappedCrowdsale accordingly.
* polished tests for linter, salve Travis
* polished IncreasingPriceCrowdsale.sol for linter.
* renamed and polished for linter WhitelistedCrowdsale test.
* fixed indentation in IncreasingPriceCrowdsaleImpl.sol for linter
* fixed ignoring token.mint return value in MintedCrowdsale.sol
* expanded docs throughout, fixed minor issues
* extended test coverage for IndividuallyCappedCrowdsale
* Extended WhitelistedCrwodsale test coverage
* roll back decoupling of RefundVault in RefundableCrowdsale
* moved cap exceedance checks in Capped and IndividuallyCapped crowdsales to _preValidatePurchase to save gas
* revert name change, IndividuallyCapped to UserCapped
* extended docs.
* added crowd whitelisting with tests
* added group capping, plus tests
* added modifiers in TimedCrowdsale and WhitelistedCrowdsale
* polished tests for linter
* moved check of whitelisted to modifier, mainly for testing coverage
* fixed minor ordering/polishingafter review
* modified TimedCrowdsale modifier/constructor ordering
* unchanged truffle-config.js
* changed indentation of visibility modifier in mocks
* changed naming of modifier and function to use Open/Closed for TimedCrowdsale
* changed ordering of constructor calls in SampleCrowdsale
* changed startTime and endTime to openingTime and closingTime throughout
* fixed exceeding line lenght for linter
* renamed _emitTokens to _deliverTokens
* renamed addCrowdToWhitelist to addManyToWhitelist
* renamed UserCappedCrowdsale to IndividuallyCappedCrowdsale
7 years ago
|
|
|
|
Rename ERC interfaces to I prefix (#1252)
* rename ERC20 to IERC20
* move ERC20.sol to IERC20.sol
* rename StandardToken to ERC20
* rename StandardTokenMock to ERC20Mock
* move StandardToken.sol to ERC20.sol, likewise test and mock files
* rename MintableToken to ERC20Mintable
* move MintableToken.sol to ERC20Mintable.sol, likewise test and mock files
* rename BurnableToken to ERC20Burnable
* move BurnableToken.sol to ERC20Burnable.sol, likewise for related files
* rename CappedToken to ERC20Capped
* move CappedToken.sol to ERC20Capped.sol, likewise for related files
* rename PausableToken to ERC20Pausable
* move PausableToken.sol to ERC20Pausable.sol, likewise for related files
* rename DetailedERC20 to ERC20Detailed
* move DetailedERC20.sol to ERC20Detailed.sol, likewise for related files
* rename ERC721 to IERC721, and likewise for other related interfaces
* move ERC721.sol to IERC721.sol, likewise for other 721 interfaces
* rename ERC721Token to ERC721
* move ERC721Token.sol to ERC721.sol, likewise for related files
* rename ERC721BasicToken to ERC721Basic
* move ERC721BasicToken.sol to ERC721Basic.sol, likewise for related files
* rename ERC721PausableToken to ERC721Pausable
* move ERC721PausableToken.sol to ERC721Pausable.sol
* rename ERC165 to IERC165
* move ERC165.sol to IERC165.sol
* amend comment that ERC20 is based on FirstBlood
* fix comments mentioning IERC721Receiver
7 years ago
|
|
|
describe('using ERC20Mintable', function () {
|
|
|
|
beforeEach(async function () {
|
Rename ERC interfaces to I prefix (#1252)
* rename ERC20 to IERC20
* move ERC20.sol to IERC20.sol
* rename StandardToken to ERC20
* rename StandardTokenMock to ERC20Mock
* move StandardToken.sol to ERC20.sol, likewise test and mock files
* rename MintableToken to ERC20Mintable
* move MintableToken.sol to ERC20Mintable.sol, likewise test and mock files
* rename BurnableToken to ERC20Burnable
* move BurnableToken.sol to ERC20Burnable.sol, likewise for related files
* rename CappedToken to ERC20Capped
* move CappedToken.sol to ERC20Capped.sol, likewise for related files
* rename PausableToken to ERC20Pausable
* move PausableToken.sol to ERC20Pausable.sol, likewise for related files
* rename DetailedERC20 to ERC20Detailed
* move DetailedERC20.sol to ERC20Detailed.sol, likewise for related files
* rename ERC721 to IERC721, and likewise for other related interfaces
* move ERC721.sol to IERC721.sol, likewise for other 721 interfaces
* rename ERC721Token to ERC721
* move ERC721Token.sol to ERC721.sol, likewise for related files
* rename ERC721BasicToken to ERC721Basic
* move ERC721BasicToken.sol to ERC721Basic.sol, likewise for related files
* rename ERC721PausableToken to ERC721Pausable
* move ERC721PausableToken.sol to ERC721Pausable.sol
* rename ERC165 to IERC165
* move ERC165.sol to IERC165.sol
* amend comment that ERC20 is based on FirstBlood
* fix comments mentioning IERC721Receiver
7 years ago
|
|
|
this.token = await ERC20Mintable.new();
|
|
|
|
this.crowdsale = await MintedCrowdsale.new(rate, wallet, this.token.address);
|
|
|
|
await this.token.transferOwnership(this.crowdsale.address);
|
|
|
|
});
|
Crowdsale refactor and add new models (#744)
* Basic idea
* Fine tuning idea
* Add comments / tidy up Crowdsale base class
* fixed TimedCrowdsale constructor
* added simple crowdsale test
* added HODL directory under home to store unused contracts. ugly hack to solve Crowdsale selection in tests, better way?
* Capped no longer inherits from Timed, added capReached() method (replacing hasEnded())
* added SafeMath in TimedCrowdsale for safety, CHECK whether it is inherited from Crowdsale
* several fixes related to separating Capped from Timed. functions renamed, mocks changed. Capped tests passing
* added TimedCrowdsaleImpl.sol, TimedCrowdsale tests, passed
* added Whitelisted implementation and test, passed.
* removed unnecessary super constructor call in WhitelistedCrowdsale, removed unused dependencies in tests
* renamed UserCappedCrowdsale to IndividuallyCappedCrowdsale, implemented IndividuallyCappedCrowdsaleImpl.sol and corresponding tests, passed.
* homogeneized use of using SafeMath for uint256 across validation crowdsales. checked that it IS indeed inherited, but leaving it there as per Frans suggestion.
* adding questions.md where I track questions, bugs and progress
* modified VariablePriceCrowdsale, added Impl.
* finished VariablePrice, fixed sign, added test, passing.
* changed VariablePrice to IncreasingPrice, added corresponding require()
* MintedCrowdsale done, mock implemented, test passing
* PremintedCrowdsale done, mocks, tests passing
* checked FinalizableCrowdsale
* PostDeliveryCrowdsale done, mock, tests passing.
* RefundableCrowdsale done. Detached Vault. modified mock and test, passing
* renamed crowdsale-refactor to crowdsale in contracts and test
* deleted HODL old contracts
* polished variable names in tests
* fixed typos and removed comments in tests
* Renamed 'crowdsale-refactor' to 'crowdsale' in all imports
* Fix minor param naming issues in Crowdsale functions and added documentation to Crowdsale.sol
* Added documentation to Crowdsale extensions
* removed residual comments and progress tracking files
* added docs for validation crowdsales
* Made user promises in PostDeliveryCrowdsale public so that users can query their promised token balance.
* added docs for distribution crowdsales
* renamed PremintedCrowdsale to AllowanceCrowdsale
* added allowance check function and corresponding test. fixed filename in AllowanceCrowdsale mock.
* spilt Crowdsale _postValidatePurchase in _postValidatePurchase and _updatePurchasingState. changed IndividuallyCappedCrowdsale accordingly.
* polished tests for linter, salve Travis
* polished IncreasingPriceCrowdsale.sol for linter.
* renamed and polished for linter WhitelistedCrowdsale test.
* fixed indentation in IncreasingPriceCrowdsaleImpl.sol for linter
* fixed ignoring token.mint return value in MintedCrowdsale.sol
* expanded docs throughout, fixed minor issues
* extended test coverage for IndividuallyCappedCrowdsale
* Extended WhitelistedCrwodsale test coverage
* roll back decoupling of RefundVault in RefundableCrowdsale
* moved cap exceedance checks in Capped and IndividuallyCapped crowdsales to _preValidatePurchase to save gas
* revert name change, IndividuallyCapped to UserCapped
* extended docs.
* added crowd whitelisting with tests
* added group capping, plus tests
* added modifiers in TimedCrowdsale and WhitelistedCrowdsale
* polished tests for linter
* moved check of whitelisted to modifier, mainly for testing coverage
* fixed minor ordering/polishingafter review
* modified TimedCrowdsale modifier/constructor ordering
* unchanged truffle-config.js
* changed indentation of visibility modifier in mocks
* changed naming of modifier and function to use Open/Closed for TimedCrowdsale
* changed ordering of constructor calls in SampleCrowdsale
* changed startTime and endTime to openingTime and closingTime throughout
* fixed exceeding line lenght for linter
* renamed _emitTokens to _deliverTokens
* renamed addCrowdToWhitelist to addManyToWhitelist
* renamed UserCappedCrowdsale to IndividuallyCappedCrowdsale
7 years ago
|
|
|
|
|
|
|
it('should be token owner', async function () {
|
|
|
|
(await this.token.owner()).should.equal(this.crowdsale.address);
|
Crowdsale refactor and add new models (#744)
* Basic idea
* Fine tuning idea
* Add comments / tidy up Crowdsale base class
* fixed TimedCrowdsale constructor
* added simple crowdsale test
* added HODL directory under home to store unused contracts. ugly hack to solve Crowdsale selection in tests, better way?
* Capped no longer inherits from Timed, added capReached() method (replacing hasEnded())
* added SafeMath in TimedCrowdsale for safety, CHECK whether it is inherited from Crowdsale
* several fixes related to separating Capped from Timed. functions renamed, mocks changed. Capped tests passing
* added TimedCrowdsaleImpl.sol, TimedCrowdsale tests, passed
* added Whitelisted implementation and test, passed.
* removed unnecessary super constructor call in WhitelistedCrowdsale, removed unused dependencies in tests
* renamed UserCappedCrowdsale to IndividuallyCappedCrowdsale, implemented IndividuallyCappedCrowdsaleImpl.sol and corresponding tests, passed.
* homogeneized use of using SafeMath for uint256 across validation crowdsales. checked that it IS indeed inherited, but leaving it there as per Frans suggestion.
* adding questions.md where I track questions, bugs and progress
* modified VariablePriceCrowdsale, added Impl.
* finished VariablePrice, fixed sign, added test, passing.
* changed VariablePrice to IncreasingPrice, added corresponding require()
* MintedCrowdsale done, mock implemented, test passing
* PremintedCrowdsale done, mocks, tests passing
* checked FinalizableCrowdsale
* PostDeliveryCrowdsale done, mock, tests passing.
* RefundableCrowdsale done. Detached Vault. modified mock and test, passing
* renamed crowdsale-refactor to crowdsale in contracts and test
* deleted HODL old contracts
* polished variable names in tests
* fixed typos and removed comments in tests
* Renamed 'crowdsale-refactor' to 'crowdsale' in all imports
* Fix minor param naming issues in Crowdsale functions and added documentation to Crowdsale.sol
* Added documentation to Crowdsale extensions
* removed residual comments and progress tracking files
* added docs for validation crowdsales
* Made user promises in PostDeliveryCrowdsale public so that users can query their promised token balance.
* added docs for distribution crowdsales
* renamed PremintedCrowdsale to AllowanceCrowdsale
* added allowance check function and corresponding test. fixed filename in AllowanceCrowdsale mock.
* spilt Crowdsale _postValidatePurchase in _postValidatePurchase and _updatePurchasingState. changed IndividuallyCappedCrowdsale accordingly.
* polished tests for linter, salve Travis
* polished IncreasingPriceCrowdsale.sol for linter.
* renamed and polished for linter WhitelistedCrowdsale test.
* fixed indentation in IncreasingPriceCrowdsaleImpl.sol for linter
* fixed ignoring token.mint return value in MintedCrowdsale.sol
* expanded docs throughout, fixed minor issues
* extended test coverage for IndividuallyCappedCrowdsale
* Extended WhitelistedCrwodsale test coverage
* roll back decoupling of RefundVault in RefundableCrowdsale
* moved cap exceedance checks in Capped and IndividuallyCapped crowdsales to _preValidatePurchase to save gas
* revert name change, IndividuallyCapped to UserCapped
* extended docs.
* added crowd whitelisting with tests
* added group capping, plus tests
* added modifiers in TimedCrowdsale and WhitelistedCrowdsale
* polished tests for linter
* moved check of whitelisted to modifier, mainly for testing coverage
* fixed minor ordering/polishingafter review
* modified TimedCrowdsale modifier/constructor ordering
* unchanged truffle-config.js
* changed indentation of visibility modifier in mocks
* changed naming of modifier and function to use Open/Closed for TimedCrowdsale
* changed ordering of constructor calls in SampleCrowdsale
* changed startTime and endTime to openingTime and closingTime throughout
* fixed exceeding line lenght for linter
* renamed _emitTokens to _deliverTokens
* renamed addCrowdToWhitelist to addManyToWhitelist
* renamed UserCappedCrowdsale to IndividuallyCappedCrowdsale
7 years ago
|
|
|
});
|
|
|
|
|
|
|
|
shouldBehaveLikeMintedCrowdsale([_, investor, wallet, purchaser], rate, value);
|
Crowdsale refactor and add new models (#744)
* Basic idea
* Fine tuning idea
* Add comments / tidy up Crowdsale base class
* fixed TimedCrowdsale constructor
* added simple crowdsale test
* added HODL directory under home to store unused contracts. ugly hack to solve Crowdsale selection in tests, better way?
* Capped no longer inherits from Timed, added capReached() method (replacing hasEnded())
* added SafeMath in TimedCrowdsale for safety, CHECK whether it is inherited from Crowdsale
* several fixes related to separating Capped from Timed. functions renamed, mocks changed. Capped tests passing
* added TimedCrowdsaleImpl.sol, TimedCrowdsale tests, passed
* added Whitelisted implementation and test, passed.
* removed unnecessary super constructor call in WhitelistedCrowdsale, removed unused dependencies in tests
* renamed UserCappedCrowdsale to IndividuallyCappedCrowdsale, implemented IndividuallyCappedCrowdsaleImpl.sol and corresponding tests, passed.
* homogeneized use of using SafeMath for uint256 across validation crowdsales. checked that it IS indeed inherited, but leaving it there as per Frans suggestion.
* adding questions.md where I track questions, bugs and progress
* modified VariablePriceCrowdsale, added Impl.
* finished VariablePrice, fixed sign, added test, passing.
* changed VariablePrice to IncreasingPrice, added corresponding require()
* MintedCrowdsale done, mock implemented, test passing
* PremintedCrowdsale done, mocks, tests passing
* checked FinalizableCrowdsale
* PostDeliveryCrowdsale done, mock, tests passing.
* RefundableCrowdsale done. Detached Vault. modified mock and test, passing
* renamed crowdsale-refactor to crowdsale in contracts and test
* deleted HODL old contracts
* polished variable names in tests
* fixed typos and removed comments in tests
* Renamed 'crowdsale-refactor' to 'crowdsale' in all imports
* Fix minor param naming issues in Crowdsale functions and added documentation to Crowdsale.sol
* Added documentation to Crowdsale extensions
* removed residual comments and progress tracking files
* added docs for validation crowdsales
* Made user promises in PostDeliveryCrowdsale public so that users can query their promised token balance.
* added docs for distribution crowdsales
* renamed PremintedCrowdsale to AllowanceCrowdsale
* added allowance check function and corresponding test. fixed filename in AllowanceCrowdsale mock.
* spilt Crowdsale _postValidatePurchase in _postValidatePurchase and _updatePurchasingState. changed IndividuallyCappedCrowdsale accordingly.
* polished tests for linter, salve Travis
* polished IncreasingPriceCrowdsale.sol for linter.
* renamed and polished for linter WhitelistedCrowdsale test.
* fixed indentation in IncreasingPriceCrowdsaleImpl.sol for linter
* fixed ignoring token.mint return value in MintedCrowdsale.sol
* expanded docs throughout, fixed minor issues
* extended test coverage for IndividuallyCappedCrowdsale
* Extended WhitelistedCrwodsale test coverage
* roll back decoupling of RefundVault in RefundableCrowdsale
* moved cap exceedance checks in Capped and IndividuallyCapped crowdsales to _preValidatePurchase to save gas
* revert name change, IndividuallyCapped to UserCapped
* extended docs.
* added crowd whitelisting with tests
* added group capping, plus tests
* added modifiers in TimedCrowdsale and WhitelistedCrowdsale
* polished tests for linter
* moved check of whitelisted to modifier, mainly for testing coverage
* fixed minor ordering/polishingafter review
* modified TimedCrowdsale modifier/constructor ordering
* unchanged truffle-config.js
* changed indentation of visibility modifier in mocks
* changed naming of modifier and function to use Open/Closed for TimedCrowdsale
* changed ordering of constructor calls in SampleCrowdsale
* changed startTime and endTime to openingTime and closingTime throughout
* fixed exceeding line lenght for linter
* renamed _emitTokens to _deliverTokens
* renamed addCrowdToWhitelist to addManyToWhitelist
* renamed UserCappedCrowdsale to IndividuallyCappedCrowdsale
7 years ago
|
|
|
});
|
|
|
|
|
|
|
|
describe('using RBACMintableToken', function () {
|
|
|
|
const ROLE_MINTER = 'minter';
|
Crowdsale refactor and add new models (#744)
* Basic idea
* Fine tuning idea
* Add comments / tidy up Crowdsale base class
* fixed TimedCrowdsale constructor
* added simple crowdsale test
* added HODL directory under home to store unused contracts. ugly hack to solve Crowdsale selection in tests, better way?
* Capped no longer inherits from Timed, added capReached() method (replacing hasEnded())
* added SafeMath in TimedCrowdsale for safety, CHECK whether it is inherited from Crowdsale
* several fixes related to separating Capped from Timed. functions renamed, mocks changed. Capped tests passing
* added TimedCrowdsaleImpl.sol, TimedCrowdsale tests, passed
* added Whitelisted implementation and test, passed.
* removed unnecessary super constructor call in WhitelistedCrowdsale, removed unused dependencies in tests
* renamed UserCappedCrowdsale to IndividuallyCappedCrowdsale, implemented IndividuallyCappedCrowdsaleImpl.sol and corresponding tests, passed.
* homogeneized use of using SafeMath for uint256 across validation crowdsales. checked that it IS indeed inherited, but leaving it there as per Frans suggestion.
* adding questions.md where I track questions, bugs and progress
* modified VariablePriceCrowdsale, added Impl.
* finished VariablePrice, fixed sign, added test, passing.
* changed VariablePrice to IncreasingPrice, added corresponding require()
* MintedCrowdsale done, mock implemented, test passing
* PremintedCrowdsale done, mocks, tests passing
* checked FinalizableCrowdsale
* PostDeliveryCrowdsale done, mock, tests passing.
* RefundableCrowdsale done. Detached Vault. modified mock and test, passing
* renamed crowdsale-refactor to crowdsale in contracts and test
* deleted HODL old contracts
* polished variable names in tests
* fixed typos and removed comments in tests
* Renamed 'crowdsale-refactor' to 'crowdsale' in all imports
* Fix minor param naming issues in Crowdsale functions and added documentation to Crowdsale.sol
* Added documentation to Crowdsale extensions
* removed residual comments and progress tracking files
* added docs for validation crowdsales
* Made user promises in PostDeliveryCrowdsale public so that users can query their promised token balance.
* added docs for distribution crowdsales
* renamed PremintedCrowdsale to AllowanceCrowdsale
* added allowance check function and corresponding test. fixed filename in AllowanceCrowdsale mock.
* spilt Crowdsale _postValidatePurchase in _postValidatePurchase and _updatePurchasingState. changed IndividuallyCappedCrowdsale accordingly.
* polished tests for linter, salve Travis
* polished IncreasingPriceCrowdsale.sol for linter.
* renamed and polished for linter WhitelistedCrowdsale test.
* fixed indentation in IncreasingPriceCrowdsaleImpl.sol for linter
* fixed ignoring token.mint return value in MintedCrowdsale.sol
* expanded docs throughout, fixed minor issues
* extended test coverage for IndividuallyCappedCrowdsale
* Extended WhitelistedCrwodsale test coverage
* roll back decoupling of RefundVault in RefundableCrowdsale
* moved cap exceedance checks in Capped and IndividuallyCapped crowdsales to _preValidatePurchase to save gas
* revert name change, IndividuallyCapped to UserCapped
* extended docs.
* added crowd whitelisting with tests
* added group capping, plus tests
* added modifiers in TimedCrowdsale and WhitelistedCrowdsale
* polished tests for linter
* moved check of whitelisted to modifier, mainly for testing coverage
* fixed minor ordering/polishingafter review
* modified TimedCrowdsale modifier/constructor ordering
* unchanged truffle-config.js
* changed indentation of visibility modifier in mocks
* changed naming of modifier and function to use Open/Closed for TimedCrowdsale
* changed ordering of constructor calls in SampleCrowdsale
* changed startTime and endTime to openingTime and closingTime throughout
* fixed exceeding line lenght for linter
* renamed _emitTokens to _deliverTokens
* renamed addCrowdToWhitelist to addManyToWhitelist
* renamed UserCappedCrowdsale to IndividuallyCappedCrowdsale
7 years ago
|
|
|
|
|
|
|
beforeEach(async function () {
|
|
|
|
this.token = await RBACMintableToken.new();
|
|
|
|
this.crowdsale = await MintedCrowdsale.new(rate, wallet, this.token.address);
|
|
|
|
await this.token.addMinter(this.crowdsale.address);
|
Crowdsale refactor and add new models (#744)
* Basic idea
* Fine tuning idea
* Add comments / tidy up Crowdsale base class
* fixed TimedCrowdsale constructor
* added simple crowdsale test
* added HODL directory under home to store unused contracts. ugly hack to solve Crowdsale selection in tests, better way?
* Capped no longer inherits from Timed, added capReached() method (replacing hasEnded())
* added SafeMath in TimedCrowdsale for safety, CHECK whether it is inherited from Crowdsale
* several fixes related to separating Capped from Timed. functions renamed, mocks changed. Capped tests passing
* added TimedCrowdsaleImpl.sol, TimedCrowdsale tests, passed
* added Whitelisted implementation and test, passed.
* removed unnecessary super constructor call in WhitelistedCrowdsale, removed unused dependencies in tests
* renamed UserCappedCrowdsale to IndividuallyCappedCrowdsale, implemented IndividuallyCappedCrowdsaleImpl.sol and corresponding tests, passed.
* homogeneized use of using SafeMath for uint256 across validation crowdsales. checked that it IS indeed inherited, but leaving it there as per Frans suggestion.
* adding questions.md where I track questions, bugs and progress
* modified VariablePriceCrowdsale, added Impl.
* finished VariablePrice, fixed sign, added test, passing.
* changed VariablePrice to IncreasingPrice, added corresponding require()
* MintedCrowdsale done, mock implemented, test passing
* PremintedCrowdsale done, mocks, tests passing
* checked FinalizableCrowdsale
* PostDeliveryCrowdsale done, mock, tests passing.
* RefundableCrowdsale done. Detached Vault. modified mock and test, passing
* renamed crowdsale-refactor to crowdsale in contracts and test
* deleted HODL old contracts
* polished variable names in tests
* fixed typos and removed comments in tests
* Renamed 'crowdsale-refactor' to 'crowdsale' in all imports
* Fix minor param naming issues in Crowdsale functions and added documentation to Crowdsale.sol
* Added documentation to Crowdsale extensions
* removed residual comments and progress tracking files
* added docs for validation crowdsales
* Made user promises in PostDeliveryCrowdsale public so that users can query their promised token balance.
* added docs for distribution crowdsales
* renamed PremintedCrowdsale to AllowanceCrowdsale
* added allowance check function and corresponding test. fixed filename in AllowanceCrowdsale mock.
* spilt Crowdsale _postValidatePurchase in _postValidatePurchase and _updatePurchasingState. changed IndividuallyCappedCrowdsale accordingly.
* polished tests for linter, salve Travis
* polished IncreasingPriceCrowdsale.sol for linter.
* renamed and polished for linter WhitelistedCrowdsale test.
* fixed indentation in IncreasingPriceCrowdsaleImpl.sol for linter
* fixed ignoring token.mint return value in MintedCrowdsale.sol
* expanded docs throughout, fixed minor issues
* extended test coverage for IndividuallyCappedCrowdsale
* Extended WhitelistedCrwodsale test coverage
* roll back decoupling of RefundVault in RefundableCrowdsale
* moved cap exceedance checks in Capped and IndividuallyCapped crowdsales to _preValidatePurchase to save gas
* revert name change, IndividuallyCapped to UserCapped
* extended docs.
* added crowd whitelisting with tests
* added group capping, plus tests
* added modifiers in TimedCrowdsale and WhitelistedCrowdsale
* polished tests for linter
* moved check of whitelisted to modifier, mainly for testing coverage
* fixed minor ordering/polishingafter review
* modified TimedCrowdsale modifier/constructor ordering
* unchanged truffle-config.js
* changed indentation of visibility modifier in mocks
* changed naming of modifier and function to use Open/Closed for TimedCrowdsale
* changed ordering of constructor calls in SampleCrowdsale
* changed startTime and endTime to openingTime and closingTime throughout
* fixed exceeding line lenght for linter
* renamed _emitTokens to _deliverTokens
* renamed addCrowdToWhitelist to addManyToWhitelist
* renamed UserCappedCrowdsale to IndividuallyCappedCrowdsale
7 years ago
|
|
|
});
|
|
|
|
|
|
|
|
it('should have minter role on token', async function () {
|
|
|
|
(await this.token.hasRole(this.crowdsale.address, ROLE_MINTER)).should.equal(true);
|
Crowdsale refactor and add new models (#744)
* Basic idea
* Fine tuning idea
* Add comments / tidy up Crowdsale base class
* fixed TimedCrowdsale constructor
* added simple crowdsale test
* added HODL directory under home to store unused contracts. ugly hack to solve Crowdsale selection in tests, better way?
* Capped no longer inherits from Timed, added capReached() method (replacing hasEnded())
* added SafeMath in TimedCrowdsale for safety, CHECK whether it is inherited from Crowdsale
* several fixes related to separating Capped from Timed. functions renamed, mocks changed. Capped tests passing
* added TimedCrowdsaleImpl.sol, TimedCrowdsale tests, passed
* added Whitelisted implementation and test, passed.
* removed unnecessary super constructor call in WhitelistedCrowdsale, removed unused dependencies in tests
* renamed UserCappedCrowdsale to IndividuallyCappedCrowdsale, implemented IndividuallyCappedCrowdsaleImpl.sol and corresponding tests, passed.
* homogeneized use of using SafeMath for uint256 across validation crowdsales. checked that it IS indeed inherited, but leaving it there as per Frans suggestion.
* adding questions.md where I track questions, bugs and progress
* modified VariablePriceCrowdsale, added Impl.
* finished VariablePrice, fixed sign, added test, passing.
* changed VariablePrice to IncreasingPrice, added corresponding require()
* MintedCrowdsale done, mock implemented, test passing
* PremintedCrowdsale done, mocks, tests passing
* checked FinalizableCrowdsale
* PostDeliveryCrowdsale done, mock, tests passing.
* RefundableCrowdsale done. Detached Vault. modified mock and test, passing
* renamed crowdsale-refactor to crowdsale in contracts and test
* deleted HODL old contracts
* polished variable names in tests
* fixed typos and removed comments in tests
* Renamed 'crowdsale-refactor' to 'crowdsale' in all imports
* Fix minor param naming issues in Crowdsale functions and added documentation to Crowdsale.sol
* Added documentation to Crowdsale extensions
* removed residual comments and progress tracking files
* added docs for validation crowdsales
* Made user promises in PostDeliveryCrowdsale public so that users can query their promised token balance.
* added docs for distribution crowdsales
* renamed PremintedCrowdsale to AllowanceCrowdsale
* added allowance check function and corresponding test. fixed filename in AllowanceCrowdsale mock.
* spilt Crowdsale _postValidatePurchase in _postValidatePurchase and _updatePurchasingState. changed IndividuallyCappedCrowdsale accordingly.
* polished tests for linter, salve Travis
* polished IncreasingPriceCrowdsale.sol for linter.
* renamed and polished for linter WhitelistedCrowdsale test.
* fixed indentation in IncreasingPriceCrowdsaleImpl.sol for linter
* fixed ignoring token.mint return value in MintedCrowdsale.sol
* expanded docs throughout, fixed minor issues
* extended test coverage for IndividuallyCappedCrowdsale
* Extended WhitelistedCrwodsale test coverage
* roll back decoupling of RefundVault in RefundableCrowdsale
* moved cap exceedance checks in Capped and IndividuallyCapped crowdsales to _preValidatePurchase to save gas
* revert name change, IndividuallyCapped to UserCapped
* extended docs.
* added crowd whitelisting with tests
* added group capping, plus tests
* added modifiers in TimedCrowdsale and WhitelistedCrowdsale
* polished tests for linter
* moved check of whitelisted to modifier, mainly for testing coverage
* fixed minor ordering/polishingafter review
* modified TimedCrowdsale modifier/constructor ordering
* unchanged truffle-config.js
* changed indentation of visibility modifier in mocks
* changed naming of modifier and function to use Open/Closed for TimedCrowdsale
* changed ordering of constructor calls in SampleCrowdsale
* changed startTime and endTime to openingTime and closingTime throughout
* fixed exceeding line lenght for linter
* renamed _emitTokens to _deliverTokens
* renamed addCrowdToWhitelist to addManyToWhitelist
* renamed UserCappedCrowdsale to IndividuallyCappedCrowdsale
7 years ago
|
|
|
});
|
|
|
|
|
|
|
|
shouldBehaveLikeMintedCrowdsale([_, investor, wallet, purchaser], rate, value);
|
Crowdsale refactor and add new models (#744)
* Basic idea
* Fine tuning idea
* Add comments / tidy up Crowdsale base class
* fixed TimedCrowdsale constructor
* added simple crowdsale test
* added HODL directory under home to store unused contracts. ugly hack to solve Crowdsale selection in tests, better way?
* Capped no longer inherits from Timed, added capReached() method (replacing hasEnded())
* added SafeMath in TimedCrowdsale for safety, CHECK whether it is inherited from Crowdsale
* several fixes related to separating Capped from Timed. functions renamed, mocks changed. Capped tests passing
* added TimedCrowdsaleImpl.sol, TimedCrowdsale tests, passed
* added Whitelisted implementation and test, passed.
* removed unnecessary super constructor call in WhitelistedCrowdsale, removed unused dependencies in tests
* renamed UserCappedCrowdsale to IndividuallyCappedCrowdsale, implemented IndividuallyCappedCrowdsaleImpl.sol and corresponding tests, passed.
* homogeneized use of using SafeMath for uint256 across validation crowdsales. checked that it IS indeed inherited, but leaving it there as per Frans suggestion.
* adding questions.md where I track questions, bugs and progress
* modified VariablePriceCrowdsale, added Impl.
* finished VariablePrice, fixed sign, added test, passing.
* changed VariablePrice to IncreasingPrice, added corresponding require()
* MintedCrowdsale done, mock implemented, test passing
* PremintedCrowdsale done, mocks, tests passing
* checked FinalizableCrowdsale
* PostDeliveryCrowdsale done, mock, tests passing.
* RefundableCrowdsale done. Detached Vault. modified mock and test, passing
* renamed crowdsale-refactor to crowdsale in contracts and test
* deleted HODL old contracts
* polished variable names in tests
* fixed typos and removed comments in tests
* Renamed 'crowdsale-refactor' to 'crowdsale' in all imports
* Fix minor param naming issues in Crowdsale functions and added documentation to Crowdsale.sol
* Added documentation to Crowdsale extensions
* removed residual comments and progress tracking files
* added docs for validation crowdsales
* Made user promises in PostDeliveryCrowdsale public so that users can query their promised token balance.
* added docs for distribution crowdsales
* renamed PremintedCrowdsale to AllowanceCrowdsale
* added allowance check function and corresponding test. fixed filename in AllowanceCrowdsale mock.
* spilt Crowdsale _postValidatePurchase in _postValidatePurchase and _updatePurchasingState. changed IndividuallyCappedCrowdsale accordingly.
* polished tests for linter, salve Travis
* polished IncreasingPriceCrowdsale.sol for linter.
* renamed and polished for linter WhitelistedCrowdsale test.
* fixed indentation in IncreasingPriceCrowdsaleImpl.sol for linter
* fixed ignoring token.mint return value in MintedCrowdsale.sol
* expanded docs throughout, fixed minor issues
* extended test coverage for IndividuallyCappedCrowdsale
* Extended WhitelistedCrwodsale test coverage
* roll back decoupling of RefundVault in RefundableCrowdsale
* moved cap exceedance checks in Capped and IndividuallyCapped crowdsales to _preValidatePurchase to save gas
* revert name change, IndividuallyCapped to UserCapped
* extended docs.
* added crowd whitelisting with tests
* added group capping, plus tests
* added modifiers in TimedCrowdsale and WhitelistedCrowdsale
* polished tests for linter
* moved check of whitelisted to modifier, mainly for testing coverage
* fixed minor ordering/polishingafter review
* modified TimedCrowdsale modifier/constructor ordering
* unchanged truffle-config.js
* changed indentation of visibility modifier in mocks
* changed naming of modifier and function to use Open/Closed for TimedCrowdsale
* changed ordering of constructor calls in SampleCrowdsale
* changed startTime and endTime to openingTime and closingTime throughout
* fixed exceeding line lenght for linter
* renamed _emitTokens to _deliverTokens
* renamed addCrowdToWhitelist to addManyToWhitelist
* renamed UserCappedCrowdsale to IndividuallyCappedCrowdsale
7 years ago
|
|
|
});
|
|
|
|
|
|
|
|
describe('using non-mintable token', function () {
|
|
|
|
beforeEach(async function () {
|
Rename ERC interfaces to I prefix (#1252)
* rename ERC20 to IERC20
* move ERC20.sol to IERC20.sol
* rename StandardToken to ERC20
* rename StandardTokenMock to ERC20Mock
* move StandardToken.sol to ERC20.sol, likewise test and mock files
* rename MintableToken to ERC20Mintable
* move MintableToken.sol to ERC20Mintable.sol, likewise test and mock files
* rename BurnableToken to ERC20Burnable
* move BurnableToken.sol to ERC20Burnable.sol, likewise for related files
* rename CappedToken to ERC20Capped
* move CappedToken.sol to ERC20Capped.sol, likewise for related files
* rename PausableToken to ERC20Pausable
* move PausableToken.sol to ERC20Pausable.sol, likewise for related files
* rename DetailedERC20 to ERC20Detailed
* move DetailedERC20.sol to ERC20Detailed.sol, likewise for related files
* rename ERC721 to IERC721, and likewise for other related interfaces
* move ERC721.sol to IERC721.sol, likewise for other 721 interfaces
* rename ERC721Token to ERC721
* move ERC721Token.sol to ERC721.sol, likewise for related files
* rename ERC721BasicToken to ERC721Basic
* move ERC721BasicToken.sol to ERC721Basic.sol, likewise for related files
* rename ERC721PausableToken to ERC721Pausable
* move ERC721PausableToken.sol to ERC721Pausable.sol
* rename ERC165 to IERC165
* move ERC165.sol to IERC165.sol
* amend comment that ERC20 is based on FirstBlood
* fix comments mentioning IERC721Receiver
7 years ago
|
|
|
this.token = await ERC20.new();
|
|
|
|
this.crowdsale = await MintedCrowdsale.new(rate, wallet, this.token.address);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('rejects bare payments', async function () {
|
|
|
|
await assertRevert(this.crowdsale.send(value));
|
|
|
|
});
|
|
|
|
|
|
|
|
it('rejects token purchases', async function () {
|
|
|
|
await assertRevert(this.crowdsale.buyTokens(investor, { value: value, from: purchaser }));
|
|
|
|
});
|
|
|
|
});
|
Crowdsale refactor and add new models (#744)
* Basic idea
* Fine tuning idea
* Add comments / tidy up Crowdsale base class
* fixed TimedCrowdsale constructor
* added simple crowdsale test
* added HODL directory under home to store unused contracts. ugly hack to solve Crowdsale selection in tests, better way?
* Capped no longer inherits from Timed, added capReached() method (replacing hasEnded())
* added SafeMath in TimedCrowdsale for safety, CHECK whether it is inherited from Crowdsale
* several fixes related to separating Capped from Timed. functions renamed, mocks changed. Capped tests passing
* added TimedCrowdsaleImpl.sol, TimedCrowdsale tests, passed
* added Whitelisted implementation and test, passed.
* removed unnecessary super constructor call in WhitelistedCrowdsale, removed unused dependencies in tests
* renamed UserCappedCrowdsale to IndividuallyCappedCrowdsale, implemented IndividuallyCappedCrowdsaleImpl.sol and corresponding tests, passed.
* homogeneized use of using SafeMath for uint256 across validation crowdsales. checked that it IS indeed inherited, but leaving it there as per Frans suggestion.
* adding questions.md where I track questions, bugs and progress
* modified VariablePriceCrowdsale, added Impl.
* finished VariablePrice, fixed sign, added test, passing.
* changed VariablePrice to IncreasingPrice, added corresponding require()
* MintedCrowdsale done, mock implemented, test passing
* PremintedCrowdsale done, mocks, tests passing
* checked FinalizableCrowdsale
* PostDeliveryCrowdsale done, mock, tests passing.
* RefundableCrowdsale done. Detached Vault. modified mock and test, passing
* renamed crowdsale-refactor to crowdsale in contracts and test
* deleted HODL old contracts
* polished variable names in tests
* fixed typos and removed comments in tests
* Renamed 'crowdsale-refactor' to 'crowdsale' in all imports
* Fix minor param naming issues in Crowdsale functions and added documentation to Crowdsale.sol
* Added documentation to Crowdsale extensions
* removed residual comments and progress tracking files
* added docs for validation crowdsales
* Made user promises in PostDeliveryCrowdsale public so that users can query their promised token balance.
* added docs for distribution crowdsales
* renamed PremintedCrowdsale to AllowanceCrowdsale
* added allowance check function and corresponding test. fixed filename in AllowanceCrowdsale mock.
* spilt Crowdsale _postValidatePurchase in _postValidatePurchase and _updatePurchasingState. changed IndividuallyCappedCrowdsale accordingly.
* polished tests for linter, salve Travis
* polished IncreasingPriceCrowdsale.sol for linter.
* renamed and polished for linter WhitelistedCrowdsale test.
* fixed indentation in IncreasingPriceCrowdsaleImpl.sol for linter
* fixed ignoring token.mint return value in MintedCrowdsale.sol
* expanded docs throughout, fixed minor issues
* extended test coverage for IndividuallyCappedCrowdsale
* Extended WhitelistedCrwodsale test coverage
* roll back decoupling of RefundVault in RefundableCrowdsale
* moved cap exceedance checks in Capped and IndividuallyCapped crowdsales to _preValidatePurchase to save gas
* revert name change, IndividuallyCapped to UserCapped
* extended docs.
* added crowd whitelisting with tests
* added group capping, plus tests
* added modifiers in TimedCrowdsale and WhitelistedCrowdsale
* polished tests for linter
* moved check of whitelisted to modifier, mainly for testing coverage
* fixed minor ordering/polishingafter review
* modified TimedCrowdsale modifier/constructor ordering
* unchanged truffle-config.js
* changed indentation of visibility modifier in mocks
* changed naming of modifier and function to use Open/Closed for TimedCrowdsale
* changed ordering of constructor calls in SampleCrowdsale
* changed startTime and endTime to openingTime and closingTime throughout
* fixed exceeding line lenght for linter
* renamed _emitTokens to _deliverTokens
* renamed addCrowdToWhitelist to addManyToWhitelist
* renamed UserCappedCrowdsale to IndividuallyCappedCrowdsale
7 years ago
|
|
|
});
|