IThunderLoan is the specification contract that flash loan receivers import to interact with ThunderLoan. It defines the repay function signature that integrators call inside executeOperation.
The interface declares repay(address token, uint256 amount) but ThunderLoan implements repay(IERC20 token, uint256 amount). While ABI-compatible at runtime (both encode as 20 bytes), the mismatch produces type errors in statically-typed clients, misleads developers about the intended API, and breaks strict type-checking SDK calls.
Likelihood:
Every flash loan receiver written against the published interface encounters this mismatch when calling repay — the MockFlashLoanReceiver already demonstrates this pattern with IThunderLoan(s_thunderLoan).repay(token, amount + fee) where token is typed as address.
Type-checked SDKs (ethers.js v6, viem) generate call encoders from the ABI; a mismatch between interface ABI and implementation ABI causes silent encoding divergence.
Impact:
Developers integrating against the interface spec write address-typed repay calls, discover type mismatch warnings, and may work around them incorrectly — increasing the chance of integration bugs.
ABI-generated client code from the interface will encode calls differently than client code from the implementation, causing unexpected behavior in type-strict environments.
Place this test in test/ and run forge test --match-test testInterfaceTypeMismatch. The test demonstrates that IThunderLoan.repay() declares token as address while ThunderLoan.repay() uses IERC20, causing type mismatch warnings and misleading integrators who implement the interface.
Update IThunderLoan to import IERC20 and change the repay() signature to repay(IERC20 token, uint256 amount) so the interface matches the implementation exactly.
Also update MockFlashLoanReceiver and any other code that passes address to repay to use the IERC20 type.
The contest is live. Earn rewards by submitting a finding.
Submissions are being reviewed by our AI judge. Results will be available in a few minutes.
View all submissionsThe contest is complete and the rewards are being distributed.