Questions tagged [pallet-contracts]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
6 views

Can I add pallet-contracts in substrate-node-template?

Is there a way to add a pallet-contracts to substrate-node-template?
user avatar
0 votes
0 answers
14 views

Contracts Pallet Inner Workings

I find myself needing to do two things with the contracts pallet, which each raise a question: 1/ I want to call the instantiate_with_code extrinsic from another rust function. What is the correct way ...
user avatar
1 vote
1 answer
39 views

How can I increase contract memory in pallet-contracts + chain-extension?

I am exposing some external functions to ink! contracts via a chain-extension in pallet-contracts. I am essentially passing a vector of bytes as a parameter to a contract method and directly ...
user avatar
2 votes
1 answer
23 views

Is it feasible to modify the contracts pallet to integrate it into a non-substrate rust-based blockchain?

Is it feasible to modify the contracts pallet to integrate it into a non-substrate rust-based blockchain? Say one that runs on Tendermint.
user avatar
2 votes
1 answer
46 views

Dispatching a runtime call from an ink! smart contract

Disc: I know about the existence of ChainExtension feature. Here I would like to ask about the other way. There is this CallFilter thing in Config for pallet-contracts and IIUC it defines what kind of ...
user avatar
  • 58
1 vote
1 answer
33 views

Contract CodeRejected when using chain extension

I've recently upgraded my chain to the latest substrate master, however, I'm unable to deploy contracts that use a chain extension. When I try to use a chain extension, the contract fails to deploy ...
user avatar
  • 333
2 votes
3 answers
83 views

How do I find the gas consumed by a contracts extrinsic?

I am querying extrinsic data and I am able to fetch gasLimit and gasPrice out of Extrinsic.method.args. But how do I fetch the amount of gas used from an extrinsic?
user avatar
3 votes
2 answers
42 views

Why would a cross contract call be giving `NotCallable`?

I'm hitting an error when trying to do a cross contract call with two contracts running on substrate branch monthly-2022-03 and compiled with "language": "ink! 3.0.0-rc8", &...
user avatar
  • 568
1 vote
1 answer
30 views

Error when implementing contracts pallet

Error message: error: failed to select a version for 'log'. ... required by package 'frame-benchmarking v4.0.0-dev (https://github.com/paritytech/substrate#580ebae1)' ... which satisfies git ...
user avatar
  • 59
4 votes
1 answer
54 views

How to call runtime functions from a contract

A chain_extension is one way to call into the runtime from a smart contract on the contracts pallet. What other methods exist, and why might you use them instead of the extension pattern?
user avatar
1 vote
2 answers
50 views

Ways to get the code hash of a contract by a given address

I've been wondering how I can access a contract's code hash. I see that from ink version 3.0.1, there is a function inside the ink_env crate code_hash but even when updating to the following version, ...
user avatar
  • 31
4 votes
1 answer
53 views

How to benchmark a chain extension?

I would like to know the recommended way to benchmark a chain extension, and then how to charge the calculated weight. According to this document, we need to write benchmarks.
user avatar
2 votes
1 answer
25 views

Is there a substrate node that contains pallet-contracts and uses instant seal consensus?

I've seen instant seal mentioned as a way to get transactions sealed by the substrate node upon receipt. I also know that moonbeam have this in their node. Is there a substrate node that includes ...
user avatar
  • 568
3 votes
1 answer
48 views

How to access environmental information about a contract from within a chain extension?

When we have an Ink! smart contract code calling a chain extension, how do we receive this information from within the chain extension: The calling smart contract address/ID The original caller of ...
user avatar
  • 143
7 votes
2 answers
69 views

Wasm interpreter in pallet-contracts

I have a question about how pallet-contracts interprets a Wasm contract. Are the following assumptions correct? pallet-contracts interprets contracts through the simple wasmi interpreter gas metering ...
user avatar
4 votes
2 answers
69 views

Correct way to use dynamic sized types in chain extension

I'm writing chain extensions for my pallets and I have a few functions that require dynamic sized types, for example Vec<u8> for metadata and Vec<u64> for a list of asset ids. The way I am ...
user avatar