Closed ascjones closed 7 months ago
Do you think this PR can resolve my question? https://substrate.stackexchange.com/questions/10685/how-to-call-a-contract-from-pallet-with-specific-interface
I want to extend my pallet through the developers' uploaded contract,
for example,
For an NFT marketplace pallet, I want to allow NFT collection owners to register a few "hooks" (such as on_bought
and on_sell
) so they can have a restricted way to extend fixed pallet business logic.
So, I want those contracts that serve as a hook, acquired to conform to specific interfaces, and in the pallet, I want to call the typed interface instead of a selector.
Do you think this PR can resolve my question? https://substrate.stackexchange.com/questions/10685/how-to-call-a-contract-from-pallet-with-specific-interface
I want to extend my pallet through the developers' uploaded contract, for example, For an NFT marketplace pallet, I want to allow NFT collection owners to register a few "hooks" (such as
on_bought
andon_sell
) so they can have a restricted way to extend fixed pallet business logic. So, I want those contracts that serve as a hook, acquired to conform to specific interfaces, and in the pallet, I want to call the typed interface instead of a selector.
Yes, you can use the technique I have used in this PR. I am currently working on a nicer API for this, but it is a few weeks away from being ready.
Do you think this PR can resolve my question? https://substrate.stackexchange.com/questions/10685/how-to-call-a-contract-from-pallet-with-specific-interface I want to extend my pallet through the developers' uploaded contract, for example, For an NFT marketplace pallet, I want to allow NFT collection owners to register a few "hooks" (such as
on_bought
andon_sell
) so they can have a restricted way to extend fixed pallet business logic. So, I want those contracts that serve as a hook, acquired to conform to specific interfaces, and in the pallet, I want to call the typed interface instead of a selector.Yes, you can use the technique I have used in this PR. I am currently working on a nicer API for this, but it is a few weeks away from being ready.
That's awesome! Will try when it's landing
Superseded by https://github.com/paritytech/ink/pull/2189, it is more appropriate to live in that repo since that is where the API will live.
This pull request has been mentioned on Polkadot Forum. There might be relevant details there:
https://forum.polkadot.network/t/contracts-on-assethub-roadmap/9513/11
An foundational step towards https://github.com/paritytech/ink/issues/1674, developing an API for calling into a contract from the runtime.
This PR
contract-caller
which allows calling into a flipper contractink
to construct the call for the contractflipper
contract with a trait and an e2e test which demonstrates it working: instantiates the contract, invokes the pallet, queries the modified state of the contract.The next step (in progress) is to work and iterate on the
ink
API itself, which will involve anink
PR and a PR here to utilize the new API.