Questions tagged [pallet-contracts]
The pallet-contracts tag has no usage guidance.
108 questions
0
votes
0
answers
9
views
Substrate Fronteir EVM, can deployed smart contracts call other pallet functions?
I read that the pallet-contracts with ink! can call pallet functions both back and fourth but what about the EVM frontier pallet?
0
votes
0
answers
21
views
What should be the `pallet-contracts` configurations when ED is zero
I’m working on implementing a Substrate-based chain using zero Existential Deposit, similar to the Polkadot-dropIt configuration. However, despite having configured zero gas fees and deposits, I am ...
2
votes
1
answer
21
views
How to properly send a bare_call from a pallet to a smart contract
I'm trying to make a pallet -> contract call, using the bare_call function.
pub fn call_smart_contract(
origin: OriginFor<T>,
dest: T::AccountId,
mut ...
0
votes
1
answer
13
views
Missing Native Executable After Rust Version Upgrade
We recently upgraded our Rust version from nightly 2024-02-18 (with rustc 1.78.0) to stable-x86_64-apple-darwin (default) rustc 1.81.0 (eeb90cda1 2024-09-04) while working on our private Substrate ...
1
vote
1
answer
66
views
error: System.ExtrinsicFailed: NoProvider when deploying smart contract
I just installed pallet-contracts on my Frontier node.
From the Polkadot js app interface, I can send transactions with tokens without problems, but if I try to deploy a new smart contract (inside ...
0
votes
0
answers
14
views
Contract Reverted?
I was deploying WebAssembly (WASM) contracts on the Polkadot SDK version release-polkadot1.1.0. My codebase utilized unified address mapping. However, when I attempted to deploy the contract using the ...
1
vote
1
answer
43
views
How to clean corrupted data of pallet-contracts?
our chain was live few years ago. We had integrated pallet-contracts. During runtime-upgrade, it seems we had missed the migration of pallet-contracts.
Now we have corrupted data in pallet-contracts. ...
0
votes
1
answer
39
views
How can I properly use scale::Decode to get consistent results?
I'm trying to process a result from a contract call using what's here. It works totally fine when I'm trying to get a u32 result from an ink_e2e test. E.g.
// -- Snip --
let number_of_items = client
...
0
votes
0
answers
36
views
I'm facing the issue of StorageDepositNotEnoughFunds in pallet-contracts
When I've integrated the pallet-contracts of v1.1.0 in the relay chain, it is showing the error of StorageDepositNotEnoughFunds Origin doesn't have enough balance to pay the required storage deposits....
2
votes
1
answer
127
views
Syncing with a chain that requires host functions deprecated by the Substrate
I'm working on upgrading a Substrate-based standalone chain that was launched several years ago.
Recently, we made a transition from polkadot-v0.9.34 to polkadot-v0.9.35. After we did that, we are no ...
0
votes
0
answers
19
views
Not able to add any crates in substrate-node-template
I am working on substrate.where I want to use some of create like pinata_sdk,Openssl etc but I am not able to import or add in cargo.tmol file where I add I get this error: `
--- stderr
Compiling sp-...
0
votes
0
answers
15
views
Tool for Automatic Generation of Contract Wrapper Code from Ink Metadata
I am currently exploring ways to streamline the process of interacting with contracts on the Pallet Contracts. One challenge I've encountered is the need to manually write wrapper code for contracts ...
3
votes
0
answers
52
views
Explorer compatibility with blockchain node version v1.0.0
The issue I ran in is finding an explorer version, which is compatible with substrate version v1.0.0.
I found that version of explorer below v0.133.1 (https://github.com/polkadot-js/apps/releases/tag/...
1
vote
0
answers
26
views
how to know about token implementation?
I have a questions about Tokens in polkadot ecosystem , If I am on parachain and this parachain A uses a token from another parachain B , if this token implements on_transfer hook does this hook will ...
1
vote
1
answer
104
views
Implementing pallet_contracts into node
I'm trying to implement pallet_contracts into my node, but that results in an error. I don't get why I'm getting this error and what I'm supposed to do with it.
Checking pallet-contracts v4.0.0-...
1
vote
1
answer
50
views
ContractTrapped Error That Affects Additional Messages Over Time
Have you ever seen a ContractTrapped error that does not initially exist on a deployed contract, but starts later after some use of the contract, and gets worse over time, affecting one contract ...
0
votes
0
answers
22
views
is it necessary to download all the dependencies and the full target file to compile and build any contract?
due to I have limited internet in my country , I can not download the full building files after I wrote the contract and need to only see if there are any errors and need to run the tests .
so if I ...
0
votes
0
answers
66
views
How to execute smart contract from offchain-worker?
Would it be possible to execute smart contract call from an offchain-worker, either using ink! or pallet-contracts?
Can someone please help me to provide the solution? is there any example?
0
votes
1
answer
100
views
Cumulus parachain (branch=release-polkadot-v1.5.0) with the pallet-contracts given this error:"StorageDepositNotEnoughFunds/BadOrigin"
Rust version:rustc 1.77.0-nightly (3d0e6bed6 2023-12-21)
Zombienet-linux-x64 version:1.3.87
Polkadot SDK version:polkadot 1.5.0-a3dc2f15f23
I have created a simple Cumulus Parachain based in the new ...
1
vote
0
answers
14
views
What happens to smart contracts when breaking changes are introduced to ink?
I've seen breaking changes mentioned in this issue for upgrading set_code_hash.
This got me thinking, what happens to existing contracts when a breaking change to ink is introduced?
For example, we're ...
1
vote
0
answers
15
views
How do I predict an address given a salt in python?
I have python code that does deploy a few ink! contracts that depend on each other. In order to do this in a batch call, I want to predict the contract address given the salt.
How would I do this, ...
0
votes
1
answer
72
views
Error: duplicate lang item in crate `sp_io` (which `sp_application_crypto` depends on): `panic_impl`
I am building a solo chain from Substrate node template, I have made some changes to switch from PoA to PoS just like this repo. Now, I am trying to add pallet-contracts on the runtime. I added the ...
1
vote
2
answers
108
views
How to add pallet contract for polkadot-v1.0.0?
How to add pallet contract for polkadot-v1.0.0? Do I only need to change the node/runtime folder or the runtime folder at root or both?
2
votes
1
answer
35
views
How to Modify static buffer size for my ink smart contract to Resolving 'OutputBufferTooSmall' Error for Larger Vectors in ink smart contract
I'm facing an 'OutputBufferTooSmall' error in my [Language/Framework] code when working with larger vectors. I suspect this is related to the maximum allowed input/output sizes. I need guidance on how ...
2
votes
1
answer
48
views
How to restrict ink! contracts code upgrade?
What is the best way to disable ink! smart contracts code upgradability for a class of contracts? Below I describe what I need it for, just in case. Thank you!
For my use case, I need my pallet to ...
2
votes
1
answer
52
views
Appropriate Substrate Pallets for voting proposal
In my custom blockchain, i want to offer a feature where i will provide some proposals to my users. The users can vote on to the proposal they find considerate. To accept the proposal, there will be a ...
1
vote
0
answers
34
views
Uncaught error. Something went wrong with the query and rendering of this component
I am getting this error while adding pallet_contracts in my chain. This is my github-code. Can you please describe me why I am getting this issue?
Edit
As @forgetso suggested in comment, I change ...
2
votes
1
answer
108
views
How to customize pallet_contracts?
We have our own chain where we've added pallet_contracts pallet for writing and deploying smart contract. We just want to give permission to upload smart contract for few users only. Someone please ...
1
vote
0
answers
63
views
Extrinsic Read Smartcontract Data
I would try to replicate the Extrinsics that is thrown when using this
This is the ABI of my smart contract
{
"args": [
{
"label": "code",
...
1
vote
1
answer
124
views
how to call smart contract function in custom pallet?
Is there any way to call ink! smart contract function in substrate custom pallet?
We've found this answer where bare_call function is based on older version of contract_pallet.
// This ends up calling ...
3
votes
1
answer
100
views
Incompatibility between subxt_signer and subxt
https://github.com/paritytech/subxt/blob/master/subxt/examples/tx_basic.rs
I want to call a function in my substrate pallet. I am using the
substrate-node-template
subxt
subxt_signer
use subxt::{...
2
votes
0
answers
36
views
Uncaught error substrate-node-template pallet-contract
I am trying to use latest substrate node template. I have added pallet-contract. The code compile but when accessing contracts from polkadotjs Developer menu, I got this issue.
Uncaught error. ...
0
votes
1
answer
81
views
Get contract address from instantiated ContractRef
Based on this example
I'm doing something similar:
#[ink(message)]
pub fn new_multisig(&mut self, threshold: u8, owners_list: Vec<AccountId>, salt: Vec<u8>) {
let ...
1
vote
2
answers
107
views
Not able to upload contract in substrate node template
I have added pallet-contract in our chain. Build contract works fine and run chain in dev mode also works fine. But when I try to deploy contract it doesn't work and doesn't throw any error. Can ...
0
votes
0
answers
70
views
How to wrap an ink::env::Error in a Custom Error?
In my contract, I have a requirement to call messages from external contracts without knowing their specific identities beforehand. To achieve this, I utilize the call builder, enabling the execution ...
0
votes
1
answer
31
views
Could not find `CollectiveEvents` in `pallet_contracts`
Error:
const CONTRACTS_EVENTS: pallet_contracts::CollectEvents =
^^^^^^^^^^^^^ not found in `pallet_contracts
Cargo.toml File
pallet-contracts = { version ...
1
vote
1
answer
64
views
How to mint multiple characters randomly?
Let me give scenario, let's say:
There are 2 types of playable characters
Chickens (90% chance to mint)
Foxes (10% chance to mint)
and total supply is 15,000 units :
13,500 chickens
1,500 foxes
...
0
votes
1
answer
61
views
How to deploy a contract on your chain
Hi i have cloned the node-template and also added the pallet-contract in it, now i want to know that how can i deploy a smart contract on my chain i have also deployed it on EC2 instance but i want to ...
3
votes
1
answer
74
views
How to "graceful terminate" a smart contract from the "rococo-contracts-rpc.polkadot.io" chain?
In theory we could use this command:
cargo contract remove --execute --code-hash '******' --url 'wss://rococo-contracts-rpc.polkadot.io' --suri 'seeds'
But in order to do that we have first to ...
0
votes
1
answer
33
views
"TooManyTopics" Dispatch Error and Contract Revert when Minting in OpenBrush PSP37 Smart Contract
I am facing an issue with the OpenBrush PSP37 smart contract while calling the mint function. I receive a Contract Reverted! error with a TooManyTopics dispatch error. However, upon inspecting the ...
1
vote
1
answer
108
views
Getting "Contract Reverted!" error with "TooManyTopics" dispatch error when calling mint function in OpenBrush PSP37 smart contract
I'm working on adding events to an OpenBrush PSP37 smart contract and deploying it using Substrate Contract UI. However, when I try to call the mint function, I encounter the following error:
Contract ...
3
votes
1
answer
89
views
Build the data bytes to query a contract with the api state_call
I would like to use the rpc call to query a contract.
I try to use the method "call" from the endpoint "state" with the first parameter "ContractsApi_call" but I am not ...
3
votes
1
answer
39
views
Off chain worker for https:// request
I have a simple question if i use off chain workers to get calls to https://somecoinexchange/ to get data for some calculation, what will be the gas usage. I was presuming that since no chain work is ...
8
votes
1
answer
150
views
Support WeightV2 in a substrate chain?
I started working from the substrate-parachain-template and added the pallet_contracts to the runtime. When I open the Contracts UI, I'm getting the error message that states the node does not support ...
0
votes
1
answer
70
views
upgrading substrate node from Polkadot 0.9.28 to 0.9.40
I have a substrate node of Polkadot 0.9.28. It is customised to enable contracts, and I have enabled the contract and runtime pallets. The tutorial I worked on is no more available in substrate docs. ...
4
votes
1
answer
44
views
How can i query pallet contract to give the Scale codec value of a Contract Root Storage Key
According to ink!:
"Storage data is always encoded with the SCALE codec. The storage API operates by storing and loading entries into and from a single storage cells, where each storage cell is ...
2
votes
1
answer
115
views
Error when implementing contract-pallet into substrate-node-template
I was looking to implement smart-contract into substrate-node-template as I do not want to use substrate-contracts-node.
I was trying to follow this guide - https://substrate-developer-hub.github.io/...
9
votes
1
answer
121
views
Smart Contract blockspace allocation in Hybrid Chains
In Rob Habermeier's blogpost about Hybrid Chains, he mentions allocating contract execution to a limited fraction of the chain's blockspace.
Is that some functionality that pallet-contracts provides?
...
2
votes
1
answer
90
views
How to decrease wasm smart contract deployment fee without decreasing Transaction fee?
i am using substrate pallet_contracts for wasm contract deployment how can i set the fees for contract deployment?
4
votes
1
answer
209
views
Caching of smart contract storage reads
Wanted to get some clarity on repeated reads.
Assuming this is the contract storage, two values both under the default 0x00000000 key in the storage.
#[ink(storage)]
pub struct MyContract {
pub ...