-
Notifications
You must be signed in to change notification settings - Fork 37
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
Update Solidity compiler #430
Conversation
* Update Solidity compiter to version 0.5.10 * Update OpenZeppelin package to version 2.3.0 * Rebuild solc iframe to make sure it synchronizes with latest changes * Update pragma statement version for all template contract files * Update template contracts to use explicit memory modifier where applicable * Change cryptopizza generateRandomDna function from external to public * Update ERC721 contract interface in Crypto Pizza template * Update all address comparisons in example contracts to involve explicit type casting * Change constant keyword usage in template contracts in favor of the view keyword * Explicitly add the payable modifier to receiver/beneficiary address in Raise To Summon template * Explicitly add address type casting to this keyword in all contract templates * Change the usage of var keyword in favor of explicit data type in all contract templates * Update Ownable contract in Voting template to use latest OpenZeppelin implementation * Change test compiler settings to use new compiler * Change Raise to Summon test to expect 0 errors instead * Update test references to match contract source modifications and compiler version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✓ Confirm that Solidity 0.5.10 compiler is being used - OK!
✓ Confirm that new compiler breaks old contracts for 0.4 Solidity - Yes, BREAKS!
✓ Compile and deploy all templates on Browser network - OK!
✓ Manually run through some templates on Browser network - OK!
- ✓ Empty
- ✓ Hello world
- ✓ ERC20
- ✓ Censorship resistant newsfeed
- ✓ Summon Nick Johnson
✓ Test to import OpenZeppelin contracts in new projects - OK!
✓ Test to use different accounts when interacting with dapps - OK!
✓ Test to use custom wallet - OK
✓ Test to deploy to public testnet and interact
- ✓ Tested Hello world on Ropsten. - OK!
✓ Test to export Dapp as html file - OK!
- Note: exported dapps who use metamask cannot be run as local file because metamask doesn't allow it. (can use
python2 -m SimpleHTTPServer 8080
. - Note2: dapps might have to perform web3.currentProvider.enable() for metamask to open
- Note3: dapps who use synchronous access to web3.eth.accounts can fail, have to do asnyc call as:
web3.eth.getAccounts( (err,accounts) => {...}
. This goes for most of our templates. - ✓ Tested Hello World on Ropsten and Customer ganache-cli using different account - WORKS!
✓ Test uploading to IPFS - OK!
✓ Test downloading from IPFS - OK!
✓ Try running customer network with ganache-cli and custom wallet - OK!
- Note: Have to lower the gas limit to about 2000000 in the chain settings then also close the deploy window before redeploying.
Final note: We might need to inform users that all their 0.4 contracts will not compile anymore and provide a link to the Solidity changelog so they can start fixing their contracts.
Thanks for the review! About the compiler transition:
I did not suggest anything because the compiler is supposedly very explicit about what the errors are. At first:
Updating the
About running the exported dapps locally, this has also been explored in open issue #392:
From: Extra Notes section in #392 (comment)
From: Problem section in #392 (comment) |
Description of the Change
Update Solidity compiler to version
0.5.10
Update OpenZeppelin package to version
2.3.0
Rebuild
solc
iframe to make sure it synchronizes with latest changesUpdate
pragma
statement version for all template contract filesUpdate template contracts to use explicit
memory
modifier whereapplicable
Change cryptopizza
generateRandomDna
function fromexternal
topublic
Update
ERC721
contract interface in Crypto Pizza templateUpdate all address comparisons in example contracts to involve
explicit type casting
Change
constant
keyword usage in template contracts in favor of theview
keywordExplicitly add the
payable
modifier to receiver/beneficiary address inRaise To Summon template
Explicitly add address type casting to this keyword in all contract
templates
Change the usage of
var
keyword in favor of explicit data type in allcontract templates
Update
Ownable
contract in Voting template to use latest OpenZeppelinimplementation
Change test compiler settings to use new compiler
Change Raise to Summon test to expect 0 errors instead
Update test references to match contract source modifications and
compiler version
Template files diff
cryptopizza.zip
empty.zip
erc-20-token.zip
hello.zip
newsfeed.zip
raisetosummon.zip
safemath.zip
voting.zip