The recommended way to create updatable contracts is to create a proxy contract which then calls an origial contract. I haven’t worked with proxy contracts yet, but I’ve seen the code and it appeared to be complex for such a simple task.

Instead, why not store a file with the address of a smart contract in IPFS, and then fetch a file from a proxy contract? Whenever a smart contract is updated, edit a file in IPFS to reflect a change. This way, code will become way simpler and may not even require a proxy contract.

  • In that case another contract couldn't use your contract, they can't read the IPFS content directly because it is off-chain.
    – Ismael
    Sep 17 at 3:12
  • Why do you assume that code for fetching a file from IPFS is way simpler than the code to call another contract from the proxy?
    – lenin
    Sep 17 at 4:28
  • @lenin I don't assume, I know. it's 1 line
    – kennya
    Sep 17 at 4:54
  • Elaborate. Which "my contract" - proxy one or original one? Why not? And what is the it in "it's off-chain" you mean?
    – kennya
    Sep 17 at 4:56
  • @kennya Can you show an implementation? How does a contract read from IPFS?
    – Ismael
    Sep 17 at 6:07

Your Answer

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

Browse other questions tagged or ask your own question.