Checking Smart Contract Versions before Execution
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 548
- Forks
- 152
- Avg merge
- 1h 15m
- Merged PRs (30d)
- 1
Description
Issue To Be Solved
Scenario: I'm a user that has signed a transaction to do something involving a smart contract. But, between the time that I sign the tx and the time that the tx is executed, that smart contract gets updated. There is a very good chance that I'd actually want my transaction to automatically abort, so that I can see what has changed about that smart contract, and then either re-authorize (or not!) based on my findings.
Possible Solution
It should be the case that a tx (or script) can include a list of smart contracts with some kind of "version identifier" (possibly a version number, possibly the content hash of the contract code) that the tx expects to see. If any of the listed smart contracts have versions differing from the given version numbers at the time that the tx is executed, the tx is aborted before it even starts (still paying the inclusion fee, of course).
On the client side, it would be ideal if we could provide a mechanism in the SDK to do some basic static analysis of the smart contract to automatically create this list for all smart contracts that are referenced by the contract. This would be impossible to do for references that go "through" an interface, but I think that this should be fine. If you are calling through a polymorphic interface, you are explicitly allowing the interaction to be mediated by the interface definition, and not the static type of the object. (Although, if the interface definition changed versions, you'd probably still want to abort...)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files, tests, or entry points are identified. Start by reviewing how transactions and scripts reference smart contracts, then examine the SDK discussion in the issue. Done would require an agreed version-identifier design and defined abort behavior when a referenced contract changes before execution.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- blockchain
- Domain
- blockchain
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100