Skip to content

[pallet-assets] Reject delegatecall into pallet-assets ERC20 precompile#11676

Draft
0xRVE wants to merge 4 commits intomasterfrom
rve/add-delegate-call-guardin-assets-precompiles
Draft

[pallet-assets] Reject delegatecall into pallet-assets ERC20 precompile#11676
0xRVE wants to merge 4 commits intomasterfrom
rve/add-delegate-call-guardin-assets-precompiles

Conversation

@0xRVE
Copy link
Copy Markdown
Contributor

@0xRVE 0xRVE commented Apr 7, 2026

There is no legitimate use case for delegatecalling into the asset precompile. This matches the precedent set by the Storage precompile, which already enforces a delegatecall check (in the opposite direction — it requires delegatecall).

Changes

  • lib.rs: Add ERR_DELEGATECALL_DENIED const and is_delegate_call() guard before any dispatch logic
  • tests.rs: Add delegatecall_is_rejected test using the Caller.sol fixture

Test plan

  • cargo test -p pallet-assets-precompiles — all 67 tests pass
  • delegatecall_is_rejected verifies the guard rejects delegatecall via the Caller fixture contract

@0xRVE 0xRVE requested a review from a team April 7, 2026 14:37
@0xRVE 0xRVE added T7-smart_contracts This PR/Issue is related to smart contracts. A5-run-CI Run CI on draft PR labels Apr 7, 2026
@0xRVE
Copy link
Copy Markdown
Contributor Author

0xRVE commented Apr 7, 2026

/cmd prdoc --audience runtime_dev --bump minor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A5-run-CI Run CI on draft PR T7-smart_contracts This PR/Issue is related to smart contracts.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant