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,370 points
7,363 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
• 69,220 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 30, 2018 in Blockchain by Omkar
• 69,220 points
1,178 views
0 votes
1 answer

Web3j v3.3.1 : Error while generating compiled solidity smart contracts which returns array of struct

Solidity does not support returning structs in ...READ MORE

answered Jun 19, 2018 in Blockchain by aryya
• 7,460 points
1,668 views
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
• 69,220 points
1,530 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
1,922 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
• 26,740 points
45,216 views
0 votes
1 answer

Hyperledger Sawtooth vs Quorum in concurrency and speed Ask

Summary: Both should provide similar reliability of ...READ MORE

answered Sep 26, 2018 in IoT (Internet of Things) by Upasana
• 8,620 points
1,451 views
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, 2019 in Blockchain by anonymous
3,877 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
• 69,220 points
1,706 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP