In a smart contract, if we make a member variable public
:
Question 1: Can a malicious party write a transaction/contract and change the value/state of the public
variable in the contract?
Question 2: Would the problem be solved by only turning public to private
?
For instance, if in a contract we have:
address private owner;
and in the contract constructor we have:
owner = msg.sender;
then we have a getter function like:
get_owner() returns (address){
return owner;
}
then nobody can change owner, but if have
address public owner;
someone may change it later on?
But if we have a getter function as above, MyEtherWallet (to interact with a contract on testrpc) does not read/return owner, unless we turn public owner to a private one.
Question 3: Why MyEtherWallet does not return a value, for the getter functions that we write?