Description
callora-revenue-pool does not compile. cargo check -p callora-revenue-pool fails with five error[E0425]: cannot find value errors because the pause implementation references two constants — PAUSED_KEY and ERR_PAUSED — that are used in contracts/revenue_pool/src/lib.rs (:185, :188, :211, :235, :246) but never declared. The neighbouring constants (ADMIN_KEY, ERR_UNAUTHORIZED, etc.) are declared together at the top of the file (contracts/revenue_pool/src/lib.rs:16–:26); these two were simply omitted.
The pause feature itself is fully implemented — pause, unpause, is_paused, and the require_not_paused guard on distribute / batch_distribute all exist — so this is purely a missing-declaration fix plus the documentation that should have shipped with it.
Requirements and context
Functional
- Declare the two missing string constants alongside the existing ones in
contracts/revenue_pool/src/lib.rs (near :16–:26):
const PAUSED_KEY: &str = "paused"; — the instance-storage symbol key used by pause/unpause/is_paused.
const ERR_PAUSED: &str = "revenue pool is paused"; — the panic message used by require_not_paused (:188).
- The chosen
PAUSED_KEY value must be a fresh, unused instance-storage key (it must not collide with ADMIN_KEY, PENDING_ADMIN_KEY, USDC_KEY, MAX_DISTRIBUTE_KEY, or VERSION_KEY).
- The
pause_set event already emitted by pause/unpause (contracts/revenue_pool/src/lib.rs:213 / :237) is not documented in EVENT_SCHEMA.md — add it.
Non-functional / repo conventions
- No behavioral change beyond making the code build:
distribute and batch_distribute already call Self::require_not_paused(&env) (:343, :458); once the constants exist these guards must function and stay tested.
- Follow the existing constant style in the file (string keys via
Symbol::new(&env, KEY)), consistent with claim_admin / set_admin.
Acceptance criteria
Suggested execution
1. Fork the repo and create a branch
git checkout -b fix/revenue-pool-paused-constants
2. Implement changes
contracts/revenue_pool/src/lib.rs — add the two const declarations next to the existing constants block.
EVENT_SCHEMA.md — add a pause_set section under Contract: callora-revenue-pool and a row in the indexer quick-reference table.
3. Write/extend tests
- In
contracts/revenue_pool/src/test.rs add (or confirm) tests: pause then is_paused()==true; distribute while paused panics with ERR_PAUSED; batch_distribute while paused panics; unpause restores both; double-pause / unpause-when-not-paused panic paths.
4. Test and commit
cargo fmt --all -- --check
cargo clippy --all-targets --all-features -- -D warnings
cargo test --workspace
./scripts/check-wasm-size.sh
./scripts/coverage.sh
Example commit message
fix(revenue-pool): declare missing PAUSED_KEY/ERR_PAUSED constants
Pause/unpause referenced two undeclared constants, breaking compilation
(E0425). Add them next to the existing constant block and document the
pause_set event in EVENT_SCHEMA.md.
Guidelines
- Coverage must stay >= 95% (
scripts/coverage.sh), CI-enforced via .github/workflows/coverage.yml.
- Add NatSpec-style
/// docs if you touch any entrypoint; keep EVENT_SCHEMA.md authoritative for the pause_set event.
- Timeframe: 96 hours.
Description
callora-revenue-pooldoes not compile.cargo check -p callora-revenue-poolfails with fiveerror[E0425]: cannot find valueerrors because the pause implementation references two constants —PAUSED_KEYandERR_PAUSED— that are used incontracts/revenue_pool/src/lib.rs(:185,:188,:211,:235,:246) but never declared. The neighbouring constants (ADMIN_KEY,ERR_UNAUTHORIZED, etc.) are declared together at the top of the file (contracts/revenue_pool/src/lib.rs:16–:26); these two were simply omitted.The pause feature itself is fully implemented —
pause,unpause,is_paused, and therequire_not_pausedguard ondistribute/batch_distributeall exist — so this is purely a missing-declaration fix plus the documentation that should have shipped with it.Requirements and context
Functional
contracts/revenue_pool/src/lib.rs(near:16–:26):const PAUSED_KEY: &str = "paused";— the instance-storage symbol key used bypause/unpause/is_paused.const ERR_PAUSED: &str = "revenue pool is paused";— the panic message used byrequire_not_paused(:188).PAUSED_KEYvalue must be a fresh, unused instance-storage key (it must not collide withADMIN_KEY,PENDING_ADMIN_KEY,USDC_KEY,MAX_DISTRIBUTE_KEY, orVERSION_KEY).pause_setevent already emitted bypause/unpause(contracts/revenue_pool/src/lib.rs:213/:237) is not documented inEVENT_SCHEMA.md— add it.Non-functional / repo conventions
distributeandbatch_distributealready callSelf::require_not_paused(&env)(:343,:458); once the constants exist these guards must function and stay tested.Symbol::new(&env, KEY)), consistent withclaim_admin/set_admin.Acceptance criteria
cargo check -p callora-revenue-poolandcargo build --workspacesucceed.PAUSED_KEYandERR_PAUSEDare declared once, with aPAUSED_KEYvalue that does not collide with any other storage key.cargo test --workspacepasses; pause/unpause and "distribute while paused panics" behavior is exercised incontracts/revenue_pool/src/test.rs.EVENT_SCHEMA.mddocuments thepause_setevent (topic"pause_set", topic 1caller, databool) and adds it to the indexer quick-reference table.cargo clippy --all-targets --all-features -- -D warningsis clean.Suggested execution
1. Fork the repo and create a branch
2. Implement changes
contracts/revenue_pool/src/lib.rs— add the twoconstdeclarations next to the existing constants block.EVENT_SCHEMA.md— add apause_setsection underContract: callora-revenue-pooland a row in the indexer quick-reference table.3. Write/extend tests
contracts/revenue_pool/src/test.rsadd (or confirm) tests:pausethenis_paused()==true;distributewhile paused panics withERR_PAUSED;batch_distributewhile paused panics;unpauserestores both; double-pause / unpause-when-not-paused panic paths.4. Test and commit
cargo fmt --all -- --check cargo clippy --all-targets --all-features -- -D warnings cargo test --workspace ./scripts/check-wasm-size.sh ./scripts/coverage.shExample commit message
Guidelines
scripts/coverage.sh), CI-enforced via.github/workflows/coverage.yml.///docs if you touch any entrypoint; keepEVENT_SCHEMA.mdauthoritative for thepause_setevent.