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 Answer
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.
-
Many thanks. This is what I was looking for. I know where to look now.– SokratesMar 26, 2022 at 6:22
-