Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Sync) bridge <- master #348

Merged
merged 172 commits into from
Nov 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
172 commits
Select commit Hold shift + click to select a range
51cec26
Mention about ICO Wizard in the top of sources
vbaranov Oct 4, 2017
63ecbf0
Merge pull request #214 from vbaranov/dev
vbaranov Oct 4, 2017
4b45161
README: Change maxCap for tier from MetaMask
vbaranov Oct 5, 2017
ddcd67a
Merge pull request #224 from vbaranov/dev
vbaranov Oct 5, 2017
afe75c7
README: Change maxCap for tier from MetaMask
vbaranov Oct 5, 2017
a919f20
Merge pull request #225 from vbaranov/dev
vbaranov Oct 5, 2017
67d917a
twitter link fix
vbaranov Oct 6, 2017
13968c0
update dependency
vbaranov Oct 6, 2017
2c40525
Merge pull request #229 from oraclesorg/master
vbaranov Oct 6, 2017
43385f2
README sync
vbaranov Oct 6, 2017
4504657
Merge pull request #4 from oraclesorg/stage
vbaranov Oct 6, 2017
5e761a0
Merge pull request #230 from vbaranov/stage
vbaranov Oct 6, 2017
5032607
web3 0.19 -> web3 1.0; twice callback from contract deployment fix; m…
vbaranov Oct 6, 2017
d9f55b4
Merge pull request #231 from vbaranov/stage
vbaranov Oct 6, 2017
14e873e
Merge pull request #234 from oraclesorg/stage
vbaranov Oct 7, 2017
6f1fa41
Emergency alert
vbaranov Oct 9, 2017
04b255b
Merge pull request #239 from vbaranov/stage
vbaranov Oct 9, 2017
cafe2a7
Merge pull request #240 from vbaranov/stage
vbaranov Oct 9, 2017
c1b18ce
Urgent: white list adding bug
vbaranov Oct 9, 2017
7e8e720
Merge pull request #243 from vbaranov/stage
vbaranov Oct 9, 2017
e6186a9
Merge pull request #242 from vbaranov/stage
vbaranov Oct 9, 2017
dc4d56b
Critical: crowdsale contract gas estimation fix; ethereumjs-abi modul…
vbaranov Oct 9, 2017
26ccd07
Merge pull request #246 from vbaranov/stage
vbaranov Oct 9, 2017
58dedc2
Merge pull request #245 from vbaranov/stage
vbaranov Oct 9, 2017
fd204c7
Disabled emergency alert
vbaranov Oct 9, 2017
48765ad
Merge pull request #247 from vbaranov/stage
vbaranov Oct 9, 2017
aff4fce
Workaround mainnet for error : no cb on error
vbaranov Oct 9, 2017
dddf33a
Merge pull request #248 from vbaranov/stage
vbaranov Oct 9, 2017
5b73ad9
Stage: emergency alert
vbaranov Oct 9, 2017
3b8b830
Stage: emergency alert
vbaranov Oct 9, 2017
75c473a
Merge pull request #249 from vbaranov/stage
vbaranov Oct 9, 2017
8d51cd1
Maiinet fix update
vbaranov Oct 10, 2017
02ea631
src/submodules is deleted
vbaranov Oct 10, 2017
2435737
package.json update
vbaranov Oct 10, 2017
96dea8b
Garbage collection
vbaranov Oct 10, 2017
f98b428
Merge pull request #250 from vbaranov/stage
vbaranov Oct 10, 2017
8967ffa
Merge pull request #251 from oraclesorg/stage
vbaranov Oct 10, 2017
c23e911
investors count fix
vbaranov Oct 10, 2017
1727fff
Remove loader on error
vbaranov Oct 10, 2017
263e73c
Merge pull request #252 from vbaranov/stage
vbaranov Oct 10, 2017
0df1dbf
Merge pull request #253 from vbaranov/stage
vbaranov Oct 10, 2017
4d5bb96
Local running of Wizard for Windows users
vbaranov Oct 10, 2017
b7a3122
README fixes
vbaranov Oct 10, 2017
7f2873b
Merge pull request #254 from vbaranov/stage
vbaranov Oct 10, 2017
28cb7a6
Merge pull request #255 from vbaranov/stage
vbaranov Oct 10, 2017
1a31f5c
Alert between steps 3 and 4
vbaranov Oct 11, 2017
a5ea9ff
Merge pull request #256 from vbaranov/stage
vbaranov Oct 11, 2017
2b01210
Merge pull request #257 from vbaranov/stage
vbaranov Oct 11, 2017
618c3b8
Automatic file download
vbaranov Oct 11, 2017
e524bf6
package.json update
vbaranov Oct 11, 2017
35a2617
web3 is doubled fix: doubled in package and in npm start script
vbaranov Oct 11, 2017
d4ebe86
Merge pull request #259 from vbaranov/stage
vbaranov Oct 11, 2017
2eb0576
Merge pull request #260 from vbaranov/stage
vbaranov Oct 11, 2017
5460938
Polling of transactions from deployment of contracts
vbaranov Oct 11, 2017
d05e7de
Merge pull request #261 from vbaranov/stage
vbaranov Oct 11, 2017
e9b2338
Merge pull request #262 from vbaranov/stage
vbaranov Oct 11, 2017
e641e24
Mainnet fix: sending transactions to contracts
vbaranov Oct 11, 2017
85af198
Merge pull request #263 from vbaranov/stage
vbaranov Oct 11, 2017
aff94f5
Merge pull request #264 from vbaranov/stage
vbaranov Oct 11, 2017
beb7f56
crowdsale page light fix: price and goal representation
vbaranov Oct 12, 2017
ad0fe93
package.json
vbaranov Oct 12, 2017
ff0e30b
Merge pull request #266 from vbaranov/stage
vbaranov Oct 12, 2017
07900d2
Merge pull request #265 from vbaranov/stage
vbaranov Oct 12, 2017
a39d09b
roundToDecimals function
vbaranov Oct 16, 2017
4d7da17
Merge pull request #275 from vbaranov/stage
vbaranov Oct 16, 2017
7f700cb
reviewer suggestions
vbaranov Oct 18, 2017
9317dd5
Merge pull request #277 from vbaranov/stage
vbaranov Oct 18, 2017
e5ffa24
reviewer suggestions
vbaranov Oct 18, 2017
3aa4351
Merge pull request #278 from vbaranov/stage
vbaranov Oct 18, 2017
052ff3e
Merge pull request #276 from oraclesorg/stage
vbaranov Oct 18, 2017
c85e488
(Fix) roundToDecimals function updating to cover all use case
vbaranov Oct 18, 2017
89168d2
Merge pull request #280 from vbaranov/stage
vbaranov Oct 18, 2017
b8b7359
Screenshots for end-user instructions
vbaranov Oct 19, 2017
ddb82f9
Screenshots for end-users instructions
vbaranov Oct 19, 2017
6d4039c
(WIKI) New screenshots for end-user instructions
vbaranov Oct 19, 2017
ec5cf6e
Delete MyEtherWalletGenerateTransaction.png
vbaranov Oct 19, 2017
570481e
(WIKI) MyEtherWalletConnectToMetaMask.png
vbaranov Oct 19, 2017
b8eca89
(WIKI) MyEtherWalletConnectToMetaMask.png
vbaranov Oct 19, 2017
c820d85
(WIKI) new MyEtherWalletConnectToMetaMask.png
vbaranov Oct 19, 2017
5b95ca4
(WIKI) buy and change max cap from README to WIKI
vbaranov Oct 19, 2017
6fd6ffd
screenshots for wiki
vbaranov Oct 20, 2017
61e8a5a
Updates regarding to reviewer comments
vbaranov Oct 20, 2017
c2c29cf
Merge pull request #286 from vbaranov/stage
vbaranov Oct 20, 2017
e4d57f7
Merge remote-tracking branch 'upstream/master' into emergency1
vbaranov Oct 20, 2017
6ddaab1
Gas price reduction
vbaranov Oct 20, 2017
aea0df6
roundToDecimals is returned back
vbaranov Oct 20, 2017
69aafc3
roundToDecimals is returned back
vbaranov Oct 20, 2017
a5ba0d7
Merge pull request #287 from vbaranov/emergency1
vbaranov Oct 20, 2017
6186a89
5gwei gas price
vbaranov Oct 20, 2017
6530f01
Merge pull request #288 from vbaranov/stage
vbaranov Oct 20, 2017
5fe6743
reviewer comments
vbaranov Oct 22, 2017
ce84c87
reviewer comments
vbaranov Oct 22, 2017
fa989d5
Merge pull request #293 from vbaranov/stage
vbaranov Oct 22, 2017
85ac253
Merge branch 'master' into stage
vbaranov Oct 22, 2017
f7d26e3
Update constants.js
vbaranov Oct 22, 2017
630e868
Update index.js
vbaranov Oct 22, 2017
81e03da
Update index.js
vbaranov Oct 22, 2017
2728283
Update utils.js
vbaranov Oct 22, 2017
d163ada
Update constants.js
vbaranov Oct 22, 2017
8c93f09
Update index.js
vbaranov Oct 22, 2017
ddbd462
TRUNC_TO_DECIMALS
vbaranov Oct 22, 2017
26131b0
Merge pull request #281 from oraclesorg/stage
vbaranov Oct 22, 2017
9ed19ec
relates to #290
vbaranov Oct 22, 2017
3723ed4
Contracts: reserved tokens tests update
vbaranov Oct 22, 2017
28bb73c
Merge pull request #295 from vbaranov/stage
vbaranov Oct 22, 2017
054a0b9
Reserved tokens fix
vbaranov Oct 23, 2017
b1a5f43
Merge pull request #299 from vbaranov/stage
vbaranov Oct 23, 2017
d6a5035
fixed typos and grammar issues.
dynamitechetan Oct 24, 2017
5ef1604
Merge pull request #300 from dynamitechetan/patch-1
vbaranov Oct 24, 2017
466964e
Merge pull request #301 from oraclesorg/master
vbaranov Oct 24, 2017
1494a06
ABI encoded parameters without 0x
vbaranov Oct 24, 2017
04b2b44
Merge pull request #303 from vbaranov/stage
vbaranov Oct 24, 2017
a623c19
Fix contract name
fvictorio Oct 25, 2017
615e26d
Use Oracles favicon
fvictorio Oct 25, 2017
699f8c3
Merge pull request #305 from fvictorio/fix-contract-name
vbaranov Oct 26, 2017
4ade07b
Merge pull request #308 from oraclesorg/master
vbaranov Oct 26, 2017
9adadf6
isBreakingCap fix
vbaranov Oct 26, 2017
a08cc1f
isBreakingCap fix, combine-solidity windows support
vbaranov Oct 26, 2017
90e0f37
Merge pull request #309 from vbaranov/stage
vbaranov Oct 26, 2017
fe8c3ce
Merge pull request #310 from vbaranov/emergency1
vbaranov Oct 26, 2017
dba2008
Update README.md
igorbarinov Oct 27, 2017
1a7cbbd
Link to PR policy, add lists in timing
mmmikhail Oct 29, 2017
668226c
Link to Wiki
mmmikhail Oct 30, 2017
beefc3c
#313
vbaranov Oct 31, 2017
2e13c4f
Merge pull request #314 from vbaranov/stage
vbaranov Oct 31, 2017
2a33359
Update README.md
igorbarinov Oct 31, 2017
057f33a
Change 'shortcut icon' to 'icon'
fvictorio Nov 1, 2017
da1b1a3
Add validation on invest button
fernandomg Nov 1, 2017
2901904
oracles-combine-solidity update
vbaranov Nov 1, 2017
cb5f66c
Update submodule oracles-combine-solidity
vbaranov Nov 1, 2017
e91eae6
Update gas limits for two calls
fvictorio Nov 1, 2017
7ecaa25
Use web3 HttpProvider in development if web3 is not injected
fvictorio Nov 1, 2017
6fcc3d9
node v.8 for Travis CI
vbaranov Nov 2, 2017
c20a604
package.json engine version: 8.9.0
vbaranov Nov 2, 2017
bfa79d1
Update npm run build
vbaranov Nov 2, 2017
5f10e8f
Merge pull request #322 from vbaranov/emergency1
vbaranov Nov 2, 2017
ec70fc9
Merge remote-tracking branch 'upstream/stage' into stage
vbaranov Nov 2, 2017
851f286
Stage sync with master
vbaranov Nov 2, 2017
f0f482b
Update package.json
vbaranov Nov 2, 2017
8dddf3e
Update .travis.yml
vbaranov Nov 2, 2017
facb172
Merge pull request #306 from fvictorio/fix-favicon
vbaranov Nov 2, 2017
b03c840
Stage sync with Master
vbaranov Nov 2, 2017
49b9b07
favicon for crowdsale and invest pages
vbaranov Nov 2, 2017
feaecb5
Merge pull request #329 from vbaranov/emergency1
vbaranov Nov 2, 2017
d4a562f
Merge pull request #330 from oraclesorg/master
vbaranov Nov 2, 2017
82df45b
&.disabled is not used in css
vbaranov Nov 2, 2017
35fbcf2
Merge pull request #321 from oraclesorg/validation-on-invest-button
vbaranov Nov 2, 2017
d3f1c13
Merge pull request #331 from oraclesorg/master
vbaranov Nov 2, 2017
ec68d1f
Merge pull request #332 from oraclesorg/master
vbaranov Nov 2, 2017
e8f2cf2
Merge pull request #324 from oraclesorg/update-gas-limits
vbaranov Nov 2, 2017
ff4ebc4
Merge pull request #333 from oraclesorg/master
vbaranov Nov 2, 2017
98a7052
Moved pristine flag as part of the Component's state
fernandomg Nov 2, 2017
29c9fd0
Show toaster when user rejects Invest Transaction
fernandomg Nov 3, 2017
c43a842
Merge pull request #334 from oraclesorg/validation-on-invest-button
vbaranov Nov 3, 2017
fee1ea0
Display toaster after Contract was downloaded
fernandomg Nov 3, 2017
3484475
Revert "Display toaster after Contract was downloaded"
fernandomg Nov 3, 2017
e314cd2
Display toaster after Contract was downloaded
fernandomg Nov 3, 2017
c5dd00c
Extract condition to variable
fvictorio Nov 6, 2017
40768cd
alertOptions to invest constants
vbaranov Nov 6, 2017
6c02f5d
invest constants file
vbaranov Nov 6, 2017
ffb0db8
Merge pull request #336 from oraclesorg/toaster-on-transaction-rejection
vbaranov Nov 6, 2017
d6223fd
Merge pull request #343 from oraclesorg/master
vbaranov Nov 6, 2017
9494ba3
alertOptions to stepFour constants
vbaranov Nov 6, 2017
1325d1b
alet msg to constants too
vbaranov Nov 6, 2017
54e6118
Merge pull request #340 from oraclesorg/toaster-on-contract-download
vbaranov Nov 6, 2017
5ff68b4
Merge pull request #325 from oraclesorg/use-web3-http-provider
vbaranov Nov 6, 2017
15b34b7
0x removed from ABI encoded parameters in the downloaded file
vbaranov Nov 6, 2017
6444aab
Merge pull request #346 from oraclesorg/0x-removed-from-ABI-encoded
vbaranov Nov 6, 2017
432ff65
temp
vbaranov Nov 7, 2017
88bf029
Merge branch 'stage' into master
vbaranov Nov 7, 2017
78c7429
(Emergency) [email protected] submodule
vbaranov Nov 7, 2017
8cb6bd2
Merge branch 'bridge' into master
vbaranov Nov 7, 2017
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
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ install:
- npm install

after-script:
- sudo kill `sudo lsof -t -i:8545`
- sudo kill `sudo lsof -t -i:8545`
55 changes: 29 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
![ICO Wizard DApp](https://forum.oracles.org//uploads/default/original/1X/0883f34b870fac19914d7b5e43e4f815dbe5c267.png)
![ICO Wizard DApp](https://forum.oracles.org/uploads/default/original/1X/4defd4c248825a9216a247ab3c5cb1f613d7e5ef.png)

# ICO Wizard DApp

[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/hyperium/hyper/master/LICENSE)
[![Build Status](https://travis-ci.org/oraclesorg/ico-wizard.svg?branch=master)](https://travis-ci.org/oraclesorg/ico-wizard)
[![Waffle.io - Columns and their card count](https://badge.waffle.io/oraclesorg/ico-wizard.svg?columns=all)](http://waffle.io/oraclesorg/ico-wizard)
[![Join the chat at https://gitter.im/oraclesorg/ico-wizard](https://badges.gitter.im/oraclesorg/ico-wizard.svg)](https://gitter.im/oraclesorg/ico-wizard?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

_Attention_!

Expand All @@ -18,7 +20,6 @@ Please, read instruction before you'll start to create crowdsales using ICO Wiza
+ [Run local version for development](#run-local-version-for-development)
+ [ICO configuration](#ico-configuration)
+ [Tests](#tests)
+ [Investment with transaction from MetaMask](#investment-with-transaction-from-metamask)
* [Deploying of crowdsale to Mainnet](#deploying-of-crowdsale-to-mainnet)
+ [Time](#time)
+ [Price](#price)
Expand All @@ -29,7 +30,6 @@ Please, read instruction before you'll start to create crowdsales using ICO Wiza
* [Support](#support)
* [Notable Contributors](#notable-contributors)
* [Disclaimer](#disclaimer)
* [Bridge testing](#bridge-testing)


## Introduction
Expand Down Expand Up @@ -156,14 +156,14 @@ Test scripts are added to Travis CI and executed at every pull request.
If you want to start it by yourself, simply run the command `npm test` from the root directory.
It will start testrpc at port 8545, Truffle will compile, deploy contracts to it and Truffle will execute tests.

*Note:* Kill testrpc after tests will executed:
*Note:* Kill testrpc after tests will be executed:
```
sudo kill `sudo lsof -t -i:8545`.
```

Currently available tests cover the following scenario:
Currently, available tests cover the following scenario:

The updatable, whitelisted one tier crowdsale contract with one address in white list and reserved tokens for the same address (both: in absolute values and in percentage)
The updatable, whitelisted one tier crowdsale contract with one address in whitelist and reserved tokens for the same address (both: in absolute values and in percentage)

Checklist of contracts' testing:

Expand Down Expand Up @@ -220,50 +220,49 @@ Contract: CrowdsaleTokenExt

The one-tier crowdsale contract takes ~24 minutes in total.

Estimates for each contracts:
Estimates for each contract:


SafeMathLib : 02:00
* SafeMathLib : 02:00

Token: 04:15
* Token: 04:15

Pricing strategy: 01:32
* Pricing strategy: 01:32

Crowdsale: 04:52
* Crowdsale: 04:52

Finalize agent: 01:52
* Finalize agent: 01:52


Estimates for each methods invocation:

* setLastCrowdsale for Pricing Strategy: 00:58

setLastCrowdsale for Pricing Strategy: 00:58
* updateJoinedCrowdsales: 02:00

updateJoinedCrowdsales: 02:00
* setMintAgent: 01:30

setMintAgent: 01:30
* setMintAgent: 02:10

setMintAgent: 02:10
* setFinalizeAgent: 01:20

setFinalizeAgent: 01:20
* setReleaseAgent: 00:53

setReleaseAgent: 00:53

transferOwnership: 00:40
* transferOwnership: 00:40

### Price

Attention!

Deploying to the Mainnet is expensive. For a contract with one tier the price is 0.16 ETH.
Deploying to the Mainnet is expensive. For a contract with one tier, the price is 0.16 ETH.

With the price of 1 ETH of $300.0 USD the price of one deployment will be $48.0 USD.
With the price of 1 ETH of $300.0 USD, the price of one deployment will be $48.0 USD.



## How to verify ICO Wizard contracts in Etherscan

**Important!:** All information required for verification of ICO Wizard contracts located in a text file. You must download it on the Step 4 of ICO Wizard. There is **no** way to get it later and you'll need to repeat wizard for the new set of conracts to get the file.
**Important!:** All information required for verification of ICO Wizard contracts located in a text file. You must download it on Step 4 of ICO Wizard. There is **no** way to get it later and you'll need to repeat wizard for the new set of contracts to get the file.

### Crowdsale contract verification:

Expand All @@ -282,7 +281,7 @@ With the price of 1 ETH of $300.0 USD the price of one deployment will be $48.0

2.6. **Constructor Arguments ABI-encoded (For contracts that accept constructor parameters)** is *Crowdsale contract ABI encoded constructor arguments for [Tier name]*

3. For **Contract Library Address (For contracts that use libraries, supports up to 5 libraries)** By default we use only one library.
3. For **Contract Library Address (For contracts that use libraries, supports up to 5 libraries)** By default, we use only one library.

**Library_1 Name** type `:` and then the value of *SafeMathlLib library name* header from the file. Default value: `:SafeMathLibExt`.

Expand All @@ -309,12 +308,16 @@ We created ICO Wizard for a crowdsale of [Oracles Network](https://oracles.org/)

## Contributors guide

Issues which are looking for a handsome contributors are marked as _LookingForContributor_ label in [Issues](https://github.com/oraclesorg/ico-wizard/issues?q=is%3Aissue+is%3Aopen+label%3ALookingForContributor) section of the GitHub
Issues which are looking for a handsome contributors are marked as _LookingForContributor_ label in [Issues](https://github.com/oraclesorg/ico-wizard/issues?q=is%3Aissue+is%3Aopen+label%3ALookingForContributor) section of the GitHub.

Take a look at our [PR Policy](https://github.com/oraclesorg/ico-wizard/wiki/Pull-Request-Policy).

## Support

You can get support on [Telegram](https://t.me/oraclesnetwork).

Need more info? [Go Wiki](https://github.com/oraclesorg/ico-wizard/wiki).

## Notable Contributors

Brought to you by [Oracles Network](https://oracles.org/team) team.
Expand Down Expand Up @@ -418,4 +421,4 @@ ABI of the right-side contract is [here](https://github.com/oraclesorg/parity-br

8. Invest in the crowdsale page.

9. After ~10 - 20 seconds (for Oracles network) check at Kovan: https://kovan.etherscan.io/address/[verified_right-side_bridge_contract_address]#readContract `balances` for the same address that invest at ICO Wizard.
9. After ~10 - 20 seconds (for Oracles network) check at Kovan: https://kovan.etherscan.io/address/[verified_right-side_bridge_contract_address]#readContract `balances` for the same address that invest at ICO Wizard.
Binary file added docs/MyEtherWalletAttachToContract.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/MyEtherWalletChooseNetwork.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/MyEtherWalletConnectToMetaMask.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/MyEtherWalletGenerateTransactionBasic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/MyEtherWalletGenerateTransactionBuy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/MyEtherWalletSelectFunction.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"oracles-combine-solidity": "file:submodules/oracles-combine-solidity",
"path": "^0.12.7",
"react": "^15.6.1",
"react-alert": "^2.4.0",
"react-countdown-clock": "^2.0.0",
"react-dom": "^15.6.1",
"react-router-dom": "^4.1.2",
Expand Down
4 changes: 4 additions & 0 deletions src/components/invest/constants.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export const alertOptions = {
offset: '80px 14',
position: 'top right'
};
34 changes: 26 additions & 8 deletions src/components/invest/index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import React from 'react'
import ReactCountdownClock from 'react-countdown-clock'
import AlertContainer from 'react-alert'
import { getWeb3, checkTxMined, attachToContract, checkNetWorkByID, sendTXToContract } from '../../utils/blockchainHelpers'
import { getCrowdsaleData, getCurrentRate, initializeAccumulativeData, getAccumulativeCrowdsaleData, getCrowdsaleTargetDates, findCurrentContractRecursively, getJoinedTiers } from '../crowdsale/utils'
import { getQueryVariable, getURLParam, getWhiteListWithCapCrowdsaleAssets } from '../../utils/utils'
import { noMetaMaskAlert, noContractAlert, investmentDisabledAlert, investmentDisabledAlertInTime, successfulInvestmentAlert, invalidCrowdsaleAddrAlert } from '../../utils/alerts'
import { Loader } from '../Common/Loader'
import { ICOConfig } from '../Common/config'
import { defaultState, GAS_PRICE } from '../../utils/constants'
import { alertOptions } from './constants'

export class Invest extends React.Component {
constructor(props) {
Expand All @@ -18,6 +20,7 @@ export class Invest extends React.Component {
var state = defaultState;
state.seconds = 0;
state.loading = true;
state.pristineTokenInput = true;
this.state = state;
}

Expand Down Expand Up @@ -115,7 +118,7 @@ export class Invest extends React.Component {
event.preventDefault();

if (!this.isValidToken(this.state.tokensToInvest)) {
this.pristineTokenInput = false;
this.setState({ pristineTokenInput: false });
return;
}

Expand Down Expand Up @@ -192,11 +195,17 @@ export class Invest extends React.Component {
gasPrice: GAS_PRICE
};
console.log(opts);
sendTXToContract(web3, crowdsaleContract.methods.buy().send(opts), (err) => {
let state = this.state;
state.loading = false;
this.setState(state);
successfulInvestmentAlert(this.state.tokensToInvest);

sendTXToContract(web3, crowdsaleContract.methods.buy().send(opts), err => {
this.setState({ loading: false });

if (!err) {
successfulInvestmentAlert(this.state.tokensToInvest);
} else {
const type = 'error';
const message = 'User Rejected Transaction';
this.showToaster({type, message});
}
});

/*crowdsaleContract.methods.buy().send(opts, (err, txHash) => {
Expand Down Expand Up @@ -231,7 +240,7 @@ export class Invest extends React.Component {
}

tokensToInvestOnChange(event) {
this.pristineTokenInput = false;
this.setState({ pristineTokenInput: false });

let state = this.state;
state["tokensToInvest"] = event.target.value;
Expand Down Expand Up @@ -273,6 +282,14 @@ export class Invest extends React.Component {
return { days, hours, minutes}
}

showToaster = ({type = 'info', message = ''}) => {
if (!message) {
return
}

this.msg[type](message);
}

render(state){
const { seconds } = this.state
const { days, hours, minutes } = this.getTimeStamps(seconds)
Expand All @@ -296,7 +313,7 @@ export class Invest extends React.Component {
const totalSupply = (this.state.contractType === this.state.contractTypes.whitelistwithcap)?tierCap:standardCrowdsaleSupply;

let invalidTokenDescription = null;
if (!this.pristineTokenInput && !this.isValidToken(this.state.tokensToInvest)) {
if (!this.state.pristineTokenInput && !this.isValidToken(this.state.tokensToInvest)) {
invalidTokenDescription = <p className="error">Number of tokens to buy should be positive</p>;
}

Expand Down Expand Up @@ -378,6 +395,7 @@ export class Invest extends React.Component {
</div>
</div>
<Loader show={this.state.loading}></Loader>
<AlertContainer ref={a => this.msg = a} {...alertOptions} />
</div>
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/components/stepFour/constants.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export const alertOptions = { time: 10000, position: 'top right' }
export const fileDownloadedToasterMsg = "A file with contracts and metadata downloaded on your computer"
15 changes: 14 additions & 1 deletion src/components/stepFour/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import { DisplayTextArea } from '../Common/DisplayTextArea'
import { Loader } from '../Common/Loader'
import { NAVIGATION_STEPS, TRUNC_TO_DECIMALS } from '../../utils/constants'
import { copy } from '../../utils/copy';
import AlertContainer from 'react-alert'
import { alertOptions, fileDownloadedToasterMsg } from './constants'
const { PUBLISH } = NAVIGATION_STEPS

export class stepFour extends stepTwo {
Expand Down Expand Up @@ -479,7 +481,6 @@ export class stepFour extends stepTwo {
let web3 = this.state.web3;
let contracts = this.state.contracts;
console.log(contracts);
this.downloadCrowdsaleInfo();

this.setState(() => {
setLastCrowdsaleRecursive(0, web3, contracts.pricingStrategy.abi, contracts.pricingStrategy.addr, contracts.crowdsale.addr.slice(-1)[0], 142982, (err) => {
Expand All @@ -500,6 +501,9 @@ export class stepFour extends stepTwo {
transferOwnership(web3, this.state.contracts.token.abi, contracts.token.addr, this.state.crowdsale[0].walletAddress, 46699, (err) => {
if (err) return this.hideLoader();
this.hideLoader();

this.downloadCrowdsaleInfo();
this.showToaster({ message: fileDownloadedToasterMsg })
//this.goToCrowdsalePage();
});
});
Expand Down Expand Up @@ -537,6 +541,14 @@ export class stepFour extends stepTwo {
this.props.history.push(newHistory);
}

showToaster = ({type = 'info', message = ''}) => {
if (!message) {
return
}

this.msg[type](message);
}

render() {
let crowdsaleSetups = [];
for (let i = 0; i < this.state.crowdsale.length; i++) {
Expand Down Expand Up @@ -770,6 +782,7 @@ export class stepFour extends stepTwo {
<a onClick={this.goToCrowdsalePage} className="button button_fill">Continue</a>
</div>
<Loader show={this.state.loading}></Loader>
<AlertContainer ref={a => this.msg = a} {...alertOptions} />
</section>
)}
}
2 changes: 1 addition & 1 deletion src/components/stepFour/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ export function setReservedTokensListMultiple(web3, abi, addr, token, cb) {
console.log("inPercentageDecimals: " + inPercentageDecimals)

let method = tokenContract.methods.setReservedTokensListMultiple(addrs, inTokens, inPercentageUnit, inPercentageDecimals).send({gasPrice: GAS_PRICE})
sendTXToContract(web3, method, cb);
sendTXToContract(web3, method, cb)
});
}

Expand Down
7 changes: 6 additions & 1 deletion src/utils/blockchainHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,16 @@ export function getWeb3(cb) {
if (typeof web3 === 'undefined') {
// no web3, use fallback
console.error("Please use a web3 browser");
const devEnvironment = process.env.NODE_ENV === 'development';
if (devEnvironment) {
web3 = new Web3(new Web3.providers.HttpProvider('http://localhost:8545'));
}

cb(web3, false);
} else {
// window.web3 == web3 most of the time. Don't override the provided,
// web3, just wrap it in your Web3.
var myWeb3 = new Web3(web3.currentProvider);
var myWeb3 = new Web3(web3.currentProvider);

//checkNetworkVersion(myWeb3, function(isOraclesNetwork) {
cb(myWeb3, false);
Expand Down
6 changes: 3 additions & 3 deletions src/utils/microservices.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function getABIencoded(web3, types, vals, cb) {
console.log(vals);

let encoded = web3.eth.abi.encodeParameters(types, vals);
let outputRaw = encoded.toString("hex")
let output = outputRaw.indexOf("0x") > -1?outputRaw.substr(2):outputRaw
cb(output);
let ABIencodedRaw = encoded.toString("hex")
let ABIencoded = ABIencodedRaw.indexOf("0x") > -1 ? ABIencodedRaw.substr(2) : ABIencodedRaw
cb(ABIencoded);
}