Hot answers tagged

7 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() { ...
user avatar
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 ...
user avatar
  • 252
5 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 ...
user avatar
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 ...
user avatar
5 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 = ...
user avatar
  • 631
5 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', ...
user avatar
4 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). ...
user avatar
  • 692
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 ...
user avatar
  • 1,328
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 ...
user avatar
  • 3,257
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. ...
user avatar
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 ...
user avatar
3 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 ...
user avatar
2 votes
Accepted

how are we sending funds on polygon through contract

The issue is that your contract is not deployed on Mainnet. It is deployed on Testnet, but on Mainnet there is no contract code associated with the address. You should try to deploy it again on ...
user avatar
  • 3,257
2 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 ...
user avatar
  • 131
2 votes

Why is transaction reverting with no additional error details?

From the transaction trace it did a single externall call and reverted. "type": "CALL", "from": "0xa3bab7a95ed40c2a62c7a1ac4ef2043f8b7a1cb6", "to&...
user avatar
  • 29.6k
2 votes
Accepted

Remix not recognizing WMATIC address in an array

Ethereum addresses have checksum and solidity enforces that to avoid "spelling" errors. If they were assigning to an uint prepending 0 will make it skip the checksum uint a = ...
user avatar
  • 29.6k
2 votes
Accepted

Getting error member `add` not found when using ChainlinkClient.sol v0.8.0

You need to put the line using Chainlink for Chainlink.Request; after the contract declaration like so: contract APIConsumer is ChainlinkClient { using Chainlink for Chainlink.Request; ...
user avatar
  • 536
2 votes
Accepted

I accidentally sent Dai to polygon contract. What can I do?

After looking into the smart contract code, it will unfortunately be very hard/impossible to get your Dai back, except of you know the devs/Owner of the contract. It's a proxy contract, meaning that ...
user avatar
2 votes

How to deploy a contract on Polygon/Ethereum/BSC with shared state?

while keeping the same address ideally. Addresses are interchangeable between the networks. The smart contract address is the deployer address + nonce. You just use the same private key to deploy the ...
user avatar
2 votes
Accepted

How do I set provider for polygon mainnet?

No, it won't work without Metamask. The line window.ethereum is trying to get the object that Metamask injects in your browser. If you want it to work without metamask, you'll need a provider like ...
user avatar
2 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: &...
user avatar
  • 167
2 votes

How to successfully utilise the safe mint or mint function?

I'd modify the mintNFT function in the contract // *** Add _data parmeter function mintNFT(address recipient, string memory tokenURI, bytes memory _data) public onlyOwner returns (uint256) { ...
user avatar
  • 29.6k
2 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
user avatar
  • 21
2 votes

The same wallet address on the Mainnet Ethereum network and on the Polygon network. Are these two different wallets with two different owners?

It is likely that yes. Both polygon and ethereum use the same format for wallet addresses, and with the same private key you could sign transactions for both chains.
user avatar
  • 29.6k
1 vote

GET quote on polygon chain using 0x API

Found it Prefix the chain name to the domain, in this case https://polygon.api.0x.org/ So this query will become https://polygon.api.0x.org/swap/v1/quote?sellToken=...
user avatar
  • 73
1 vote
Accepted

Why can I not get Remix to deploy to Polygon Mainnet?

This error is probably not caused by the contract or the deployment. non-200 status When you contact the RPC to deploy you don't get an OK http 200 status. This mean that you can not connect to it. ...
user avatar
1 vote
Accepted

What are the pros and cons selling NFT using the ETH on Polygon?

Pros cheaper transaction costs faster transactions. Cons your assets are less secure. Do you trust polygon to not lose your funds?
user avatar
1 vote

I wonder where this hack started from

Sorry, buddy. Apparently you got scammed by a malicious DeFi website. Follow my trail of thought: 1- I figured there were only 2 possibilities: (1) your seed or private key were compromised, which I ...
user avatar
1 vote
Accepted

Moralis.Cloud.beforeSave not triggered when adding tables through a sync job (plugin)

For performance reasons, the historical sync uses bulk insert. A side effect of this optimization is that triggers are not fired for those inserts. This explains the behaviour you observed where the ...
user avatar
1 vote

How can I acquire some ERC20 tokens to test AAVE on mumbai testnet?

The best way i found was to use these resources: https://docs.aave.com/developers/deployed-contracts/matic-polygon-market This gets you the token addresses https://explorer-mumbai.maticvigil.com/...
user avatar
  • 11

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