Skip to content

Commit

Permalink
more supporting lib
Browse files Browse the repository at this point in the history
  • Loading branch information
rolfbans committed Mar 30, 2018
1 parent 44510d5 commit 3de1274
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 12 deletions.
4 changes: 4 additions & 0 deletions migrations/2_po8_token.js
Expand Up @@ -8,6 +8,10 @@ module.exports = function(deployer, network, accounts) {
/*save token address for private sale migration*/
if(meta.po8Token) {
meta.po8Token.address = PO8Token.address;
} else {
meta.po8Token = {
address: PO8Token.address
};
}
file.saveMeta(meta);
});
Expand Down
16 changes: 14 additions & 2 deletions migrations/3_private_sale.js
Expand Up @@ -3,6 +3,7 @@ var meta = require('../migrations/meta/meta');
var configFile = require('../migrations/config/config');
var time = require('../migrations/utils/time');
var file = require('../migrations/utils/file');
var currency = require('../migrations/utils/currency');


module.exports = function(deployer, network, accounts) {
Expand All @@ -11,12 +12,23 @@ module.exports = function(deployer, network, accounts) {
/*PO8 Private Sale*/
var config = configFile.privateSale.config;
//the private sale will start in 3 seconds after deployed
config.open = Date.now() + 3;
config.close = Date.now() + 60;
config.open = Date.now() + time.duration.seconds(3);
config.close = Date.now() + time.duration.days(30);
config.token = {
address: meta.po8Token.address
};
config.cap = currency.ether(13500);//aprox $9.6m
config.minWei = currency.ether(250);//aprox $176K
config.bonusRate = 0.5;
config.walletEth = accounts[0];
config.walletToken = accounts[0];
config.tx_options.from = accounts[0];
config.tx_options.gas = 500000000;




//updating meta
meta.privateSale = {
config: config
};
Expand Down
18 changes: 9 additions & 9 deletions migrations/meta/meta.json
@@ -1,22 +1,22 @@
{
"po8Token": {
"address": "0x345ca3e014aaf5dca488057592ee47305d9b3e10"
"address": "0x4e71920b7330515faf5ea0c690f1ad06a85fb60c"
},
"privateSale": {
"config": {
"open": 1522376192734,
"close": 1522376192791,
"cap": "500000000000000000000",
"open": 1522382209172,
"close": 1522384801169,
"cap": "13500000000000000",
"rate": 5,
"bonusRate": 0.5,
"minWei": "1000000000000000000",
"walletEth": "",
"minWei": "250000000000000",
"walletEth": "0x627306090abab3a6e1400e9345bc60c78a8bef57",
"token": {
"address": "0x345ca3e014aaf5dca488057592ee47305d9b3e10"
"address": "0x4e71920b7330515faf5ea0c690f1ad06a85fb60c"
},
"walletToken": "",
"walletToken": "0x627306090abab3a6e1400e9345bc60c78a8bef57",
"tx_options": {
"from": "",
"from": "0x627306090abab3a6e1400e9345bc60c78a8bef57",
"gas": 500000000
}
}
Expand Down
11 changes: 11 additions & 0 deletions migrations/utils/currency.js
@@ -0,0 +1,11 @@
var BigNumber = require('bignumber.js').BigNumber;

function ether(val) {
var number = new BigNumber(val);
var result = number.multipliedBy(1000000000000);
return result.toString();
}

module.exports = {
ether: ether
};
2 changes: 2 additions & 0 deletions package.json
Expand Up @@ -57,9 +57,11 @@
"whatwg-fetch": "1.0.0"
},
"dependencies": {
"bignumber.js": "^6.0.0",
"dotenv": "^2.0.0",
"react": "^16.2.0",
"react-dom": "^16.2.0",
"web3": "^1.0.0-beta.33",
"zeppelin-solidity": "1.7.0"
},
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/contract_output.txt
Expand Up @@ -190,7 +190,7 @@ AL_SUPPLY;\r\n balances[owner] = INITIAL_SUPPLY;\r\n }\r\n\r\n\r\n\r\n
addProp: [Function: bound addProp],
toJSON: [Function: bound toJSON],
web3:
Web3 {
GetWeb3 {
_requestManager: [Object],
currentProvider: [Object],
eth: [Object],
Expand Down

0 comments on commit 3de1274

Please sign in to comment.