Skip to content

emergency_withdraw admin privilege needs clear documentation and audit requirements #192

Description

@ritaifeoluwa

Description

The FarmingPool's emergency_withdraw function allows admin to withdraw any user's funds. This is a powerful privilege that should be documented clearly.

Current behavior

pub fn emergency_withdraw(env: Env, user: Address) -> Result<i128, PoolError> {
    require_initialized(&env)?;
    let admin = get_admin(&env)?;
    admin.require_auth();
    // ... withdraws user's funds
}

Expected behavior

Document:

  • When emergency_withdraw should be used
  • What happens to the user's credits
  • Whether the user is notified
  • Audit trail requirements

Why this matters

Admin abuse of emergency_withdraw could harm users. Clear documentation and audit requirements help prevent misuse.

Labels

documentation, farming-pool, hard

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programdocumentationImprovements or additions to documentationfarming-poolFarmingPool contracthardRequires deep domain knowledge and careful design — not a quick fix

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions