Merge tag 'extendableICO' into develop

hotfix changes
This commit is contained in:
David E. Perez Negron Rocha 2020-06-08 14:43:52 -05:00
commit 8a2b4024d4
3 changed files with 106 additions and 52 deletions

32
DISCLAIMERS Normal file
View File

@ -0,0 +1,32 @@
Disclaimers for DECA offering:
General Disclaimer:
This Offering may be subject to securities regulations in your country of
residence. As such, you may wish to consult with your investment advisor.
The complete explanation of the DECA project and the merits of the investment
in DECA are outlined in the White Paper and other supporting documents.
These are available for review on the DECA website (https://deca.eco).
Further Disclaimer if investor is located in North America:
This Offering may be subject to securities regulations in your country of
residence. As such, you may wish to consult with your investment advisor.
The complete explanation of the DECA project and the merits of the investment
in DECA are outlined in the White Paper and other supporting documents.
These are available for review on the DECA website (https://deca.eco).
Investors who are located in North America may qualify for investment under an
“accredited investor” exemption. While this exemption may vary by jurisdiction,
the general criteria is outlined as follows:
“Accredited Investor”, means a purchaser that:
 
(a) Has, in each of the past two years, had gross income before taxes of
$200,000 (or $300,000 with a spouse) and has a reasonable expectation of
achieving such income in the current year;
 
(b) Has financial assets of $1,000,000 (either alone or with a spouse), where
financial assets means cash and securities; or
 
(c) Has net assets of $5,000,000 (either alone or with a spouse).

View File

@ -153,6 +153,13 @@ contract DECA is ERC20, Ownable {
_mint(msg.sender, toSender); _mint(msg.sender, toSender);
} }
//Add weeks in case ICO gets not enough funds
function appendWeeks(uint addWeeks ) public onlyOwner {
require(now >= bonus2Ends && now < endDate);
// add weeks to the endDate
endDate += (addWeeks * 1 weeks);
}
//Close down the ICO and claim the Ether. //Close down the ICO and claim the Ether.
function getETH() public onlyOwner { function getETH() public onlyOwner {
require(now >= endDate); require(now >= endDate);

View File

@ -84,63 +84,64 @@ contract('DECA', function (accs) {
}) })
}), }),
describe('check pause', function () {
it('should get/set pause', async function () {
let p = await this.deca.getPause.call();
assert.equal(false, p, "pause should be disabled")
await this.deca.setPause(true, {from: this.creator.address, gas: 6712390})
p = await this.deca.getPause.call();
assert.equal(true, p, "pause should be enabled")
})
it('should fail on pay', async function () {
await this.deca.setPause(true, {from: this.creator.address, gas: 6712390})
let wasErr = false;
try {
let rs = await web3.eth.sendTransaction({
from: this.creator.address,
to: this.deca.address,
value: 225,
gas: 6712390
});
} catch (err) {
wasErr = true;
}
await this.deca.setPause(false, {from: this.creator.address, gas: 6712390})
wasErr = false; describe('check pause', function () {
try { it('should get/set pause', async function () {
let rs = await web3.eth.sendTransaction({ let p = await this.deca.getPause.call();
from: this.creator.address, assert.equal(false, p, "pause should be disabled")
to: this.deca.address, await this.deca.setPause(true, {from: this.creator.address, gas: 6712390})
value: 225, p = await this.deca.getPause.call();
gas: 6712390 assert.equal(true, p, "pause should be enabled")
}); })
} catch (err) { it('should fail on pay', async function () {
wasErr = true; await this.deca.setPause(true, {from: this.creator.address, gas: 6712390})
} let wasErr = false;
assert.equal(false, wasErr, "pause should work") try {
}) let rs = await web3.eth.sendTransaction({
it('check intruder pause', async function () { from: this.creator.address,
var sender = await getHighBalance();
await increaseTime(duration.days(1))
await web3.eth.sendTransaction({
from: sender.address,
to: this.deca.address, to: this.deca.address,
value: 1, value: 225,
gas: 6712390 gas: 6712390
}); });
let wasErr = false; } catch (err) {
try { wasErr = true;
await this.deca.setPause(true, {from: sender.address, gas: 6712390}) }
} catch (err) { await this.deca.setPause(false, {from: this.creator.address, gas: 6712390})
wasErr = true;
}
assert.equal(true, wasErr, "only owner could pause")
let own = await this.deca.owner();
assert.equal(this.creator.address, own, "owner does not match")
})
wasErr = false;
try {
let rs = await web3.eth.sendTransaction({
from: this.creator.address,
to: this.deca.address,
value: 225,
gas: 6712390
});
} catch (err) {
wasErr = true;
}
assert.equal(false, wasErr, "pause should work")
}) })
it('check intruder pause', async function () {
var sender = await getHighBalance();
await increaseTime(duration.days(1))
await web3.eth.sendTransaction({
from: sender.address,
to: this.deca.address,
value: 1,
gas: 6712390
});
let wasErr = false;
try {
await this.deca.setPause(true, {from: sender.address, gas: 6712390})
} catch (err) {
wasErr = true;
}
assert.equal(true, wasErr, "only owner could pause")
let own = await this.deca.owner();
assert.equal(this.creator.address, own, "owner does not match")
})
})
describe('check crowdsale dates', function () { describe('check crowdsale dates', function () {
it('check preICOEnds', async function () { it('check preICOEnds', async function () {
@ -199,8 +200,22 @@ contract('DECA', function (accs) {
assert.equal(true, wasErr, "crowdsale should be stopped") assert.equal(true, wasErr, "crowdsale should be stopped")
}) })
it('check appendWeeks', async function () {
await increaseTime(duration.weeks(10))
// get endDate before
let endDateBefore = await this.deca.endDate.call();
// add one week
await this.deca.appendWeeks(1, {
from: this.creator.address,
gas: 6712390
});
// get endDate after
let endDateAfter = await this.deca.endDate.call();
// 1 week = 604800 seconds
assert.equal(604800, endDateAfter - endDateBefore, "appendWeeks does not work");
})
}) })
describe('transferAnyERC20Token', async function () { describe('transferAnyERC20Token', async function () {
it('check transfer from external', async function () { it('check transfer from external', async function () {