Questions tagged [substrate-contracts-node]
The substrate-contracts-node tag has no usage guidance.
93
questions
1
vote
0
answers
27
views
I want to clone a stable coin project in Rust but having a lot of errors
I am facing too much errors when I clone this project, I want to create a stable coin in substrate I found this repository https://github.com/1010adigupta/ink-Stable-Coin
But after installing rust ...
0
votes
0
answers
10
views
How to test smart contract timestamp dependent behavior?
how can I test block_timestamp-dependent smart contract behavior?
The substrate contact node doesn't allow block_timestamp manipulations.
For context, in the EVM ecosystem, one can use hardhat helpers ...
0
votes
1
answer
57
views
contracts-ui cannot connect to local node
When following ink getting started tutorial at https://use.ink/getting-started/running-substrate I am stuck at one of the steps.
After starting contracts node in dev mode with the following command:
...
0
votes
1
answer
29
views
substrate contracts node compilation failed
Following
https://use.ink/getting-started/setup#2-build-it-yourself
cargo install contracts-node --git https://github.com/paritytech/substrate-contracts-node.git --tag v0.23.0 --force --locked
gives ...
2
votes
0
answers
55
views
Deploy ink! contracts with unified accounts
I have a chain similar to mentioned in this question, where I'm trying to deploy ink! smart contracts. I'm setting my Environment like this:
use ink::env::{Environment, DefaultEnvironment};
use ...
0
votes
0
answers
20
views
Encountering Error "Encountered Unknown Ink! attribute argument: path" in Ink! Smart Contract
I am working on an Ink! smart contract in Rust, and I've encountered an error that I'm having trouble resolving. I followed a solution from a source [provide link here if applicable], but the problem ...
1
vote
0
answers
17
views
RelaychainwithChainbridge
We have tried to connect my relay chain with Chainbridge, but I got errors (SUB to ETH and ETH to SUB). I could not replace the existing relay chain with my relay chain. Please let me know the ...
1
vote
2
answers
53
views
Getting error for running the substrate-contracts-node
first I installed the substrate contract node from this command cargo install contracts-node --git https://github.com/paritytech/substrate-contracts-node.git from paritytech GitHub
I got too many ...
1
vote
1
answer
39
views
What happens to legacy contracts given breaking changes to cargo-contract v3?
In the cargo contract v3 release, breaking changes were made for how contracts are built (cdylib -> bin) and specifying no_main.
I've found that cargo contract v2 produces contracts compatible with ...
1
vote
2
answers
97
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
1
answer
26
views
block time_stamp return value
When using block_timestamp to return value, why it's return 1,690,534,220,344 value? Someone please explain me what is the meaning of this value?
#[ink(message)]
pub fn abc(&self) -> u64 {
...
0
votes
0
answers
28
views
the trait `StorableHint<ManualKey<1648493478>>` is not implemented
Can someone please help me figure our this issue?
error[E0277]: the trait bound `ink::storage::Mapping<(ink::ink_primitives::AccountId, u64), u64, RequestUnstakingTimeKey>: StorableHint<...
2
votes
1
answer
60
views
Generate random number ink!
I am writing ink! contract to generate random number between min and max value. I found this article. Here we can generate random number between 0 to 99. Then I modified to generate random number ...
0
votes
1
answer
24
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 ...
0
votes
1
answer
33
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 ...
2
votes
2
answers
653
views
What is the purpose of installing cargo-contract and using it to create Ink! Rust smart contracts?
What's the deal with installing cargo-contract to make Ink! Rust smart contracts? Is it the contract compiler, or is it ructc? Why do we even need it?
2
votes
0
answers
37
views
How to upload the same ink! smart contract to a different code hash?
I've written this ink! quickstart script that I can repeatedly call to run these steps to flood my local testnet with instances of Flipper contracts:
Kills an existing substrate-contracts-node ...
1
vote
1
answer
68
views
Explain components of Mapping used by Openbrush. Mainly placeholders for the actual type used in the code. Like ApprovalsKey used in bellow example
I am trying to understand the working of upgradeble storage used by openbrush libraries.
I am unable to understand Mapping used in impls of psp34 trait eg
pub operator_approvals: Mapping<(Owner,...
1
vote
1
answer
45
views
Why we use empty struct named as key of particular lib name in mapping while using it in storage of openbrush libraries
When you go through the openbrush smart contract library. You will notice they are using upgradeable smart contract storage and while defining storage they are using some empty struct as key of ...
2
votes
1
answer
67
views
Error calling smart contract with py-substrate-interface
I am using substrate-contracts-node. I've uploaded and instantiated the smart contract.
I would like to interact and query the function using py-substrate-interface. However, I ran into an error while ...
2
votes
1
answer
57
views
Replacing Endowed Account Address in a Local Substrate Blockchain: A Tutorial
Hello Substrate community!
If you have been following the tutorial on building a local blockchain using Substrate, you may have noticed that your address is hard-coded in a JSON file.
To replace your ...
2
votes
2
answers
237
views
Do ink compiler automatically generate getter function for state variable ( if declared as public ) like solidity language?
In the case of solidity language -
In smart contracts, state variables can be made public to allow for easy access and visibility of the data stored in the contract. When a state variable is declared ...
3
votes
1
answer
110
views
bridge substrate solo chain to parachain
I am trying to bridge a solo substrate chain to a parachain .
I am very new to this.
I came across the parity-bridges-common repo (https://github.com/paritytech/parity-bridges-common) . I was able to ...
2
votes
1
answer
64
views
How to run ink! e2e tests in GitHub CI
The directory structure for my project is something like this
ink
- contract
runtime
node
and so on
I want to run the contract ink/contract e2e tests in GitHub CI using my own node instead of the ...
4
votes
1
answer
105
views
trait bounds not satisfied with Executive::try_runtime_upgrade()
I'm attempting to integrate try-runtime into substrate-contracts-node and I get the following error when I call Executive::try_runtime_upgrade():
Compiling contracts-node-runtime v0.24.0 (/Users/bruno/...
1
vote
3
answers
113
views
Unable to deploy the open-brush contracts build using toolchain nightly-2023-02-07 on substrate node
As you can see in following link . I was not able to build contract using latest rust nighly ( rustc 1.70.0-nightly (17c116721 2023-03-29)) toolchain.
ERROR: Loading of original wasm failed
I got the ...
0
votes
0
answers
281
views
Error: Service(Client(VersionInvalid("cannot deserialize module: UnknownOpcode(192)"))) [duplicate]
Link:
https://github.com/paritytech/substrate-contracts-node
https://use.ink/getting-started/running-substrate
When I try to run "substrate-contracts-node --dev" I get this error:
...
2
votes
1
answer
122
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 ...
1
vote
1
answer
16
views
Substrate node tempalate Facing error converting chainSpec.json to raw format
I am using substrate node-template for my blockchain, I want run with my own accounts, for some reason below code converting chainSpec.json raw format is throwing error.
macOS: : Apple M1 pro Ventura ...
1
vote
2
answers
176
views
How to add evm and ethereum pallet from scratch into substrate node?
I want to add evm pallet and ethereum pallet into my substrate node from scratch, so how I can do that.
3
votes
1
answer
42
views
Substrate node template fees deduction using native token
I have create blockchain using substrate-node-template with aura consensus and which contains own native coin and I have created stable-coin using pallet-contract. This stable token is contract, ...
1
vote
2
answers
69
views
Issue with adding a smart contract address to a DEX pallet in a Substrate-based node
I am facing an issue while creating a DEX pallet that allows a user to create a their tokens contract and add it to my DEX in a Substrate-based node. I am using the substrate-node-contract to upload ...
0
votes
1
answer
35
views
Can I make a cross-contract call with constructor (function with "#[ink(constuctor)]" attribute) in ink! contract?
I've been trying to implement cross contract calls in constrcutor but somehow I can't seem to make it right. Is the following code executable?
#[openbrush::contract]
pub mod contract {
#[ink(storage)...
2
votes
1
answer
191
views
Failed to instantiate a new WASM module instance: Limit of 32 concurrent instances has been reached
The Problem
I recently switched from polkadot-v0.20.0 to polkadot-v0.37.0 in order to support V4 Ink Smart contracts.
But I am encountering the following error using the npm package @polkadot/api when ...
2
votes
1
answer
70
views
Error running e2e tests on flipper
I have the substrate-contracts-node running and I run the following command on the flipper contract:
cargo test --features e2e-tests
Results in the following error:
running 4 tests
test flipper::...
1
vote
1
answer
291
views
Substrate node-template Compiling sp-externalities error: cannot find macro `thread_local` in this scope
When I am trying to build substrate node-template, cargo build below error occurs. How to solve this issue.
system : Apple M1 Pro
OSX : Ventura 13.2.1
rustup show
installed toolchains
-----------------...
0
votes
1
answer
83
views
Getting error after runtime upgrade
I am trying to upgrade the version of substrate on my running blockchain from version v0.9.25 to v0.9.36, everything is fine but after runtime upgrade my terminal shows this [869] 🏊♂️ Running ...
1
vote
2
answers
74
views
While executing contracts functions getting out of gas error
I have deployed a wasm smart contract on chain using version polkadot-v0.9.36, after deploying the contract when I tried to execute its function i got error out of gas as shown below.
When I tried ...
0
votes
2
answers
138
views
What is the cause of this contracts.ContractTrapped error?
I have had two contracts (A, B), where contract a calls a function on contract b, when contract a is deployed. This works fine up to a certain point where I receive a contracts.ContractTrapped error (...
0
votes
1
answer
59
views
Calling ink! contracts not working
I have been trying to call the flipper ink! contract from polkadot.js contracts section I keep getting this error.
I've build the smart contract using cargo +nightly contract build and am using ink! ...
0
votes
1
answer
185
views
How to Call a Smart Contract on the Backend
What is the best way to call a contract (based on the Substrate Blokchain) on the backend side from the code? I know there is Polkadot.js but it's rather a frontend focused tool, and there is also ...
0
votes
1
answer
62
views
How to add a Substrate token created with a smart contract to my wallet? What wallet can I use for testing in a local environment?
I created a token on the Substrate chain using a smart contract and I am now trying to add it to my wallet. However, when I enter the contract address into the "Import a token" section of ...
1
vote
1
answer
88
views
contracts.OutofGas when i want to uplooad smart contract
i want upload smart contract in the https://polkadot.js.org/apps/#/contracts but it when i press the depoloy button , it show me this error :
polkadot-v0.9.34
substrate-contracts-node : substrate-...
1
vote
1
answer
157
views
cargo-contract cannot build using the "stable" channel. Switch to nightly
I want to run and build contract by thia command :
Step 1: cargo contract new my_contract
Step 2: cargo contract build
when i want to run Step 2 and i faced this error :
ERROR: cargo-contract cannot ...
0
votes
1
answer
88
views
How to upload a smart contract using Pallet-contract on Substrate Chain
I am using the Pallet-contract module in my Substrate chain and I would like to upload a smart contract. I have the following questions:
What should I put in the code input field? Do I need to upload ...
1
vote
1
answer
81
views
How to implement token registration, trading and enforce the use of native token for fees in a DEX built with Substrate?
How can I implement token registration, trading, and fee payment with my native token (GGG) in a decentralized exchange (DEX) built with Substrate?
Specifically, I am looking to:
Allow users to add ...
2
votes
2
answers
227
views
How to change the native token in Substrate to a custom token?
I want create a custom token in Substrate by the name GGG and I want to use this token for each transaction fee instead of the default Substrate token. Can someone please guide me on how to change the ...
2
votes
1
answer
124
views
Problem adding a smart contract into a Substrate node
I added these pallets into runtime Cargo.toml :
pallet-contracts = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", " ...
0
votes
2
answers
101
views
Balance got Reserved while deploying wasm contracts?
i am using pallet-contracts in my substrate based chain when i am deploying the wasm smart-contract some balance is getting reserved.How can i stop this i don't want to reserve the balance,Or is there ...
1
vote
1
answer
296
views
`let...else` statements are unstable when i need to use pallet-contract
i want to add pallet-contract in my project , it show me error when run this command : cargo check
Error :
error[E0658]: `let...else` statements are unstable
--> /home/kianoush/.cargo/git/...