Terra Classic Vesting Info

Luna Classic stands as a testament to the essence of a truly decentralized blockchain, conceived from the unwavering determination of a community unwilling to forsake an extraordinary project. It unfolds as a narrative of revival a compelling testament to the collective willpower that mends the intricate fabric of projects. Delve into the comprehensive white paper outlining the meticulous bottom-to-top plan for this remarkable resurgence.

Terra Classic Vesting Logo

TrustNet Score

The TrustNet Score evaluates crypto projects based on audit results, security, KYC verification, and social media presence. This score offers a quick, transparent view of a project's credibility, helping users make informed decisions in the Web3 space.

67.09
Poor Excellent

Real-Time Threat Detection

Real-time threat detection, powered by Cyvers.io, is currently not activated for this project.

This advanced feature provides continuous monitoring and instant alerts to safeguard your assets from potential security threats. Real-time detection enhances your project's security by proactively identifying and mitigating risks. For more information, click here.

Security Assessments

"Static Analysis Dynamic Analysis Symbolic Execution SWC Check Manual Review"
Contract address
N/A
Network N/A
License N/A
Compiler N/A
Type N/A
Language Rust / Solana
Onboard date 2025/02/04
Revision date 2025/02/04

Summary and Final Words

No crucial issues found

The contract does not contain issues of high or medium criticality. This means that no known vulnerabilities were found in the source code.

Contract owner cannot mint

It is not possible to mint new tokens.

Contract owner cannot blacklist addresses.

It is not possible to lock user funds by blacklisting addresses.

Contract owner cannot set high fees

The fees, if applicable, can be a maximum of 25% or lower. The contract can therefore not be locked. Please take a look in the comment section for more details.

Contract cannot be locked

Owner cannot lock any user funds.

Token cannot be burned

There is no burning within the contract without any allowances

Ownership is renounced

The contract does not include owner functions that allow post-deployment modifications.

Contract is upgradeable

The contract uses a proxy pattern or similar mechanism, enabling future upgrades. This can introduce risks if the upgrade mechanism is not securely managed.

Scope of Work

This audit encompasses the evaluation of the files listed below, each verified with a SHA-1 Hash. The team referenced above has provided the necessary files for assessment.

The auditing process consists of the following systematic steps:

  1. Specification Review: Analyze the provided specifications, source code, and instructions to fully understand the smart contract's size, scope, and functionality.
  2. Manual Code Examination: Conduct a thorough line-by-line review of the source code to identify potential vulnerabilities and areas for improvement.
  3. Specification Alignment: Ensure that the code accurately implements the provided specifications and intended functionalities.
  4. Test Coverage Assessment: Evaluate the extent and effectiveness of test cases in covering the codebase, identifying any gaps in testing.
  5. Symbolic Execution: Analyze the smart contract to determine how various inputs affect execution paths, identifying potential edge cases and vulnerabilities.
  6. Best Practices Evaluation: Assess the smart contracts against established industry and academic best practices to enhance efficiency, maintainability, and security.
  7. Actionable Recommendations: Provide detailed, specific, and actionable steps to secure and optimize the smart contracts.

A file with a different Hash has been intentionally or otherwise modified after the security review. A different Hash may indicate a changed condition or potential vulnerability that was not within the scope of this review.

Final Words

The following provides a concise summary of the audit report, accompanied by insightful comments from the auditor. This overview captures the key findings and observations, offering valuable context and clarity.


Ownership Privileges
  • The function Cancel can only be executed by the designated owner (the Terra Classic Governance account). This function allows the owner to cancel the vesting schedule, which immediately releases all vested but unclaimed funds to the vestee and returns any overfunded amounts to the Community Pool.
  • The initialization process sets the owner to the Terra Classic Governance account, ensuring that administrative control over the vesting schedule remains exclusively with the designated governance entity.
  • The function UpdateOwnership is explicitly disabled, preventing any transfer of ownership and ensuring that administrative authority cannot be reassigned.

The audited smart contract is the Terra Classic Vesting contract, designed to manage governance‐approved payrolls on the Terra Classic blockchain. The contract implements a vesting mechanism where funds are provided via a Community Pool Spend proposal. The permissionless functions Fund and Distribute can be executed by any user to activate the vesting schedule and claim vested tokens, while only the owner (Terra Classic Governance) has the privilege to cancel the vesting schedule.

Throughout the review, the contract’s structure and logic have been found to adhere closely to the design principles of Dao‑Dao’s cw‑vesting contract. However, several potential improvements were identified:

  • State Update Ordering in Distribution: In the Distribute function, state is updated before validating the withdrawal amount. Although CosmWasm’s transactional semantics ensure reversion on error, reordering the logic to perform validations before state modifications would improve clarity and safeguard against potential future maintenance issues.
  • Subtraction Safety in Cancellation: In the Cancel function, the calculation of the Community Pool refund assumes that the contract balance is always sufficient to cover the unclaimed vested funds. Introducing explicit checks or safe subtraction methods could further strengthen the contract against unexpected states.
  • Parameter Documentation: Enhanced documentation regarding the start_time and vesting_duration_seconds parameters would help users understand that if funding occurs after the vesting start time, any already vested funds become claimable immediately.

Overall, the Terra Classic Vesting contract’s core vesting logic (including funding, distribution, and cancellation) follows a clear design inspired by Dao‑Dao’s cw‑vesting contract. The key invariants (such as requiring an exact funding amount, tracking the claimed amount, and ensuring a monotonically increasing vesting schedule) are well‑enforced by the code and are covered by tests. The issues noted above are minor improvements for clarity and extra safety rather than critical security vulnerabilities.

Note - This audit report consists of a security analysis of the Terra Classic Vesting smart contract. This analysis did not include exhaustive functional or unit testing of the contract's logic. Moreover, only the Terra Classic Vesting contract was audited; other contracts associated with the project were not reviewed by our team. We recommend that investors and users perform their own due diligence before making any decisions.

Files and details

Functions
public

/

State variables
public

/

Total lines
of code

/

Capabilities
Hover on items

/

Functions
public

/

State variables
public

/

Total lines
of code

/

Capabilities
Hover on items

/

Functions
public

/

State variables
public

/

Total lines
of code

/

Capabilities
Hover on items

/

Functions
public

/

State variables
public

/

Total lines
of code

/

Capabilities
Hover on items

/

Functions
public

/

State variables
public

/

Total lines
of code

/

Capabilities
Hover on items

/

Functions
public

/

State variables
public

/

Total lines
of code

/

Capabilities
Hover on items

/

Functions
public

/

State variables
public

/

Total lines
of code

/

Capabilities
Hover on items

/

Functions
public

/

State variables
public

/

Total lines
of code

/

Capabilities
Hover on items

/

Findings and Audit result

low Issues | 2 findings

Pending

#1 low Issue
State Update Ordering in Distribution
payment.rs
L135-139
Description

In the distribute function the contract first increments the claimed amount and then checks whether the requested withdrawal is valid (i.e. non‑zero and not greater than the currently distributable amount). Although CosmWasm’s transactional semantics guarantee that a failing execution will revert all state modifications, updating state before validation can be confusing and may be a maintenance risk if future changes affect transactional behavior.

Pending

#2 low Issue
Potential Underflow in Cancellation Computation
payment.rs
L150-184
Description

When canceling a vesting payment, the contract computes the amount to return to the Community Pool as let to_owner = total_balance - to_vestee; This subtraction assumes that the contract’s current balance (total_balance) is at least as large as the unclaimed vested amount (to_vestee). In normal operation this invariant is maintained by the funding and distribution logic. However, if for any reason this invariant were to be broken (for example, due to an unforeseen external interaction or mis-sequencing of messages), the subtraction could underflow.

optimization Issues | 1 findings

Pending

#1 optimization Issue
Incomplete Input Validation for Schedule Points File
payment.rs
L276-281
Description

In the PiecewiseLinear schedule validation, while there is a check for minimum steps (> 2), there's no maximum limit on the number of schedule points. Auditor Comment: A malicious user could potentially create a schedule with an extremely large number of points, causing gas issues.