Skip to main content

Questions tagged [smart-contract]

Everything smart contract related, either WASM or EVM based.

24 questions from the last 365 days
Filter by
Sorted by
Tagged with
1 vote
0 answers
8 views

OpenBrush and RMRK-Ink updates? [closed]

I had been looking around for tools to aid my ink! smart contract development. I had found OpenBrush from BrushFam and RMRK-ink to be a great resources.But seem like they haven't got any updates since ...
Sacate's user avatar
  • 21
1 vote
1 answer
17 views

Security when instantiate Smart Contract

i am new to smart contract development and i decide to use Ink as a way to learn more about blockchain and Dapps. I was curious about what if an unauthorized actor could instantiate a new instance of ...
Sacate's user avatar
  • 21
0 votes
1 answer
20 views

Call read only ink contract functions from subxt

How do i do something like cargo contract call --contract --message get --suri //Alice in subxt or from a rust backend the docs in subxt focus mostly on signing and submitting txs and events hence ...
roguewane's user avatar
0 votes
0 answers
16 views

Help with indexing smart contract events

Was having a hard time with subxt and indexing smart contract events hence asking for help I want to look for an event on a specific smart contract i deployed can someone help provide some existing ...
roguewane's user avatar
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 ...
Alexandre Ribeiro's user avatar
0 votes
0 answers
12 views

Getting this error on deploying evm smart contracts "gas required exceeds allowance 0"

I've integrated frontier evm-v1.11.0 into both L1 substrate and L0 rococo chains. While account-to-account transfers work smoothly, I'm encountering an issue when trying to deploy a smart contract via ...
Arunjot Singh's user avatar
0 votes
0 answers
19 views

How to Use sin() and cos() in ink! Smart Contracts?

I'm working on a smart contract using the ink! framework for Polkadot, and I need to perform some trigonometric calculations, specifically using the sin() and cos() functions. Since ink! is based on ...
Davy King's user avatar
0 votes
0 answers
17 views

Getting Wrong ABI for the openbrush contracts

openbrush Library when I am building the openbrush examples i am getting wrong ABI for the input of all the functions that are in the libraray. Can anyone tell why it is happening. e.g. This is in ...
user26021116's user avatar
0 votes
1 answer
20 views

Creation of a smart contract in contracts pallet

I need to create a smart contract using contracts pallet. I look at the source code of the contracts pallet and see: pub fn upload_code( origin: OriginFor<T>, code: Vec<u8>, ...
Tomasz Waszczyk's user avatar
0 votes
1 answer
17 views

openbrush::implementation(PSP34Ownable) not implemented!

when building I get this error: error: custom attribute panicked | 4 | #[openbrush::implementation(PSP34, PSP34Ownable, PSP34Mintable, PSP34Enumerable, PSP34Metadata)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...
MarlessDev's user avatar
0 votes
0 answers
11 views

Decimals in the psp22 contract

What is the role of decimals in the PSP22 contract ?? as by default Balance data-type will automatically take the number of decimal places that we have set in the chain, so what is the role of ...
Shivam Varshney's user avatar
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 ...
Jacopo Mosconi's user avatar
0 votes
1 answer
19 views

How Can I Scale Token Distribution in an INK! Custody Smart Contract Using OpenBrush?

community! I am a beginner in INK! and I am developing a custody contract using OpenBrush. This contract receives token (X) as collateral for another token (Y) contract. At regular intervals, the ...
Lucas Cardeal's user avatar
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 ...
Kofi's user avatar
  • 143
0 votes
0 answers
20 views

Gas Limit is over estimated for dex contract

i've been working with the dex smart contracts. Whenever i try to use the add liquidity function of the contract ,it has been calculating the gas limit of 1.3 billion in frontier1.1.0. In frontier v1....
Arunjot Singh's user avatar
2 votes
1 answer
39 views

How to impl FindAuthor<H160> with Babe

I want add pallet-evm in my substrate node. and my substrate node use Babe instead of Aura. How can I Impl FindAuthor whih Babe ? this is the example of Aura. I want to impl it with Babe pub struct ...
robin y's user avatar
  • 21
0 votes
1 answer
31 views

getting CouldNotReadInput while creating cross invocation call when passing Vec<u8> as argument

This is how i am trying to invoke call.. where Bytes is Vec<u8> let res = build_call::<DefaultEnvironment>() .call(handler_acc_id) .exec_input( ...
Priyanshu Mishra's user avatar
1 vote
0 answers
14 views

How To Increase Static Buffer Size in Ink 5.0 Contract

In Ink 5.0, the Static Buffer size can be increased. Does anyone know HOW to do that? This PR mentions several methods they were considering: https://github.com/paritytech/ink/pull/1869 I tried the ...
KathrynColleen'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
0 votes
1 answer
55 views

duplicate lang item in crate `core` [closed]

Unable to build ink! smart contract My command: cargo contract build --release Issue: attempted to define built-in macro more than once /Users/xxx/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/...
CocDap's user avatar
  • 750
2 votes
1 answer
34 views

Are web3.js & ethers.js compatible with ink! smart contracts?

I am pretty new to Substrate and wonder if we can communicate with ink! smart contracts via established libraries such as web3.js or ethers.js? Is the underlying RPC-based communication the same?
Sebastian Dine's user avatar
2 votes
0 answers
54 views

Deployment of contract and calling its function is taking too much fees

I have configured the transaction fees to be approximately 40. However, when deploying a smart contract on an EVM-compatible chain, the fees amount to be 2300, and when calling this function, the ...
Arunjot Singh's user avatar
0 votes
0 answers
12 views

How to call function with the same name but from different trait inside ink-e2e-test

Let's say I have the following impl of my Contract: impl Contract{ #[ink(message)] pub fn my_fun(&self); } impl MyTrait1 for Contract { #[ink(message)] pub fn my_fun(&self); } ...
Yrefef's user avatar
  • 75
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?
Boleng's user avatar
  • 568