cipherzzz / JediBetDapp

Ethereum dApp using truffle and react for a simple betting game
19 stars 7 forks source link

Error: Expected token LBrace got 'View' #5

Open jpvajda opened 5 years ago

jpvajda commented 5 years ago

Following the instructions from this post:

https://medium.com/coinmonks/optimizing-your-solidity-contracts-gas-usage-9d65334db6c7

line 132 is throwing an error when attempting to compile the contract:

function checkPermissions(address sender) view private {
     //only the originator or taker can call this function
     require(sender == game.originator.addr || sender == game.taker.addr);  
    }

error

browser/ballot.sol:132:47: Error: Expected token LBrace got 'View'
    function checkPermissions(address sender) view private {
jpvajda commented 5 years ago
screen shot 2018-12-10 at 3 00 52 pm
antonio-hickey commented 3 years ago

Try changing the Solidity version to 4.24 in the Bet.sol and Migrations.sol: change pragma solidity ^0.4.8 to pragma solidity ^0.4.24

Also there are 2 truffle .js configs in this repo, by default truffle uses truffle-config.js which is empty so paste this and save: module.exports = { compilers: { solc: { version: "0.4.24", } }, };

Try to compile the contract now it should work!