Skip to content

Commit

Permalink
Improves comment.
Browse files Browse the repository at this point in the history
  • Loading branch information
steven2308 committed Dec 4, 2023
1 parent 2f617db commit 28977d0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions contracts/RMRK/equippable/RMRKMinifiedEquippable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -390,9 +390,7 @@ contract RMRKMinifiedEquippable is
uint256 destinationId,
bytes memory data
) internal virtual {
// It seems redundant, but otherwise it would revert with no error
_checkDestination(to);

_innerMint(to, tokenId, destinationId, data);
_sendToNFT(address(0), to, 0, destinationId, tokenId, data);
}
Expand Down Expand Up @@ -2066,7 +2064,7 @@ contract RMRKMinifiedEquippable is
* @param to Address of the destination
*/
function _checkDestination(address to) internal view {
// It seems redundant, but otherwise it would revert with no error
// Checking if it is a contract before calling it seems redundant, but otherwise it would revert with no error
if (to.code.length == 0) revert RMRKIsNotContract();
if (!IERC165(to).supportsInterface(type(IERC7401).interfaceId))
revert RMRKNestableTransferToNonRMRKNestableImplementer();
Expand Down
4 changes: 1 addition & 3 deletions contracts/RMRK/nestable/RMRKNestable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -444,9 +444,7 @@ contract RMRKNestable is Context, IERC165, IERC721, IERC7401, RMRKCore {
uint256 destinationId,
bytes memory data
) internal virtual {
// It seems redundant, but otherwise it would revert with no error
_checkDestination(to);

_innerMint(to, tokenId, destinationId, data);
_sendToNFT(address(0), to, 0, destinationId, tokenId, data);
}
Expand Down Expand Up @@ -1175,7 +1173,7 @@ contract RMRKNestable is Context, IERC165, IERC721, IERC7401, RMRKCore {
* @param to Address of the destination
*/
function _checkDestination(address to) internal view {
// It seems redundant, but otherwise it would revert with no error
// Checking if it is a contract before calling it seems redundant, but otherwise it would revert with no error
if (to.code.length == 0) revert RMRKIsNotContract();
if (!IERC165(to).supportsInterface(type(IERC7401).interfaceId))
revert RMRKNestableTransferToNonRMRKNestableImplementer();
Expand Down

0 comments on commit 28977d0

Please sign in to comment.