NFTBridge
60,000 USDC
View results
Submission Details
Severity: low
Invalid

`Starklane` from `Bridge.sol` should implement `IStarklane.sol`

Summary

Even though the Starklane contract, located in Bridge.sol implicitly follows the IStarklane.sol by implementing all of the functions from the interface. However, as it does not formally declare its implementation, it lacks explicit contractual adherenceto the interface which may lead to several potential issues.

Vulnerability Details

Interfaces serve as a blueprint that allows contracts to communicate with each other in a standardized manner, fostering composability within the ecosystem. An interface acts as a formal agreement that ensures consistency in function signatures between the interface itself and any contract that implements it. This structure is crucial, particularly when interacting with contracts that are already deployed on the blockchain. This ensures that calls to external contracts are made correctly and consistently. However, failing to explicitly declare an interface implementation in a contract can obscure this crucial relationship and lead to vulnerabilities associated with integration and maintenance, such as unexpected behaviors or breaches in expected contract functionality.

Even though the contract implicitly follows the IStarklane.sol, there is a discrepancy

The startRequestCancellation function has an onlyOwnermodifier

/**
@notice Start the cancellation of a given request.
@param payload Request to cancel
@param nonce Nonce used for request sending.
*/
function startRequestCancellation(
uint256[] memory payload,
uint256 nonce
) external;

The same method declaraction in the interface does not include the onlyOwner modifier.

Impact

The impacts, from not implementing the interface could include

  • There's a risk of missing function implementations required by the interface. If the contract does not declare itself as implementing an interface, this might go unnoticed, especially if it compiles without errors due to the presence of other functions with matching signatures.

  • There might be unintentional mismatches in function signatures (e.g., function name, parameters, return type), which can lead to incorrect behavior or contract failure.

  • Other contracts or external clients interacting with the contract might rely on certain assurances that come from interface implementation (like ERC standards). Missing explicit declarations may disrupt integrations and interactions.

  • Future upgrades or modules that interact with the contract might require explicit interface implementation to ensure compatibility and correct functioning within a larger ecosystem.

  • Future developers maintaining or upgrading the contract might overlook the requirement to conform to the interface specifications. This can lead to degradation in contract quality and functionality over time.

  • Modern Solidity compilers can provide warnings or optimization benefits when interfaces are explicitly implemented. Without such declarations, some compiler-level checks and optimizations might not be applied, potentially affecting performance and security.

  • Modern Solidity compilers can provide warnings or optimization benefits when interfaces are explicitly implemented. Without such declarations, some compiler-level checks and optimizations might not be applied, potentially affecting performance and security.

Tools Used

  • Manual Code Review: Analyzing the contract code directly.

Recommendations

  • The Starklane contract should explicitly declare its implementation of the IStarklane interface using the is keyword in its declaration within the Bridge.sol file. This explicit declaration not only reinforces the architectural design of the contract but also enhances its interoperability and robustness by ensuring compliance with the defined interface.

  • Ensure that the contract is compliant with the interface and make adjustments to either the contract or the interface if required.

Updates

Lead Judging Commences

n0kto Lead Judge 9 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

Informational / Gas

Please, do not suppose impacts, think about the real impact of the bug and check the CodeHawks documentation to confirm: https://docs.codehawks.com/hawks-auditors/how-to-determine-a-finding-validity A PoC always helps to understand the real impact possible.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.