Goal
Expose the three permissionless global-state transactions added by #317:
accrueStabilityFee, updateRedemptionRate, and refreshGlobals.
Scope
-
Add typed stablecoin_ffi planners for
Instruction::AccrueStabilityFee, Instruction::UpdateRedemptionRate, and
Instruction::RefreshGlobals.
-
Add matching StablecoinModuleImpl methods. Each accepts a caller account ID;
permissionless means any wallet-controlled public account may call, but that
caller is still the sole signer.
-
Derive global PDAs and canonical clock internally. Read
ProtocolParameters to obtain the configured oracle account.
-
Preserve exact IDL account order and signer flags:
- accrue: caller, parameters, accumulator, clock
- update: caller, parameters, redemption state, oracle, clock
- refresh: caller, parameters, accumulator, redemption state, oracle, clock
-
Submit through logos_execution_zone.send_generic_public_transaction and
return stable {status,error,transactionId} maps.
-
Reuse the controller quote preflight for strict updateRedemptionRate.
refreshGlobals must retain its best-effort semantics: always accrue the fee
half and allow the guest to skip the redemption half when the interval is not
due or the oracle is stale/zero.
-
Do not block any poke solely because ProtocolParameters.is_frozen is true;
all three program instructions remain available while frozen.
Acceptance criteria
- Every planner round-trips to the intended zero-argument
stablecoin_core::Instruction variant.
- Planner tests pin exact account order, program ID, instruction words, and
caller-only signer flags for all three methods.
- Module tests cover malformed/non-wallet caller IDs, missing globals, wrong
oracle binding, wallet transport failure, rejected transactions, successful
transaction IDs, and frozen-protocol submission.
updateRedemptionRate does not submit when live preflight proves too-soon,
stale-oracle, or zero-price failure.
refreshGlobals does submit under those three soft-gate conditions and does
not reinterpret them as client-side errors.
nix build .#stablecoin-module, module inspection, and headless
logoscore call smoke tests pass.
- Repository Rust format, TOML format, Clippy, unit/integration tests, and IDL
drift checks remain green.
Dependencies
Depends on the scaffold, raw global-state, current-projection, and controller
quote sub-issues under #321.
Out of scope
Keeper scheduling, retries, rewards, UI work, and background services.
Goal
Expose the three permissionless global-state transactions added by #317:
accrueStabilityFee,updateRedemptionRate, andrefreshGlobals.Scope
Add typed
stablecoin_ffiplanners forInstruction::AccrueStabilityFee,Instruction::UpdateRedemptionRate, andInstruction::RefreshGlobals.Add matching
StablecoinModuleImplmethods. Each accepts a caller account ID;permissionless means any wallet-controlled public account may call, but that
caller is still the sole signer.
Derive global PDAs and canonical clock internally. Read
ProtocolParametersto obtain the configured oracle account.Preserve exact IDL account order and signer flags:
Submit through
logos_execution_zone.send_generic_public_transactionandreturn stable
{status,error,transactionId}maps.Reuse the controller quote preflight for strict
updateRedemptionRate.refreshGlobalsmust retain its best-effort semantics: always accrue the feehalf and allow the guest to skip the redemption half when the interval is not
due or the oracle is stale/zero.
Do not block any poke solely because
ProtocolParameters.is_frozenis true;all three program instructions remain available while frozen.
Acceptance criteria
stablecoin_core::Instructionvariant.caller-only signer flags for all three methods.
oracle binding, wallet transport failure, rejected transactions, successful
transaction IDs, and frozen-protocol submission.
updateRedemptionRatedoes not submit when live preflight proves too-soon,stale-oracle, or zero-price failure.
refreshGlobalsdoes submit under those three soft-gate conditions and doesnot reinterpret them as client-side errors.
nix build .#stablecoin-module, module inspection, and headlesslogoscorecall smoke tests pass.drift checks remain green.
Dependencies
Depends on the scaffold, raw global-state, current-projection, and controller
quote sub-issues under #321.
Out of scope
Keeper scheduling, retries, rewards, UI work, and background services.