New answers tagged testing
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 ...
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 ...
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 ...
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/...
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.
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....
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 ...
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 ...
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 ...
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 ...
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.
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(...
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
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 ...
Top 50 recent answers are included
Related Tags
testing × 634solidity × 285
truffle × 188
hardhat × 144
unittesting × 52
ethers.js × 46
javascript × 42
contract-development × 41
mocha × 41
testrpc × 38
truffle-test × 36
testnets × 33
chai × 31
go-ethereum × 30
web3js × 28
ganache × 27
foundry × 27
remix × 21
blockchain × 19
erc-20 × 18
test × 16
events × 15
contract-deployment × 14
contract-debugging × 13
ether × 12