Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
128c4c0
Improve encapsulation on ERC165
Sep 3, 2018
0d8a5e4
Improve encapsulation on ERC20
Sep 3, 2018
1c365fe
Improve encapsulation on ERC721
Sep 3, 2018
9ebdae6
Add tests, use standard getters
Sep 3, 2018
963a00b
fix tests
Sep 3, 2018
4d8db8d
Fix lint
Sep 3, 2018
dc7b21e
Merge branch 'master' into refactor/1174/private-state-vars-erc
Sep 4, 2018
0b0d6c6
move interface ids to implementation contracts
frangio Sep 4, 2018
68094d1
Do not prefix getters
Sep 5, 2018
2ea79e9
Merge branch 'master' into refactor/1174/private-state-vars-erc
Sep 5, 2018
5fc3742
Improve encapsulation on Pausable
Sep 3, 2018
172b720
add the underscore
Sep 3, 2018
86bbab3
Improve encapsulation on ownership
Sep 3, 2018
faed52d
fix rebase
Sep 3, 2018
21ae177
fix ownership
Sep 3, 2018
917a019
Improve encapsulation on payments
Sep 3, 2018
478d974
Add missing tests
Sep 4, 2018
0fecbac
add missing test
Sep 4, 2018
9449572
Do not prefix getters
Sep 5, 2018
1856f07
Fix tests.
Sep 5, 2018
f61acdc
Improve encapsulation on Crowdsales
Sep 3, 2018
44d113a
add missing tests
Sep 3, 2018
0257670
remove only
Sep 3, 2018
5a476d1
Do not prefix getters
Sep 5, 2018
85a0fc3
Update modifiers to call public view functions.
Sep 5, 2018
24761a5
remove isMinter
Sep 5, 2018
c14d597
fix is owner call
Sep 5, 2018
ba7fa16
fix isOpen
Sep 5, 2018
776d47a
Merge branch 'master' into feature/1179/modifiers-call-functions
Sep 6, 2018
7a37725
Fix merge
Sep 6, 2018
52352ce
Improve encapsulation on TimedCrowdsale
Sep 6, 2018
63b93cc
Add missing parentheses
Sep 6, 2018
b6bddb2
Merge branch 'master' into refactor/1174/private-state-vars-timed-cro…
frangio Sep 6, 2018
369b8d6
remove duplicate function definition
frangio Sep 6, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions contracts/crowdsale/price/IncreasingPriceCrowdsale.sol
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ contract IncreasingPriceCrowdsale is TimedCrowdsale {
*/
function getCurrentRate() public view returns (uint256) {
// solium-disable-next-line security/no-block-members
uint256 elapsedTime = block.timestamp.sub(openingTime);
uint256 timeRange = closingTime.sub(openingTime);
uint256 elapsedTime = block.timestamp.sub(openingTime());
uint256 timeRange = closingTime().sub(openingTime());
uint256 rateRange = initialRate_.sub(finalRate_);
return initialRate_.sub(elapsedTime.mul(rateRange).div(timeRange));
}
Expand Down
26 changes: 20 additions & 6 deletions contracts/crowdsale/validation/TimedCrowdsale.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import "../Crowdsale.sol";
contract TimedCrowdsale is Crowdsale {
using SafeMath for uint256;

uint256 public openingTime;
uint256 public closingTime;
uint256 private openingTime_;
uint256 private closingTime_;

/**
* @dev Reverts if not in crowdsale time range.
Expand All @@ -32,16 +32,30 @@ contract TimedCrowdsale is Crowdsale {
require(_openingTime >= block.timestamp);
require(_closingTime >= _openingTime);

openingTime = _openingTime;
closingTime = _closingTime;
openingTime_ = _openingTime;
closingTime_ = _closingTime;
}

/**
* @return the crowdsale opening time.
*/
function openingTime() public view returns(uint256) {
return openingTime_;
}

/**
* @return the crowdsale closing time.
*/
function closingTime() public view returns(uint256) {
return closingTime_;
}

/**
* @return true if the crowdsale is open, false otherwise.
*/
function isOpen() public view returns (bool) {
// solium-disable-next-line security/no-block-members
return block.timestamp >= openingTime && block.timestamp <= closingTime;
return block.timestamp >= openingTime_ && block.timestamp <= closingTime_;
}

/**
Expand All @@ -50,7 +64,7 @@ contract TimedCrowdsale is Crowdsale {
*/
function hasClosed() public view returns (bool) {
// solium-disable-next-line security/no-block-members
return block.timestamp > closingTime;
return block.timestamp > closingTime_;
}

/**
Expand Down