Closed filippsen closed 5 years ago
Thanks for the review!
About the compiler transition:
"compiler breaks old contracts for 0.4 Solidity"
I did not suggest anything because the compiler is supposedly very explicit about what the errors are. At first:
Loading the compiler...
/contracts/HelloWorld.sol:1:1: ParserError: Source file requires different compiler version (current compiler is 0.5.10+commit.5a6ea5b1.Emscripten.clang - note that nightly builds are considered to be strictly less than the released version
pragma solidity ^0.4.25; ...
^----------------------^
Updating the pragma
line reported by the previous output, it moves onto language changes territory:
Using Solidity compiler version 0.5.10
/contracts/HelloWorld.sol:6:17: TypeError: Data location must be "memory" for parameter in function, but none was given.
constructor(string initMessage) public {
^----------------^
/contracts/HelloWorld.sol:10:21: TypeError: Data location must be "memory" for parameter in function, but none was given.
function update(string newMessage) public {
^---------------^
About running the exported dapps locally, this has also been explored in open issue #392:
Note: exported dapps who use metamask cannot be run as local file because metamask doesn't allow it. (can use python2 -m SimpleHTTPServer 8080.
From: Extra Notes section in https://github.com/SuperblocksHQ/superblocks-lab/issues/392#issuecomment-502061573 [...] to get MetaMask notification to appear, it is required that the dapp file is served by a web server. In case the dapp is accessed via file:///..., calls to window.web3 or window.ethereum won't work.
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.
From: Problem section in https://github.com/SuperblocksHQ/superblocks-lab/issues/392#issuecomment-502061573 "In order to retrieve account information when using MetaMask, it is now required to ask for user's consent before direct access to the account is granted."
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 where applicableChange 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 in Raise To Summon templateExplicitly 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 templatesUpdate
Ownable
contract in Voting template to use latest OpenZeppelin implementationChange 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