2

I created my first contract erc20, implement a mint function, the case is, if I copy the code json, I paste it in another wallet I can use the interface of the contract equally, although this is not the address that created the contract. So my question, if we could get the json of any token could we have access to its interface? Is it safe that nobody can access the json except the address that created the contract?

1

I think you're referring to the Json ABI, the Application Binary Interface.

It's not a security risk. It merely enumerates the functions and arguments coded in the contract. This informs software clients about the structure of the function interfaces. While it is not impossible to interact with a smart contract without the ABI, all courteous developers publish it. Knowledge of the source code is sufficient to derive the ABI. It's a compiler output along with the bytecode.

Knowledge of the contract interface helps generic user interfaces such as wallets present human-readable forms. This is how etherscan.io constucts their read contract and write to contract tabs (if the source, and therefore ABI is verified.).

Knowledge of the ABI doesn't elevate user privileges in any way. They still have to sign with their own accounts.

Hope it helps.

  • Thanks for your answer, I understand that it is safe since to configure Json interface it is necessary to obtain it from the source code and that only the creator obtains the contract. No one else would have access to the json interface. – man mano Aug 20 '18 at 20:42
  • It just doesn't matter if it falls into the public domain, and it probably should, just the contract source code. If possession of those things bestows inappropriate power then there is surely a bigger security problem and a determined attacker will need neither of those artifacts to exploit it. I tried to summarize what the ABI actually is. Perhaps research. My guess is it's not what you think. – Rob Hitchens - B9lab Aug 20 '18 at 23:33
  • "just like the contract source code." - they should both be on public display. – Rob Hitchens - B9lab Aug 20 '18 at 23:49

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.