1

I've recently upgraded my chain to the latest substrate master, however, I'm unable to deploy contracts that use a chain extension. When I try to use a chain extension, the contract fails to deploy with the CodeRejected error. Are there any breaking changes in the chain extension configuration that I may have missed when upgrading?

My contract code is here: https://github.com/ideal-lab5/contracts/blob/main/iris_asset_exchange/lib.rs

And my chain extension is defined here: https://github.com/driemworks/substrate/blob/f73557b96ef8c7cc1e428a78ea4106b66c165d64/bin/node-template/runtime/src/lib.rs#L920

As you can see, I have defined that the chain extension should be enabled:

fn enabled() -> bool {
    true
}

I encountered the same issue when trying to use the rand-extension example too: https://github.com/paritytech/ink/tree/master/examples/rand-extension

1 Answer 1

1

You forgot to tell pallet-contracts about your chain extensions here.

You need to do this:

type ChainExtension = IrisExtension;
1
  • Can't believe I missed that! I modified the runtime to include that and my contract deploys successfully now.
    – Tony
    May 9, 2022 at 16:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.