Liquid Staking

Stakelink
DeFiHardhatOracle
50,000 USDC
View results
Submission Details
Severity: medium
Invalid

scripts/prod/old/addRESDLImage/add-resdl-image.ts

Your code snippet involves creating and proposing a transaction to upgrade a smart contract and set a base URI using a multi-signature wallet. Here are several potential vulnerabilities or areas of concern to consider:

  1. Reentrancy Risk:

    • If setBaseURI or upgradeTo functions involve external calls or can trigger state changes in other contracts, they could be vulnerable to reentrancy attacks. Ensure proper protection, such as using checks-effects-interactions pattern or reentrancy guards.

  2. Lack of Access Control:

    • The code does not show if the functions upgradeTo and setBaseURI have appropriate access controls in the SDLPool contract. Ensure that only authorized addresses (e.g., the multisig wallet) can call these functions to prevent unauthorized upgrades or changes.

  3. Transaction Ordering Dependency:

    • The creation of multiple transactions in the same proposal could lead to unintended behavior if the second transaction (setting the base URI) depends on the first one (upgrading the contract). Make sure that the contract logic handles these operations appropriately.

  4. Gas Limit:

    • The code does not specify gas limits for the transactions. If the gas limit is exceeded during execution, the transaction will fail. Consider setting an appropriate gas limit when proposing the transaction.

  5. Error Handling:

    • While there is a basic error handling structure at the end of the script, additional error handling may be necessary during the transaction creation and proposal process. For example, if getContract or any other asynchronous operation fails, it should be appropriately handled.

  6. Hardcoded Values:

    • The multisigAddress, sdlPoolImplementation, and baseURI are hardcoded. If these values need to change frequently or differ between environments, consider externalizing them into a configuration file or environment variables.

  7. Signature Validation:

    • Ensure that the signatures and transaction hashes are being verified correctly in the Safe transaction proposal. Mismanagement of signatures could lead to unauthorized proposals being accepted.

  8. SafeAPIKit Endpoint:

    • The use of a specific Safe API URL (https://safe-transaction-mainnet.safe.global) should be validated to ensure that it is the correct endpoint for the intended network. Using the wrong endpoint could lead to failures or security issues.

  9. Handling of MetaTransactionData:

    • Ensure that the MetaTransactionData structure you create aligns with the expected input for the proposeTransaction method. Any discrepancies could cause transaction failures or unintended behaviors.

  10. Audit and Testing:

    • Before deploying this script, conduct thorough testing and auditing of the SDLPool contract and this script to ensure that there are no overlooked vulnerabilities or edge cases.

By addressing these concerns, you can help improve the security and robustness of your code. Consider conducting a formal code review or audit for further assurance, especially since you are working with multi-signature wallets and contract upgrades.

Updates

Lead Judging Commences

inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Lack of quality

Support

FAQs

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

Give us feedback!