mirror of
https://github.com/fluencelabs/smartcontracts
synced 2025-04-24 18:52:19 +00:00
tiny fixes
This commit is contained in:
parent
8e0e8902a3
commit
423ae7fef2
@ -101,7 +101,7 @@ contract FluencePreSale is Haltable, SafeMath {
|
||||
uint public constant decimals = 18;
|
||||
|
||||
// 6% of tokens
|
||||
uint256 public constant SUPPLY_LIMIT = 6000000;
|
||||
uint256 public constant SUPPLY_LIMIT = 6000000 ether;
|
||||
|
||||
// What is given to contributors, <= SUPPLY_LIMIT
|
||||
uint256 public totalSupply;
|
||||
@ -159,11 +159,12 @@ contract FluencePreSale is Haltable, SafeMath {
|
||||
_;
|
||||
}
|
||||
|
||||
function FluencePreSale(uint _startAtBlock, uint _endAtBlock){
|
||||
function FluencePreSale(uint _startAtBlock, uint _endAtBlock, uint softCapEther){
|
||||
require(_startAtBlock > 0 && _endAtBlock > 0);
|
||||
beneficiary = msg.sender;
|
||||
startAtBlock = _startAtBlock;
|
||||
endAtBlock = _endAtBlock;
|
||||
softCap = softCapEther * 1 ether;
|
||||
}
|
||||
|
||||
function setBeneficiary(address to) onlyOwner external {
|
||||
|
@ -1,5 +1,5 @@
|
||||
var FluencePreSale = artifacts.require("./FluencePreSale.sol");
|
||||
|
||||
module.exports = function(deployer) {
|
||||
deployer.deploy(FluencePreSale, 673000, 674000);
|
||||
deployer.deploy(FluencePreSale, 1, 674000, 1000);
|
||||
};
|
||||
|
349
package-lock.json
generated
349
package-lock.json
generated
@ -9,6 +9,167 @@
|
||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
|
||||
"integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8="
|
||||
},
|
||||
"ansi-styles": {
|
||||
"version": "2.2.1",
|
||||
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz",
|
||||
"integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=",
|
||||
"dev": true
|
||||
},
|
||||
"babel-code-frame": {
|
||||
"version": "6.22.0",
|
||||
"resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.22.0.tgz",
|
||||
"integrity": "sha1-AnYgvuVnqIwyVhV05/0IAdMxGOQ=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"chalk": "1.1.3",
|
||||
"esutils": "2.0.2",
|
||||
"js-tokens": "3.0.2"
|
||||
}
|
||||
},
|
||||
"babel-core": {
|
||||
"version": "6.25.0",
|
||||
"resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.25.0.tgz",
|
||||
"integrity": "sha1-fdQrBGPHQunVKW3rPsZ6kyLa1yk=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"babel-code-frame": "6.22.0",
|
||||
"babel-generator": "6.25.0",
|
||||
"babel-helpers": "6.24.1",
|
||||
"babel-messages": "6.23.0",
|
||||
"babel-register": "6.24.1",
|
||||
"babel-runtime": "6.25.0",
|
||||
"babel-template": "6.25.0",
|
||||
"babel-traverse": "6.25.0",
|
||||
"babel-types": "6.25.0",
|
||||
"babylon": "6.17.4",
|
||||
"convert-source-map": "1.5.0",
|
||||
"debug": "2.6.8",
|
||||
"json5": "0.5.1",
|
||||
"lodash": "4.17.4",
|
||||
"minimatch": "3.0.4",
|
||||
"path-is-absolute": "1.0.1",
|
||||
"private": "0.1.7",
|
||||
"slash": "1.0.0",
|
||||
"source-map": "0.5.6"
|
||||
}
|
||||
},
|
||||
"babel-generator": {
|
||||
"version": "6.25.0",
|
||||
"resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.25.0.tgz",
|
||||
"integrity": "sha1-M6GvcNXyiQrrRlpKd5PB32qeqfw=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"babel-messages": "6.23.0",
|
||||
"babel-runtime": "6.25.0",
|
||||
"babel-types": "6.25.0",
|
||||
"detect-indent": "4.0.0",
|
||||
"jsesc": "1.3.0",
|
||||
"lodash": "4.17.4",
|
||||
"source-map": "0.5.6",
|
||||
"trim-right": "1.0.1"
|
||||
}
|
||||
},
|
||||
"babel-helpers": {
|
||||
"version": "6.24.1",
|
||||
"resolved": "https://registry.npmjs.org/babel-helpers/-/babel-helpers-6.24.1.tgz",
|
||||
"integrity": "sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"babel-runtime": "6.25.0",
|
||||
"babel-template": "6.25.0"
|
||||
}
|
||||
},
|
||||
"babel-messages": {
|
||||
"version": "6.23.0",
|
||||
"resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz",
|
||||
"integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"babel-runtime": "6.25.0"
|
||||
}
|
||||
},
|
||||
"babel-polyfill": {
|
||||
"version": "6.23.0",
|
||||
"resolved": "https://registry.npmjs.org/babel-polyfill/-/babel-polyfill-6.23.0.tgz",
|
||||
"integrity": "sha1-g2TKYt+Or7gwSZ9pkXdGbDsDSZ0=",
|
||||
"requires": {
|
||||
"babel-runtime": "6.25.0",
|
||||
"core-js": "2.5.0",
|
||||
"regenerator-runtime": "0.10.5"
|
||||
}
|
||||
},
|
||||
"babel-register": {
|
||||
"version": "6.24.1",
|
||||
"resolved": "https://registry.npmjs.org/babel-register/-/babel-register-6.24.1.tgz",
|
||||
"integrity": "sha1-fhDhOi9xBlvfrVoXh7pFvKbe118=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"babel-core": "6.25.0",
|
||||
"babel-runtime": "6.25.0",
|
||||
"core-js": "2.5.0",
|
||||
"home-or-tmp": "2.0.0",
|
||||
"lodash": "4.17.4",
|
||||
"mkdirp": "0.5.1",
|
||||
"source-map-support": "0.4.15"
|
||||
}
|
||||
},
|
||||
"babel-runtime": {
|
||||
"version": "6.25.0",
|
||||
"resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.25.0.tgz",
|
||||
"integrity": "sha1-M7mOql1IK7AajRqmtDetKwGuxBw=",
|
||||
"requires": {
|
||||
"core-js": "2.5.0",
|
||||
"regenerator-runtime": "0.10.5"
|
||||
}
|
||||
},
|
||||
"babel-template": {
|
||||
"version": "6.25.0",
|
||||
"resolved": "https://registry.npmjs.org/babel-template/-/babel-template-6.25.0.tgz",
|
||||
"integrity": "sha1-ZlJBFmt8KqTGGdceGSlpVSsQwHE=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"babel-runtime": "6.25.0",
|
||||
"babel-traverse": "6.25.0",
|
||||
"babel-types": "6.25.0",
|
||||
"babylon": "6.17.4",
|
||||
"lodash": "4.17.4"
|
||||
}
|
||||
},
|
||||
"babel-traverse": {
|
||||
"version": "6.25.0",
|
||||
"resolved": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.25.0.tgz",
|
||||
"integrity": "sha1-IldJfi/NGbie3BPEyROB+VEklvE=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"babel-code-frame": "6.22.0",
|
||||
"babel-messages": "6.23.0",
|
||||
"babel-runtime": "6.25.0",
|
||||
"babel-types": "6.25.0",
|
||||
"babylon": "6.17.4",
|
||||
"debug": "2.6.8",
|
||||
"globals": "9.18.0",
|
||||
"invariant": "2.2.2",
|
||||
"lodash": "4.17.4"
|
||||
}
|
||||
},
|
||||
"babel-types": {
|
||||
"version": "6.25.0",
|
||||
"resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.25.0.tgz",
|
||||
"integrity": "sha1-cK+ySNVmDl0Y+BHZHIMDtUE0oY4=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"babel-runtime": "6.25.0",
|
||||
"esutils": "2.0.2",
|
||||
"lodash": "4.17.4",
|
||||
"to-fast-properties": "1.0.3"
|
||||
}
|
||||
},
|
||||
"babylon": {
|
||||
"version": "6.17.4",
|
||||
"resolved": "https://registry.npmjs.org/babylon/-/babylon-6.17.4.tgz",
|
||||
"integrity": "sha512-kChlV+0SXkjE0vUn9OZ7pBMWRFd8uq3mZe8x1K6jhuNcAFAtEnjchFAqB+dYEXKyd+JpT6eppRR78QAr5gTsUw==",
|
||||
"dev": true
|
||||
},
|
||||
"balanced-match": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
|
||||
@ -38,6 +199,27 @@
|
||||
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz",
|
||||
"integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo="
|
||||
},
|
||||
"chalk": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
|
||||
"integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ansi-styles": "2.2.1",
|
||||
"escape-string-regexp": "1.0.5",
|
||||
"has-ansi": "2.0.0",
|
||||
"strip-ansi": "3.0.1",
|
||||
"supports-color": "2.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"supports-color": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
|
||||
"integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"cliui": {
|
||||
"version": "3.2.0",
|
||||
"resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz",
|
||||
@ -66,6 +248,17 @@
|
||||
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
||||
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
|
||||
},
|
||||
"convert-source-map": {
|
||||
"version": "1.5.0",
|
||||
"resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.5.0.tgz",
|
||||
"integrity": "sha1-ms1whRxtXf3ZPZKC5e35SgP/RrU=",
|
||||
"dev": true
|
||||
},
|
||||
"core-js": {
|
||||
"version": "2.5.0",
|
||||
"resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.0.tgz",
|
||||
"integrity": "sha1-VpwFCRi+ZIazg3VSAorgRmtxcIY="
|
||||
},
|
||||
"debug": {
|
||||
"version": "2.6.8",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz",
|
||||
@ -79,6 +272,15 @@
|
||||
"resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz",
|
||||
"integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA="
|
||||
},
|
||||
"detect-indent": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz",
|
||||
"integrity": "sha1-920GQ1LN9Docts5hnE7jqUdd4gg=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"repeating": "2.0.1"
|
||||
}
|
||||
},
|
||||
"diff": {
|
||||
"version": "3.2.0",
|
||||
"resolved": "https://registry.npmjs.org/diff/-/diff-3.2.0.tgz",
|
||||
@ -97,6 +299,12 @@
|
||||
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
|
||||
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ="
|
||||
},
|
||||
"esutils": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz",
|
||||
"integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=",
|
||||
"dev": true
|
||||
},
|
||||
"find-up": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz",
|
||||
@ -141,6 +349,12 @@
|
||||
"path-is-absolute": "1.0.1"
|
||||
}
|
||||
},
|
||||
"globals": {
|
||||
"version": "9.18.0",
|
||||
"resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz",
|
||||
"integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==",
|
||||
"dev": true
|
||||
},
|
||||
"graceful-fs": {
|
||||
"version": "4.1.11",
|
||||
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz",
|
||||
@ -156,11 +370,30 @@
|
||||
"resolved": "https://registry.npmjs.org/growl/-/growl-1.9.2.tgz",
|
||||
"integrity": "sha1-Dqd0NxXbjY3ixe3hd14bRayFwC8="
|
||||
},
|
||||
"has-ansi": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz",
|
||||
"integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ansi-regex": "2.1.1"
|
||||
}
|
||||
},
|
||||
"has-flag": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz",
|
||||
"integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo="
|
||||
},
|
||||
"home-or-tmp": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-2.0.0.tgz",
|
||||
"integrity": "sha1-42w/LSyufXRqhX440Y1fMqeILbg=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"os-homedir": "1.0.2",
|
||||
"os-tmpdir": "1.0.2"
|
||||
}
|
||||
},
|
||||
"hosted-git-info": {
|
||||
"version": "2.5.0",
|
||||
"resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.5.0.tgz",
|
||||
@ -180,6 +413,15 @@
|
||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
|
||||
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4="
|
||||
},
|
||||
"invariant": {
|
||||
"version": "2.2.2",
|
||||
"resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.2.tgz",
|
||||
"integrity": "sha1-nh9WrArNtr8wMwbzOL47IErmA2A=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"loose-envify": "1.3.1"
|
||||
}
|
||||
},
|
||||
"invert-kv": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz",
|
||||
@ -198,6 +440,15 @@
|
||||
"builtin-modules": "1.1.1"
|
||||
}
|
||||
},
|
||||
"is-finite": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz",
|
||||
"integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"number-is-nan": "1.0.1"
|
||||
}
|
||||
},
|
||||
"is-fullwidth-code-point": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz",
|
||||
@ -211,11 +462,29 @@
|
||||
"resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz",
|
||||
"integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI="
|
||||
},
|
||||
"js-tokens": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz",
|
||||
"integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=",
|
||||
"dev": true
|
||||
},
|
||||
"jsesc": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz",
|
||||
"integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=",
|
||||
"dev": true
|
||||
},
|
||||
"json3": {
|
||||
"version": "3.3.2",
|
||||
"resolved": "https://registry.npmjs.org/json3/-/json3-3.3.2.tgz",
|
||||
"integrity": "sha1-PAQ0dD35Pi9cQq7nsZvLSDV19OE="
|
||||
},
|
||||
"json5": {
|
||||
"version": "0.5.1",
|
||||
"resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz",
|
||||
"integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=",
|
||||
"dev": true
|
||||
},
|
||||
"jsonfile": {
|
||||
"version": "2.4.0",
|
||||
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz",
|
||||
@ -252,6 +521,12 @@
|
||||
"strip-bom": "2.0.0"
|
||||
}
|
||||
},
|
||||
"lodash": {
|
||||
"version": "4.17.4",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz",
|
||||
"integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4=",
|
||||
"dev": true
|
||||
},
|
||||
"lodash._baseassign": {
|
||||
"version": "3.2.0",
|
||||
"resolved": "https://registry.npmjs.org/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz",
|
||||
@ -316,6 +591,15 @@
|
||||
"lodash.isarray": "3.0.4"
|
||||
}
|
||||
},
|
||||
"loose-envify": {
|
||||
"version": "1.3.1",
|
||||
"resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.3.1.tgz",
|
||||
"integrity": "sha1-0aitM/qc4OcT1l/dCsi3SNR4yEg=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"js-tokens": "3.0.2"
|
||||
}
|
||||
},
|
||||
"memorystream": {
|
||||
"version": "0.3.1",
|
||||
"resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz",
|
||||
@ -394,6 +678,12 @@
|
||||
"resolved": "https://registry.npmjs.org/original-require/-/original-require-1.0.1.tgz",
|
||||
"integrity": "sha1-DxMEcVhM0zURxew4yNWSE/msXiA="
|
||||
},
|
||||
"os-homedir": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz",
|
||||
"integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=",
|
||||
"dev": true
|
||||
},
|
||||
"os-locale": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz",
|
||||
@ -402,6 +692,12 @@
|
||||
"lcid": "1.0.0"
|
||||
}
|
||||
},
|
||||
"os-tmpdir": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
|
||||
"integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=",
|
||||
"dev": true
|
||||
},
|
||||
"parse-json": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz",
|
||||
@ -451,6 +747,12 @@
|
||||
"pinkie": "2.0.4"
|
||||
}
|
||||
},
|
||||
"private": {
|
||||
"version": "0.1.7",
|
||||
"resolved": "https://registry.npmjs.org/private/-/private-0.1.7.tgz",
|
||||
"integrity": "sha1-aM5eih7woju1cMwoU3tTMqumPvE=",
|
||||
"dev": true
|
||||
},
|
||||
"read-pkg": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz",
|
||||
@ -470,6 +772,20 @@
|
||||
"read-pkg": "1.1.0"
|
||||
}
|
||||
},
|
||||
"regenerator-runtime": {
|
||||
"version": "0.10.5",
|
||||
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz",
|
||||
"integrity": "sha1-M2w+/BIgrc7dosn6tntaeVWjNlg="
|
||||
},
|
||||
"repeating": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz",
|
||||
"integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"is-finite": "1.0.2"
|
||||
}
|
||||
},
|
||||
"require-directory": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
|
||||
@ -503,6 +819,12 @@
|
||||
"resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
|
||||
"integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc="
|
||||
},
|
||||
"slash": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz",
|
||||
"integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=",
|
||||
"dev": true
|
||||
},
|
||||
"solc": {
|
||||
"version": "0.4.13",
|
||||
"resolved": "https://registry.npmjs.org/solc/-/solc-0.4.13.tgz",
|
||||
@ -515,6 +837,21 @@
|
||||
"yargs": "4.8.1"
|
||||
}
|
||||
},
|
||||
"source-map": {
|
||||
"version": "0.5.6",
|
||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.6.tgz",
|
||||
"integrity": "sha1-dc449SvwczxafwwRjYEzSiu19BI=",
|
||||
"dev": true
|
||||
},
|
||||
"source-map-support": {
|
||||
"version": "0.4.15",
|
||||
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.15.tgz",
|
||||
"integrity": "sha1-AyAt9lwG0r2MfsI2KhkwVv7407E=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"source-map": "0.5.6"
|
||||
}
|
||||
},
|
||||
"spdx-correct": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-1.0.2.tgz",
|
||||
@ -567,6 +904,18 @@
|
||||
"has-flag": "1.0.0"
|
||||
}
|
||||
},
|
||||
"to-fast-properties": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz",
|
||||
"integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=",
|
||||
"dev": true
|
||||
},
|
||||
"trim-right": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz",
|
||||
"integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=",
|
||||
"dev": true
|
||||
},
|
||||
"truffle": {
|
||||
"version": "3.4.7",
|
||||
"resolved": "https://registry.npmjs.org/truffle/-/truffle-3.4.7.tgz",
|
||||
|
@ -6,6 +6,10 @@
|
||||
"run": "truffle build"
|
||||
},
|
||||
"dependencies": {
|
||||
"babel-polyfill": "^6.23.0",
|
||||
"truffle": "^3.4.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-register": "^6.24.1"
|
||||
}
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ import "../contracts/FluencePreSale.sol";
|
||||
contract TestFluencePreSale {
|
||||
|
||||
uint public initialBalance = 10 ether;
|
||||
uint public gasLimit = 500000;
|
||||
|
||||
function testSoftCap() {
|
||||
FluencePreSale fluence = FluencePreSale(DeployedAddresses.FluencePreSale());
|
||||
@ -16,16 +17,4 @@ contract TestFluencePreSale {
|
||||
Assert.equal(fluence.softCap(), expected, "Soft cap must be 1000 ether");
|
||||
}
|
||||
|
||||
function testContribute() {
|
||||
FluencePreSale fluence = new FluencePreSale(0, 100000000000);
|
||||
|
||||
Assert.equal(fluence.owner(), tx.origin, "Owner must be set to sender");
|
||||
|
||||
assert(fluence.call.gas(3000000).value(1 ether)());
|
||||
|
||||
assert(fluence.balanceOf(tx.origin) == 1500);
|
||||
|
||||
Assert.equal(fluence.balanceOf(tx.origin), 1500, "User should get 1500 FPT for 1 eth");
|
||||
}
|
||||
|
||||
}
|
||||
|
47
test/fluence.js
Normal file
47
test/fluence.js
Normal file
@ -0,0 +1,47 @@
|
||||
const FluencePreSale = artifacts.require("./FluencePreSale.sol");
|
||||
|
||||
contract('FluencePreSale', function(accounts) {
|
||||
it("should be able to contribute 1 eth", async function() {
|
||||
const instance = await FluencePreSale.deployed();
|
||||
|
||||
const tx = await instance.sendTransaction({from: accounts[0], value: web3.toWei(1, 'ether')})
|
||||
|
||||
const tokensBalance = await instance.balanceOf(accounts[0])
|
||||
assert.equal(tokensBalance.toNumber(), 1500 * (10 ** 18), "Balance should be 1500 * 10^18")
|
||||
|
||||
const ethCollected = await instance.etherCollected()
|
||||
assert.equal(ethCollected.toNumber(), 1 * (10**18), "etherCollected should be 1 ether");
|
||||
|
||||
const tokensIssued = await instance.totalSupply()
|
||||
assert.equal(tokensIssued.toNumber(), 1500 * (10**18), "totalSupply should be 1500 ether");
|
||||
|
||||
})
|
||||
|
||||
it("should be able to contribute 5 eth", async function() {
|
||||
const instance = await FluencePreSale.deployed();
|
||||
|
||||
const tx = await instance.sendTransaction({from: accounts[1], value: web3.toWei(5, 'ether')})
|
||||
|
||||
const tokensBalance = await instance.balanceOf(accounts[1])
|
||||
assert.equal(tokensBalance.toNumber(), 2250 * 5 * (10 ** 18), "Balance should be 2250 * 5 * 10^18")
|
||||
|
||||
const ethCollected = await instance.etherCollected()
|
||||
assert.equal(ethCollected.toNumber(), 6 * (10**18), "etherCollected should be 6 ether");
|
||||
|
||||
const tokensIssued = await instance.totalSupply()
|
||||
assert.equal(tokensIssued.toNumber(), (2250 * 5 + 1500) * (10**18), "totalSupply should be 2250 * 5 ether");
|
||||
|
||||
})
|
||||
|
||||
it("should not be able to contribute 0.1 eth", async function() {
|
||||
const instance = await FluencePreSale.deployed();
|
||||
|
||||
try {
|
||||
await instance.sendTransaction({from: accounts[2], value: web3.toWei(100, 'finney')})
|
||||
} catch(e) {
|
||||
return;
|
||||
}
|
||||
assert.equal(1, 0, "Exception was not thrown on 0.1 eth contribution")
|
||||
|
||||
})
|
||||
});
|
@ -1,64 +0,0 @@
|
||||
/*var MetaCoin = artifacts.require("./MetaCoin.sol");
|
||||
|
||||
contract('MetaCoin', function(accounts) {
|
||||
it("should put 10000 MetaCoin in the first account", function() {
|
||||
return MetaCoin.deployed().then(function(instance) {
|
||||
return instance.getBalance.call(accounts[0]);
|
||||
}).then(function(balance) {
|
||||
assert.equal(balance.valueOf(), 10000, "10000 wasn't in the first account");
|
||||
});
|
||||
});
|
||||
it("should call a function that depends on a linked library", function() {
|
||||
var meta;
|
||||
var metaCoinBalance;
|
||||
var metaCoinEthBalance;
|
||||
|
||||
return MetaCoin.deployed().then(function(instance) {
|
||||
meta = instance;
|
||||
return meta.getBalance.call(accounts[0]);
|
||||
}).then(function(outCoinBalance) {
|
||||
metaCoinBalance = outCoinBalance.toNumber();
|
||||
return meta.getBalanceInEth.call(accounts[0]);
|
||||
}).then(function(outCoinBalanceEth) {
|
||||
metaCoinEthBalance = outCoinBalanceEth.toNumber();
|
||||
}).then(function() {
|
||||
assert.equal(metaCoinEthBalance, 2 * metaCoinBalance, "Library function returned unexpected function, linkage may be broken");
|
||||
});
|
||||
});
|
||||
it("should send coin correctly", function() {
|
||||
var meta;
|
||||
|
||||
// Get initial balances of first and second account.
|
||||
var account_one = accounts[0];
|
||||
var account_two = accounts[1];
|
||||
|
||||
var account_one_starting_balance;
|
||||
var account_two_starting_balance;
|
||||
var account_one_ending_balance;
|
||||
var account_two_ending_balance;
|
||||
|
||||
var amount = 10;
|
||||
|
||||
return MetaCoin.deployed().then(function(instance) {
|
||||
meta = instance;
|
||||
return meta.getBalance.call(account_one);
|
||||
}).then(function(balance) {
|
||||
account_one_starting_balance = balance.toNumber();
|
||||
return meta.getBalance.call(account_two);
|
||||
}).then(function(balance) {
|
||||
account_two_starting_balance = balance.toNumber();
|
||||
return meta.sendCoin(account_two, amount, {from: account_one});
|
||||
}).then(function() {
|
||||
return meta.getBalance.call(account_one);
|
||||
}).then(function(balance) {
|
||||
account_one_ending_balance = balance.toNumber();
|
||||
return meta.getBalance.call(account_two);
|
||||
}).then(function(balance) {
|
||||
account_two_ending_balance = balance.toNumber();
|
||||
|
||||
assert.equal(account_one_ending_balance, account_one_starting_balance - amount, "Amount wasn't correctly taken from the sender");
|
||||
assert.equal(account_two_ending_balance, account_two_starting_balance + amount, "Amount wasn't correctly sent to the receiver");
|
||||
});
|
||||
});
|
||||
});
|
||||
*/
|
@ -1,3 +1,6 @@
|
||||
require('babel-register');
|
||||
require('babel-polyfill');
|
||||
|
||||
module.exports = {
|
||||
networks: {
|
||||
development: {
|
||||
|
Loading…
x
Reference in New Issue
Block a user