Skip to main content

IBosonTwinHandler

View Source: contracts/interfaces/handlers/IBosonTwinHandler.sol

↗ Extends: IBosonTwinEvents

IBosonTwinHandler

Handles creation, removal, and querying of twins within the protocol.
The ERC-165 identifier for this interface is: 0x60b30e70

Functions

createTwin

Creates a Twin.
Emits a TwinCreated event if successful.
Reverts if:
- The twins region of protocol is paused
- Seller does not exist
- Protocol is not approved to transfer the seller's token
- Twin supplyAvailable is zero
- Twin is NonFungibleToken and amount was set
- Twin is NonFungibleToken and end of range would overflow
- Twin is NonFungibleToken with unlimited supply and starting token id is too high
- Twin is NonFungibleToken and range is already being used in another twin of the seller
- Twin is FungibleToken or MultiToken and amount was not set
- Twin is FungibleToken or MultiToken and amount is greater than supply available

function createTwin(struct BosonTypes.Twin _twin) 
external

Arguments

NameTypeDescription
_twinBosonTypes.Twinthe fully populated struct with twin id set to 0x0

removeTwin

Removes a twin.
Emits a TwinDeleted event if successful.
Reverts if:
- The twins region of protocol is paused
- Caller is not the seller.
- Twin does not exist.
- Bundle for twin exists

function removeTwin(uint256 _twinId) 
external

Arguments

NameTypeDescription
_twinIduint256the id of the twin to check

getTwin

Gets the details about a given twin.

function getTwin(uint256 _twinId) 
external
view
returns(bool exists, BosonTypes.Twin memory twin)

Arguments

NameTypeDescription
_twinIduint256the id of the twin to check

Returns

NameTypeDescription
existsboolthe twin was found
twinBosonTypes.Twinthe twin details. See {BosonTypes.Twin}

getNextTwinId

Gets the next twin id.Does not increment the counter.

function getNextTwinId() 
external
view
returns(uint256 nextTwinId)

Returns

NameTypeDescription
nextTwinIduint256the next twin id