Closed 0xGuybrush closed 4 weeks ago
Able to reproduce this with the given setup
Additional notes:
forge init
npm install @openzeppelin/contracts
@openzeppelin/contracts=node_modules/@openzeppelin/contracts/
the thing here is that when you IERC20(usdc).totalSupply();
that line is added in REPL contract, e.g. if you !source
output will be something like
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.27;
import {Vm} from "forge-std/Vm.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
contract REPL {
Vm internal constant vm = Vm(address(uint160(uint256(keccak256("hevm cheat code")))));
/// @notice REPL contract entry point
function run() public {
address usdc = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48;
IERC20(usdc).totalSupply();
IERC20(usdc).totalSupply();
IERC20(usdc).totalSupply();
IERC20(usdc).totalSupply();
}
}
so looks like working as designed to me. @zerosnacks could oyu please share your thoughts? thank you!
Ah good find @grandizzy, that makes total sense. I wasn't aware of the !source
command at the time.
Marking this as expected behavior
, cc @0xGuybrush feel free to re-open if this is incorrect
Ah that makes sense, thanks both!
Component
Chisel
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.2.0 (c2e5297 2024-06-14T00:22:57.565836000Z)
What command(s) is the bug in?
chisel
Operating System
macOS (Apple Silicon)
Describe the bug
Steps to Reproduce
chisel
sessionview
functionCurrent Outcome
Desired Outcome
MCVE
Start
chisel
:Within Chisel:
After one run, we get:
After mutliple runs we get: