Merge pull request #98 from metaplex-foundation/ensure-no-outside-authorities

Further check on init auction manager to ensure safety
This commit is contained in:
B 2021-06-28 22:44:51 -05:00 committed by GitHub
commit 1f706f15c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -49,6 +49,14 @@ pub fn process_init_auction_manager(
assert_owned_by(store_info, program_id)?;
assert_owned_by(accept_payment_info, &store.token_program)?;
if auction.authority != *auction_manager_info.key && auction.authority != *authority_info.key {
return Err(MetaplexError::AuctionAuthorityMismatch.into());
}
if vault.authority != *auction_manager_info.key && vault.authority != *authority_info.key {
return Err(MetaplexError::VaultAuthorityMismatch.into());
}
if auction.state != AuctionState::Created {
return Err(MetaplexError::AuctionMustBeCreated.into());
}