Category: Coding Mistakes
Struct not shared
Low Severity
Low Impact
Medium Likelihood
Description
The Voter
and VotingEscrow
objects are not properly shared after their creation. This prevents users from accessing these objects when attempting to create a lock and deposit to a gauge, as these operations require access to both the Voter
and VotingEscrow
objects.
The issue stems from commented-out code in the create<T>
function in voting_escrow.move:
public fun create<T>(_: &Publisher, voter_id: ID, clock: &Clock, ctx: &mut TxContext): VotingEscrow<T> {
// ... object initialization ...
// This critical line is commented out:
// transfer::share_object(voting_escrow);
voting_escrow
}
Impact
Users are prevented from participating in the voting system since they cannot access the required Voter
and VotingEscrow
objects for creating locks and depositing to gauges.
Recommendations
We recommend uncommenting the transfer::share_object(voting_escrow)
line in the create function.
Remediation
This issue has been acknowledged by Magma Finance, and fixes were implemented in the following commits: