0
votes

Build Delegator Contracts...

  1. Git clone "https://github.com/paritytech/ink.git".
  2. Move "examples/delegator".
  3. Build contracts by using "build-all.sh".

Deploy & Execute

  1. Excecute Substrate-Node-Template with Contract Pallet.
  2. Visit Polkadot/Substrate Portal(https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A9944#/accounts)
  3. Go to Contract Page(https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A9944#/contracts)
  4. Deploy "delegator/target/ink/accumulator/accumulator.contract".
  5. Deploy "delegator/target/ink/adder/adder.contract" by indicating "accumlator" address as a parameter.
  6. Excecute "inc" of adder contract.
  7. I get a error "system.ExtrinsicFailed contracts.ContractTrapped"

How can I solve this problem?

1

1 Answers

0
votes

I have a similar issue when trying to call Smart Contract from within offchain worker test environment.

DispatchError::Module { index: 0, error: 17, message: Some("ContractTrapped") }

Found here: primitives/sandbox/with_std.rs:275 The error in:

Trap(Trap { kind: Unreachable })

But still have no idea why it happened and how to fix it.