Skip to content

Advance Foundry: (DeFi) invariant_protocolMustHaveMoreValueThanTotalSupply() calls and reverts #3637

Answered by EngrPips
Febri-An asked this question in Q&A
Discussion options

You must be logged in to vote

Hello @Febri-An, It seems to me that your Handler contract is not versatile enough to handle some weird cases which will help you cut down on reverts. While I may be wrong, I will advice that you compare your Handler contract with Patrick's Handler contract on the official GitHub repo associated with the course. Also, below is my Hanlder contract, which works correctly.

// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.23;

import {ERC20Mock} from "@openzeppelin/contracts/mocks/ERC20Mock.sol";
import {MockV3Aggregator} from "../Mocks/MockV3Aggregator.sol";
import {DSCEngine} from "../../src/DSCEngine.sol";
import {DecentralizedStableCoin} from "../../src/DecentralizedStableCoin.sol"

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@Febri-An
Comment options

@EngrPips
Comment options

@Febri-An
Comment options

@Febri-An
Comment options

@EngrPips
Comment options

Answer selected by Febri-An
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants