If someone created an erc20 token with the state variable uint256 totalSupply = 100
, what is stopping another dev from creating a contract with that manipulates the totalSupply
to 0
?
Would making the state variable private or internal prevent this from happening?
Even so, couldn't that attacker make a contract: contract attackContract is totalSupply {
and manipulate it that way?
^ Asking these questions because I want to make a smart contract that holds the total supply and can transfer tokens only via contracts with access to, set by the deployer.