Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion programs/mint_governor/src/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ pub struct TokensMintedEvent {
pub destination_ata: Pubkey,
pub amount: u64,
pub post_total_minted: u64,
pub authority_max_total: Option<u64>,
pub post_mint_supply: u64,
}

Expand All @@ -52,15 +53,17 @@ pub struct MintAuthorityUpdatedEvent {
pub mint_authority: Pubkey,
pub authorized_minter: Pubkey,
pub max_total: Option<u64>,
pub total_minted: u64,
}

#[event]
pub struct MintAuthorityRemovedEvent {
pub common: CommonFields,
pub mint_governor: Pubkey,
pub mint_authority: Pubkey,
pub authorized_minter: Pubkey,
pub max_total: Option<u64>,
pub total_minted: u64,
pub mint_authority: Pubkey,
}

#[event]
Expand Down
1 change: 1 addition & 0 deletions programs/mint_governor/src/instructions/mint_tokens.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ impl MintTokens<'_> {
destination_ata: ctx.accounts.destination_ata.key(),
amount: args.amount,
post_total_minted: mint_authority.total_minted,
authority_max_total: mint_authority.max_total,
post_mint_supply: ctx.accounts.mint.supply,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@ impl RemoveMintAuthority<'_> {
mint_governor_seq_num: mint_governor.seq_num,
},
mint_governor: mint_governor.key(),
mint_authority: mint_authority.key(),
authorized_minter: mint_authority.authorized_minter,
max_total: mint_authority.max_total,
total_minted: mint_authority.total_minted,
mint_authority: mint_authority.key(),
});

// Mint authority account gets closed using close constraint
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ impl UpdateMintAuthority<'_> {
mint_authority: mint_authority.key(),
authorized_minter: mint_authority.authorized_minter,
max_total: mint_authority.max_total,
total_minted: mint_authority.total_minted,
});

Ok(())
Expand Down
2 changes: 1 addition & 1 deletion sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@metadaoproject/programs",
"version": "0.1.0-alpha.6",
"version": "0.1.0-alpha.7",
"type": "module",
"main": "dist/index.js",
"module": "dist/index.js",
Expand Down
54 changes: 46 additions & 8 deletions sdk/src/mint_governor/v0.7/types/mint_governor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,13 @@ export type MintGovernor = {
type: "u64";
index: false;
},
{
name: "authorityMaxTotal";
type: {
option: "u64";
};
index: false;
},
{
name: "postMintSupply";
type: "u64";
Expand Down Expand Up @@ -632,6 +639,11 @@ export type MintGovernor = {
};
index: false;
},
{
name: "totalMinted";
type: "u64";
index: false;
},
];
},
{
Expand All @@ -649,19 +661,26 @@ export type MintGovernor = {
type: "publicKey";
index: false;
},
{
name: "mintAuthority";
type: "publicKey";
index: false;
},
{
name: "authorizedMinter";
type: "publicKey";
index: false;
},
{
name: "totalMinted";
type: "u64";
name: "maxTotal";
type: {
option: "u64";
};
index: false;
},
{
name: "mintAuthority";
type: "publicKey";
name: "totalMinted";
type: "u64";
index: false;
},
];
Expand Down Expand Up @@ -1335,6 +1354,13 @@ export const IDL: MintGovernor = {
type: "u64",
index: false,
},
{
name: "authorityMaxTotal",
type: {
option: "u64",
},
index: false,
},
{
name: "postMintSupply",
type: "u64",
Expand Down Expand Up @@ -1374,6 +1400,11 @@ export const IDL: MintGovernor = {
},
index: false,
},
{
name: "totalMinted",
type: "u64",
index: false,
},
],
},
{
Expand All @@ -1391,19 +1422,26 @@ export const IDL: MintGovernor = {
type: "publicKey",
index: false,
},
{
name: "mintAuthority",
type: "publicKey",
index: false,
},
{
name: "authorizedMinter",
type: "publicKey",
index: false,
},
{
name: "totalMinted",
type: "u64",
name: "maxTotal",
type: {
option: "u64",
},
index: false,
},
{
name: "mintAuthority",
type: "publicKey",
name: "totalMinted",
type: "u64",
index: false,
},
],
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,7 @@
"@jridgewell/sourcemap-codec" "^1.4.10"

"@metadaoproject/programs@./sdk":
version "0.1.0-alpha.6"
version "0.1.0-alpha.7"
dependencies:
"@coral-xyz/anchor" "0.29.0"
"@noble/hashes" "1.8.0"
Expand Down
Loading