0

I deployed a contract on ropsten but it was not showing the name and the symbol. I have the feeling that there is something wrong at the deployment and I think it has to do with the parameters. As you can see in the picture.... is it the way I should write them or is it wrong ? Thank you very much

enter image description here

0

The parameters are not wrong, there's no error during deployment and the compiler is acting as expected.

In Solidity, when you declare a variable as public, you are telling the compiler to create a public function with the same name of the variable, so that you can query the value of the variable from outside the smart contract.

In your case, you are declaring your variables as private, so the compiler does not create those functions.

Just change the visibility of name and symbol variables from private to public and you will be able to read those values easily from remix or any other ÐApp.

Note: please always post the source code exposing the problem, not a snaphost of it.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.