Skip to content

[Rarible] - ProviderError: Client error: Execution failed: Execution aborted due to trap (WASM unreachable instruction) #195

@nhussein11

Description

@nhussein11

Description

A ProviderError is occurring when attempting to interact with a deployed contract via ethers v5 in the Hardhat project environment. The error suggests a low-level execution failure, specifically a WASM trap in the passet_hub_runtime.

This issue was encountered while deploying and interacting with the RoyaltiesRegistry contract on the polkadot testnet.

Environment

Steps to Reproduce

  1. Clone the repository

    git clone https://github.com/rarible/protocol-contracts.git
    cd protocol-contracts
  2. Switch to the dot-is-dead branch

    git checkout feature/dot-is-dead
  3. Install dependencies and build (from root folder)

    yarn
    yarn build
  4. Navigate to hardhat-deploy directory

    cd projects/hardhat-deploy
  5. Compile the contracts

    npx hardhat compile --network polkadotHubTestnet --config dot.hardhat.config.ts
  6. Deploy the RoyaltiesRegistry contract

    npx hardhat deploy --tags 301 --network polkadotHubTestnet --config dot.hardhat.config.ts
  7. Observe the error - The deployment or subsequent interaction triggers the WASM trap error

Expected Behavior

The contract function call should execute successfully and return the expected result without runtime errors.

Actual Behavior

The deployment fails with the following execution error:

Error: ERROR processing deploy/301_zk_deploy_RoayltiesRegistry.ts:
ProviderError: Client error: Execution failed: Execution aborted due to trap: wasm trap: wasm unreachable instruction executed
WASM backtrace:
error while executing at wasm backtrace:
    0: 0xf768 - passet_hub_runtime.wasm!__rustc[4794b31dd7191200]::rust_begin_unwind
    1: 0x43ac - passet_hub_runtime.wasm!core::panicking::panic_fmt::hd534225921b41838
    2: 0x13d78 - passet_hub_runtime.wasm!core::panicking::panic_explicit::heb0bd95c0f96042a
    3: 0x64344 - passet_hub_runtime.wasm!<pallet_revive::vm::evm::EVMInputs as revm_interpreter::interpreter_types::InputsTr>::target_address::panic_cold_explicit::hfe125084368ce98b
    4: 0x64338 - passet_hub_runtime.wasm!<pallet_revive::vm::evm::EVMInputs as revm_interpreter::interpreter_types::InputsTr>::target_address::he46518d7886e7db8
    5: 0x22fe9c - passet_hub_runtime.wasm!pallet_revive::vm::evm::instructions::host::sload::hcc841f86b67100ec
    6: 0x21ad0d - passet_hub_runtime.wasm!pallet_revive::exec::Stack<T,E>::run::h139a840eb24e10dc
    7: 0x20c9f3 - passet_hub_runtime.wasm!pallet_revive::<impl pallet_revive::pallet::Pallet<T>>::run_guarded::{{closure}}::h243d0f62c500b662
    8: 0x1ec499 - passet_hub_runtime.wasm!pallet_revive::<impl pallet_revive::pallet::Pallet<T>>::bare_call::h2d45fb946b815e57
    9: 0x60694f - passet_hub_runtime.wasm!<passet_hub_runtime::Runtime as pallet_revive::runtime_decl_for_revive_api::ReviveApiV1<...>>::eth_transact::h73c8fe48a6417f52
   10: 0x68f10b - passet_hub_runtime.wasm!ReviveApi_eth_transact
    at HttpProvider.request (hardhat/src/internal/core/providers/http.ts:116:21)
    at processTicksAndRejections (node:internal/process/task_queues:105:5)
    at DeploymentsManager.executeDeployScripts (hardhat-deploy-immutable-proxy/src/DeploymentsManager.ts:1257:19)
    at processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async DeploymentsManager.runDeploy (hardhat-deploy-immutable-proxy/src/DeploymentsManager.ts:1100:5)
    at async SimpleTaskDefinition.action (hardhat-deploy-immutable-proxy/src/index.ts:446:5)
    at async Environment._runTaskDefinition (hardhat/src/internal/core/runtime-environment.ts:351:14)
    at async Environment.run (hardhat/src/internal/core/runtime-environment.ts:184:14)
    at async SimpleTaskDefinition.action (hardhat-deploy-immutable-proxy/src/index.ts:597:32)
    at async Environment._runTaskDefinition (hardhat/src/internal/core/runtime-environment.ts:351:14)
    at async Environment.run (hardhat/src/internal/core/runtime-environment.ts:184:14)
    at async SimpleTaskDefinition.action (hardhat-deploy-immutable-proxy/src/index.ts:686:5)

Key error location: The panic occurs in pallet_revive::vm::evm::instructions::host::sload (WASM backtrace line 5), suggesting the issue happens during an SLOAD operation (storage read) in the EVM execution layer.

Additional Context

  • The error appears to be a low-level runtime/WASM trap and is unlikely related to the contract's deployment script (301_zk_deploy_RoayltiesRegistry.ts)
  • The RoyaltiesRegistry contract is properly imported and defined in the deployment folder
  • The deployment itself appears successful (contract is visible on Blockscout)
  • The issue occurs during standard contract interaction calls via ethers v5
  • This appears to be a runtime-level issue rather than a contract code issue

CC: @ifelsedeveloper

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions