Questions tagged [foundry-forge]

Forge is a command-line tool that ships with Foundry. Forge tests, builds, and deploys your smart contracts.

Foundry is a smart contract development toolchain.

Foundry manages your dependencies, compiles your project, runs tests, deploys, and lets you interact with the chain from the command-line and via Solidity scripts.

Read the documentation

3 questions
1
vote
0 answers

Is there any way to mock an external call with more results in Foundry?

I'm trying to write unit tests in Foundry and I've quite enjoyed the ability to mock external calls using function mockCall(address where, uint256 value, bytes calldata data, bytes calldata retdata) external. However, I can't figure out if there's…
0
votes
1 answer

Solidity, Foundry - testing stdstore

I'm following https://github.com/Thaddeus19/NFTContracts_with_Foundry/blob/main/src/test/NFTTest.t.sol. Here's my test contract: // SPDX-License-Identifier: UNLICENSED pragma solidity >=0.8.4; import {Vm} from "@std/Vm.sol"; import…
Ayudh
  • 1,673
  • 1
  • 22
  • 55
0
votes
1 answer

Want to pass address of one contract into another inside Foundry test

I am working through OpenZeppelin's Ethernaut challenges and want to use Foundry. I have two smart contracts in my src folder: CoinFlip.sol (the challenge code) and CoinFlipBreak.sol (contract to solve the challenge) In my test file in the setUp()…
user2623706
  • 527
  • 1
  • 6
  • 19