Source Code
Overview
GLMR Balance
GLMR Value
$0.00Latest 25 from a total of 930 transactions
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Bulk Equip | 10732037 | 266 days ago | IN | 0 GLMR | 0.034207 | ||||
| Bulk Equip | 10731998 | 266 days ago | IN | 0 GLMR | 0.026762 | ||||
| Bulk Equip | 10611896 | 275 days ago | IN | 0 GLMR | 0.0294445 | ||||
| Bulk Equip | 10001275 | 318 days ago | IN | 0 GLMR | 0.0294265 | ||||
| Bulk Equip | 9757943 | 335 days ago | IN | 0 GLMR | 0.05307 | ||||
| Bulk Equip | 9292129 | 368 days ago | IN | 0 GLMR | 0.121028 | ||||
| Bulk Equip | 9093064 | 382 days ago | IN | 0 GLMR | 0.103532 | ||||
| Bulk Equip | 9092977 | 382 days ago | IN | 0 GLMR | 0.134438 | ||||
| Bulk Equip | 9065765 | 384 days ago | IN | 0 GLMR | 0.121454 | ||||
| Bulk Equip | 9065544 | 384 days ago | IN | 0 GLMR | 0.057298 | ||||
| Bulk Equip | 9065541 | 384 days ago | IN | 0 GLMR | 0.057298 | ||||
| Bulk Equip | 9065538 | 384 days ago | IN | 0 GLMR | 0.057298 | ||||
| Bulk Equip | 9065535 | 384 days ago | IN | 0 GLMR | 0.057298 | ||||
| Bulk Equip | 9065531 | 384 days ago | IN | 0 GLMR | 0.057298 | ||||
| Bulk Equip | 8524847 | 423 days ago | IN | 0 GLMR | 0.106976 | ||||
| Bulk Equip | 8524828 | 423 days ago | IN | 0 GLMR | 0.186364 | ||||
| Bulk Equip | 8244607 | 443 days ago | IN | 0 GLMR | 0.05376115 | ||||
| Bulk Equip | 8130696 | 451 days ago | IN | 0 GLMR | 0.052676 | ||||
| Bulk Equip | 8129927 | 451 days ago | IN | 0 GLMR | 0.052676 | ||||
| Bulk Equip | 8129891 | 451 days ago | IN | 0 GLMR | 0.117706 | ||||
| Bulk Equip | 8125572 | 451 days ago | IN | 0 GLMR | 0.052676 | ||||
| Bulk Equip | 7357789 | 505 days ago | IN | 0 GLMR | 0.05929156 | ||||
| Bulk Equip | 7320000 | 508 days ago | IN | 0 GLMR | 0.026338 | ||||
| Bulk Equip | 7305219 | 509 days ago | IN | 0 GLMR | 0.058853 | ||||
| Bulk Equip | 7303915 | 509 days ago | IN | 0 GLMR | 0.058853 |
View more zero value Internal Transactions in Advanced View mode
Cross-Chain Transactions
Loading...
Loading
Contract Name:
RMRKBulkWriter
Compiler Version
v0.8.18+commit.87f61d96
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// 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);
}{
"optimizer": {
"enabled": true,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
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"}]Contract Creation Code
608060405234801561001057600080fd5b50610756806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c806371a5e8c81461003b5780639d11045414610050575b600080fd5b61004e61004936600461055b565b610063565b005b61004e61005e366004610664565b610216565b838361006f82826102fc565b835160005b8181101561013e57876001600160a01b031663c259a9888888848151811061009e5761009e61069a565b6020026020010151600001518985815181106100bc576100bc61069a565b6020026020010151602001516040518463ffffffff1660e01b81526004016101019392919092835267ffffffffffffffff918216602084015216604082015260600190565b600060405180830381600087803b15801561011b57600080fd5b505af115801561012f573d6000803e3d6000fd5b50505050806001019050610074565b5050825160005b8181101561020c57868582815181106101605761016061069a565b6020026020010151600001511461018a5760405163411ba6b760e01b815260040160405180910390fd5b876001600160a01b03166338dcf74c8683815181106101ab576101ab61069a565b60200260200101516040518263ffffffff1660e01b81526004016101cf91906106b0565b600060405180830381600087803b1580156101e957600080fd5b505af11580156101fd573d6000803e3d6000fd5b50505050806001019050610145565b5050505050505050565b8051829061022482826102fc565b82516040808501516060860151915163184b353160e31b8152600481019390935267ffffffffffffffff90811660248401521660448201526001600160a01b0385169063c259a98890606401600060405180830381600087803b15801561028a57600080fd5b505af115801561029e573d6000803e3d6000fd5b5050604051630e373dd360e21b81526001600160a01b03871692506338dcf74c91506102ce9086906004016106b0565b600060405180830381600087803b1580156102e857600080fd5b505af115801561020c573d6000803e3d6000fd5b6040516331a9108f60e11b8152600481018290526000906001600160a01b03841690636352211e90602401602060405180830381865afa158015610344573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061036891906106fc565b90506001600160a01b038116331461039357604051632e95f4e360e11b815260040160405180910390fd5b505050565b6001600160a01b03811681146103ad57600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff811182821017156103e9576103e96103b0565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715610418576104186103b0565b604052919050565b600067ffffffffffffffff82111561043a5761043a6103b0565b5060051b60200190565b803567ffffffffffffffff8116811461045c57600080fd5b919050565b600060a0828403121561047357600080fd5b60405160a0810181811067ffffffffffffffff82111715610496576104966103b0565b806040525080915082358152602083013560208201526104b860408401610444565b60408201526104c960608401610444565b60608201526104da60808401610444565b60808201525092915050565b600082601f8301126104f757600080fd5b8135602061050c61050783610420565b6103ef565b82815260a0928302850182019282820191908785111561052b57600080fd5b8387015b8581101561054e576105418982610461565b845292840192810161052f565b5090979650505050505050565b6000806000806080858703121561057157600080fd5b843561057c81610398565b9350602085810135935060408087013567ffffffffffffffff808211156105a257600080fd5b818901915089601f8301126105b657600080fd5b81356105c461050782610420565b81815260069190911b8301850190858101908c8311156105e357600080fd5b938601935b828510156106315785858e0312156106005760008081fd5b6106086103c6565b61061186610444565b815261061e888701610444565b81890152825293850193908601906105e8565b97505050606089013593508084111561064957600080fd5b505050610658878288016104e6565b91505092959194509250565b60008060c0838503121561067757600080fd5b823561068281610398565b91506106918460208501610461565b90509250929050565b634e487b7160e01b600052603260045260246000fd5b600060a0820190508251825260208301516020830152604083015167ffffffffffffffff8082166040850152806060860151166060850152806080860151166080850152505092915050565b60006020828403121561070e57600080fd5b815161071981610398565b939250505056fea26469706673582212203ff8018330df4094cf3461945c2c9c7412ea27ee869c3728ba27f337ef6ecd8a64736f6c63430008120033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100365760003560e01c806371a5e8c81461003b5780639d11045414610050575b600080fd5b61004e61004936600461055b565b610063565b005b61004e61005e366004610664565b610216565b838361006f82826102fc565b835160005b8181101561013e57876001600160a01b031663c259a9888888848151811061009e5761009e61069a565b6020026020010151600001518985815181106100bc576100bc61069a565b6020026020010151602001516040518463ffffffff1660e01b81526004016101019392919092835267ffffffffffffffff918216602084015216604082015260600190565b600060405180830381600087803b15801561011b57600080fd5b505af115801561012f573d6000803e3d6000fd5b50505050806001019050610074565b5050825160005b8181101561020c57868582815181106101605761016061069a565b6020026020010151600001511461018a5760405163411ba6b760e01b815260040160405180910390fd5b876001600160a01b03166338dcf74c8683815181106101ab576101ab61069a565b60200260200101516040518263ffffffff1660e01b81526004016101cf91906106b0565b600060405180830381600087803b1580156101e957600080fd5b505af11580156101fd573d6000803e3d6000fd5b50505050806001019050610145565b5050505050505050565b8051829061022482826102fc565b82516040808501516060860151915163184b353160e31b8152600481019390935267ffffffffffffffff90811660248401521660448201526001600160a01b0385169063c259a98890606401600060405180830381600087803b15801561028a57600080fd5b505af115801561029e573d6000803e3d6000fd5b5050604051630e373dd360e21b81526001600160a01b03871692506338dcf74c91506102ce9086906004016106b0565b600060405180830381600087803b1580156102e857600080fd5b505af115801561020c573d6000803e3d6000fd5b6040516331a9108f60e11b8152600481018290526000906001600160a01b03841690636352211e90602401602060405180830381865afa158015610344573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061036891906106fc565b90506001600160a01b038116331461039357604051632e95f4e360e11b815260040160405180910390fd5b505050565b6001600160a01b03811681146103ad57600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff811182821017156103e9576103e96103b0565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715610418576104186103b0565b604052919050565b600067ffffffffffffffff82111561043a5761043a6103b0565b5060051b60200190565b803567ffffffffffffffff8116811461045c57600080fd5b919050565b600060a0828403121561047357600080fd5b60405160a0810181811067ffffffffffffffff82111715610496576104966103b0565b806040525080915082358152602083013560208201526104b860408401610444565b60408201526104c960608401610444565b60608201526104da60808401610444565b60808201525092915050565b600082601f8301126104f757600080fd5b8135602061050c61050783610420565b6103ef565b82815260a0928302850182019282820191908785111561052b57600080fd5b8387015b8581101561054e576105418982610461565b845292840192810161052f565b5090979650505050505050565b6000806000806080858703121561057157600080fd5b843561057c81610398565b9350602085810135935060408087013567ffffffffffffffff808211156105a257600080fd5b818901915089601f8301126105b657600080fd5b81356105c461050782610420565b81815260069190911b8301850190858101908c8311156105e357600080fd5b938601935b828510156106315785858e0312156106005760008081fd5b6106086103c6565b61061186610444565b815261061e888701610444565b81890152825293850193908601906105e8565b97505050606089013593508084111561064957600080fd5b505050610658878288016104e6565b91505092959194509250565b60008060c0838503121561067757600080fd5b823561068281610398565b91506106918460208501610461565b90509250929050565b634e487b7160e01b600052603260045260246000fd5b600060a0820190508251825260208301516020830152604083015167ffffffffffffffff8082166040850152806060860151166060850152806080860151166080850152505092915050565b60006020828403121561070e57600080fd5b815161071981610398565b939250505056fea26469706673582212203ff8018330df4094cf3461945c2c9c7412ea27ee869c3728ba27f337ef6ecd8a64736f6c63430008120033
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in GLMR
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
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.