Skip to content

Add ink! E2E test: Use ink! contract in hardhat script, sign via metamask. #2433

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

Open
cmichi opened this issue Mar 18, 2025 · 0 comments
Open

Comments

@cmichi
Copy link
Collaborator

cmichi commented Mar 18, 2025

We believe that it's already possible to have Metamask interact with ink! contracts that have the Solidity ABI encoding enabled. Enabling this can be done via

#[ink::contract(abi = "all")] or #[ink::contract(abi = "sol")]

I'm copy/pasting from a discussion in Element.

Peter:

On the calling and interaction side, it should work already (from a raw call data perspective). Local testing just requires an eth-rpc to be running (example: polkadot-sdk/target/release/eth-rpc --dev --node-rpc-url ws://127.0.0.1:944).

From a metadata perspective, David could answer best. But IIRC, I wonder if we could add an ink! contract to a hardhat script and test it like that (signing via metamask)

David:

The metadata (in this case the .abi file) should work fine too for any contract that compiles successfully with abi = "<sol|all>"

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

No branches or pull requests

2 participants