code-423n4 / 2021-04-maple-findings

0 stars 0 forks source link

Interface and implementation function declaration differs #98

Open code423n4 opened 3 years ago

code423n4 commented 3 years ago

Handle

paulius.eth

Vulnerability details

Vulnerability details

ILoan.sol: function getNextPayment() external view returns (uint256, uint256, uint256, uint256) Loan.sol: function getNextPayment() public view returns(uint256, uint256, uint256, uint256, bool) Such discrepencies appear because implementation contracts do not inherit the interface explicitly (Loan is ILoan), so it does not give compilation errors if the declaration changes.

Recommended Mitigation Steps

Unify the declarations or even better, make the contract inherit from the interface so you can always be sure that these functions are present.

lucas-manuel commented 3 years ago

Informational, will address