Halborn Logo

Goldilocks Core - Goldilocks


Prepared by:

Halborn Logo

HALBORN

Last Updated 12/11/2024

Date of Engagement by: November 14th, 2024 - November 19th, 2024

Summary

100% of all REPORTED Findings have been addressed

All findings

7

Critical

0

High

0

Medium

0

Low

2

Informational

5


1. Introduction

Goldilocks engaged Halborn to conduct a security assessment on their GoldiVault and WeethGoldiVault Solidity smart contracts beginning on November 14th, 2024 and ending on November 19th, 2024. The security assessment was scoped to the smart contracts provided in the Goldilocks-core GitHub repository, commit hashes and further details can be found in the Scope section of this report.


Goldilocks yield splitting vaults allow users to deposit assets, split them into ownership and yield tokens, and trade these tokens to unlock immediate liquidity from the future earnings of yield-bearing positions on Berachain's DeFi protocols. Goldivault is the base contract for our yield tokenization platform and WeethGoldiVault is a specific example of a vault contract that inherits from Goldivault.

2. Assessment Summary

The team at Halborn assigned one full-time security engineer to check the security of the smart contracts. The security engineer is a blockchain and smart-contract security expert with advanced penetration testing and smart-contract hacking skills, and deep knowledge of multiple blockchain protocols.


The purpose of this assessment is to:

    • Ensure that smart contract functionality operates as intended

    • Identify potential security issues with the smart contracts


In summary, Halborn identified some improvements to reduce the likelihood and impact of risks, which were partially addressed by the Goldilocks team. The main ones were the following:

    • Add validations in the renew function to ensure all tokens from the previous cycle are redeemed before renewal of the vault parameters.

    • Enforce logical constraints in initializeProtocol, changeProtocolParameters, and constructor to cap fees below 100% and validate '_depositWindow' is less than '_duration'.


3. SCOPE

Files and Repository
(a) Repository: goldilocks-core
(b) Assessed Commit ID: b694904
(c) Items in scope:
  • src/core/goldivault/Goldivault.sol
  • src/core/goldivault/WeethGoldivault.sol
Out-of-Scope: Third party dependencies and economic attacks.
Remediation Commit ID:
Out-of-Scope: New features/implementations after the remediation commit IDs.

4. Findings Overview

Security analysisRisk levelRemediation
Potential Loss of Rewards Due to Renew FunctionLowSolved - 11/26/2024
Lack of Logical Limits for ParametersLowRisk Accepted - 11/26/2024
Missing Non-Reentrancy ProtectionInformationalSolved - 11/26/2024
Insufficient Validation for Yield Tokens OperationsInformationalAcknowledged - 11/26/2024
Unlimited Token Approvals in ConstructorInformationalSolved - 11/26/2024
Inadequate Validation for Zero Values and AddressesInformationalSolved - 11/26/2024
Missing Comprehensive Validations in buyYT and sellYTInformationalSolved - 11/26/2024

Halborn strongly recommends conducting a follow-up assessment of the project either within six months or immediately following any material changes to the codebase, whichever comes first. This approach is crucial for maintaining the project’s integrity and addressing potential vulnerabilities introduced by code modifications.

// Download the full report

* Use Google Chrome for best results

** Check "Background Graphics" in the print settings if needed

© Halborn 2024. All rights reserved.