6,608 questions
0
votes
0
answers
34
views
Why am I getting a decode error when calling a function in my Hardhat smart contract?
I’m building a simple Voting DApp using Solidity and Hardhat.
The contract deploys successfully, and I can start and end voting without issues.
However, when I try to call the getWinner() function ...
1
vote
1
answer
37
views
Why does my ERC20 contract revert when calling transferFrom?
I'm writing an ERC20-based contract in Solidity 0.8.21.
When I call transferFrom, the transaction reverts even though the allowance and balance are sufficient.
Here’s a simplified example:
function ...
0
votes
0
answers
49
views
Forge test fails with --match-test(Fork mainnet) but passes with forge test(anvil)
I’m running into an issue with my Foundry tests and can’t figure out what’s going wrong.
When I run on a local Anvil fork, everything passes just fine. But when I switch to a mainnet fork, I keep ...
0
votes
1
answer
85
views
How to correctly ABI-decode multicall results (ERC-20 decimals + symbol) in tests?
I’m trying to understand ABI decoding of multicall RPC calls so I can create stubbed tests using WireMock for my Rust EVM application.
The multicall function signature is:
function aggregate(Call[] ...
2
votes
1
answer
75
views
How to find proper address to use AggregatorV3Interface?
I am using hardhat and metamask on a local blockchain and I have imported AggregatorV3Interface and am trying to get the latest price of USDT in my contract to exchange Ethereuem to USDT.
Here is the ...
0
votes
1
answer
82
views
How to transfer tokens from one contract to another contract
I have two contracts, A and B. Contract A defines my token. I want to transfer some of these tokens to Contract B.
If I understood correctly:
First, contract A should have some tokens to be able to ...
0
votes
1
answer
34
views
"Token Purchase Failing with 'Insufficient Reserve' Error in Solidity Smart Contract"
I’ve deployed two contracts for a token sale system on BSC Testnet:
TestUSDT: https://testnet.bscscan.com/address/0xD93221735d2323a7ddca9e82d0EF44040C570848#readContract (Mock USDT)
APTToken: https://...
-1
votes
1
answer
90
views
How to call name and Symbol of an XRC-20 (ERC-20) token on XDC/Ethereum?
I'm trying to interact with a deployed XRC-20 token contract on the XDC Network (EVM-compatible) using Rust and the alloy crate.
I have already deployed my token using MetaMask and Remix IDE, and I ...
1
vote
1
answer
66
views
Failed: gas limit set too low" after increasing gas limits multiple times and even setting gas limit to 1300000 in my vrf contract
Hello here i have issues in my project where VRF is suppose to call the chainlink functions, but i keep getting the error " Failed: gas limit set too low" after increasing gas limits ...
0
votes
0
answers
70
views
Gnosis Safe - Enable module during safe creation
Here is my contracts:
// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity ^0.8.20;
import "hardhat/console.sol";
// import console.log;
interface ISafe {
...
0
votes
0
answers
122
views
I'm getting "502 Bad Gateway" and "Subgraph not found" errors when deploying to The Graph Studio
I'm trying to deploy my subgraph to The Graph Studio using the following command:
graph deploy my-subgraph-name
I tried many time but still I'm getting this message:
Failed to deploy to Graph node ...
0
votes
0
answers
45
views
Counter and Number are returning undefined in React with wagmi in Next.js from Smart contract Web3
I’m working on a Next.js application and using Wagmi to interact with a smart contract. The issue I'm facing is that when I call the getDoubledNumber() and number() functions from the frontend using ...
0
votes
0
answers
37
views
AbiError: Parameter decoding error: Returned values aren't valid, did it run Out of Gas?
I'm trying to test my smart contract using ganache provider and mocha but seeing this error.
AbiError: Parameter decoding error: Returned values aren't valid, did it run Out of Gas? You might also see ...
0
votes
0
answers
81
views
Is it secure to store only the aggregated BLS public key in a smart contract for signature verification?
I have a question regarding BLS signatures and aggregate signature verification in smart contracts.
Let’s say I have 3 honest signers, each with their own private key. They all sign the same message, ...
0
votes
0
answers
110
views
MetaMask Returns ‘-32603 Internal JSON-RPC error’ with No Revert Reason on Polygon Testnet
I’m building a DApp on the Polygon testnet (the new Amoy network) using MetaMask, ethers.js, and a Solidity smart contract. Whenever I try to call my startMaintenance() function (or several others) ...
0
votes
0
answers
43
views
Can I implement a tax deduction feature in an ERC20 contract where the tax is deducted in BNB or ETH when a user swaps tokens on PancakeSwap?
The _transfer() function only handles ERC20 token transfers, so I can't implement any logic for ETH or BNB within it.
I integrated some functions, but they were not callable on PancakeSwap. When I ...
1
vote
0
answers
52
views
Uniswap V3: Unable to Add Liquidity After Deploying ERC20 Token with Tax Mechanism
I am trying to add liquidity to Uniswap V3 for my ERC20 token, which has a 4% tax deduction on transfers. The tax mechanism ensures that whenever users transfer tokens, 4% is sent to the owner's ...
0
votes
1
answer
72
views
I am unable to swap the token after adding liquidity to Uniswap V2
I have deployed an ERC20 contract on the Sepolia chain and added liquidity on Uniswap V2. However, when I tried to swap the token with ETH, the token price was not being calculated, and I was unable ...
0
votes
0
answers
28
views
The Zokrates CDN is not loading
I was working in a project and ussing zokrates cdn inside my webview. It was working right . But when I started the project I am getting error zokrates is not defined .
Below is a simple Html code ...
0
votes
1
answer
48
views
Pitfalls in small smart contract
Here is a question from a coding interview. I am just wondering what would be the major pitfall in this small smart contract in your opinion:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
...
0
votes
0
answers
193
views
PancakeSwap universal router usage. Web3, PancakeSwap, Bsc testnet
I'm working on an integration with PancakeSwap using Java and Web3J. All my tests were conducted on BSC Testnet.
After conducting some research, I used the UI to perform a transaction that went ...
-2
votes
2
answers
60
views
Why it is taking high cause fee
https://bscscan.com/address/0x1732b451aa189832109e8715b9ae0563bab7c2bc#writeContract
I have deployed this contract on BSC, can someone guide why it is taking some much gas fee.
If you have any ...
1
vote
0
answers
38
views
How to Deploy a Smart Contract and Have Someone Else Sign the Transaction? Polygon
I'm trying to deploy a Smart Contract on the Polygon mainnet, but I need the deployment transaction to be signed by someone else's wallet (so they become the contract owner and receive the tokens).
I’...
0
votes
1
answer
32
views
why when i use "token URIs" error, error says "do you mean token URI or _tokenURI"
guys can you help me? there is an error when I declare "_tokenURIs", the error is something like this:
"Undeclared identifier. Did you mean "_tokenURI" or "tokenURI"?...
0
votes
0
answers
58
views
Adding Ignition module in HardhatUserConfig
I'm creating my first project for etherum tokens. This project was initialized with Typescript+Viem+Hardhat.
After creating some contracts, I wrote an Ignition module. Then, I was about writing the ...