Git Product home page Git Product logo

Comments (10)

rstormsf avatar rstormsf commented on May 14, 2024

@igorbarinov @vbaranov https://egghead.io/courses/manage-complex-state-in-react-apps-with-mobx - great quick intro to mobx

from token-wizard.

mark-antony1 avatar mark-antony1 commented on May 14, 2024

@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.

vbaranov avatar vbaranov commented on May 14, 2024

@15chrjef current state structure is here

from token-wizard.

mark-antony1 avatar mark-antony1 commented on May 14, 2024
{
	"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.

vbaranov avatar vbaranov commented on May 14, 2024

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

  1. rename crowdsale[] to tiers[]
  2. move walletAddress property from tiers[0] to crowdsale{}

Right @15chrjef ?

from token-wizard.

mark-antony1 avatar mark-antony1 commented on May 14, 2024

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.

mark-antony1 avatar mark-antony1 commented on May 14, 2024

@vbaranov updated json above.

from token-wizard.

vbaranov avatar vbaranov commented on May 14, 2024

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.

mark-antony1 avatar mark-antony1 commented on May 14, 2024

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.

igorbarinov avatar igorbarinov commented on May 14, 2024

Implemented here #363

from token-wizard.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.