I am using foundry for testing Compound V3(comet) , but i am facing with some trouble. I just searched all around but didnt find any answer.
I am testing supply function in comet with foundry, i also run vm.roll to go to new block but there was nothing changes with my interest (I tested with hardhat and it was work).
my code like that (balance didnt changes)
3 mins
contract ContractTest is Test {
address usdc = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48;
Comet comet = Comet(0xc3d688B66703497DAA19211EEdff47f25384cdc3);
IERC20 USDC = IERC20(usdc);
function setUp() public {
vm.createSelectFork("mainnet", 17330000);
// console.log("Balance comet before: ",
comet.balanceOf(address(0x44B6370d43e359CE20fffd91B7652bCF0Fa4B40a)));
console.log("Balance comet before: ", comet.balanceOf(address(this)));
console.log("balance", USDC.balanceOf(0x55FE002aefF02F77364de339a1292923A15844B8));
vm.prank(0x55FE002aefF02F77364de339a1292923A15844B8); //Top holder USDC
// USDC.transfer(address(this), 110000*1e6);
USDC.approve(address(comet), 110000*1e6);
}
function testSupplyBase() public {
console.log("----Before testing supply, all status:----");
console.log("Balance usdc before: ", USDC.balanceOf(address(0x55FE002aefF02F77364de339a1292923A15844B8)));
vm.prank(0x55FE002aefF02F77364de339a1292923A15844B8); //Top holder USDC
comet.supply(usdc, 1000*1e6);
console.log("Balance comet before: ", comet.balanceOf(address(0x55FE002aefF02F77364de339a1292923A15844B8)));
vm.roll(17330000 + 100);
// console.log(block.number);
console.log("Balance comet after: ", comet.balanceOf(address(0x55FE002aefF02F77364de339a1292923A15844B8)));
// console.log("balance", USDC.balanceOf(0x44B6370d43e359CE20fffd91B7652bCF0Fa4B40a));
}
}