Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFP (Request for Proposals) : Support send runtime calls using wallets like metamask #55

Closed
hackfisher opened this issue Apr 27, 2023 · 3 comments

Comments

@hackfisher
Copy link
Collaborator

This can be easily constructed by the runtime calls component and dispatch js SDK

@hackfisher
Copy link
Collaborator Author

hackfisher commented Apr 28, 2023

There is existing solution(thanks to @hujw77 ) using remix with the following contract's support:

// SPDX-License-Identifier: GPL-3.0

pragma solidity >=0.7.0 <0.9.0;

contract Dispatch {
    fallback (bytes calldata _input) external payable returns (bytes memory _output)   {} 
}
[
	{
		"stateMutability": "payable",
		"type": "fallback"
	}
]

Compile this contract using remix first, then connect to you account using Inject Provider, copy dispatch precompile address and the encoded runtime call data from polkadot js:

Refer following interfaces:

https://docs.darwinia.network/builtin-precompiles-38faea0d12a648e9a061cf013e1cfdd6

image

image

@hackfisher hackfisher transferred this issue from darwinia-network/apps Mar 23, 2024
@hackfisher hackfisher changed the title A dev tool idea to support send runtime calls using wallets like metamask by adopting dispatch precompile RFP: A dev tool idea to support send runtime calls using wallets like metamask by adopting dispatch precompile Mar 23, 2024
@wuminzhe
Copy link
Contributor

wuminzhe commented Jun 21, 2024

https://jsfiddle.net/wuminzhe/5qx0pcej/1/

In vscode, there will be auto-completions.

@boundless-forest boundless-forest changed the title RFP: A dev tool idea to support send runtime calls using wallets like metamask by adopting dispatch precompile RFP (Request for Proposals) : Support send runtime calls using wallets like metamask Nov 1, 2024
@hackfisher
Copy link
Collaborator Author

This is for developer, not for app user, as we already have a solidity solution for it, let's move it to documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

2 participants