Omniscia Boson Protocol Audit
ExchangeRedeemBase Code Style Findings
ExchangeRedeemBase Code Style Findings
ERB-01C: BPIP-13 Mismatch of Voucher Burning Approach
| Type | Severity | Location |
|---|---|---|
| Standard Conformity | ![]() | ExchangeRedeemBase.sol:L45 |
Description:
The BPIP-13 document specifies that the _computeBurnTokenId function is overridden by the ExchangeHandlerFacet implementation, however, no such function exists or is overridden.
Example:
contracts/protocol/bases/ExchangeRedeemBase.sol
32function burnVoucher(Exchange storage _exchange) internal {33 // Cache protocol lookups for reference34 ProtocolLib.ProtocolLookups storage lookups = protocolLookups();35
36 // Decrease the voucher count37 lookups.voucherCount[_exchange.buyerId]--;38
39 // Burn the voucher40 uint256 offerId = _exchange.offerId;41 (, Offer storage offer) = fetchOffer(offerId);42 IBosonVoucher bosonVoucher = IBosonVoucher(getCloneAddress(lookups, offer.sellerId, offer.collectionIndex));43
44 uint256 tokenId = _exchange.id;45 if (tokenId >= EXCHANGE_ID_2_2_0) tokenId |= (offerId << 128);46 bosonVoucher.burnVoucher(tokenId);47}Recommendation:
We advise the BPIP-13 specification to be updated to match the ExchangeRedeemBase approach of using the immutable exchange ID versioning system.
Alleviation (8fccc2716047809e4bc7786c95d346e5c61b2896):
The BPIP-13 definition has been updated to match the code's implementation, addressing this exhibit.
