3

We have not had the chance to study ink! sc yet. A basic question I have is the following. In terms of an EVM deployed sc we rely on the parachain offering primitives in the form of precompiled and predeployed sc so then from our sc using these we can access extrinsics functionality from the pallets. Question: In regards to ink! sc is there something similar or because these are in Rust are set up to communicate "directly" with pallets. In other words if Pallet XYZ part of a parachain runtime supplies weather information, in an ink! sc do I get instant access as opposed to a solidity sc in the EVM which is fully dependant on whether that parachain offers a primitive pointing to that pallet?

1
  • 1
    Can you please make the question clearer?
    – Squirrel
    Mar 24, 2022 at 12:54

1 Answer 1

5

ChainExtension is what you are looking for. It allows the runtime developer to register some native functions in the ink! wasm environment, and allow the ink! code to interact with the pallets directly.

We can even use it to provides a lot more than just pallet invocation. For instance, at Phala Network, we exposes HTTP request functions in ink! query environment.

2
  • Many thanks. This is what I was looking for. I know where to look now.
    – Sokrates
    Mar 26, 2022 at 6:22
  • How about accepting my reply as an answer ;P
    – h4x3rotab
    Apr 12, 2022 at 4:48

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