Dapper Sand Bison
Medium
The inconsistent view/non-view modifiers between interfaces and implementations in Strategy and Vault contracts will cause integration issues as external protocols will have incorrect assumptions about state modifications, leading to failed transactions and increased gas costs.
Root Cause: In IStrategy.sol
and IVault.sol
, the checkPoolActivity()
function is declared without the view modifier while the implementation in Strategy.sol is view-only:
https://github.com/sherlock-audit/2025-02-yieldoor/blob/main/yieldoor/src/interfaces/IVault.sol#L20
https://github.com/sherlock-audit/2025-02-yieldoor/blob/main/yieldoor/src/interfaces/IStrategy.sol#L29
https://github.com/sherlock-audit/2025-02-yieldoor/blob/main/yieldoor/src/Strategy.sol#L310-L342
- Protocol must be deployed with the mismatched interface and implementation
- External protocol must make state assumptions based on function modifiers
- External protocol must integrate with Yieldoor through the provided interfaces
- Protocol assumes
checkPoolActivity()
modifies state based on interface declaration - Protocol implements gas estimation based on non-view function
- Transaction fails due to incorrect gas estimation or state modification assumptions
- Critical operations like position opening fail due to the interface mismatch:
https://github.com/sherlock-audit/2025-02-yieldoor/blob/main/yieldoor/src/Leverager.sol#L113-L114
- External protocol integrates with Yieldoor using IVault interface
- Protocol assumes
checkPoolActivity()
modifies state based on interface declaration - Protocol implements gas estimation based on non-view function
- Transaction fails due to incorrect gas estimation or state modification assumptions
- Critical operations like position opening fail due to the interface mismatch: https://github.com/sherlock-audit/2025-02-yieldoor/blob/main/yieldoor/src/Leverager.sol#L113-L114
- External protocols suffer from failed transactions and increased gas costs
- Integration failures in critical paths like position opening and liquidation checks
- No direct fund loss but operational impact on protocol integrations
- Affects all contracts integrating with Yieldoor through the provided interfaces
contract VaultIntegrationTest is Test {
IVault vault;
function testIncorrectStateAssumption() public {
// Setup vault integration
vault = IVault(address(0x123));
// This will fail due to incorrect gas estimation
// as interface suggests state modification
vm.expectRevert();
vault.checkPoolActivity();
}
}
- Add view modifier to interface declarations:
interface IStrategy {
function checkPoolActivity() external view returns (bool);
}
interface IVault {
function checkPoolActivity() external view returns (bool);
}
- Update Vault.sol implementation to match:
function checkPoolActivity() public view returns (bool) {
return IStrategy(strategy).checkPoolActivity();
}
- Document the view-only nature of these functions in interfaces and implementation