Skip to content

referral_storage: crate fails to compile — dead duplicated code leaves an unclosed delimiter #374

Description

@abayomicornelius

Problem

In contracts/referral_storage/src/lib.rs, get_trader_referrer and get_trader_discount_bps each contain a finished, working implementation immediately followed by leftover fragments of an older implementation that were never deleted. In get_trader_referrer, the Some(referrer) return is followed by more statements reusing an already-moved variable; in get_trader_discount_bps, a match block opens whose arms are never closed before a second, nested match begins on the very next line. Building the crate confirms this is fatal: cargo check -p referral-storage fails with an unclosed-delimiter error and "could not compile referral-storage (lib)".

Why it matters

The entire referral_storage contract — registration, tier config, self-referral checks, volume tracking, everything — cannot be built, deployed, or tested in its current state. Any CI pipeline or downstream contract depending on this crate is broken.

Suggested fix

Delete the orphaned dead-code fragments after the completed Some(referrer) return in get_trader_referrer, and after the completed config-lookup match in get_trader_discount_bps (the duplicated nested match block and everything through the stray trailing extend_ttl line), keeping only the TTL-bumping implementations that were clearly intended to replace them.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions