Skip to main content

Questions tagged [pallet-contracts]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
34 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. ...
Boleng's user avatar
  • 497
0 votes
1 answer
30 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 ...
Kofi's user avatar
  • 143
0 votes
0 answers
26 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....
Arunjot Singh's user avatar
1 vote
1 answer
70 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 ...
Yahor Tsaryk's user avatar
0 votes
0 answers
18 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-...
manish singh's user avatar
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 ...
Luca Auet's user avatar
3 votes
0 answers
48 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/...
Raid Ateir's user avatar
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 ...
castle_chain's user avatar
1 vote
1 answer
91 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-...
Arjan van Eersel's user avatar
1 vote
1 answer
47 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 ...
KathrynColleen's user avatar
0 votes
0 answers
21 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 ...
castle_chain's user avatar
0 votes
0 answers
63 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?
Boleng's user avatar
  • 497
0 votes
1 answer
99 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 ...
Evil Kyle's user avatar
  • 149
1 vote
0 answers
11 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 ...
goastler's user avatar
  • 569
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, ...
CHristian's user avatar
0 votes
1 answer
61 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 ...
Tahlil's user avatar
  • 341
1 vote
2 answers
91 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?
Tahlil's user avatar
  • 341
2 votes
1 answer
32 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 ...
the dev's user avatar
  • 477
2 votes
1 answer
45 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 ...
khassanov's user avatar
  • 105
2 votes
1 answer
43 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 ...
Ariful Islam's user avatar
1 vote
0 answers
33 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 ...
Ganesh11's user avatar
  • 1,241
2 votes
1 answer
100 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 ...
Ganesh11's user avatar
  • 1,241
1 vote
0 answers
61 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", ...
FedeC87p's user avatar
1 vote
1 answer
117 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 ...
Ganesh11's user avatar
  • 1,241
3 votes
1 answer
90 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::{...
Haider's user avatar
  • 71
0 votes
0 answers
37 views

Event on factory can't be emitted

I'm working on an an ink! contract and trying to establish a factory contract to enable indexing for each deployment using a subquery subgraph. For this purpose, we emit an event whenever a successful ...
Gabriel Gonzalez's user avatar
2 votes
0 answers
34 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. ...
Ganesh11's user avatar
  • 1,241
0 votes
1 answer
78 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 ...
Luca Auet's user avatar
1 vote
2 answers
105 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 ...
Ganesh11's user avatar
  • 1,241
0 votes
0 answers
69 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 ...
Luca Auet's user avatar
0 votes
1 answer
27 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 ...
Abubakar Mujahid's user avatar
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 ...
Ganesh11's user avatar
  • 1,241
0 votes
1 answer
54 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 ...
Abubakar Mujahid's user avatar
3 votes
1 answer
73 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 ...
Evil Kyle's user avatar
  • 149
0 votes
1 answer
30 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 ...
the dev's user avatar
  • 477
1 vote
1 answer
104 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 ...
the dev's user avatar
  • 477
3 votes
1 answer
79 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 ...
GuiGou's user avatar
  • 31
3 votes
1 answer
38 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 ...
Nöörah Smith's user avatar
8 votes
1 answer
147 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 ...
Snowmead's user avatar
  • 625
0 votes
1 answer
67 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. ...
Stanly Wilson's user avatar
4 votes
1 answer
43 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 ...
dharjeezy's user avatar
  • 419
2 votes
1 answer
104 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/...
BHappy's user avatar
  • 45
9 votes
1 answer
120 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? ...
Bernardo Rodrigues's user avatar
2 votes
1 answer
86 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?
Amit Kumar Yadav's user avatar
4 votes
1 answer
204 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 ...
fbielejec's user avatar
  • 331
1 vote
1 answer
36 views

contract pallet installation issues

A few months back, I added contract-pallet to the Polkadot using the link. At that time, I used Polkadot 0.9.28 as the node version. There was another link from the substrate that uas also useful. At ...
Stanly Wilson's user avatar
1 vote
1 answer
98 views

method not found" and "associated item not found" errors in a Substrate pallet function?

I am working on a Substrate-based blockchain project and I have the following function in my custom pallet: #[pallet::call_index(8)] #[pallet::weight(<T as Config>::WeightInfo::create_exchange())...
Mr Coder's user avatar
  • 923
3 votes
3 answers
99 views

How to sign an extrinsic as a smart contract in the browser?

When working with smart contracts in Contracts UI you sometimes need to call a message as the contract itself. For example the addOwner message of the Multisig ink! example. How can I add the contract ...
Andreea Eftene's user avatar
2 votes
1 answer
123 views

Can I deploy an old ink! v3.x contract on the latest version of substrate/polkadot (pallet-contracts >= polkadot-v0.9.37)?

I have old smart contracts written in ink! v3.x, and I need to update the substrate version (including pallet-contracts) to >= polkadot-v0.9.37. After the update, I'll need to redeploy my smart ...
Yahor Tsaryk's user avatar
0 votes
2 answers
33 views

How To Alter A Clone of Add.tsx To Add One Specific Contract in Polkadot-JS?

We are trying to modify the Polkadot-JS/apps UI to add an app of our own. We have cloned the Contracts page to make our own page so that we can easily call the contract message functions. Contract, ...
KathrynColleen's user avatar