Skip to content

Conversation

@RomarQ
Copy link

@RomarQ RomarQ commented May 2, 2025

Implements a new method on the precompile handler to obtain the addresses of contracts being constructed.

This is necessary because contracts under-construction don't have code, the code will only be added to storage after the init_code is executed.

Address type heuristics:

  • It is a smart-contract if the address is a contract being constructed;
  • It is a Precompile if calling pallet_evm::Config::PrecompilesValue::get().is_precompile returns true;
  • It is a EOA when the address does not have code;
  • If neither of the conditions above are true, we assume that an address is a smart-contract.

Also, this is already part of the changes required for supporting https://eips.ethereum.org/EIPS/eip-7702, which is part of the Pectra upgrade.

@RomarQ RomarQ self-assigned this May 2, 2025
Copy link

@manuelmauro manuelmauro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@RomarQ RomarQ merged commit 717a45f into moonbeam-polkadot-stable2409 May 5, 2025
0 of 4 checks passed
RomarQ added a commit that referenced this pull request May 5, 2025
RomarQ added a commit that referenced this pull request May 5, 2025
RomarQ added a commit that referenced this pull request May 5, 2025
RomarQ added a commit that referenced this pull request May 5, 2025
RomarQ added a commit that referenced this pull request May 5, 2025
RomarQ added a commit that referenced this pull request May 5, 2025
RomarQ added a commit that referenced this pull request May 5, 2025
RomarQ added a commit that referenced this pull request May 5, 2025
RomarQ added a commit that referenced this pull request May 6, 2025
RomarQ added a commit that referenced this pull request May 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants