poanetwork / token-wizard Goto Github PK
View Code? Open in Web Editor NEW(Discontinued) TokenWizard is an DApp to create and manage crowdsale and token contracts using a simple UI
License: MIT License
(Discontinued) TokenWizard is an DApp to create and manage crowdsale and token contracts using a simple UI
License: MIT License
-condense the four Metamask transactions into one
-replace '$this' with 'this' across the application. Using jquery like syntax is an anti-pattern in react
-use ES6 instead of regular javascript/ES5 or lower
-replace 'var' with the usage of let of const.
-extract most of the logic into separate class or util functions,
-right now there is too much logic in componentDidMount/componentWillMount, each function should have all of its logic at the same level of abstraction and be very readable by anyone who is not familiar with JS or react
state should be extracted at the application level, or passed down through props, not passed down as state to be mutated continually i.e. going passing and using state from home -> page1
remove nested ternary operators, multiple functions should be used to extract this logic or use &&/|| operators
don't mutate state directly any state changes should be made with this.setState({}) using the this.state = 'hello' will cause re-render issues within react
-remove console logs
-add extensive variable naming, i.e. using descriptive words to describe the items one is iterating over instead of 'i' in a for loop
As in Howey Test react app
If networkid == 1
show sweetalert
with text "Wizard is under maintenance on Ethereum Mainnet. Please come back later or use Kovan/Rinkeby/Oracles. Follow https://twitter.com/oraclesorg for status."
Burn left tokens after crowd sale's end.
In mintable token is not relevant.
After deployment to ethereum network automatically verify contracts in etherscan
At the moment it is possible to update tiers after finalize().
An organizer of a crowdsale can specify an additional list of time-based bonuses, e.g.
Bonus will be an add-on to any type of crowdsale contract
Problem:
If a user doesnt press Plus UI element in “Add whitelist” and “Add reserved token” the row is not added to a state of a contracts and therefore is not used in a crowdsale.
Solution:
If a button is not pressed and a row is filled, use it for the smart contract state .
After pressing Plus button clear the row and add it as it is now. If row is filled and Plus not pressed use the row in the contract state
If I were to deploy a contract I would assume if I set supply to 0 , the crowdsale would be uncapped.
If that is not the case, I'd expect that I have to have this value being set. So, make sure the user can't proceed with Supply = 0
After pressing new crowdsale there is a lag ~ 2-3 seconds.
Would be good to:
Loader should not be present if loading time is less than 1 sec.
Before starting to sign transactions show a sweetalert with number of TXs
"You are about to sign n TXs. You will see an individual Metamask windows for each of it. Please don't open two or more instances of Wizard in one browser."
Each Component Should have its own directory in the components directory and should have their own constants, utils, and eventually, actions and reducers files.
The current file such as stepOne.js should be replaced with index.js as follows in the directory.
components
stepOne
utils.js
constants.js
index.js
reducers.js
actions.js
Add Sweetalert to all pages of Wizard but Invest page if Metamask is not installed.
For the Invest page will be an additional issue.
Title: Warning
Text:
"You don't have Metamask installed. Check ICO Wizard GitHub for the instruction."
It's possible that one address will have fixed and % tokens on token setup phase
now it's not possible to add one address for both fixed and % token
Implement form validation and type checking for step three, four, and five.
We have it Howey Test appp
e.g. from Step 3 to Step 4
http://howey.oracles.org/#/questions/3 to http://howey.oracles.org/#/questions/4
Roman suggested to look into https://github.com/mobxjs/mobx instead of Redux
We need to make contract files flat to verify them later in etherscan.
It means that we need to replace all imports with actual code of imports.
Include it into the current build process.
Because we have more advanced "Reserved tokens" features to assign tokens to participants in fixed amounts or in percentage
When deploying to mainnet, the Wizard doesn't handle exception
"main.3ba23847.js:1 Unhandled rejection Error: Transaction was not mined within 50 blocks, please make sure your transaction was properly send. Be aware that it might still be mined!"
I reproduced it and time between submitting tx and this error is much less than 50 blocks time, which is like 50*15sec=12.5 minutes
Information on Page 4 (Results) is very important for the crowdsale and token. It contains all settings of all tiers, code of a contract, ABI, constructor parameters. ICO Wizard is a client-side app without persistence besides an Ethereum blockchain.
We need to store the data somewhere. I propose to store data in a generated PDF document and download it to user's computer.
ABI is unusable after copying from generated PDF
Example,
generated document
https://transfer.sh/4d0z7/crowdsale.pdf
contract
0x820C6cfEbd22D1bd8C55f9527d1270BEe3bea7A9
not recognized by parity as a valid JSON array
Maybe we should switch from PDF to something else, e.g. anonymous Gist
https://developer.github.com/v3/gists/#create-a-gist
Enabled option may confuse users when they don’t fill whitelist addresses . Let’s make it “off” by default.
Unhandled rejection Error: Error: [number-to-bn] while converting number 1e+21 to BN.js instance, error: invalid number value. Value must be an integer, hex string, BN or BigNumber instance. Note, decimals are not supported. Given value: "1e+21"
at Object.l [as toBN] (https://wizard.oracles.org/static/js/main.3ba23847.js:1:423452)
at s (https://wizard.oracles.org/static/js/main.3ba23847.js:1:92390)
at o.c [as _inputFormatter] (https://wizard.oracles.org/static/js/main.3ba23847.js:1:92487)
at o.encode (https://wizard.oracles.org/static/js/main.3ba23847.js:1:111282)
at https://wizard.oracles.org/static/js/main.3ba23847.js:1:111119
at Array.forEach ()
at https://wizard.oracles.org/static/js/main.3ba23847.js:1:111090
at o.encode (https://wizard.oracles.org/static/js/main.3ba23847.js:1:111136)
at https://wizard.oracles.org/static/js/main.3ba23847.js:1:358198
at Array.map ()
at m.encodeParameters (https://wizard.oracles.org/static/js/main.3ba23847.js:1:358171)
at https://wizard.oracles.org/static/js/main.3ba23847.js:1:1381438
at Array.map ()
at Object.p._encodeMethodABI (https://wizard.oracles.org/static/js/main.3ba23847.js:1:1381413)
at Object.p._processExecuteArguments (https://wizard.oracles.org/static/js/main.3ba23847.js:1:1385504)
at Object.p._executeMethod (https://wizard.oracles.org/static/js/main.3ba23847.js:1:1385995)
at https://wizard.oracles.org/static/js/main.3ba23847.js:1:251424
at https://wizard.oracles.org/static/js/main.3ba23847.js:1:98770
at a (https://wizard.oracles.org/static/js/main.3ba23847.js:1:1167349)
at i._settlePromiseFromHandler (https://wizard.oracles.org/static/js/main.3ba23847.js:1:1140792)
at i._settlePromise (https://wizard.oracles.org/static/js/main.3ba23847.js:1:1141636)
at i._settlePromise0 (https://wizard.oracles.org/static/js/main.3ba23847.js:1:1142338)
From previous event:
at i.d [as _captureStackTrace] (https://wizard.oracles.org/static/js/main.3ba23847.js:1:1107076)
at i._then (https://wizard.oracles.org/static/js/main.3ba23847.js:1:1136426)
at i.then (https://wizard.oracles.org/static/js/main.3ba23847.js:1:1134794)
at f (https://wizard.oracles.org/static/js/main.3ba23847.js:1:98605)
at o (https://wizard.oracles.org/static/js/main.3ba23847.js:1:250931)
at d (https://wizard.oracles.org/static/js/main.3ba23847.js:1:255134)
at https://wizard.oracles.org/static/js/main.3ba23847.js:1:489908
at https://wizard.oracles.org/static/js/main.3ba23847.js:1:254995
at e (https://wizard.oracles.org/static/js/main.3ba23847.js:1:250247)
at Object.callback (https://wizard.oracles.org/static/js/main.3ba23847.js:1:98558)
at o (https://wizard.oracles.org/static/js/main.3ba23847.js:1:107831)
at https://wizard.oracles.org/static/js/main.3ba23847.js:1:1193283
at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/inpage.js:9899:9
at completeRequest (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/inpage.js:9950:9)
at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/inpage.js:673:16
at replenish (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/inpage.js:1193:25)
at iterateeCallback (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/inpage.js:1183:17)
at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/inpage.js:1158:16
at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/inpage.js:9827:7
at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/inpage.js:9923:18
at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/inpage.js:3335:16
at replenish (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/inpage.js:1198:17)
at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/inpage.js:1202:9
at eachLimit$1 (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/inpage.js:3421:24)
at Object. (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/inpage.js:1232:16)
at runReturnHandlers (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/inpage.js:9922:15)
at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/inpage.js:4105:24
at replenish (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/inpage.js:1198:17)
R @ main.3ba23847.js:1
Step four. Submit contract to the network using web3 and metamask
And remove "Soon" from "Whitelist with cap"
Comments should be reserved for explaining code not disabling it. All commented code should be deleted from the codebase.
Add instruction how to deploy ICO Wizard on Netlify.
Project 001 is a potential user of ICO Wizard. They plan to launch an ICO on September 12.
As is:
We have two rounds of contract creations. Between Step 3 and 4, and between Step 4 and 5.
To be:
All contracts will be created Between Step 3 and 4. It will allow having metadata of all contracts in the downloaded file and therefore verify all contracts.
URL https://github.com/OpenZeppelin/zeppelin-solidity
we'll use it for crowd sale contracts
Also will need to modify data on Step 4 and downloaded text file:
Add instruction to README.md
For step 5 (crowdsale page) and page Invest
using web3 provider. id of a contract should be as a GET parameter (or better option)
If "Disable whitelisting" switch is enabled, anyone can buy without limits on a tier. It's not possible to update "Disable whitelisting" after the creation of a smart contract. The switch is located near "Enable update" switch
Script missing so npm start fails with this error without executing... Any thoughts where to find it?
Icons:
2x
![image](https://user-images.githubusercontent.com/424628/30351057-6d0bdf30-97ce-11e7-9703-ac775e2acbd1.png
regular
Organiser performs KYC data collection with the White-List from the crowd before starting private Pre-Ico-Tier and pick up a group from the crowd who meet the requirements (could be > 2000 people) to set up Tiers (1, 2 or 3 pre-ico tiers with different params).
Selected group get the private link to the private Pre-ICO-Tier with specified by organiser params of the Tier:
– hard cap;
– min / max check for one investor;
– dates;
– discount.
Additional block in Step 2. An organizer can add a string with a pair of address and amounts of tokens reserved. There is a + button to add next row.
CAP = CAP - SUM(RESERVED AMOUNTS)
Regular crowd buyers can't buy reserved amount. After crowdsale ends, reserved buyers can't buy reserved amounts and it will be burned.
Replace block start and block end on Crowdsale setup to Date/Time. It will be more convenient for users to specify time instead of block. Start time can't be set up before current date and time.
Need to change on Crowdsale and Publish pages
An attacker can send a user to a legit website with a fraudulent contract. Crowdsale addresses now in GET parameters in URL and it's easy to commit fraud for the attacker.
One solution to mitigate the problem is to store parameters of the crowdsale in a configuration file. I propose to store them in local structure of an instance of ICO Wizard, e.g. using this technique https://stackoverflow.com/questions/37066758/how-can-i-use-a-config-file-in-react
If a file with config is present, the app should use parameters from the file even GET parameters are used.
After implementation of the feature add a section about configuration to README.md file
In UI:
On setup a tier step. For each tier:
if the switch is on, tier created with a method to update parameters of the tier such as
Processing 3 tier ICO, at least 6 contracts needed to be signed where gas limit was not filled in, was unsure of amount and might be a reason why contracts failed not knowing the amount of gas to send to each one.
For verification on etherscan.io I have to know:
In an example, minCap=1 maxCap=100 tokens for a user
when a crowdsale starts he buy 1 token
and after he can't buy <1 tokens, e.g. 0.1. The contract returns exception
he should be able in any amount < 100-1 in the next transaction
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.