Skip to content

Commit

Permalink
feat(transfer): standard txs tests hypercerts
Browse files Browse the repository at this point in the history
  • Loading branch information
bitbeckers committed Oct 29, 2023
1 parent 042b99c commit 391d6f7
Show file tree
Hide file tree
Showing 8 changed files with 570 additions and 17 deletions.
2 changes: 1 addition & 1 deletion contracts/src/marketplace/LooksRareProtocol.sol
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ import {QuoteType} from "./enums/QuoteType.sol";
* ~~~ ~~~
* ~~~~ ~~~~
* ~~~~~~
* @author LooksRare protocol team (👀,💎)
* @author LooksRare protocol team (👀,💎); bitbeckers
*/
contract LooksRareProtocol is
ILooksRareProtocol,
Expand Down
2 changes: 1 addition & 1 deletion contracts/src/marketplace/TransferSelectorNFT.sol
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ contract TransferSelectorNFT is ExecutionManager, PackableReentrancyGuard {
} else if (collectionType == CollectionType.ERC1155) {
transferManager.transferItemsERC1155(collection, sender, recipient, itemIds, amounts);
} else if (collectionType == CollectionType.Hypercert) {
transferManager.transferItemsERC1155(collection, sender, recipient, itemIds, amounts);
transferManager.transferItemsHypercert(collection, sender, recipient, itemIds, amounts);
} else if (collectionType == CollectionType.Hyperboard) {
revert UnsupportedCollectionType();
}
Expand Down
6 changes: 0 additions & 6 deletions contracts/src/protocol/HypercertMinter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import {PausableUpgradeable} from "oz-upgradeable/security/PausableUpgradeable.s

import {Errors} from "./libs/Errors.sol";

import "forge-std/console.sol";

/// @title Contract for managing hypercert claims and whitelists
/// @author bitbeckers
/// @notice Implementation of the HypercertTokenInterface using { SemiFungible1155 } as underlying token.
Expand Down Expand Up @@ -230,15 +228,11 @@ contract HypercertMinter is IHypercertToken, SemiFungible1155, AllowlistMinter,
// Transfer case, where to and from are non-zero
uint256 len = ids.length;
for (uint256 i; i < len;) {
console.log("Validating permissions");
uint256 typeID = getBaseType(ids[i]);
TransferRestrictions policy = typeRestrictions[typeID];
if (policy == TransferRestrictions.DisallowAll) {
revert Errors.TransfersNotAllowed();
} else if (policy == TransferRestrictions.FromCreatorOnly && from != creators[typeID]) {
console.log("Not allowed: from != creator");
console.log("from: %s != creator", from, creators[typeID]);

revert Errors.TransfersNotAllowed();
}
unchecked {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;
pragma solidity ^0.8.17;

// Libraries, interfaces, errors
import {OrderStructs} from "@hypercerts/marketplace/libraries/OrderStructs.sol";
Expand Down
Loading

0 comments on commit 391d6f7

Please sign in to comment.