Skip to main content
6 votes

Error HH19: Your project is an ESM project (you have "type": "module" set in your package.json) but your Hardhat config file uses the .js extension

Downgrading "chai" from 5.00 to 4.3.7 helped solve the error, i had dependencies that require ES modules and thats why i got the error.
Plair's user avatar
  • 71
3 votes

what is the correct way to define a custom error

If it's defined outside you can share it among your contracts and maintain consistency in your code, other than that I don't think there are any other relevant differences in deployment or execution ...
ceseshi's user avatar
  • 740
2 votes

How can I inheritance an interface without abstract?

The error you get if you try to compile without the abstract keyword actually tells you exactly what you need to do: you can't have a non-abstract contract which doesn't implement all of the function ...
Lauri Peltonen's user avatar
2 votes

ERC20 token transfer failed When getting called by a smart contract

transfer function sends tokens from the caller to the receiver and not from msg.sender. The function you wrote is called by the contract itself, and since the contract has no tokens, the function ...
Al-Qa'qa''s user avatar
  • 296
2 votes

Unknown key "viaIR"

viaIR: true may require version 0.8.13 and higher.
EthanOK's user avatar
  • 451
1 vote

Calls to self failing when passing structs

Instead of abi.encodeWithSignature(), you can use abi.encode() directly to encode the struct. Then, you would need to know the function selector (function signature hash) manually, that you can get ...
SYED ASAD KAZMI's user avatar
1 vote

Is there a way to test whether an external contract implements (or does not implement) a given interface method?

One way is to use try-catch error handling. Here's a minimal code for the same: // SPDX-License-Identifier: MIT pragma solidity ^0.8.24; interface IRandomMethod { function getUint() external view ...
SYED ASAD KAZMI's user avatar
1 vote

"Error HH604: Troubleshooting 'missing trie node' issue when forking BSC mainnet using Hardhat

Received the exact same error when forking binance blockchain. I was using It seemed to be associated with the hardhat version that I was using: v2.22.3 produced ...
Ian Forsyth 's user avatar
1 vote

Gnosis error fix - $

Looks like you got the transaction unstuck? GS020 means that there was a problem with validating signatures for that transaction. You probably tried to execute the transaction again from Safe wallet ...
Louis - Safe Core Team's user avatar
1 vote

I am getting error while importing files on Remix IDE from GitHub

Here's an example of a simple ERC20 token in Remix IDE using the default OpenZeppelin imports: pragma solidity ^0.8.20; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@...
Ake's user avatar
  • 1,149
1 vote

Trying to create a soulbound token. Keep getting two errors

Seems like you are using version 5 of OZ contracts. In version 5 they have removed the _beforeTokenTransfer and _afterTokenTransfer functions. And introduced a new single function, _update. Now you ...
Zartaj Afser's user avatar
  • 4,484
1 vote

Hello, I want to sell tokens, it gives me the same error

If you get error "PancakeLibrary: INSUFFICIENT_INPUT_AMOUNT" try to either increase the slippage tolerance in your transaction settings or double check the token amount you are trying to ...
PlasBit's user avatar
  • 11
1 vote

Generic "Error" with no further message when trying to interact with ERC-4337 Entry Point from Remix IDE

Ok, I see what happens here. Metamask can't estimate gas amount used. It works when I set it manually, like changing: let tmp = await contract.handleOps(ops, beneficiary); to: let tmp = await ...
cosiek's user avatar
  • 21
1 vote

Getting an Unexpected Token error trying to execute a transaction (Tenderly simulation works fine)

I think this issue is on the FrontEnd side of the Gnosis Safe UI because Tenderly simulator is working so it also should let you create a transaction . Ask for help from Safe Team by writing a mail or ...
Jaskaran Singh's user avatar
1 vote

It is safe to use allowUnlimitedContractSize: true?

EIP-170 introduced the 24576 byte limit on Ethereum mainnet smart contracts, however, other blockchains may not follow this standard, which I assume is why hardhat gives you the option to bypass the ...
Rohan Nero's user avatar
  • 1,607
1 vote

"Failed to decode output: Error: hex data is odd-length (argument=\"value\", value=\"0x0\", code=INVALID_ARGUMENT, version=bytes/5.7.0)"

I solved this problem by using Alpha-Beta pruning. Alpha-beta pruning is a developed version of the minimax algorithm that eliminates the worst moves and reduces the workload. // alpha beta pruning ...
umut_satir's user avatar
1 vote

npm ERR! code E404

You have to install hardhat first. cd to your projects folder and run npm i hardhat
Foxxxey's user avatar
  • 4,337
1 vote

Mock3Aggregator.sol refuses to compile

I belive this should fix your error... use: import "@chainlink/contracts/src/v0.6/tests/MockV3Aggregator.sol";
the-first-elder's user avatar
1 vote

TypeError: glob is not a function after updating typechain-hardhat to @typechain/hardhat

To clarify the previous comment: the problem is that you have a /typechain folder in your project. This causes an error when trying to destructure glob: const { glob } = await Promise.resolve().then(()...
Franco Mangone Sanmartín's user avatar

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