Skip to main content

IBosonVoucher

View Source: contracts/interfaces/clients/IBosonVoucher.sol

↗ Extends: IERC721Upgradeable, IERC721MetadataUpgradeable

IBosonVoucher

This is the interface for the Boson Protocol ERC-721 Voucher contract.
The ERC-165 identifier for this interface is: 0x2249ca21

Functions

issueVoucher

Issues a voucher to a buyer.
Minted voucher supply is sent to the buyer.
Caller must have PROTOCOL role.

function issueVoucher(uint256 _exchangeId,
address _buyer)
external

Arguments

NameTypeDescription
_exchangeIduint256the id of the exchange (corresponds to the ERC-721 token id)
_buyeraddressthe buyer address

burnVoucher

Burns a voucher.
Caller must have PROTOCOL role.

function burnVoucher(uint256 _exchangeId) 
external

Arguments

NameTypeDescription
_exchangeIduint256the id of the exchange (corresponds to the ERC-721 token id)

getSellerId

Gets the seller id.

function getSellerId() 
external
view
returns(uint256)

Returns

uint256

transferOwnership

Transfers ownership of the contract to a new account (newOwner).
Can only be called by the protocol. Change is done by calling updateSeller on the protocol.

function transferOwnership(address newOwner) 
external

Arguments

NameTypeDescription
newOwneraddressthe address to which ownership of the voucher contract will be transferred

contractURI

Returns storefront-level metadata used by OpenSea.

function contractURI() 
external
view
returns(string)

Returns

string

setContractURI

Sets new contract URI.
Can only be called by the owner or during the initialization.

function setContractURI(string _newContractURI) 
external

Arguments

NameTypeDescription
_newContractURIstringnew contract metadata URI

royaltyInfo

Provides royalty info.
Called with the sale price to determine how much royalty is owed and to whom.

function royaltyInfo(uint256 _tokenId,
uint256 _salePrice)
external
view
returns(address receiver, uint256 royaltyAmount)

Arguments

NameTypeDescription
_tokenIduint256the voucher queried for royalty information
_salePriceuint256the sale price of the voucher specified by _tokenId

Returns

NameTypeDescription
receiveraddressaddress of who should be sent the royalty payment
royaltyAmountuint256the royalty payment amount for the given sale price

setRoyaltyPercentage

Sets the royalty percentage.
Can only be called by the owner or during the initialization
Emits RoyaltyPercentageChanged if successful.
Reverts if:
- Caller is not the owner.
- _newRoyaltyPercentage is greater than max royalty percentage defined in the protocol

function setRoyaltyPercentage(uint256 _newRoyaltyPercentage) 
external

Arguments

NameTypeDescription
_newRoyaltyPercentageuint256fee in percentage. e.g. 500 = 5%

getRoyaltyPercentage

Gets the royalty percentage.

function getRoyaltyPercentage() 
external
view
returns(uint256)

Returns

uint256

Events

ContractURIChanged

event ContractURIChanged(string  contractURI)

Parameters

NameTypeDescription
contractURIstring

RoyaltyPercentageChanged

event RoyaltyPercentageChanged(uint256  royaltyPercentage)

Parameters

NameTypeDescription
royaltyPercentageuint256

VoucherInitialized

event VoucherInitialized(
uint256 indexed sellerId
uint256 indexed royaltyPercentage
string indexed contractURI
)

Parameters

NameTypeDescription
sellerIduint256
royaltyPercentageuint256
contractURIstring