Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Audit Finding Cleanup #6

Merged
merged 1 commit into from
Nov 12, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ pub struct AcceptAdminTransfer<'info> {

#[account(
mut,
has_one = minter_authority,
has_one = mint_account,
constraint = minter.pending_admin == Some(pending_admin.key()),
seeds = [b"minter", minter_authority.key().as_ref(), mint_account.key().as_ref()],
bump = minter.bump
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ pub struct GetRemainingAmount<'info> {

#[account(
mut,
has_one = minter_authority,
has_one = mint_account,
seeds = [b"minter", minter_authority.key().as_ref(), mint_account.key().as_ref()],
bump = minter.bump,
)]
Expand Down
2 changes: 2 additions & 0 deletions programs/minter-controller/src/instructions/mint_token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ pub struct MintToken<'info> {

#[account(
mut,
has_one = minter_authority,
has_one = mint_account,
seeds = [b"minter", minter_authority.key().as_ref(), mint_account.key().as_ref()],
bump = minter.bump,
)]
Expand Down
20 changes: 0 additions & 20 deletions tests/minter_controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1054,26 +1054,6 @@ describe('minter_controller', () => {
expect(minterPda.pendingAdmin.toString()).to.equal(minterAuthorityKeypair.publicKey.toString())
});

it('Cannot start admin transfer with None pending admin', async () => {
try {
await minterControllerProgram.methods
.startAdminTransfer(null)
.accounts({
minter: minterPDA,
payer: provider.wallet.publicKey,
minterAuthority: minterAuthorityKeypair.publicKey,
mintAccount: mintPDA,
admin: adminKeypair.publicKey
})
.signers([adminKeypair])
.rpc()
assert.fail('Expected err')
} catch (err) {
assert.isTrue(err.toString().includes('Cannot read properties of null'))
}

});

it('Cannot start admin transfer with missing admin signature', async () => {
try {
await minterControllerProgram.methods
Expand Down