Skip to content

get_creation_deposit uses raw Enum as Key #184

@hman38705

Description

@hman38705

Description
The function get_creation_deposit (Line 196) and its setter (Line 203) use ConfigKey::CreationDeposit directly as a storage key. In Soroban, enums used as keys in instance or persistent storage must be properly handled to avoid collisions with other instance variables or metadata. Using a raw enum variant as a top-level key without a formal wrapping structure is poor practice and risky.

Requirements and context

  • Formalize the storage key structure for all configuration parameters.
  • Ensure no collisions with other data types in the instance storage.

Suggested execution

  • Fork the repo and create a branch: git checkout -b fix/issue-81-config-keys
  • Refactor the configuration storage pattern.

Implementation changes

  • Update markets.rs (Line 199 & 207) to use a consistent DataKey::Config(ConfigKey) pattern.

Test and commit

  • Verify that setting the creation deposit does not overwrite other persistent counters like MarketCount.

Example commit message
fix: use structured DataKey for configuration storage to avoid collisions

Guidelines

  • Storage safety.
  • Timeframe: 12 hours.

Metadata

Metadata

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions