I am using a DEX Pallet and it has multiple extrinsic functions, But I am thinking of developing a smart contract in Ink that will be calling the extrinsic functions of the pallet and the people who want to interact with DEX pallet extrinsic they will be dealing with the smart contract not directly with extrinsic. Is it possible? if yes how can I do that

1 Answer 1


You can do this by writing a custom chain extension and configuring it in your contract. The guide shows you how to configure it in your contract https://use.ink/macros-attributes/chain-extension/ and this example https://github.com/paritytech/ink-examples/tree/main/rand-extension shows how to implement a rudimentary chain extension in your runtime.

As an aside, if the functionality of the contract is so reliant on the DEX pallet's extrinsics, why not implement it as a pallet instead?

Your Answer

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

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