Skip to content

Latest commit

 

History

History
34 lines (28 loc) · 1.74 KB

INSTRUCTIONS.md

File metadata and controls

34 lines (28 loc) · 1.74 KB

To run the tests in the ExploitPoCTest contract, you'll need to use the Foundry testing framework, which includes tools like forge. Here’s a step-by-step guide on how to execute these tests:

  1. Install Foundry

    • If Foundry is not installed, you can install it using the following shell command:
      curl -L https://foundry.paradigm.xyz | bash
      foundryup
  2. Navigate to Your Project Directory

    • Change to the directory where your Solidity project and the ExploitPoCTest contract are located.
  3. Compile the Contracts

    • Compile your Solidity contracts to ensure all artifacts are up to date:
      forge build
  4. Run the Tests

    • Execute the tests using the forge test command. You can run all tests or specify a particular test.
    • To run all tests:
      forge test
    • To run a specific test, use the --match-test flag followed by the name of the test function:
      forge test --match-test testNormalBorrowLiquidate
  5. Review the Output

    • Foundry will execute the tests and provide a report on the console. This report includes information on which tests passed or failed and any errors or logs generated during the test execution.
  6. Debugging (if necessary)

    • If any tests fail or behave unexpectedly, you can use forge debug tools or add logging statements (console.log) in your Solidity code to help diagnose issues.