Fixed Testing code manages bonus sales and aprove allowance

This commit is contained in:
David E. Perez Negron Rocha 2019-11-26 17:30:21 -08:00
parent 8b63b3c600
commit 1af0f37e30
1 changed files with 8 additions and 12 deletions

View File

@ -110,10 +110,10 @@ contract DECAToken is ERC20Interface, Owned, SafeMath {
uint8 constant public decimals = 18;
uint public totalSupply;
//for testing change weeks for hours...
uint public preICOEnds = now + 1 hours;
uint public bonus1Ends = now + 3 hours;
uint public bonus2Ends = now + 6 hours;
uint public endDate = now + 11 hours;
uint public preICOEnds = now + 1 weeks;
uint public bonus1Ends = now + 3 weeks;
uint public bonus2Ends = now + 6 weeks;
uint public endDate = now + 11 weeks;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
@ -149,15 +149,11 @@ contract DECAToken is ERC20Interface, Owned, SafeMath {
// from the token owner's account
// ------------------------------------------------------------------------
function approve(address spender, uint tokens) public returns (bool success) {
// approve should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'increaseApproval' and 'decreaseApproval'
if (allowed[msg.sender][spender] == 0 || tokens == 0){
// approves to set an allowance
allowed[msg.sender][spender] = tokens;
emit Approval(msg.sender, spender, tokens);
return true;
}
return false;
}
// ------------------------------------------------------------------------
// approve should be called when allowed[spender] == 0. To increment