Skip to main content
7 votes
Accepted

How to verify EVM contracts with openzeppelin using subscan or blockscout

In order for Blockscout to verify your source code it requires that you upload the source of each smart contract you want to verify. That means all the source code used to generate binary. Note that ...
Maario's user avatar
  • 659
6 votes
Accepted

How to make rawTransaction? and Can I get some guide or reference about offchain sign?

In order to make an unsigned transaction you can create an object with the required chain metadata and payload information: // create unsigned transaction payload const unsigned = { ...
Cameron Marshall's user avatar
6 votes

How to calculate the optimal tip for Substrate

The Substrate transaction queue uses solely the transaction priority passed via the SignedExtension API to prioritise which transactions make it into a block. I'm not at all familiar with EIP-1159 and ...
Gav's user avatar
  • 2,681
5 votes

Transaction pool extrinsic prioritization

Substrate is generic over the notion of "Priority" The first thing to understand is that the transaction pool itself does not determine whether a transaction is valid or what a transactions ...
JoshOrndorff's user avatar
  • 1,201
5 votes

How to use substrate archive for custom chains?

The substrate template node is available here and you can run it with cargo run --release --bin node-template-archive. As for indexing parachains I am actually not sure but I believe it could be as ...
dvdplm's user avatar
  • 401
5 votes
Accepted

Get contract address from instantiated ContractRef

You can use to_account_id method to obtain address of instantiated smart contract. use ink::ToAccountId; let contract_address = multisig.to_account_id();
Bobo K.'s user avatar
  • 386
4 votes
Accepted

Best practices for handling my own errors and openbrush's errors?

The best way is to have an enum field that will encapsulate the Ownable error, and implement the From trait for it: #[derive(Debug, PartialEq, Eq, scale::Encode, scale::Decode)] #[cfg_attr(feature = &...
P.Ossun's user avatar
  • 1,219
4 votes

dApp registration issue - Shiden Network

You need to be whitelisted to be able to join dApp staking: Please check the requirements here: https://docs.astar.network/docs/dapp-staking/for-devs/requirements Please contact me on Astar Discord if ...
Maarten Henskens's user avatar
4 votes
Accepted

How to inform polkadot.js wallet to approve erc20-type token transfer?

for contract-pallet and WASM-related contracts was defined a standard PSP22 for fungible tokens. If you want to interact with that standard you need to do cross-contract calls with the right selectors(...
Green Baneling's user avatar
4 votes
Accepted

How to transfer wrapped DOT from Astar to Polkadot using XCM

To transfer DOT back to Polkadot, you can use orml-xtokens pallet in Astar:
Shaun's user avatar
  • 111
4 votes
Accepted

How to create wrapped DOT asset on local setup

To my knowledge this has to do with not being able to pay for fees. Yes. To configure any customized asset to pay XCM fees, you must set the fee payment unit per second with xcAssetConfig....
Shaun's user avatar
  • 111
3 votes
Accepted

How to handle TX error on dapp frontend?

I hope the following sites will help you. https://stackoverflow.com/questions/74051628/how-to-get-unique-smart-contract-errors-in-a-frontend-app-using-polkadot-js/75514368#75514368 https://medium.com/@...
s.Takahashi's user avatar
3 votes
Accepted

How to use substrate archive for custom chains?

I solved the problem. Before I had run the Shiden network, I run the command for polkadot network and I forgot to delete the postgres db (or change the path in the config file to the new db). After ...
Minh Mốc's user avatar
  • 1,009
3 votes
Accepted

Is it possible to run moonbeam/Astar as a standalone network

It's possible. In this case, your network will have to run (and use) its own finality gadget (rather than that of the relay chain). You can implement the GRANDPA pallet in your network for block ...
Abdulbee's user avatar
  • 388
3 votes
Accepted

Why does the Astar XC20 wrapper example use the ERC20 wrapper functionality?

The BAI is existing ERC20 token on Astar EVM. In order to make that token xChain it needs to be connected via Astar precompile ERC20Plus with the new xcBAI asset. For this connection to happen we need ...
Maario's user avatar
  • 659
3 votes
Accepted

Astar Startup Error after upgrading from version v4.23.0 to v4.33.0

Please check release note v4.29.1 https://github.com/AstarNetwork/Astar/releases/tag/v4.29.1 In case frontier DB migration failure, please delete frontier db. {base-path}/chains/shiden/frontier or {...
Shunsuke's user avatar
  • 432
3 votes
Accepted

Error running Astar parachains with zombienet

I changed the first id to 2006 and It worked.
Ruben G's user avatar
  • 333
3 votes

How to deploy smart contract in ink which constructor takes value in params

Constructor takes Balance instead of boolean. So, you need to pass some Balance value via swanky command. E.g. swanky contract deploy erc20 --account alice -g 10000000000 -a 10000000
Shunsuke's user avatar
  • 432
2 votes
Accepted

Error Installing dependencies on Swanky project init

I had the same issue. Upgrade your NodeJS version to v18.10.0. You can also look at the pull request
Tomasz Waszczyk's user avatar
2 votes

Error Installing dependencies on Swanky project init

Only dependency is swanky itself. Can you check the package.json in the newly created project, and what happens if you run yarn (npm i) manually? The compile command has been updated. It is now under ...
codespool's user avatar
  • 156
2 votes
Accepted

#[ink(constructor)] cause a error, What is wrong with it?

I did check out your repo: you need to move the constructor as well as all message's and other parts of the Smart Contract logic within the actual implementation impl Amm { /* code here */ } I did a ...
Achim's user avatar
  • 575
2 votes

How to get ASTR balance via json rpc

Basically, it is: http.post/ws.send(payload) payload = json { "id": 0, "method": "state_getStorage", "params": [key, at] // at is an optional param, the ...
AurevoirXavier's user avatar
  • 10.7k
2 votes

how to treat u256 in ink?

The largest size ink! has built in is a u128. ink! compiles to Wasm. The largest primitive Wasm has is 64bit (due to most computers using 64bit). So, there is no benefit to using any larger primitive ...
Alex Bean's user avatar
  • 5,757
2 votes

Error Compling Contract

This is a warning by polkadotjs library, and shouldn't affect the compilation. To get rid of the warning, I suggest installing Swanky the recommended way, by downloading the prebuilt release from ...
codespool's user avatar
  • 156
2 votes
Accepted

How can I retrieve the baseFeePerGas value for historical blocks on Astar?

Here is a method to get historical baseFeePerGas const { ethers } = require("ethers"); async function getBaseFee(blockNumber) { const rpc = "https://evm.astar.network" let ...
gluneau's user avatar
  • 66
2 votes
Accepted

Error AssetNotFound - How to send XCM Instruction::Transact?

Solved this by changing the MultiAsset location to point to the target chain I would be executed the operation on. In this case, the location should be the Polkadot relay chain (parent). Changed from ...
Snowmead's user avatar
  • 625
2 votes

How to pass value as a argument in send transactions?

I doesn't seem that the error is a chain related. It will behave the same on any other parachain. You need to provide origin (caller address) to the call. const { gasRequired, result } = await ...
Bobo K.'s user avatar
  • 386
2 votes

How to crate example daap on Astar network

You can get started with this front-end template. You can set the RPC endpoint to wss://1rpc.io/astr in order to interact with Astar network.
philoniare's user avatar
1 vote

Astar RPC endpoint returns error between block 1558933 to block 1848933

Thank you for report, it looks like this range of blocks has different EVM runtime API version that mismatch current client. We will investigate how to make it work in next release. As workaround, ...
akru's user avatar
  • 11
1 vote

Chain extension for pallet_utility

There are some resources on chain extension here: https://use.ink/macros-attributes/chain-extension https://github.com/paritytech/ink-examples/tree/main/rand-extension
Bruno's user avatar
  • 8,315

Only top scored, non community-wiki answers of a minimum length are eligible