Skip to main content
5 votes

Unable to verify contracts on polygon Amoy testnet

I've asked regarding this issue on OKLink Discord channel, and they've responded. So, the correct configuration to be used in the hardhat.config.js would be: etherscan: { apiKey: { ...
SYED ASAD KAZMI's user avatar
4 votes

How to estimate gas cost for a polygon zk evm transaction?

In Polygon zkEVM the gas fee is calculated by applying a fixed factor over L1 gas fee. That price factor is a fixed value and doesn't change often and it's value is based the rollup's cost to publish ...
Maario's user avatar
  • 198
3 votes

Extract the amounts(t0, t1) for non-current tick from Uniswap v3 Pool

You can use the @uniswap/v3-core and @uniswap/v3-periphery libraries as shown in the following contract, the uniswap v3 libraries are all open source so feel free to dive into the solidity ...
MShakeG's user avatar
  • 1,733
2 votes

Polygon see mempool?

You can use Bitquery's mempool stream. Here is an example of a transaction stream from Polygon. https://ide.bitquery.io/Matic-Mempool-transaction-stream
Gaurav Agrawal's user avatar
2 votes
Accepted

Extract the amounts(t0, t1) per tick from Uniswap v3 Pool

There is an NPM library that does all these calculations. It's called univ3prices: https://www.npmjs.com/package/@thanpolas/univ3prices/v/3.0.2 Specifically, check univ3prices....
Vas Treck's user avatar
  • 422
2 votes

Encode an integer to a uint256 to call a function

const Web3 = require("web3"); const web3 = new Web3(); // You can also pass a provider URL here // Your uint256 value const uintValue = "10"; // Encode the uint256 value const ...
EthanOK's user avatar
  • 451
2 votes
Accepted

Extract the amounts(t0, t1) for non-current tick from Uniswap v3 Pool

I found the mathematically way. To calculate the amounts for tick ranges above/below of current tick range, I have to get the liquidityNet of range(or ranges between current and wanted) and to add/sub ...
KunLun's user avatar
  • 197
1 vote
Accepted

How to verify a contract on foundry on Polygon Amoy chain

The API url of Amoy Polygonscan isn't supported by Foundry yet, as it's currently supporting the OKLink explorer one. So, in your foundry.toml file, you can use this url: https://www.oklink.com/api/...
SYED ASAD KAZMI's user avatar
1 vote
Accepted

What number of confirmations is considered secure in Polygon?

I've read somewhere that 50 confirmations is generally safe. However there were bigger reorgs in the past (example with 157 blocks), so you may want to increase this number if you want to be super ...
0xSanson's user avatar
  • 3,294
1 vote

Cannot call contract function using ethers.js

Usually, this error message indicates that your transaction is going to fail. Here's what you can do Call the same function from RemixIDE/Etherscan after deployment If the function is working fine ...
Talha Sajid Chaudhary's user avatar
1 vote

Stuck $200,000 of MATIC bridging from ethereum to polygon using SAFE

I understand how stressful that must be. We can't do much on Safe's side as the transactions seem to have gone through. I can only advise to get in touch with Polygon's Plasma Bridge team here: https:/...
Louis - Safe Core Team's user avatar
1 vote

I can't verify a proxy contract on polygon amoy testnet with Hardhat

I believe the reason is that hardhat proxy cannot be verified this way currently. Tbh they should really allow hardhat and maybe we should push for a feature request on their discord. https://www.okx....
bearsworth's user avatar
1 vote
Accepted

How can I decode the output of the first call and use it to send a transaction?

Here's how you can do it, by decoding the response of the first transaction, and then fetching the necessary details from the same using regex. Then, using that info, send the second transaction. ...
SYED ASAD KAZMI's user avatar
1 vote

Polygon zkEVM get token balance Error: could not decode result data

The issue could not decode result data (value="0x", usually came from not existed contract at address. One or some address in your list is wrong. You should add try-catch in your code, and ...
CT95's user avatar
  • 416
1 vote
Accepted

Cannot send USDT on Polygon : Error happened while trying to execute a function inside a smart contract

So it is working now, with a few changes : Estimate the gas for the contract call, not for a simple transaction. let estimated_gas_for_contract_call = await contract.methods.transfer(adress_to, ...
Francois's user avatar
1 vote

Find ERC20/Polygon address with the beginning and end

An address starting with 0x858b and ending with 4B7d doesn't seem to exist on the Polygon mainnet. But to answer the how-to question so that it might be useful: There are many different ways to do ...
Ake's user avatar
  • 1,149
1 vote

How to accommodate gas costs in a multi-user refund type transaction?

If I've understanded your issue correctly, it seems you're concerned about estimating gas costs for each transaction. In essence, when users make deposits into your application, it's crucial to record ...
tqdpham96's user avatar
  • 608
1 vote
Accepted

Need Help Generating LP Contract Addresses using Uniswap V3 SDK

The issue is in the MATIC token address that you put in the code: export const MATIC_TOKEN_ON_POLYGON = new Token( SupportedChainId.POLYGON, '0x0000000000000000000000000000000000001010', You are ...
Ake's user avatar
  • 1,149
1 vote

Failing deposit transaction

You need to set allowance for the transfer back on deposit of your yieldFarmingToken. Your yieldFarming token currently deployed here. Without looking too much into the code, if you are doing this in ...
Ake's user avatar
  • 1,149
1 vote

Why is there only one USDT which PoS?

PoS refers to having been bridged via Polygon Proof of Stake bridge, alternative to Polygon Plasma bridge. This page seem to have been moved or removed, but using the way back machine we can add some ...
Maka's user avatar
  • 1,220
1 vote

Gas Estimation Error during deploy a smart contract using remix IDE with Injected Provider (Metamask)

This is because solidity 0.8.20 introduces the PUSH0(0x5f) opcode which is only supported on the ETH mainnet and not on any other chains. That's why other chains can't find the PUSH0(0x5f) opcode and ...
Zartaj Afser's user avatar
  • 4,474
1 vote
Accepted

How to decode a log['data'] hexBytes from a solidity event using web3.py

As you can see in the image below the Data field consists of five different attributes and by calling through the below web3 API it returns the hex bytes of those five attributes combined. w3.eth....
Usman Farooq's user avatar
1 vote

Flashbots on Mumbai/polygone

The Flashbot RPC endpoint for Mumbai is :https://rpc-mumbai.flashbots.net/ The Flashbot RPC endpoint for Polygon is: https://rpc-polygon.flashbots.net/
TonyCrypto44's user avatar
1 vote

Hardhat Verify contract issue

As the error code suggests, you should wait for a certain number of network confirmations before verifying a contract. On your code snippet, I can see you are trying to deploy and verify on Mumbai, ...
10xTeam.dev's user avatar
1 vote

What is the difference between "Matic" and "Matic Token"?

I don't think gatsbyz answer answers your question... Posting an answer I found somewhere else: "It's not really an ERC20 token as you think it is, the contract deployed at address(0x1010) on ...
Bryan Linton's user avatar
1 vote

Sending hundreds of transactions every minute, TXs seem to get randomly stuck in mempool even after setting high gas

First of all, I'm wondering what you are building because it sounds potentially toxic but putting that aside....there is an annoying thing on web3 where if one transaction from an address gets stuck ...
user127148's user avatar
1 vote

How to add uniswap v3 liquidity from a code smart contract?

Here is one example of adding liquidity on a Uniswap V3 pool: https://solidity-by-example.org/defi/uniswap-v3-liquidity/
Maxareo's user avatar
  • 673
1 vote

Get balance of a specific token in python using web3.py on polygon network

You need the contract's ABI, but any ERC20 standard ABI will do. def get_balance(user_address): contract_address = "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174" infura_url = '...
Christian Papathanasiou's user avatar

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