IOP _ ThunderNFT 34702 - [Smart Contract - Low] the function register_royalty_info does not allow to
Description
Brief/Intro
Vulnerability Details
/// Stores royalty info by admin or owner of the NFT collection contract
#[storage(read, write)]
fn register_royalty_info(
collection: ContractId,
receiver: Identity,
fee: u64
) {
let ownable = abi(Ownable, collection.into());
if (ownable.owner().is_some()) {
let caller = msg_sender().unwrap();
let collection_owner = ownable.owner().unwrap();
require(caller == collection_owner, RoyaltyManagerErrors::CallerMustBeOwnerOrAdmin);
} else if (ownable.admin().is_some()) {
let caller = msg_sender().unwrap();
let collection_admin = ownable.admin().unwrap();
require(caller == collection_admin, RoyaltyManagerErrors::CallerMustBeOwnerOrAdmin);
} else {
revert(111)
}
require(fee <= storage.fee_limit.read(), RoyaltyManagerErrors::FeeHigherThanLimit);
let info = RoyaltyInfo {
collection: collection,
receiver: receiver,
fee: fee
};
let option_info: Option<RoyaltyInfo> = Option::Some(info);
storage.royalty_info.insert(collection, option_info);
log(RoyaltyRegistryEvent {
royalty_info: info
});
}
Impact Details
References
Proof of concept
Proof of Concept
PreviousIOP _ ThunderNFT 34677 - [Smart Contract - Insight] NFTs can not be canceled since the cancel_orderNextIOP _ ThunderNFT 34714 - [Smart Contract - Medium] owner of NFT who have sell orderlisting NFT can n
Last updated
Was this helpful?