oasisprotocol / oasisprotocol/explorer

Can we detect push0 in contract bytecode?

Open
#2,063 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature
Dominant language
TypeScript
Stars
13
Forks
13
Avg merge
58m
Merged PRs (30d)
2

Description

Someone can successfully deploy a contract that was compiled using wrong evm version (not paris). These contracts are in half-malfunctioning state.

e.g. https://explorer.dev.oasis.io/testnet/sapphire/address/0x151d34946CA4F51B53cb01Dd713898458c7f1825/code#code
open it in abi playground:

Contract Data
decimals: 18
name:           execution failed: invalid code 😱 

Can we detect push0, or mcopy / tstore / tload in contract bytecode, to show a warning?
https://docs.blockscout.com/setup/information-and-settings/evm-version-information

some links

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the ABI playground behavior and the ethereumjs example decode-opcodes.ts, using the opcode tool as a reference for bytecode and metadata boundaries. Determine how push0, mcopy, tstore, and tload can be detected, then show a warning when deployed bytecode contains them and verify it against the linked example contract.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
blockchain
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.