fix(stablecoin): annotate stablecoin instruction accounts

This commit is contained in:
Ricardo Guilherme Schmidt 2026-06-29 13:56:04 -03:00
parent 4aaa475590
commit 50e7eda698
No known key found for this signature in database
GPG Key ID: 1396EA17DE132FFE
2 changed files with 35 additions and 20 deletions

View File

@ -8,38 +8,38 @@
{
"name": "admin",
"writable": false,
"signer": false,
"signer": true,
"init": false
},
{
"name": "protocol_parameters",
"writable": false,
"writable": true,
"signer": false,
"init": false
"init": true
},
{
"name": "stability_fee_accumulator",
"writable": false,
"writable": true,
"signer": false,
"init": false
"init": true
},
{
"name": "redemption_price_state",
"writable": false,
"writable": true,
"signer": false,
"init": false
"init": true
},
{
"name": "stablecoin_definition",
"writable": false,
"writable": true,
"signer": false,
"init": false
"init": true
},
{
"name": "stablecoin_master_holding",
"writable": false,
"writable": true,
"signer": false,
"init": false
"init": true
},
{
"name": "collateral_definition",
@ -105,7 +105,7 @@
{
"name": "caller",
"writable": false,
"signer": false,
"signer": true,
"init": false
},
{
@ -116,7 +116,7 @@
},
{
"name": "stability_fee_accumulator",
"writable": false,
"writable": true,
"signer": false,
"init": false
},
@ -135,18 +135,18 @@
{
"name": "admin",
"writable": false,
"signer": false,
"signer": true,
"init": false
},
{
"name": "protocol_parameters",
"writable": false,
"writable": true,
"signer": false,
"init": false
},
{
"name": "stability_fee_accumulator",
"writable": false,
"writable": true,
"signer": false,
"init": false
},
@ -227,24 +227,24 @@
{
"name": "owner",
"writable": false,
"signer": false,
"signer": true,
"init": false
},
{
"name": "position",
"writable": false,
"writable": true,
"signer": false,
"init": false
},
{
"name": "stablecoin_definition",
"writable": false,
"writable": true,
"signer": false,
"init": false
},
{
"name": "user_stablecoin_holding",
"writable": false,
"writable": true,
"signer": false,
"init": false
},

View File

@ -20,11 +20,17 @@ mod stablecoin {
#[instruction]
pub fn initialize_program(
ctx: ProgramContext,
#[account(signer)]
admin: AccountWithMetadata,
#[account(init)]
protocol_parameters: AccountWithMetadata,
#[account(init)]
stability_fee_accumulator: AccountWithMetadata,
#[account(init)]
redemption_price_state: AccountWithMetadata,
#[account(init)]
stablecoin_definition: AccountWithMetadata,
#[account(init)]
stablecoin_master_holding: AccountWithMetadata,
collateral_definition: AccountWithMetadata,
market_price_oracle: AccountWithMetadata,
@ -70,8 +76,10 @@ mod stablecoin {
#[instruction]
pub fn accrue_stability_fee(
ctx: ProgramContext,
#[account(signer)]
caller: AccountWithMetadata,
protocol_parameters: AccountWithMetadata,
#[account(mut)]
stability_fee_accumulator: AccountWithMetadata,
clock: AccountWithMetadata,
) -> SpelResult {
@ -93,8 +101,11 @@ mod stablecoin {
#[instruction]
pub fn set_stability_fee_per_millisecond(
ctx: ProgramContext,
#[account(signer)]
admin: AccountWithMetadata,
#[account(mut)]
protocol_parameters: AccountWithMetadata,
#[account(mut)]
stability_fee_accumulator: AccountWithMetadata,
clock: AccountWithMetadata,
new_rate: u128,
@ -162,9 +173,13 @@ mod stablecoin {
#[instruction]
pub fn generate_debt(
ctx: ProgramContext,
#[account(signer)]
owner: AccountWithMetadata,
#[account(mut)]
position: AccountWithMetadata,
#[account(mut)]
stablecoin_definition: AccountWithMetadata,
#[account(mut)]
user_stablecoin_holding: AccountWithMetadata,
stability_fee_accumulator: AccountWithMetadata,
redemption_price_state: AccountWithMetadata,