3

I am playing around with ink! and invoking contract pallets. After uploading the contract to the chain from the polkadot extension, I get a JSON file back describing the metadata for the contract, especially the method calls and arguments.

This would presume that I need to externally manage the metadata for the contract.

Is there no way to get this from the chain directly?

1 Answer 1

3

Metadata is not stored on chain to avoid bloat. Only the compiled wasm is uploaded to the chain. This is the same way it works on Ethereum with compiled solidity being stored on-chain. As pointed out in the article, you can generate the ABI if you have the contract source.

Therefore, if you have the ink! contract sources you can generate the ABI using cargo-contract build .... In future, it may also be possible using the crate contract-metadata.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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