As of May 31, 2023, we have updated our Code of Conduct.

New answers tagged

0 votes

Hardhat test error, missing argument in contract constructor

Okay, here is the updated code and subsequent error message. I think this is what you were mentioning, but I want to be sure. I am really new to smart contract development so thank you for your ...
donoso.eth's user avatar
  • 1,288
0 votes

Hardhat test error, missing argument in contract constructor

In the BCCasino constructor you are expecting 4 params: constructor(address _casino, address _token20, address _token721, address _token1155) {..} And in your hardhat test, you are deploying with ...
donoso.eth's user avatar
  • 1,288
0 votes

What is the best way of setting limits of fuzz test input parameters in Foundry?

Foundry implements function bound(uint256 x, uint256 min, uint256 max), which bounds a variable parameter to a certain range. To bound an input parameter, you can do something like this: function ...
Nal Luksic's user avatar
0 votes

cannot estimate gas; transaction may fail or may require manual gas limit

Same problem. I solved it in this way. Create a new directory totally empty: /blabla/createsmartaccount_dir. Create these 2 files inside it. /blabla/createsmartaccount_dir/index.js /blabla/...
Alfred's user avatar
  • 1
0 votes

What public testnets (test networks) and faucets exist?

You can use https://www.buildbear.io/ and create your own Testnet that comes with a built-in faucet.
Chandan's user avatar
0 votes
Accepted

How to assert that a BigNumber is included in a list of numbers?

Based on chai documentation, oneOf assertion does not work with BigNumber. I had to replace that assertion with greaterThan and lessThan: expect(tokenType).to.be.greaterThan(BigNumber.from(0)).and....
Falcon Stakepool's user avatar
1 vote

How to test a function that returns array type struct using Foundry

I can read from the error that you are comparing two instances of MarketItem that seem to be defined in two different contracts (ContractTest vs NFTMarketPlace). I guess you have copied the MarketItem ...
Jacobo Lansac's user avatar
0 votes

Hardhat vs foundry, which to use for testing?

Here is my experience with Hardhat - for us, Hardhat works very well. We use it as the Test Node, I think in the Foundry ecosystem this is equivalent to the Anvil. So here are the points why Hardhat ...
tenbits's user avatar
  • 1,085
1 vote

Hardhat vs foundry, which to use for testing?

Go with Foundry - it's faster and more ergonomic than anything else on the market right now. Solidity code should be tested in Solidity itself. It doesn't matter if you are coming from the JavaScript ...
Paul Razvan Berg's user avatar
0 votes

Simple OpenZeppeling mockCoin for local testing, Mint function gets stuck in testing

I managed to find a solution to the problem you were facing. The issue was related to the way you were interacting with the mint function in the contract using Hardhat. The problem was that you were ...
MuzammalRamzan's user avatar
1 vote

Is it possible to load contracts in hardhat genesis block?

You could use the hardhat_setCode debug method to set your contract runtime bytecode to any address. Additionally, you could set or modify any state variables with hardhat_setStorageAt.
tenbits's user avatar
  • 1,085
0 votes

Simple OpenZeppeling mockCoin for local testing, Mint function gets stuck in testing

It looks like the issue is with the way you are calling the mint function. Instead of usdcToken.connect(swapper.address).mint(swapper.address,swapAmount ), try using usdcToken.connect(swapper).mint(...
Kelvin Chelenje's user avatar
0 votes

What public testnets (test networks) and faucets exist?

Free Sepolia Testnet Faucet that lets you claim 0.5 Sepolia ETH per day. https://www.infura.io/faucet/sepolia
anataliocs's user avatar
1 vote
Accepted

How to you write tests for the transferFrom function for my ICO contract?

The error is due to the require statement that checks if the recipient is allowed to spend tokens on behalf of the sender. To make the require statement pass, you need to first approve the recipient ...
Hans-Peter Schrei's user avatar

Top 50 recent answers are included