11
votes
Accepted
How can I get USDT/USDC for Polygon Mumbai Testnet?
I've gotten some assets for polygon mumbai here: https://faucet.paradigm.xyz/
Including DAI/wETH/MATIC.
Should be able to trade those for USDC/USDT. From a quick search, can trade for USDT on Mumbai ...
9
votes
Accepted
Get balance of a specific token in python using web3.py on polygon network
You need the token's ABI and utilize the function balanceOf. Example snippet below:
token = w3.eth.contract(address={token address}, abi={token abi}) # declaring the token contract
token_balance = ...
9
votes
Accepted
Listen to events in the Polygon network using Web3.py
For future readers, apparently Polygon does not support eth_newFilter so a way to get events thru Web3 is subscribing to logs (currently available thru Web3.js) or using get_logs (if u wanna do it in ...
8
votes
Accepted
How to properly implement a ContractURI for on-chain NFTs
It seems like my setContractURI function had one encodepacket too much. it looks like it is working now on OpenSea.
function setContractURI(string memory contractURI_) public onlyOwner() {
...
7
votes
Why is transaction reverting with no additional error details?
"output": "0x4e487b710000000000000000000000000000000000000000000000000000000000000011"
0x01: If you call assert with an argument that evaluates to false.
0x11: If an arithmetic ...
7
votes
Accepted
Metamask: wallet_addEthereumChain is not working when using polygon mainet but works with polygon mumbai
Try to convert to hex the chainId with web3.utils.toHex() function:
chainId = '137'; chainId = web3.utils.toHex(chainId);
chainData = [{
chainId: chainId,
chainName: 'Matic(Polygon) Mainnet',
...
6
votes
Accepted
Unable to connect to polygon mumbai test network using truffle
After updating the RPC endpoint to https://rpc-mumbai.maticvigil.com from https://rpc-mumbai.matic.today in truffle-config.js it started working fine. It seems that Polygon team updated the RPC ...
5
votes
Accepted
How does polygon deal with Eth values within smart contracts?
So in Solidity programming the term "Ether" mean 10^18
(For example: 5 ETHER = 5*10^18 = 5000000000000000000)
So regarding the programming side of things, it does not see Ether as the ...
5
votes
Accepted
Deploying a solidity smart contract to polygon matic
Difference between ETH and Polygon smart contracts
There is none. Polygon runs barely modified GoEthereum, same as Ethereum mainnet, which runs EVM virtual machine.
Your smart contracts are ...
5
votes
Accepted
How to swap wETH for ETH on Polygon network?
First of all, the "eth" asset exists in different forms across Ethereum and Polygon. For each blockchain, we have one utility token and other erc20 compliant tokens (+ other standards).
...
5
votes
Error: network does not support ENS
This might be the same problem here.
The address that you use might be invalid (e.g. space/numbers accidentally added to address). In this case, your smartcontract address is invalid
5
votes
Is Polygon (Matic) a layer-2 or a sidechain?
Short Answer:
Polygon PoS can be considered as a combination of sidechain and layer2 solution because it is a separate chain that has its own consensus mechanism but also uses the main Ethereum layer ...
5
votes
Accepted
Failed to get EIP-1559 fees error when deploying to ZkEVM polygon using Foundry
try to add suffix --legacy in forge script
4
votes
Accepted
Is there an Ethers.js equivalent of Low, Medium, High gas preferences?
EDIT:
The code below does not work. Due to some networks returning gasPrices with precision in the single wei dimension, just multiplying it by 1.x doesn't give a whole number value as a result. I ...
4
votes
Error: network does not support ENS
I was facing this issue because I was paasing wrong CONTRACT_ADDRESS while creating the contract.
Check that you have passed the correct CONTRACT_ADDRESS
4
votes
Error: network does not support ENS
This error can sometimes throw if a contract address you are using contains an erroneous space like so:
let CONTRACT_ADDRESS = '0x1f9840a85d5af5bf1d1762f925bdaddc4201f984 ';
4
votes
Accepted
Is Polygon (Matic) a layer-2 or a sidechain?
A blockchain doesn't exclusively have to be one or the other - it can be both a sidechain and a layer-2. They aren't opposites.
A sidechain refers to a blockchain which has it's own consensus ...
4
votes
Accepted
The same wallet address on the Mainnet Ethereum network and on the Polygon network. Are these two different wallets with two different owners?
Most of the time its same. But not always.
Polygon Mainnet have made its own chain, which is seperate from Ethereum chain.
When we create wallet by wallet providers like metamask the wallet address of ...
3
votes
I wonder where this hack started from
TLDR : cancel your allowance for WETH to contract 0x9bf475e0654ec615b473599c9d39ddd87b01e894 and it wont happen again.
https://polygonscan.com/address/0x9bf475e0654ec615b473599c9d39ddd87b01e894#code ...
3
votes
Accepted
Why would Pending transactions disappear?
Miners decide how long they keep pending/queued transactions. If they disappear on polygonscan, it only means that polygonscan no longer has it, but other miners could still have them.
There are three ...
3
votes
Accepted
Retrieving Matic Reward Rates on AAVE with a Python script
So I solved the problem. There were two mistakes:
For the "REWARD_DECIMAL" and the "TOKEN_DECIMAL" I should use 10 to the power of the number, and not the numbers themselves.
...
3
votes
Accepted
Does smart contracts "sync" between Polygon and Ethereum?
1 - Do I have to redeploy the contract on the Polygon network or does it automatically sync with the Ethereum Mainnet after it is deployed?
Polygon and Ethereum are separate blockchains and do not ...
3
votes
Metamask: wallet_addEthereumChain is not working when using polygon mainet but works with polygon mumbai
import { utils } from 'ethers';
const networkMap = {
POLYGON_MAINNET: {
chainId: utils.hexValue(137), // '0x89'
chainName: "Matic(Polygon) Mainnet",
nativeCurrency: { name: &...
3
votes
How do nework bridges work e.g. ethereum to polygon/matic bridge
Since Blockchains are basically closed silos of publicly stored information. They cannot communicate with the outside world using HTTP or other data transfer protocols directly. Someone has to handle ...
3
votes
How can I decode the event log I receive in my txn where there more than 1 smart contract involved and the emitted event cannot be found in ABI
The ABI posted to Mumbai implementation contract is probably lacking.
Take transaction 0x32e3230a7478315092a04ef57fc2426947ec5031c6977c7b184e7bcd02be9216 for instance, if you look at Mumbai Explorer ...
3
votes
How can I get USDT/USDC for Polygon Mumbai Testnet?
The only way I found so far is (that still works):
Create a developers account on Circle (here) and get an API key
Use their demo app to add balance to your account available here or use their ...
3
votes
Is Polygon (Matic) a layer-2 or a sidechain?
A significant difference between layer 2 and sidechain -
Sidechains have security mechanisms of their own.
Layer 2 solutions derive their security from their parent blockchain while using their own ...
3
votes
Accepted
NFT token undefined
const voucher = lazyMinter.createVoucher(1, metadata.url)
Here you are calling an asynchronous function without telling the thread to wait for the result.
const voucher = await lazyMinter....
3
votes
How to make my own private blockchain?
So for running you own private chain you basically need to create and configure your genesis.json file and define a networkId when running your blockchain client.
For tweaking deeper configs you ...
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
polygon × 435solidity × 91
nft × 38
web3js × 36
metamask × 33
ethers.js × 33
blockchain × 27
opensea × 27
ether × 26
hardhat × 26
contract-development × 25
tokens × 25
remix × 22
erc-20 × 20
erc-721 × 20
uniswap × 18
testnets × 17
layer-2 × 17
contract-deployment × 15
etherscan × 15
web3.py × 14
0x × 13
transactions × 12
ethereum-wallet-dapp × 11
nodejs × 11