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(struct BosonTypes.Twin _twin)
- removeTwin(uint256 _twinId)
- getTwin(uint256 _twinId)
- getNextTwinId()
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
Name | Type | Description |
---|---|---|
_twin | BosonTypes.Twin | the 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
Name | Type | Description |
---|---|---|
_twinId | uint256 | the 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
Name | Type | Description |
---|---|---|
_twinId | uint256 | the id of the twin to check |
Returns
Name | Type | Description |
---|---|---|
exists | bool | the twin was found |
twin | BosonTypes.Twin | the twin details. See {BosonTypes.Twin} |
getNextTwinId
Gets the next twin id.Does not increment the counter.
function getNextTwinId()
external
view
returns(uint256 nextTwinId)
Returns
Name | Type | Description |
---|---|---|
nextTwinId | uint256 | the next twin id |