Comments (10)
@igorbarinov @vbaranov https://egghead.io/courses/manage-complex-state-in-react-apps-with-mobx - great quick intro to mobx
from token-wizard.
@rstormsf upon further review, mobx is a great approach to state management here. My only concern is decoupling the actions from the underlying data in a store. Do you have any insight here?
from token-wizard.
@15chrjef current state structure is here
from token-wizard.
{
"icoWizard": {
"compilerVersion": "0.4.11",
"contractName": "MintedTokenCappedCrowdsaleExt",
"contractType": "white-list-with-cap",
"optimized": true,
"crowdsaleWalletAddress": "0x005364854d51a0a12cb3cb9a402ef8b30702a565"
},
"contracts": {
"token": {
"src": "",
"bin": "",
"abi": [],
"addr": "",
"abiConstructor": ""
},
"crowdsale": {
"src": "",
"bin": "",
"abi": [],
"addr": [],
"abiConstructor": []
},
"pricingStrategy": {
"src": "",
"bin": "",
"abi": [],
"addr": [],
"abiConstructor": []
},
"multisig": {},
"nullFinalizeAgent": {
"src": "",
"bin": "",
"abi": [],
"addr": "",
"abiConstructor": ""
},
"finalizeAgent": {
"src": "",
"bin": "",
"addr": [],
"abiConstructor": []
},
"tokenTransferProxy": {},
"safeMathLib": {
"src": "",
"bin": "",
"addr": "",
"abiConstructor": ""
}
},
"token": {
"name": "MyToken",
"ticker": "MTK",
"supply": 0,
"decimals": "18"
},
"reservedTokens": [
{
"addr": "0x005364854d51A0A12cb3cb9A402ef8b30702a565",
"dim": "tokens",
"val": "10"
}
],
"reservedTokensElements": [
{
"key": "0",
"ref": null,
"props": {
"num": 0,
"addr": "0x005364854d51A0A12cb3cb9A402ef8b30702a565",
"dim": "tokens",
"val": "10"
},
"_owner": null,
"_store": {}
}
],
"reservedTokensInput": {
"dim": "tokens",
"addr": "",
"val": ""
},
"stepTwoValidations": {
"name": "VALIDATED",
"ticker": "VALIDATED",
"decimals": "VALIDATED",
},
"stepThreeValidations": {
"tier": "VALIDATED",
"startTime": "VALIDATED",
"endTime": "VALIDATED",
"supply": "VALIDATED",
"rate": "VALIDATED",
"updatable": "INVALID"
},
"pricingStrategies": [
{
"rate": "10000"
},
{
"rate": "1000"
}
],
"tiers": [
{
"tier": "Tier 1",
"updatable": "on",
"whitelistdisabled": "no",
"startTime": "2017-09-28T17:05",
"endTime": "2017-10-03T00:05:00",
"supply": "1000",
"whitelist": {
"addr": "0x005364854d51A0A12cb3cb9A402ef8b30702a565",
"min": "1",
"max": "10"
},
"whiteListElements": {
"key": "0",
"ref": null,
"props": {
"crowdsaleNum": 0,
"whiteListNum": 0,
"addr": "0x005364854d51A0A12cb3cb9A402ef8b30702a565",
"min": "1",
"max": "10"
},
"_owner": null,
"_store": {}
},
"whiteListInput": {
"addr": "",
"min": "",
"max": ""
},
},
{
"tier": "Tier 2",
"supply": "1000",
"updatable": "on",
"whitelist": [],
"whiteListElements": [],
"whiteListInput": {},
"startTime": "2017-10-03T00:05:00",
"endTime": "2017-10-07T00:05:00"
}
],
}
from token-wizard.
My suggestions:
1.
"crowdsale": {
"startTime": "2017-09-28T17:05",
"endTime": "2017-10-03T00:05:00",
"walletAddress": "0x005364854d51a0a12cb3cb9a402ef8b30702a565",
"supply": "1000"
}
Only walletAddress
here is the global parameter of the crowdsale. Others relate to tier. I suggest, to move startTime
, endTime
, supply
back to tiers[0]
element properties.
2.
"whitelist": {
"addr": "0x005364854d51A0A12cb3cb9A402ef8b30702a565",
"min": "1",
"max": "10"
},
"whiteListElements": {
"key": "0",
"ref": null,
"props": {
"crowdsaleNum": 0,
"whiteListNum": 0,
"addr": "0x005364854d51A0A12cb3cb9A402ef8b30702a565",
"min": "1",
"max": "10"
},
"_owner": null,
"_store": {}
},
"whiteListInput": {
"addr": "",
"min": "",
"max": ""
},
It is the tier[0]
properties too. It should be moved there.
In this case the total change, that you suggest is to
- rename
crowdsale[]
totiers[]
- move
walletAddress
property fromtiers[0]
tocrowdsale{}
Right @15chrjef ?
from token-wizard.
Those are the changes yes, but what does 'it' refer to in 'It is the tier[0] properties too. It should be moved there.'? Should the whitelist, whitelistelement, _owner, _store, and whiteListInput all be moved to tier?
from token-wizard.
@vbaranov updated json above.
from token-wizard.
Those are the changes yes, but what does 'it' refer to in 'It is the tier[0] properties too. It should be moved there.'? Should the whitelist, whitelistelement, _owner, _store, and whiteListInput all be moved to tier?
Yes, Jeff. They should be moved to the first element of tiers array (except _owner, _store): each tier has own whitelist, whitelistelement, and whiteListInput.
from token-wizard.
alright, updated JSON above, let me know if there are any other changes to be made otherwise, I'll start working on state management.
from token-wizard.
Implemented here #363
from token-wizard.
Related Issues (20)
- (Tests) - Crowdsale Page (Step five) after facelifting
- (Feature) Dutch-Crowdsale page: change goal's design HOT 1
- (Bug) Can not start new crowdsale if previous one hasn't been finished HOT 6
- (Bug) Can't get back to home
- (Bug) NoWeb3 screen flashes HOT 1
- (Bug) NoWeb3 screen flashes
- (Bug) New Crowdsale button not working / Can't start new crowdsale HOT 1
- SSR mode? HOT 1
- (Bug) Step4: no alert if user closes or refresh the page HOT 2
- Incorrect hint text in reserved tokens block
- (Bug) Dutch -Step3: allowed to add whitelist if the supply field is empty
- (Bug) Investor can't contribute in 2nd tier if already has bought total supply in 1st tier HOT 1
- (fix) UTC Time for Manage crowdsales' page.
- (fix) Remove 'Reserved tokens' for non-owners accounts on Manage page.
- (Feature) Improvements in the crowdsale list and manage section HOT 1
- Token Wizard stuck at second transaction
- Complete
- Token Wizard stuck at second transaction HOT 2
- I got the "TRANSACTION HAS FAILED, PLEASE RETRY" error message at this crowdsale
- Created a token and I get an error when trying to verify: Error! Unable to generate Contract ByteCode and ABI HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from token-wizard.