Solidity error: SyntaxError: No visibility specified.

0 votes

I have this piece of code:

  constructor() {

                caller = msg.sender;

  }

When I compile it, I am getting this error:

browser/vote.sol:17:3: SyntaxError: No visibility specified. Did you intend to add "public"? 
constructor() { ^ (Relevant source part starts here and spans across multiple lines).

How to solve this?

Dec 12, 2018 in Blockchain by slayer
• 29,050 points
403 views

1 answer to this question.

0 votes

As mentioned in the error, you have to mention the visibilty. If you wanna add public, you can do it like this:

constructor() public {

                caller = msg.sender;

  }
answered Dec 12, 2018 by Omkar
• 67,290 points

Related Questions In Blockchain

0 votes
1 answer

Not able to migrate contract in Truffle: Error: No network specified. Cannot determine current network

Make these entries in truffle.js file: module.exports = { ...READ MORE

answered Nov 29, 2018 in Blockchain by Omkar
• 67,290 points
103 views
0 votes
1 answer
0 votes
1 answer

Hyperledger Fabric: "No go in PATH" error.

The error is because the go path ...READ MORE

answered Jun 27, 2018 in Blockchain by Omkar
• 67,290 points
283 views
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
123 views
+1 vote
3 answers

Removing double quotes from a string from JSON response in PHP

Just remove the json_encode call, and it should work: $resp ...READ MORE

answered Sep 12, 2018 in Blockchain by digger
• 27,630 points
2,474 views
0 votes
1 answer
0 votes
2 answers

Truffle compile: SyntaxError: No visibility specified. Did you intend to add "public"?

You can try another method : contract HelloWorld{       function ...READ MORE

answered Mar 18 in Blockchain by anonymous
305 views
0 votes
2 answers

Truffle migrate gives “ Error: No network specified. ”

You have to mention on which network ...READ MORE

answered Aug 13, 2018 in Blockchain by Omkar
• 67,290 points
185 views