SunWeb3Sec/DeFiHackLabs

Change `forge test` command

Closed this issue · 7 comments

This command run the test file and the script/Exploit-template_new.sol:ExploitScript:

forge test --contracts <FILE_PATH> -vvv

I think this command would be more accurate:

forge test --match-contract <CONTRACT_NAME> -vvv

I can work in the changes if I get your confirmation

Yep, we can improve it. thanks @rotcivegaf

I think it's done, my pleasure

merged #829
Thanks a lot!

this change made some not compilable, for example:
when running
forge test --match-contract P719Token_exp -vvv
it reprots:

Error (6275): Source "src/test/compilation/KyberSwap/interfaces/periphery/IBasePositionManager.sol" not found: File not found. Searched the following locations: "/home/lanfear/Github/DeFiHackLabs".
ParserError: Source "src/test/compilation/KyberSwap/interfaces/periphery/IBasePositionManager.sol" not found: File not found. Searched the following locations: "/home/lanfear/Github/DeFiHackLabs".
 --> src/test/compilation/KyberSwap_exp.eth.1.sol:7:1:
  |
7 | import {IBasePositionManager as IKyberswapPositionManager} from "./KyberSwap/interfaces/periphery/IBasePositionManager.sol";
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Error (6275): Source "src/test/compilation/KyberSwap/interfaces/IPool.sol" not found: File not found. Searched the following locations: "/home/lanfear/Github/DeFiHackLabs".
ParserError: Source "src/test/compilation/KyberSwap/interfaces/IPool.sol" not found: File not found. Searched the following locations: "/home/lanfear/Github/DeFiHackLabs".
 --> src/test/compilation/KyberSwap_exp.eth.1.sol:8:1:
  |
8 | import {IPool as IKyberswapPool} from "./KyberSwap/interfaces/IPool.sol";
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Mmm, I don't think the error was caused by my changes
AFK right now, let me a few hours to check

It's working for me...

image

okay, I guess it's might be me added sth unintentionally in my project.