Skip to content

Commit

Permalink
Makes asset and equipping related variables internal instead of public.
Browse files Browse the repository at this point in the history
Bumps version to 2.1.1.
  • Loading branch information
steven2308 committed Sep 21, 2023
1 parent 99d6d47 commit 58e4ac5
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 21 deletions.
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,15 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [2.1.1] - 2023-09-21

### Changed

- Most asset and equipping related variables are changed from `private` to `internal` visibility, to allow for more flexibility on implementations.

## [2.1.0] - 2023-09-19

This release covers minor improvements and updates the numbers for Nestable and Emotable ERCs.
This release covers minor improvements and updates the numbers for Nestable and Emotable ERCs.

The original Nestable standard (ERC-6059) was missing parameter in the specification due to a method modified during the EIP process. The `interfaceId` of the specified interface was correct, so all the collections deployed using this package in the past were using the newly finalized ERC-7401 instead of ERC-6059.

Expand All @@ -16,13 +22,15 @@ The need to update the Emotes standard (ERC-6381) was noticed before it was rele
To reiterate: you do not need to worry about upgrading or fixing previously deployed collections using these ERCs, since they are already built based on the latest specification ever since they have been released into the public domain.

### Changed

- `equip` and `unequip` methods are now gated to the owner or approved for assets, transfer permission no longer needs to be granted alongside equip/unequip permission.
- Renames ERC-6059 to ERC-7401.
- Renames emotes repository to ERC-7409.
- Adds Base test and mainnet networks
- Improves hardhat config and .env.example for network configuration.

### Fixed

- No longer restricts child catalog from being different than parent's catalog to consider the child equippable in RMRKEquipRenderUtils.
- Fixes soulbound detection on RenderUtils.getExtendedNFT.

Expand Down
2 changes: 1 addition & 1 deletion contracts/RMRK/core/RMRKCore.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ contract RMRKCore {
* @notice Version of the @rmrk-team/evm-contracts package
* @return Version identifier of the smart contract
*/
string public constant VERSION = "2.1.0";
string public constant VERSION = "2.1.1";
bytes4 public constant RMRK_INTERFACE = 0x524D524B; // "RMRK" in ASCII hex
}
12 changes: 6 additions & 6 deletions contracts/RMRK/equippable/RMRKEquippable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,22 @@ contract RMRKEquippable is

// ------------------- EQUIPPABLE --------------
/// Mapping of uint64 asset ID to corresponding catalog address.
mapping(uint64 => address) private _catalogAddresses;
mapping(uint64 => address) internal _catalogAddresses;
/// Mapping of uint64 ID to asset object.
mapping(uint64 => uint64) private _equippableGroupIds;
mapping(uint64 => uint64) internal _equippableGroupIds;
/// Mapping of assetId to catalog parts applicable to this asset, both fixed and slot
mapping(uint64 => uint64[]) private _partIds;
mapping(uint64 => uint64[]) internal _partIds;

/// Mapping of token ID to catalog address to slot part ID to equipment information. Used to compose an NFT.
mapping(uint256 => mapping(address => mapping(uint64 => Equipment)))
private _equipments;
internal _equipments;

/// Mapping of token ID to child (nestable) address to child ID to count of equipped items. Used to check if equipped.
mapping(uint256 => mapping(address => mapping(uint256 => uint256)))
private _equipCountPerChild;
internal _equipCountPerChild;

/// Mapping of `equippableGroupId` to parent contract address and valid `slotId`.
mapping(uint64 => mapping(address => uint64)) private _validParentSlots;
mapping(uint64 => mapping(address => uint64)) internal _validParentSlots;

/**
* @notice Used to verify that the caller is either the owner of the given token or approved to manage the token's assets
Expand Down
18 changes: 9 additions & 9 deletions contracts/RMRK/equippable/RMRKMinifiedEquippable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -1251,10 +1251,10 @@ contract RMRKMinifiedEquippable is
}

/// Mapping of uint64 Ids to asset metadata
mapping(uint64 => string) private _assets;
mapping(uint64 => string) internal _assets;

/// Mapping of tokenId to new asset, to asset to be replaced
mapping(uint256 => mapping(uint64 => uint64)) private _assetReplacements;
mapping(uint256 => mapping(uint64 => uint64)) internal _assetReplacements;

/// Mapping of tokenId to an array of active assets
/// @dev Active recurses is unbounded, getting all would reach gas limit at around 30k items
Expand All @@ -1268,7 +1268,7 @@ contract RMRKMinifiedEquippable is
mapping(uint256 => uint64[]) internal _activeAssetPriorities;

/// Mapping of tokenId to assetId to whether the token has this asset assigned
mapping(uint256 => mapping(uint64 => bool)) private _tokenAssets;
mapping(uint256 => mapping(uint64 => bool)) internal _tokenAssets;

/// Mapping from owner to operator approvals for assets
mapping(address => mapping(address => bool))
Expand Down Expand Up @@ -1579,22 +1579,22 @@ contract RMRKMinifiedEquippable is

// ------------------- EQUIPPABLE --------------
/// Mapping of uint64 asset ID to corresponding catalog address.
mapping(uint64 => address) private _catalogAddresses;
mapping(uint64 => address) internal _catalogAddresses;
/// Mapping of uint64 ID to asset object.
mapping(uint64 => uint64) private _equippableGroupIds;
mapping(uint64 => uint64) internal _equippableGroupIds;
/// Mapping of assetId to catalog parts applicable to this asset, both fixed and slot
mapping(uint64 => uint64[]) private _partIds;
mapping(uint64 => uint64[]) internal _partIds;

/// Mapping of token ID to catalog address to slot part ID to equipment information. Used to compose an NFT.
mapping(uint256 => mapping(address => mapping(uint64 => Equipment)))
private _equipments;
internal _equipments;

/// Mapping of token ID to child (nestable) address to child ID to count of equipped items. Used to check if equipped.
mapping(uint256 => mapping(address => mapping(uint256 => uint256)))
private _equipCountPerChild;
internal _equipCountPerChild;

/// Mapping of `equippableGroupId` to parent contract address and valid `slotId`.
mapping(uint64 => mapping(address => uint64)) private _validParentSlots;
mapping(uint64 => mapping(address => uint64)) internal _validParentSlots;

/**
* @notice Used to verify that the caller is either the owner of the given token or approved to manage the token's assets
Expand Down
6 changes: 3 additions & 3 deletions contracts/RMRK/multiasset/AbstractMultiAsset.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ abstract contract AbstractMultiAsset is Context, IERC5773 {
using RMRKLib for uint64[];

/// Mapping of uint64 Ids to asset metadata
mapping(uint64 => string) private _assets;
mapping(uint64 => string) internal _assets;

/// Mapping of tokenId to new asset, to asset to be replaced
mapping(uint256 => mapping(uint64 => uint64)) private _assetReplacements;
mapping(uint256 => mapping(uint64 => uint64)) internal _assetReplacements;

/// Mapping of tokenId to an array of active assets
/// @dev Active recurses is unbounded, getting all would reach gas limit at around 30k items
Expand All @@ -33,7 +33,7 @@ abstract contract AbstractMultiAsset is Context, IERC5773 {
mapping(uint256 => uint64[]) internal _activeAssetPriorities;

/// Mapping of tokenId to assetId to whether the token has this asset assigned
mapping(uint256 => mapping(uint64 => bool)) private _tokenAssets;
mapping(uint256 => mapping(uint64 => bool)) internal _tokenAssets;

/// Mapping from owner to operator approvals for assets
mapping(address => mapping(address => bool))
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rmrk-team/evm-contracts",
"version": "2.1.0",
"version": "2.1.1",
"license": "Apache-2.0",
"files": [
"contracts/RMRK/*",
Expand Down

0 comments on commit 58e4ac5

Please sign in to comment.