1

I find one major characteristic of EOSIO is that the smart contract code is interchangeable, so that developers can easily fix any bugs or change its logic.

But what if someone changes the code to scam others, for example a money-related contracts such as ICO/STO contracts to scam others? And what if those contracts have complex architectures and take modular approach so that it's even harder to track any changes on the code?

In case of Ethereum, the contract codes cannot change, so hardcoding the deployed contract's address on other codes should solve such a problem.

Would hardcoding to assert on the hash of the binary WASM code solve that problem?

3
  • If some one have your public and private key than this is possible unless I don't think some can change your code. Because if he manage to change your code using his account that the this will be different contract all together. May be there is a better explanation to this.. Commented Feb 25, 2019 at 8:01
  • @NirdeshKumarChoudhary Thanks for the comment. I understand that the codes are perfectly fine unless I change them because I have the private keys. What my question was, then, how do others trust me? Is there any systematical solutions for them rather than just believing in me?
    – Jinu
    Commented Feb 26, 2019 at 2:27
  • 1
    I think this might be usefull https://medium.com/eos-new-york/eos-governance-approaching-immutable-dapp-architecture-e15a5c4db83c Commented Feb 26, 2019 at 10:51

2 Answers 2

1
  1. Your question's got some point. Right, it's a double sided sword that EOS allows a token owner to change the contract and do anything they want, fixing, changing contract, etc afterwards. It's great feat to have such flexibility but it's a problem if you don't have trust on the author of the contract.

  2. I don't believe we have access to the code wasm hash inside a contract.

  3. The answer is that, if you're on the investor side, you have to trust the issuer of the contract.

  4. If you're the issuer of the contract, you will have to come up with a mean to win trust. i.e. Electing someone in the community that contract involves to monitor the code, etc.

  5. As @Tong Shen answered above, you can assign your permission to yourself(the account itself, not any public key) or to eosio. Then it's not changeable. It's forcing the whole account that holds the contract immutable. Quite brutal but it works. If your contract have any loophole that is disasterous to the whole network, the BPs will do something on 15/21 vote.

p.s. I'm in EOS business in Seoul. I would like to be in touch with you if you don't mind. Would you be able to contact me? https://t.me/hahnryu

2

Set all the permissions of the contract account to eosio. Then the contract code will be theoretically not changeable unless the Active BPs vote to change it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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