GLMR Price: $0.020649 (-3.17%)

Contract

0xb6CcEC23D23b4eD3f623CAFBC90Cfff32dBf1834

Overview

GLMR Balance

Moonbeam Chain LogoMoonbeam Chain LogoMoonbeam Chain Logo0 GLMR

GLMR Value

$0.00

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Block
From
To
Bulk Equip107320372025-05-04 12:01:18266 days ago1746360078IN
0xb6CcEC23...32dBf1834
0 GLMR0.03420731.25
Bulk Equip107319982025-05-04 11:57:24266 days ago1746359844IN
0xb6CcEC23...32dBf1834
0 GLMR0.02676231.25
Bulk Equip106118962025-04-25 19:44:12275 days ago1745610252IN
0xb6CcEC23...32dBf1834
0 GLMR0.029444531.25
Bulk Equip100012752025-03-13 15:09:54318 days ago1741878594IN
0xb6CcEC23...32dBf1834
0 GLMR0.029426531.25
Bulk Equip97579432025-02-24 11:05:54335 days ago1740395154IN
0xb6CcEC23...32dBf1834
0 GLMR0.0530731.25
Bulk Equip92921292025-01-22 15:12:24368 days ago1737558744IN
0xb6CcEC23...32dBf1834
0 GLMR0.121028125
Bulk Equip90930642025-01-08 12:57:06382 days ago1736341026IN
0xb6CcEC23...32dBf1834
0 GLMR0.103532125
Bulk Equip90929772025-01-08 12:47:48382 days ago1736340468IN
0xb6CcEC23...32dBf1834
0 GLMR0.134438125
Bulk Equip90657652025-01-06 14:31:06384 days ago1736173866IN
0xb6CcEC23...32dBf1834
0 GLMR0.121454125
Bulk Equip90655442025-01-06 14:09:00384 days ago1736172540IN
0xb6CcEC23...32dBf1834
0 GLMR0.057298125
Bulk Equip90655412025-01-06 14:08:36384 days ago1736172516IN
0xb6CcEC23...32dBf1834
0 GLMR0.057298125
Bulk Equip90655382025-01-06 14:08:18384 days ago1736172498IN
0xb6CcEC23...32dBf1834
0 GLMR0.057298125
Bulk Equip90655352025-01-06 14:08:00384 days ago1736172480IN
0xb6CcEC23...32dBf1834
0 GLMR0.057298125
Bulk Equip90655312025-01-06 14:07:36384 days ago1736172456IN
0xb6CcEC23...32dBf1834
0 GLMR0.057298125
Bulk Equip85248472024-11-28 18:22:36423 days ago1732818156IN
0xb6CcEC23...32dBf1834
0 GLMR0.106976125
Bulk Equip85248282024-11-28 18:20:36423 days ago1732818036IN
0xb6CcEC23...32dBf1834
0 GLMR0.186364125
Bulk Equip82446072024-11-08 21:32:06443 days ago1731101526IN
0xb6CcEC23...32dBf1834
0 GLMR0.05376115127.57508082
Bulk Equip81306962024-10-31 21:16:00451 days ago1730409360IN
0xb6CcEC23...32dBf1834
0 GLMR0.052676125
Bulk Equip81299272024-10-31 19:58:54451 days ago1730404734IN
0xb6CcEC23...32dBf1834
0 GLMR0.052676125
Bulk Equip81298912024-10-31 19:55:18451 days ago1730404518IN
0xb6CcEC23...32dBf1834
0 GLMR0.117706125
Bulk Equip81255722024-10-31 12:38:48451 days ago1730378328IN
0xb6CcEC23...32dBf1834
0 GLMR0.052676125
Bulk Equip73577892024-09-07 10:38:36505 days ago1725705516IN
0xb6CcEC23...32dBf1834
0 GLMR0.05929156126
Bulk Equip73200002024-09-04 18:17:24508 days ago1725473844IN
0xb6CcEC23...32dBf1834
0 GLMR0.026338125
Bulk Equip73052192024-09-03 16:06:36509 days ago1725379596IN
0xb6CcEC23...32dBf1834
0 GLMR0.058853125
Bulk Equip73039152024-09-03 13:42:00509 days ago1725370920IN
0xb6CcEC23...32dBf1834
0 GLMR0.058853125
View all transactions

View more zero value Internal Transactions in Advanced View mode

Cross-Chain Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
RMRKBulkWriter

Compiler Version
v0.8.18+commit.87f61d96

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
// SPDX-License-Identifier: Apache-2.0

pragma solidity ^0.8.18;

import "../equippable/IERC6220.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";

error RMRKCanOnlyDoBulkOperationsOnOwnedTokens();
error RMRKCanOnlyDoBulkOperationsWithOneTokenAtATime();

/**
 * @title RMRKBulkWriter
 * @author RMRK team
 * @notice Smart contract of the RMRK Bulk Writer module.
 * @dev Extra utility functions for RMRK contracts.
 */
contract RMRKBulkWriter {
    /**
     * @notice Used to provide a struct for inputing unequip data.
     * @dev Only used for input and not storage of data
     * @return assetId ID of the asset that we are equipping into
     * @return slotPartId ID of the slot part that we are using to unequip
     */
    struct IntakeUnequip {
        uint64 assetId;
        uint64 slotPartId;
    }

    /**
     * @notice Reverts if the caller is not the owner of the token
     * @param collection Address of the collection that this contract is managing.
     * @param tokenId ID of the token we are managing.
     */
    modifier onlyTokenOwner(address collection, uint256 tokenId) {
        _checkTokenOwner(collection, tokenId);
        _;
    }

    /**
     * @notice Initializes the contract
     */
    constructor() {}

    /**
     * @notice Replaces the current equipped child on the asset and slot combination with the given one
     * @dev The `IntakeEquip` stuct contains the following data:
     *  [
     *      tokenId,
     *      childIndex,
     *      assetId,
     *      slotPartId,
     *      childAssetId
     *  ]
     * @param collection Address of the collection that this contract is managing.
     * @param data An `IntakeEquip` struct specifying the equip data.
     */
    function replaceEquip(
        address collection,
        IERC6220.IntakeEquip memory data
    ) public onlyTokenOwner(collection, data.tokenId) {
        IERC6220(collection).unequip(
            data.tokenId,
            data.assetId,
            data.slotPartId
        );
        IERC6220(collection).equip(data);
    }

    /**
     * @notice Performs multiple unequip and equip operations
     * @dev Unequip operations must run first
     * @dev tokenId is included as a parameter to be able to do a single check for ownership
     * @dev Every tokenId in the `IntakeEquip` structs must match the tokenId passed in
     * @dev The `IntakeUnequip` stuct contains the following data:
     *  [
     *      assetId,
     *      slotPartId,
     *  ]
     * @dev The `IntakeEquip` stuct contains the following data:
     *  [
     *      tokenId,
     *      childIndex,
     *      assetId,
     *      slotPartId,
     *      childAssetId
     *  ]
     * @param collection Address of the collection that this contract is managing.
     * @param tokenId ID of the token we are managing.
     * @param unequips[] An array of `IntakeUnequip` structs specifying the slots to unequip.
     * @param equips[] An array of `IntakeEquip` structs specifying the slots to equip.
     */
    function bulkEquip(
        address collection,
        uint256 tokenId,
        IntakeUnequip[] memory unequips,
        IERC6220.IntakeEquip[] memory equips
    ) public onlyTokenOwner(collection, tokenId) {
        uint256 length = unequips.length;
        for (uint256 i = 0; i < length; ) {
            IERC6220(collection).unequip(
                tokenId,
                unequips[i].assetId,
                unequips[i].slotPartId
            );
            unchecked {
                ++i;
            }
        }
        length = equips.length;
        for (uint256 i = 0; i < length; ) {
            if (equips[i].tokenId != tokenId) {
                revert RMRKCanOnlyDoBulkOperationsWithOneTokenAtATime();
            }
            IERC6220(collection).equip(equips[i]);
            unchecked {
                ++i;
            }
        }
    }

    /**
     * @notice Checks if the caller is the owner of the token
     * @dev Reverts if the caller is not the owner of the token
     * @param collection Address of the collection that this contract is managing.
     * @param tokenId ID of the token we are managing.
     */
    function _checkTokenOwner(
        address collection,
        uint256 tokenId
    ) internal view {
        address tokenOwner = IERC721(collection).ownerOf(tokenId);
        if (tokenOwner != msg.sender) {
            revert RMRKCanOnlyDoBulkOperationsOnOwnedTokens();
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

import "../../utils/introspection/IERC165.sol";

/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721 is IERC165 {
    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
     */
    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
     */
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    /**
     * @dev Returns the number of tokens in ``owner``'s account.
     */
    function balanceOf(address owner) external view returns (uint256 balance);

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) external view returns (address owner);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes calldata data
    ) external;

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
     * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
     * understand this adds an external call which potentially creates a reentrancy vulnerability.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account.
     * The approval is cleared when the token is transferred.
     *
     * Only a single account can be approved at a time, so approving the zero address clears previous approvals.
     *
     * Requirements:
     *
     * - The caller must own the token or be an approved operator.
     * - `tokenId` must exist.
     *
     * Emits an {Approval} event.
     */
    function approve(address to, uint256 tokenId) external;

    /**
     * @dev Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the caller.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool _approved) external;

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
     *
     * See {setApprovalForAll}
     */
    function isApprovedForAll(address owner, address operator) external view returns (bool);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

// SPDX-License-Identifier: Apache-2.0

pragma solidity ^0.8.18;

import "../multiasset/IERC5773.sol";

/**
 * @title IERC6220
 * @author RMRK team
 * @notice Interface smart contract of the RMRK equippable module.
 */
interface IERC6220 is IERC5773 {
    /**
     * @notice Used to store the core structure of the `Equippable` RMRK lego.
     * @return assetId The ID of the asset equipping a child
     * @return childAssetId The ID of the asset used as equipment
     * @return childId The ID of token that is equipped
     * @return childEquippableAddress Address of the collection to which the child asset belongs to
     */
    struct Equipment {
        uint64 assetId;
        uint64 childAssetId;
        uint256 childId;
        address childEquippableAddress;
    }

    /**
     * @notice Used to provide a struct for inputing equip data.
     * @dev Only used for input and not storage of data.
     * @return tokenId ID of the token we are managing
     * @return childIndex Index of a child in the list of token's active children
     * @return assetId ID of the asset that we are equipping into
     * @return slotPartId ID of the slot part that we are using to equip
     * @return childAssetId ID of the asset that we are equipping
     */
    struct IntakeEquip {
        uint256 tokenId;
        uint256 childIndex;
        uint64 assetId;
        uint64 slotPartId;
        uint64 childAssetId;
    }

    /**
     * @notice Used to notify listeners that a child's asset has been equipped into one of its parent assets.
     * @param tokenId ID of the token that had an asset equipped
     * @param assetId ID of the asset associated with the token we are equipping into
     * @param slotPartId ID of the slot we are using to equip
     * @param childId ID of the child token we are equipping into the slot
     * @param childAddress Address of the child token's collection
     * @param childAssetId ID of the asset associated with the token we are equipping
     */
    event ChildAssetEquipped(
        uint256 indexed tokenId,
        uint64 indexed assetId,
        uint64 indexed slotPartId,
        uint256 childId,
        address childAddress,
        uint64 childAssetId
    );

    /**
     * @notice Used to notify listeners that a child's asset has been unequipped from one of its parent assets.
     * @param tokenId ID of the token that had an asset unequipped
     * @param assetId ID of the asset associated with the token we are unequipping out of
     * @param slotPartId ID of the slot we are unequipping from
     * @param childId ID of the token being unequipped
     * @param childAddress Address of the collection that a token that is being unequipped belongs to
     * @param childAssetId ID of the asset associated with the token we are unequipping
     */
    event ChildAssetUnequipped(
        uint256 indexed tokenId,
        uint64 indexed assetId,
        uint64 indexed slotPartId,
        uint256 childId,
        address childAddress,
        uint64 childAssetId
    );

    /**
     * @notice Used to notify listeners that the assets belonging to a `equippableGroupId` have been marked as
     *  equippable into a given slot and parent
     * @param equippableGroupId ID of the equippable group being marked as equippable into the slot associated with
     *  `slotPartId` of the `parentAddress` collection
     * @param slotPartId ID of the slot part of the catalog into which the parts belonging to the equippable group
     *  associated with `equippableGroupId` can be equipped
     * @param parentAddress Address of the collection into which the parts belonging to `equippableGroupId` can be
     *  equipped
     */
    event ValidParentEquippableGroupIdSet(
        uint64 indexed equippableGroupId,
        uint64 indexed slotPartId,
        address parentAddress
    );

    /**
     * @notice Used to equip a child into a token.
     * @dev The `IntakeEquip` stuct contains the following data:
     *  [
     *      tokenId,
     *      childIndex,
     *      assetId,
     *      slotPartId,
     *      childAssetId
     *  ]
     * @param data An `IntakeEquip` struct specifying the equip data
     */
    function equip(IntakeEquip memory data) external;

    /**
     * @notice Used to unequip child from parent token.
     * @dev This can only be called by the owner of the token or by an account that has been granted permission to
     *  manage the given token by the current owner.
     * @param tokenId ID of the parent from which the child is being unequipped
     * @param assetId ID of the parent's asset that contains the `Slot` into which the child is equipped
     * @param slotPartId ID of the `Slot` from which to unequip the child
     */
    function unequip(
        uint256 tokenId,
        uint64 assetId,
        uint64 slotPartId
    ) external;

    /**
     * @notice Used to check whether the token has a given child equipped.
     * @dev This is used to prevent from transferring a child that is equipped.
     * @param tokenId ID of the parent token for which we are querying for
     * @param childAddress Address of the child token's smart contract
     * @param childId ID of the child token
     * @return A boolean value indicating whether the child token is equipped into the given token or not
     */
    function isChildEquipped(
        uint256 tokenId,
        address childAddress,
        uint256 childId
    ) external view returns (bool);

    /**
     * @notice Used to verify whether a token can be equipped into a given parent's slot.
     * @param parent Address of the parent token's smart contract
     * @param tokenId ID of the token we want to equip
     * @param assetId ID of the asset associated with the token we want to equip
     * @param slotId ID of the slot that we want to equip the token into
     * @return A boolean indicating whether the token with the given asset can be equipped into the desired slot
     */
    function canTokenBeEquippedWithAssetIntoSlot(
        address parent,
        uint256 tokenId,
        uint64 assetId,
        uint64 slotId
    ) external view returns (bool);

    /**
     * @notice Used to get the Equipment object equipped into the specified slot of the desired token.
     * @dev The `Equipment` struct consists of the following data:
     *  [
     *      assetId,
     *      childAssetId,
     *      childId,
     *      childEquippableAddress
     *  ]
     * @param tokenId ID of the token for which we are retrieving the equipped object
     * @param targetCatalogAddress Address of the `Catalog` associated with the `Slot` part of the token
     * @param slotPartId ID of the `Slot` part that we are checking for equipped objects
     * @return The `Equipment` struct containing data about the equipped object
     */
    function getEquipment(
        uint256 tokenId,
        address targetCatalogAddress,
        uint64 slotPartId
    ) external view returns (Equipment memory);

    /**
     * @notice Used to get the asset and equippable data associated with given `assetId`.
     * @param tokenId ID of the token for which to retrieve the asset
     * @param assetId ID of the asset of which we are retrieving
     * @return metadataURI The metadata URI of the asset
     * @return equippableGroupId ID of the equippable group this asset belongs to
     * @return catalogAddress The address of the catalog the part belongs to
     * @return partIds An array of IDs of parts included in the asset
     */
    function getAssetAndEquippableData(
        uint256 tokenId,
        uint64 assetId
    )
        external
        view
        returns (
            string memory metadataURI,
            uint64 equippableGroupId,
            address catalogAddress,
            uint64[] memory partIds
        );
}

// SPDX-License-Identifier: Apache-2.0

pragma solidity ^0.8.18;

import "@openzeppelin/contracts/utils/introspection/IERC165.sol";

/**
 * @title IERC5773
 * @author RMRK team
 * @notice Interface smart contract of the RMRK multi asset module.
 */
interface IERC5773 is IERC165 {
    /**
     * @notice Used to notify listeners that an asset object is initialized at `assetId`.
     * @param assetId ID of the asset that was initialized
     */
    event AssetSet(uint64 indexed assetId);

    /**
     * @notice Used to notify listeners that an asset object at `assetId` is added to token's pending asset
     *  array.
     * @param tokenIds An array of token IDs that received a new pending asset
     * @param assetId ID of the asset that has been added to the token's pending assets array
     * @param replacesId ID of the asset that would be replaced
     */
    event AssetAddedToTokens(
        uint256[] tokenIds,
        uint64 indexed assetId,
        uint64 indexed replacesId
    );

    /**
     * @notice Used to notify listeners that an asset object at `assetId` is accepted by the token and migrated
     *  from token's pending assets array to active assets array of the token.
     * @param tokenId ID of the token that had a new asset accepted
     * @param assetId ID of the asset that was accepted
     * @param replacesId ID of the asset that was replaced
     */
    event AssetAccepted(
        uint256 indexed tokenId,
        uint64 indexed assetId,
        uint64 indexed replacesId
    );

    /**
     * @notice Used to notify listeners that an asset object at `assetId` is rejected from token and is dropped
     *  from the pending assets array of the token.
     * @param tokenId ID of the token that had an asset rejected
     * @param assetId ID of the asset that was rejected
     */
    event AssetRejected(uint256 indexed tokenId, uint64 indexed assetId);

    /**
     * @notice Used to notify listeners that token's prioritiy array is reordered.
     * @param tokenId ID of the token that had the asset priority array updated
     */
    event AssetPrioritySet(uint256 indexed tokenId);

    /**
     * @notice Used to notify listeners that owner has granted an approval to the user to manage the assets of a
     *  given token.
     * @dev Approvals must be cleared on transfer
     * @param owner Address of the account that has granted the approval for all token's assets
     * @param approved Address of the account that has been granted approval to manage the token's assets
     * @param tokenId ID of the token on which the approval was granted
     */
    event ApprovalForAssets(
        address indexed owner,
        address indexed approved,
        uint256 indexed tokenId
    );

    /**
     * @notice Used to notify listeners that owner has granted approval to the user to manage assets of all of their
     *  tokens.
     * @param owner Address of the account that has granted the approval for all assets on all of their tokens
     * @param operator Address of the account that has been granted the approval to manage the token's assets on all of
     *  the tokens
     * @param approved Boolean value signifying whether the permission has been granted (`true`) or revoked (`false`)
     */
    event ApprovalForAllForAssets(
        address indexed owner,
        address indexed operator,
        bool approved
    );

    /**
     * @notice Accepts an asset at from the pending array of given token.
     * @dev Migrates the asset from the token's pending asset array to the token's active asset array.
     * @dev Active assets cannot be removed by anyone, but can be replaced by a new asset.
     * @dev Requirements:
     *
     *  - The caller must own the token or be approved to manage the token's assets
     *  - `tokenId` must exist.
     *  - `index` must be in range of the length of the pending asset array.
     * @dev Emits an {AssetAccepted} event.
     * @param tokenId ID of the token for which to accept the pending asset
     * @param index Index of the asset in the pending array to accept
     * @param assetId ID of the asset expected to be in the index
     */
    function acceptAsset(
        uint256 tokenId,
        uint256 index,
        uint64 assetId
    ) external;

    /**
     * @notice Rejects an asset from the pending array of given token.
     * @dev Removes the asset from the token's pending asset array.
     * @dev Requirements:
     *
     *  - The caller must own the token or be approved to manage the token's assets
     *  - `tokenId` must exist.
     *  - `index` must be in range of the length of the pending asset array.
     * @dev Emits a {AssetRejected} event.
     * @param tokenId ID of the token that the asset is being rejected from
     * @param index Index of the asset in the pending array to be rejected
     * @param assetId ID of the asset expected to be in the index
     */
    function rejectAsset(
        uint256 tokenId,
        uint256 index,
        uint64 assetId
    ) external;

    /**
     * @notice Rejects all assets from the pending array of a given token.
     * @dev Effecitvely deletes the pending array.
     * @dev Requirements:
     *
     *  - The caller must own the token or be approved to manage the token's assets
     *  - `tokenId` must exist.
     * @dev Emits a {AssetRejected} event with assetId = 0.
     * @param tokenId ID of the token of which to clear the pending array.
     * @param maxRejections Maximum number of expected assets to reject, used to prevent from rejecting assets which
     *  arrive just before this operation.
     */
    function rejectAllAssets(uint256 tokenId, uint256 maxRejections) external;

    /**
     * @notice Sets a new priority array for a given token.
     * @dev The priority array is a non-sequential list of `uint64`s, where the lowest value is considered highest
     *  priority.
     * @dev Value `0` of a priority is a special case equivalent to unitialized.
     * @dev Requirements:
     *
     *  - The caller must own the token or be approved to manage the token's assets
     *  - `tokenId` must exist.
     *  - The length of `priorities` must be equal the length of the active assets array.
     * @dev Emits a {AssetPrioritySet} event.
     * @param tokenId ID of the token to set the priorities for
     * @param priorities An array of priorities of active assets. The succesion of items in the priorities array
     *  matches that of the succesion of items in the active array
     */
    function setPriority(
        uint256 tokenId,
        uint64[] calldata priorities
    ) external;

    /**
     * @notice Used to retrieve IDs of the active assets of given token.
     * @dev Asset data is stored by reference, in order to access the data corresponding to the ID, call
     *  `getAssetMetadata(tokenId, assetId)`.
     * @dev You can safely get 10k
     * @param tokenId ID of the token to retrieve the IDs of the active assets
     * @return An array of active asset IDs of the given token
     */
    function getActiveAssets(
        uint256 tokenId
    ) external view returns (uint64[] memory);

    /**
     * @notice Used to retrieve IDs of the pending assets of given token.
     * @dev Asset data is stored by reference, in order to access the data corresponding to the ID, call
     *  `getAssetMetadata(tokenId, assetId)`.
     * @param tokenId ID of the token to retrieve the IDs of the pending assets
     * @return An array of pending asset IDs of the given token
     */
    function getPendingAssets(
        uint256 tokenId
    ) external view returns (uint64[] memory);

    /**
     * @notice Used to retrieve the priorities of the active resoources of a given token.
     * @dev Asset priorities are a non-sequential array of uint64 values with an array size equal to active asset
     *  priorites.
     * @param tokenId ID of the token for which to retrieve the priorities of the active assets
     * @return An array of priorities of the active assets of the given token
     */
    function getActiveAssetPriorities(
        uint256 tokenId
    ) external view returns (uint64[] memory);

    /**
     * @notice Used to retrieve the asset that will be replaced if a given asset from the token's pending array
     *  is accepted.
     * @dev Asset data is stored by reference, in order to access the data corresponding to the ID, call
     *  `getAssetMetadata(tokenId, assetId)`.
     * @param tokenId ID of the token to check
     * @param newAssetId ID of the pending asset which will be accepted
     * @return ID of the asset which will be replaced
     */
    function getAssetReplacements(
        uint256 tokenId,
        uint64 newAssetId
    ) external view returns (uint64);

    /**
     * @notice Used to fetch the asset metadata of the specified token's active asset with the given index.
     * @dev Assets are stored by reference mapping `_assets[assetId]`.
     * @dev Can be overriden to implement enumerate, fallback or other custom logic.
     * @param tokenId ID of the token from which to retrieve the asset metadata
     * @param assetId Asset Id, must be in the active assets array
     * @return The metadata of the asset belonging to the specified index in the token's active assets
     *  array
     */
    function getAssetMetadata(
        uint256 tokenId,
        uint64 assetId
    ) external view returns (string memory);

    // Approvals

    /**
     * @notice Used to grant permission to the user to manage token's assets.
     * @dev This differs from transfer approvals, as approvals are not cleared when the approved party accepts or
     *  rejects an asset, or sets asset priorities. This approval is cleared on token transfer.
     * @dev Only a single account can be approved at a time, so approving the `0x0` address clears previous approvals.
     * @dev Requirements:
     *
     *  - The caller must own the token or be an approved operator.
     *  - `tokenId` must exist.
     * @dev Emits an {ApprovalForAssets} event.
     * @param to Address of the account to grant the approval to
     * @param tokenId ID of the token for which the approval to manage the assets is granted
     */
    function approveForAssets(address to, uint256 tokenId) external;

    /**
     * @notice Used to retrieve the address of the account approved to manage assets of a given token.
     * @dev Requirements:
     *
     *  - `tokenId` must exist.
     * @param tokenId ID of the token for which to retrieve the approved address
     * @return Address of the account that is approved to manage the specified token's assets
     */
    function getApprovedForAssets(
        uint256 tokenId
    ) external view returns (address);

    /**
     * @notice Used to add or remove an operator of assets for the caller.
     * @dev Operators can call {acceptAsset}, {rejectAsset}, {rejectAllAssets} or {setPriority} for any token
     *  owned by the caller.
     * @dev Requirements:
     *
     *  - The `operator` cannot be the caller.
     * @dev Emits an {ApprovalForAllForAssets} event.
     * @param operator Address of the account to which the operator role is granted or revoked from
     * @param approved The boolean value indicating whether the operator role is being granted (`true`) or revoked
     *  (`false`)
     */
    function setApprovalForAllForAssets(
        address operator,
        bool approved
    ) external;

    /**
     * @notice Used to check whether the address has been granted the operator role by a given address or not.
     * @dev See {setApprovalForAllForAssets}.
     * @param owner Address of the account that we are checking for whether it has granted the operator role
     * @param operator Address of the account that we are checking whether it has the operator role or not
     * @return A boolean value indicating wehter the account we are checking has been granted the operator role
     */
    function isApprovedForAllForAssets(
        address owner,
        address operator
    ) external view returns (bool);
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

API
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"RMRKCanOnlyDoBulkOperationsOnOwnedTokens","type":"error"},{"inputs":[],"name":"RMRKCanOnlyDoBulkOperationsWithOneTokenAtATime","type":"error"},{"inputs":[{"internalType":"address","name":"collection","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"components":[{"internalType":"uint64","name":"assetId","type":"uint64"},{"internalType":"uint64","name":"slotPartId","type":"uint64"}],"internalType":"struct RMRKBulkWriter.IntakeUnequip[]","name":"unequips","type":"tuple[]"},{"components":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"childIndex","type":"uint256"},{"internalType":"uint64","name":"assetId","type":"uint64"},{"internalType":"uint64","name":"slotPartId","type":"uint64"},{"internalType":"uint64","name":"childAssetId","type":"uint64"}],"internalType":"struct IERC6220.IntakeEquip[]","name":"equips","type":"tuple[]"}],"name":"bulkEquip","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"collection","type":"address"},{"components":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"childIndex","type":"uint256"},{"internalType":"uint64","name":"assetId","type":"uint64"},{"internalType":"uint64","name":"slotPartId","type":"uint64"},{"internalType":"uint64","name":"childAssetId","type":"uint64"}],"internalType":"struct IERC6220.IntakeEquip","name":"data","type":"tuple"}],"name":"replaceEquip","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b50610756806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c806371a5e8c81461003b5780639d11045414610050575b600080fd5b61004e61004936600461055b565b610063565b005b61004e61005e366004610664565b610216565b838361006f82826102fc565b835160005b8181101561013e57876001600160a01b031663c259a9888888848151811061009e5761009e61069a565b6020026020010151600001518985815181106100bc576100bc61069a565b6020026020010151602001516040518463ffffffff1660e01b81526004016101019392919092835267ffffffffffffffff918216602084015216604082015260600190565b600060405180830381600087803b15801561011b57600080fd5b505af115801561012f573d6000803e3d6000fd5b50505050806001019050610074565b5050825160005b8181101561020c57868582815181106101605761016061069a565b6020026020010151600001511461018a5760405163411ba6b760e01b815260040160405180910390fd5b876001600160a01b03166338dcf74c8683815181106101ab576101ab61069a565b60200260200101516040518263ffffffff1660e01b81526004016101cf91906106b0565b600060405180830381600087803b1580156101e957600080fd5b505af11580156101fd573d6000803e3d6000fd5b50505050806001019050610145565b5050505050505050565b8051829061022482826102fc565b82516040808501516060860151915163184b353160e31b8152600481019390935267ffffffffffffffff90811660248401521660448201526001600160a01b0385169063c259a98890606401600060405180830381600087803b15801561028a57600080fd5b505af115801561029e573d6000803e3d6000fd5b5050604051630e373dd360e21b81526001600160a01b03871692506338dcf74c91506102ce9086906004016106b0565b600060405180830381600087803b1580156102e857600080fd5b505af115801561020c573d6000803e3d6000fd5b6040516331a9108f60e11b8152600481018290526000906001600160a01b03841690636352211e90602401602060405180830381865afa158015610344573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061036891906106fc565b90506001600160a01b038116331461039357604051632e95f4e360e11b815260040160405180910390fd5b505050565b6001600160a01b03811681146103ad57600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff811182821017156103e9576103e96103b0565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715610418576104186103b0565b604052919050565b600067ffffffffffffffff82111561043a5761043a6103b0565b5060051b60200190565b803567ffffffffffffffff8116811461045c57600080fd5b919050565b600060a0828403121561047357600080fd5b60405160a0810181811067ffffffffffffffff82111715610496576104966103b0565b806040525080915082358152602083013560208201526104b860408401610444565b60408201526104c960608401610444565b60608201526104da60808401610444565b60808201525092915050565b600082601f8301126104f757600080fd5b8135602061050c61050783610420565b6103ef565b82815260a0928302850182019282820191908785111561052b57600080fd5b8387015b8581101561054e576105418982610461565b845292840192810161052f565b5090979650505050505050565b6000806000806080858703121561057157600080fd5b843561057c81610398565b9350602085810135935060408087013567ffffffffffffffff808211156105a257600080fd5b818901915089601f8301126105b657600080fd5b81356105c461050782610420565b81815260069190911b8301850190858101908c8311156105e357600080fd5b938601935b828510156106315785858e0312156106005760008081fd5b6106086103c6565b61061186610444565b815261061e888701610444565b81890152825293850193908601906105e8565b97505050606089013593508084111561064957600080fd5b505050610658878288016104e6565b91505092959194509250565b60008060c0838503121561067757600080fd5b823561068281610398565b91506106918460208501610461565b90509250929050565b634e487b7160e01b600052603260045260246000fd5b600060a0820190508251825260208301516020830152604083015167ffffffffffffffff8082166040850152806060860151166060850152806080860151166080850152505092915050565b60006020828403121561070e57600080fd5b815161071981610398565b939250505056fea26469706673582212203ff8018330df4094cf3461945c2c9c7412ea27ee869c3728ba27f337ef6ecd8a64736f6c63430008120033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100365760003560e01c806371a5e8c81461003b5780639d11045414610050575b600080fd5b61004e61004936600461055b565b610063565b005b61004e61005e366004610664565b610216565b838361006f82826102fc565b835160005b8181101561013e57876001600160a01b031663c259a9888888848151811061009e5761009e61069a565b6020026020010151600001518985815181106100bc576100bc61069a565b6020026020010151602001516040518463ffffffff1660e01b81526004016101019392919092835267ffffffffffffffff918216602084015216604082015260600190565b600060405180830381600087803b15801561011b57600080fd5b505af115801561012f573d6000803e3d6000fd5b50505050806001019050610074565b5050825160005b8181101561020c57868582815181106101605761016061069a565b6020026020010151600001511461018a5760405163411ba6b760e01b815260040160405180910390fd5b876001600160a01b03166338dcf74c8683815181106101ab576101ab61069a565b60200260200101516040518263ffffffff1660e01b81526004016101cf91906106b0565b600060405180830381600087803b1580156101e957600080fd5b505af11580156101fd573d6000803e3d6000fd5b50505050806001019050610145565b5050505050505050565b8051829061022482826102fc565b82516040808501516060860151915163184b353160e31b8152600481019390935267ffffffffffffffff90811660248401521660448201526001600160a01b0385169063c259a98890606401600060405180830381600087803b15801561028a57600080fd5b505af115801561029e573d6000803e3d6000fd5b5050604051630e373dd360e21b81526001600160a01b03871692506338dcf74c91506102ce9086906004016106b0565b600060405180830381600087803b1580156102e857600080fd5b505af115801561020c573d6000803e3d6000fd5b6040516331a9108f60e11b8152600481018290526000906001600160a01b03841690636352211e90602401602060405180830381865afa158015610344573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061036891906106fc565b90506001600160a01b038116331461039357604051632e95f4e360e11b815260040160405180910390fd5b505050565b6001600160a01b03811681146103ad57600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff811182821017156103e9576103e96103b0565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715610418576104186103b0565b604052919050565b600067ffffffffffffffff82111561043a5761043a6103b0565b5060051b60200190565b803567ffffffffffffffff8116811461045c57600080fd5b919050565b600060a0828403121561047357600080fd5b60405160a0810181811067ffffffffffffffff82111715610496576104966103b0565b806040525080915082358152602083013560208201526104b860408401610444565b60408201526104c960608401610444565b60608201526104da60808401610444565b60808201525092915050565b600082601f8301126104f757600080fd5b8135602061050c61050783610420565b6103ef565b82815260a0928302850182019282820191908785111561052b57600080fd5b8387015b8581101561054e576105418982610461565b845292840192810161052f565b5090979650505050505050565b6000806000806080858703121561057157600080fd5b843561057c81610398565b9350602085810135935060408087013567ffffffffffffffff808211156105a257600080fd5b818901915089601f8301126105b657600080fd5b81356105c461050782610420565b81815260069190911b8301850190858101908c8311156105e357600080fd5b938601935b828510156106315785858e0312156106005760008081fd5b6106086103c6565b61061186610444565b815261061e888701610444565b81890152825293850193908601906105e8565b97505050606089013593508084111561064957600080fd5b505050610658878288016104e6565b91505092959194509250565b60008060c0838503121561067757600080fd5b823561068281610398565b91506106918460208501610461565b90509250929050565b634e487b7160e01b600052603260045260246000fd5b600060a0820190508251825260208301516020830152604083015167ffffffffffffffff8082166040850152806060860151166060850152806080860151166080850152505092915050565b60006020828403121561070e57600080fd5b815161071981610398565b939250505056fea26469706673582212203ff8018330df4094cf3461945c2c9c7412ea27ee869c3728ba27f337ef6ecd8a64736f6c63430008120033

Block Transaction Gas Used Reward
view all blocks collator

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.