arrow_backRetour aux issues
Stellar-Ecosystem/lodestar
#328
Débutant
Ouvrirarrow_forward
Débutant
Ouvrirarrow_forward
Débutant
Ouvrirarrow_forward
Agents: `admin_deactivate_agent` and `flag_agent` share duplicated admin-check code
ecoDébutant
good first issue
refactor
area: contract-agents
P3-low
effort: small
descriptionDescription
## Context
The same seven-line load-admin-and-compare block appears in `flag_agent`, `admin_deactivate_agent`, and `transfer_admin`.
## Problem
Duplication means a future fix to the admin check has three places to land and two chances to be missed. It is also the kind of thing that makes the file harder to read than it needs to be.
## Proposed approach
Extract a private `fn require_admin(env: &Env, caller: &Address)` helper and call it from all three sites.
## Acceptance criteria
- [ ] A single helper implements the admin check
- [ ] All three call sites use it
- [ ] Existing admin tests pass unchanged
## Where to look
- `contract/agents/src/lib.rs:396`
---
_Newcomers welcome._ Comment to claim this before you start so we avoid duplicate work. Setup instructions are in `CONTRIBUTING.md`; ask here if anything is unclear and someone will help.
Issues similaires
MyZubster-Ecosystem/myzubster
star1
Poids du dépôt moyen
[BOUNTY · OPEN FOR CONTRIBUTORS] Crea il fumetto visuale “Come funziona MyZubster” — 300 MYZ proposed
# 🎨 Bounty — Crea il fumetto visuale “Come funziona MyZubster” ## Status **OPEN FOR CONTRIBUTORS / PROPOSED** > Quest…
JavaScript
documentation
good first issue
StudentSuite/awesome-study-resources
star8
Poids du dépôt léger
Psychology subsection has only 4 entries
The `### Psychology` subsection under By Subject currently has only 4 entries (CrashCourse, Fiveable, Seneca Learning, …
JavaScript
good first issue
content
StudentSuite/awesome-study-resources
star8
Poids du dépôt léger
Foreign Languages subsection has only 4 entries
The `### Foreign Languages` subsection under By Subject currently has only 4 entries (Duolingo, italki, Language Reacto…
JavaScript
good first issue
content