Core
Other
Utils
Bulk Writer

RMRKBulkWriter

RMRK team

RMRKBulkWriter

Smart contract of the RMRK Bulk Writer module.

Extra utility functions for RMRK contracts.

Methods

bulkEquip

function bulkEquip(address collection, uint256 tokenId, RMRKBulkWriter.IntakeUnequip[] unequips, IERC6220.IntakeEquip[] equips) external nonpayable

Parameters

NameTypeDescription
collectionaddressundefined
tokenIduint256undefined
unequipsRMRKBulkWriter.IntakeUnequip[]undefined
equipsIERC6220.IntakeEquip[]undefined

bulkTransferAllChildren

function bulkTransferAllChildren(address collection, uint256 tokenId, address to, uint256 destinationId) external nonpayable

Transfers all children from one token.

If destinationId is 0, the destination can be an EoA or a contract implementing the IERC721Receiver interface.If destinationId is not 0, the destination must be a contract implementing the IERC7401 interface.This methods works with active children only.This contract must have approval to manage the NFT, only the current owner can call this method (not an approved operator).

Parameters

NameTypeDescription
collectionaddressAddress of the collection that this contract is managing
tokenIduint256ID of the token we are managing
toaddressAddress of the destination token or contract
destinationIduint256ID of the destination token

bulkTransferChildren

function bulkTransferChildren(address collection, uint256 tokenId, uint256[] childrenIndexes, address to, uint256 destinationId) external nonpayable

Transfers multiple children from one token.

If destinationId is 0, the destination can be an EoA or a contract implementing the IERC721Receiver interface.If destinationId is not 0, the destination must be a contract implementing the IERC7401 interface.childrenIndexes MUST be in ascending order, this method will transfer the children in reverse order to avoid index changes on children.This methods works with active children only.This contract must have approval to manage the NFT, only the current owner can call this method (not an approved operator).

Parameters

NameTypeDescription
collectionaddressAddress of the collection that this contract is managing
tokenIduint256ID of the token we are managing
childrenIndexesuint256[]An array of indexes of the children to transfer
toaddressAddress of the destination token or contract
destinationIduint256ID of the destination token

replaceEquip

function replaceEquip(address collection, IERC6220.IntakeEquip data) external nonpayable

Parameters

NameTypeDescription
collectionaddressundefined
dataIERC6220.IntakeEquipundefined

Errors

RMRKCanOnlyDoBulkOperationsOnOwnedTokens

error RMRKCanOnlyDoBulkOperationsOnOwnedTokens()

Attempting to do a bulk operation on a token that is not owned by the caller

RMRKCanOnlyDoBulkOperationsWithOneTokenAtATime

error RMRKCanOnlyDoBulkOperationsWithOneTokenAtATime()

Attempting to do a bulk operation with multiple tokens at a time