@artblocks/contracts 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/README.md +3 -9
  2. package/artifacts/contracts/AdminACLV1.sol/AdminACLV1.json +2 -2
  3. package/artifacts/contracts/BasicPolyptychRandomizerV0.sol/BasicPolyptychRandomizerV0.json +229 -0
  4. package/artifacts/contracts/BasicRandomizerV2.sol/BasicRandomizerV2.json +3 -3
  5. package/artifacts/contracts/GenArt721CoreV3.sol/GenArt721CoreV3.json +2 -2
  6. package/artifacts/contracts/GenArt721CoreV3_Engine.sol/GenArt721CoreV3_Engine.json +2 -2
  7. package/artifacts/contracts/archive/minter-suite/Minters/MinterDAExp/MinterDAExpV0.sol/MinterDAExpV0.json +2 -2
  8. package/artifacts/contracts/archive/minter-suite/Minters/MinterDAExp/MinterDAExpV1.sol/MinterDAExpV1.json +2 -2
  9. package/artifacts/contracts/archive/minter-suite/Minters/MinterDAExp/MinterDAExpV2.sol/MinterDAExpV2.json +2 -2
  10. package/artifacts/contracts/archive/minter-suite/Minters/MinterDAExp/MinterDAExpV3.sol/MinterDAExpV3.json +2 -2
  11. package/artifacts/contracts/archive/minter-suite/Minters/MinterDAExpSettlement/MinterDAExpSettlementV0.sol/MinterDAExpSettlementV0.json +2 -2
  12. package/artifacts/contracts/{minter-suite/Minters → archive/minter-suite/Minters/MinterDAExpSettlement}/MinterDAExpSettlementV1.sol/MinterDAExpSettlementV1.json +3 -3
  13. package/artifacts/contracts/archive/minter-suite/Minters/MinterDALin/MinterDALinV0.sol/MinterDALinV0.json +2 -2
  14. package/artifacts/contracts/archive/minter-suite/Minters/MinterDALin/MinterDALinV1.sol/MinterDALinV1.json +2 -2
  15. package/artifacts/contracts/archive/minter-suite/Minters/MinterDALin/MinterDALinV2.sol/MinterDALinV2.json +2 -2
  16. package/artifacts/contracts/archive/minter-suite/Minters/MinterDALin/MinterDALinV3.sol/MinterDALinV3.json +2 -2
  17. package/artifacts/contracts/archive/minter-suite/Minters/MinterHolder/MinterHolderV0.sol/MinterHolderV0.json +2 -2
  18. package/artifacts/contracts/archive/minter-suite/Minters/MinterHolder/MinterHolderV1.sol/MinterHolderV1.json +2 -2
  19. package/artifacts/contracts/archive/minter-suite/Minters/MinterHolder/MinterHolderV2.sol/MinterHolderV2.json +2 -2
  20. package/artifacts/contracts/archive/minter-suite/Minters/MinterHolder/MinterHolderV3.sol/MinterHolderV3.json +2 -2
  21. package/artifacts/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV0.sol/MinterMerkleV0.json +2 -2
  22. package/artifacts/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV1.sol/MinterMerkleV1.json +2 -2
  23. package/artifacts/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV2.sol/MinterMerkleV2.json +2 -2
  24. package/artifacts/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV3.sol/MinterMerkleV3.json +2 -2
  25. package/artifacts/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV4.sol/MinterMerkleV4.json +2 -2
  26. package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPrice/MinterSetPriceV0.sol/MinterSetPriceV0.json +2 -2
  27. package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPrice/MinterSetPriceV1.sol/MinterSetPriceV1.json +2 -2
  28. package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPrice/MinterSetPriceV2.sol/MinterSetPriceV2.json +2 -2
  29. package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPrice/MinterSetPriceV3.sol/MinterSetPriceV3.json +2 -2
  30. package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPriceERC20/MinterSetPriceERC20V0.sol/MinterSetPriceERC20V0.json +2 -2
  31. package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPriceERC20/MinterSetPriceERC20V1.sol/MinterSetPriceERC20V1.json +2 -2
  32. package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPriceERC20/MinterSetPriceERC20V2.sol/MinterSetPriceERC20V2.json +2 -2
  33. package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPriceERC20/MinterSetPriceERC20V3.sol/MinterSetPriceERC20V3.json +2 -2
  34. package/artifacts/contracts/explorations/GenArt721CoreV3_Explorations.sol/GenArt721CoreV3_Explorations.json +2 -2
  35. package/artifacts/contracts/interfaces/0.8.x/IFilteredMinterDAExpSettlementV1.sol/IFilteredMinterDAExpSettlementV1.json +767 -0
  36. package/artifacts/contracts/interfaces/0.8.x/IMinterFilterV0.sol/IMinterFilterV0.json +6 -0
  37. package/artifacts/contracts/interfaces/0.8.x/IRandomizerPolyptychV0.sol/IRandomizerPolyptychV0.json +87 -0
  38. package/artifacts/contracts/interfaces/0.8.x/IRandomizerV2.sol/IRandomizerV2.json +1 -1
  39. package/artifacts/contracts/minter-suite/MinterFilter/MinterFilterV0.sol/MinterFilterV0.json +8 -2
  40. package/artifacts/contracts/minter-suite/MinterFilter/MinterFilterV1.sol/MinterFilterV1.json +34 -2
  41. package/artifacts/contracts/minter-suite/Minters/MinterDAExpSettlementV2.sol/MinterDAExpSettlementV2.json +1127 -0
  42. package/artifacts/contracts/minter-suite/Minters/MinterDAExpV4.sol/MinterDAExpV4.json +15 -2
  43. package/artifacts/contracts/minter-suite/Minters/MinterDALinV4.sol/MinterDALinV4.json +15 -2
  44. package/artifacts/contracts/minter-suite/Minters/MinterHolderV4.sol/MinterHolderV4.json +15 -2
  45. package/artifacts/contracts/minter-suite/Minters/MinterMerkleV5.sol/MinterMerkleV5.json +15 -2
  46. package/artifacts/contracts/minter-suite/Minters/MinterPolyptychV0.sol/IGenArt721CoreContractV3WithRandomizer.json +662 -0
  47. package/artifacts/contracts/minter-suite/Minters/MinterPolyptychV0.sol/MinterPolyptychV0.json +1268 -0
  48. package/artifacts/contracts/minter-suite/Minters/MinterSetPriceERC20V4.sol/MinterSetPriceERC20V4.json +15 -2
  49. package/artifacts/contracts/minter-suite/Minters/MinterSetPriceV4.sol/MinterSetPriceV4.json +15 -2
  50. package/artifacts/contracts/mock/GenArt721CoreV3_Engine_IncorrectCoreType.sol/GenArt721CoreV3_Engine_IncorrectCoreType.json +2 -2
  51. package/artifacts/contracts/mock/RandomizerV2_NoAssignMock.sol/RandomizerV2_NoAssignMock.json +3 -3
  52. package/contracts/BasicPolyptychRandomizerV0.sol +126 -0
  53. package/contracts/BasicRandomizerV2.sol +3 -3
  54. package/contracts/{minter-suite/Minters → archive/minter-suite/Minters/MinterDAExpSettlement}/MinterDAExpSettlementV1.sol +4 -4
  55. package/contracts/interfaces/0.8.x/IFilteredMinterDAExpSettlementV1.sol +21 -0
  56. package/contracts/interfaces/0.8.x/IMinterFilterV0.sol +6 -0
  57. package/contracts/interfaces/0.8.x/IRandomizerPolyptychV0.sol +31 -0
  58. package/contracts/interfaces/0.8.x/IRandomizerV2.sol +5 -2
  59. package/contracts/minter-suite/MinterFilter/MinterFilterV1.sol +18 -0
  60. package/contracts/minter-suite/Minters/MinterDAExpSettlementV2.sol +1312 -0
  61. package/contracts/minter-suite/Minters/MinterDAExpV4.sol +32 -4
  62. package/contracts/minter-suite/Minters/MinterDALinV4.sol +32 -5
  63. package/contracts/minter-suite/Minters/MinterHolderV4.sol +35 -6
  64. package/contracts/minter-suite/Minters/MinterMerkleV5.sol +35 -6
  65. package/contracts/minter-suite/Minters/MinterPolyptychV0.sol +998 -0
  66. package/contracts/minter-suite/Minters/MinterSetPriceERC20V4.sol +35 -6
  67. package/contracts/minter-suite/Minters/MinterSetPriceV4.sol +32 -4
  68. package/package.json +8 -2
@@ -0,0 +1,126 @@
1
+ // SPDX-License-Identifier: LGPL-3.0-only
2
+ // Creatd By: Art Blocks Inc.
3
+
4
+ pragma solidity 0.8.17;
5
+
6
+ import "./interfaces/0.8.x/IGenArt721CoreContractV3_Base.sol";
7
+ import "./interfaces/0.8.x/IRandomizerPolyptychV0.sol";
8
+
9
+ import "@openzeppelin-4.7/contracts/access/Ownable.sol";
10
+
11
+ /**
12
+ * @title Basic Polytych Randomizer contract that enables the copying of token hash seeds.
13
+ * @notice This contract requires several configuration options to be set properly before
14
+ * it enables the copying of token hashes from an original token (the first panel of a polyptych)
15
+ * to subsequent diptych, triptych, or polyptych panels.
16
+ *
17
+ * Requirements to use the polyptych randomizer:
18
+ * - Core contract must be an instance of `GenArt721CoreV3_Engine`
19
+ * - The initial project used as the first panel should be minted with a pseudo random token hash
20
+ * - An `MinterPolyptychV0` contract or similar must be deployed and configured as the `hashSeedSetterContract`
21
+ * - The `projectDuplicateHashSeedLimit` should be configured for each project
22
+ *
23
+ * Once the contract is configured, it will enable newly-minted tokens to use a copy of the hash
24
+ * seed from a previously-minted token.
25
+ */
26
+ contract BasicPolyptychRandomizerV0 is IRandomizerPolyptychV0, Ownable {
27
+ // The core contract that may interact with this randomizer contract.
28
+ IGenArt721CoreContractV3_Base public genArt721Core;
29
+
30
+ // Used to obtain the project ID from the token ID
31
+ uint256 constant ONE_MILLION = 1_000_000;
32
+
33
+ // Mapping of token IDs to hash seeds
34
+ mapping(uint256 => bytes12) public polyptychHashSeeds;
35
+
36
+ // Configures the maximum number of hash seed copies that can exist per project (default zero)
37
+ mapping(uint256 => bool) public projectIsPolyptych;
38
+
39
+ // The contract allowed to assign hash seeds (e.g. PolyptychMinterV0)
40
+ address public hashSeedSetterContract;
41
+
42
+ function assignCoreAndRenounce(address _genArt721Core) external onlyOwner {
43
+ renounceOwnership();
44
+ genArt721Core = IGenArt721CoreContractV3_Base(_genArt721Core);
45
+ }
46
+
47
+ // modifier to restrict access to only AdminACL allowed calls
48
+ // @dev defers which ACL contract is used to the core contract
49
+ modifier onlyCoreAdminACL(bytes4 _selector) {
50
+ require(
51
+ genArt721Core.adminACLAllowed(msg.sender, address(this), _selector),
52
+ "Only Core AdminACL allowed"
53
+ );
54
+ _;
55
+ }
56
+
57
+ modifier onlyArtist(uint256 _projectId) {
58
+ require(
59
+ msg.sender == genArt721Core.projectIdToArtistAddress(_projectId),
60
+ "Only Artist"
61
+ );
62
+ _;
63
+ }
64
+
65
+ // Allows the owner of the core contract to set the minter that is allowed to assign hash seeds
66
+ function setHashSeedSetterContract(
67
+ address _contractAddress
68
+ ) external onlyCoreAdminACL(this.setHashSeedSetterContract.selector) {
69
+ hashSeedSetterContract = _contractAddress;
70
+ emit HashSeedSetterUpdated(_contractAddress);
71
+ }
72
+
73
+ /**
74
+ * @notice Allows the owner of the core contract to configure a project as a polyptych
75
+ * @param _projectId - The ID of the project that has a polyptych panel (second, third, etc.)
76
+ */
77
+ function toggleProjectIsPolyptych(
78
+ uint256 _projectId
79
+ ) external onlyArtist(_projectId) {
80
+ projectIsPolyptych[_projectId] = !projectIsPolyptych[_projectId];
81
+ emit ProjectIsPolyptychUpdated(
82
+ _projectId,
83
+ projectIsPolyptych[_projectId]
84
+ );
85
+ }
86
+
87
+ // Sets the token hash seed to be re-used in the subsequent panels of a polyptych
88
+ function setPolyptychHashSeed(
89
+ uint256 _tokenId,
90
+ bytes12 _hashSeed
91
+ ) external {
92
+ require(
93
+ msg.sender == hashSeedSetterContract,
94
+ "Only hashSeedSetterContract"
95
+ );
96
+ polyptychHashSeeds[_tokenId] = _hashSeed;
97
+ // @dev event indicating token hash seed assigned is not required for subgraph indexing
98
+ // because token hash seeds are still assigned atomically in `assignTokenHash` function.
99
+ // If token hash seeds were assigned async, event emission may be required to support
100
+ // subgraph indexing.
101
+ }
102
+
103
+ // When `genArt721Core` calls this, it can be assured that the randomizer
104
+ // will set a bytes32 hash for tokenId `_tokenId` on the core contract.
105
+ function assignTokenHash(uint256 _tokenId) external virtual {
106
+ require(msg.sender == address(genArt721Core), "Only core may call");
107
+
108
+ if (projectIsPolyptych[_tokenId / ONE_MILLION]) {
109
+ bytes12 seededHash = polyptychHashSeeds[_tokenId];
110
+ require(seededHash != 0, "Only non-zero hash seed");
111
+ genArt721Core.setTokenHash_8PT(_tokenId, seededHash);
112
+ } else {
113
+ uint256 time = block.timestamp;
114
+ bytes32 hash = keccak256(
115
+ abi.encodePacked(
116
+ _tokenId,
117
+ block.number,
118
+ blockhash(block.number - 1),
119
+ time,
120
+ (time % 200) + 1
121
+ )
122
+ );
123
+ genArt721Core.setTokenHash_8PT(_tokenId, hash);
124
+ }
125
+ }
126
+ }
@@ -4,17 +4,17 @@
4
4
  pragma solidity 0.8.17;
5
5
 
6
6
  import "./interfaces/0.8.x/IRandomizerV2.sol";
7
- import "./interfaces/0.8.x/IGenArt721CoreContractV3.sol";
7
+ import "./interfaces/0.8.x/IGenArt721CoreContractV3_Base.sol";
8
8
 
9
9
  import "@openzeppelin-4.7/contracts/access/Ownable.sol";
10
10
 
11
11
  contract BasicRandomizerV2 is IRandomizerV2, Ownable {
12
12
  // The core contract that may interact with this randomizer contract.
13
- IGenArt721CoreContractV3 public genArt721Core;
13
+ IGenArt721CoreContractV3_Base public genArt721Core;
14
14
 
15
15
  function assignCoreAndRenounce(address _genArt721Core) external onlyOwner {
16
16
  renounceOwnership();
17
- genArt721Core = IGenArt721CoreContractV3(_genArt721Core);
17
+ genArt721Core = IGenArt721CoreContractV3_Base(_genArt721Core);
18
18
  }
19
19
 
20
20
  // When `genArt721Core` calls this, it can be assured that the randomizer
@@ -1,10 +1,10 @@
1
1
  // SPDX-License-Identifier: LGPL-3.0-only
2
2
  // Created By: Art Blocks Inc.
3
3
 
4
- import "../../interfaces/0.8.x/IGenArt721CoreContractV3_Base.sol";
5
- import "../../interfaces/0.8.x/IMinterFilterV0.sol";
6
- import "../../interfaces/0.8.x/IFilteredMinterDAExpSettlementV0.sol";
7
- import "./MinterBase_v0_1_1.sol";
4
+ import "../../../../interfaces/0.8.x/IGenArt721CoreContractV3_Base.sol";
5
+ import "../../../../interfaces/0.8.x/IMinterFilterV0.sol";
6
+ import "../../../../interfaces/0.8.x/IFilteredMinterDAExpSettlementV0.sol";
7
+ import "../../../../minter-suite/Minters/MinterBase_v0_1_1.sol";
8
8
 
9
9
  import "@openzeppelin-4.7/contracts/security/ReentrancyGuard.sol";
10
10
  import "@openzeppelin-4.7/contracts/utils/math/SafeCast.sol";
@@ -0,0 +1,21 @@
1
+ // SPDX-License-Identifier: LGPL-3.0-only
2
+ // Created By: Art Blocks Inc.
3
+
4
+ import "./IFilteredMinterDAExpSettlement_Mixin.sol";
5
+ import "./IFilteredMinterV2.sol";
6
+ import "./IFilteredMinterDAExpV0.sol";
7
+
8
+ pragma solidity ^0.8.0;
9
+
10
+ /**
11
+ * @title This interface combines the set of interfaces that add support for
12
+ * a Dutch Auction with Settlement minter.
13
+ * @author Art Blocks Inc.
14
+ */
15
+ interface IFilteredMinterDAExpSettlementV1 is
16
+ IFilteredMinterDAExpSettlement_Mixin,
17
+ IFilteredMinterV2,
18
+ IFilteredMinterDAExpV0
19
+ {
20
+
21
+ }
@@ -4,6 +4,12 @@
4
4
  pragma solidity ^0.8.0;
5
5
 
6
6
  interface IMinterFilterV0 {
7
+ /**
8
+ * @notice Emitted when contract is deployed to notify indexing services
9
+ * of the new contract deployment.
10
+ */
11
+ event Deployed();
12
+
7
13
  /**
8
14
  * @notice Approved minter `_minterAddress`.
9
15
  */
@@ -0,0 +1,31 @@
1
+ // SPDX-License-Identifier: LGPL-3.0-only
2
+ // Creatd By: Art Blocks Inc.
3
+
4
+ pragma solidity 0.8.17;
5
+
6
+ import "./IRandomizerV2.sol";
7
+
8
+ interface IRandomizerPolyptychV0 is IRandomizerV2 {
9
+ /**
10
+ * @notice Minter contract at `_contractAddress` allowed to assign token hash seeds.
11
+ */
12
+ event HashSeedSetterUpdated(address indexed _contractAddress);
13
+
14
+ /**
15
+ * @notice Project with ID `_projectId` is enabled/disabled for polyptych minting.
16
+ */
17
+ event ProjectIsPolyptychUpdated(uint256 _projectId, bool _isPolyptych);
18
+
19
+ /**
20
+ * @notice When a core contract calls this, it can be assured that the randomizer
21
+ * will set a bytes32 hash for tokenId `_tokenId` on the core contract. This function
22
+ * may only be called by the contract configured as the `hashSeedSetterContract` via
23
+ * the `setHashSeedSetterContract` available to the core contract admin.
24
+ */
25
+ function assignTokenHash(uint256 _tokenId) external;
26
+
27
+ /**
28
+ * @notice Store the token hash seed for an existing token to be re-used in a polyptych panel.
29
+ */
30
+ function setPolyptychHashSeed(uint256 _tokenId, bytes12 _hashSeed) external;
31
+ }
@@ -3,11 +3,14 @@
3
3
 
4
4
  pragma solidity ^0.8.0;
5
5
 
6
- import "./IGenArt721CoreContractV3.sol";
6
+ import "./IGenArt721CoreContractV3_Base.sol";
7
7
 
8
8
  interface IRandomizerV2 {
9
9
  // The core contract that may interact with this randomizer contract.
10
- function genArt721Core() external view returns (IGenArt721CoreContractV3);
10
+ function genArt721Core()
11
+ external
12
+ view
13
+ returns (IGenArt721CoreContractV3_Base);
11
14
 
12
15
  // When a core contract calls this, it can be assured that the randomizer
13
16
  // will set a bytes32 hash for tokenId `_tokenId` on the core contract.
@@ -6,6 +6,8 @@ import "../../interfaces/0.8.x/IFilteredMinterV0.sol";
6
6
  import "../../interfaces/0.8.x/IAdminACLV0.sol";
7
7
  import "../../interfaces/0.8.x/IGenArt721CoreContractV3.sol";
8
8
 
9
+ import "../../libs/0.8.x/Bytes32Strings.sol";
10
+
9
11
  import "@openzeppelin-4.5/contracts/utils/structs/EnumerableMap.sol";
10
12
 
11
13
  pragma solidity 0.8.17;
@@ -39,6 +41,21 @@ pragma solidity 0.8.17;
39
41
  contract MinterFilterV1 is IMinterFilterV0 {
40
42
  // add Enumerable Map methods
41
43
  using EnumerableMap for EnumerableMap.UintToAddressMap;
44
+ // add Bytes32Strings methods
45
+ using Bytes32Strings for bytes32;
46
+
47
+ /// version & type of this core contract
48
+ bytes32 constant MINTER_FILTER_VERSION = "v1.0.1";
49
+
50
+ function minterFilterVersion() external pure returns (string memory) {
51
+ return MINTER_FILTER_VERSION.toString();
52
+ }
53
+
54
+ bytes32 constant MINTER_FILTER_TYPE = "MinterFilterV1";
55
+
56
+ function minterFilterType() external pure returns (string memory) {
57
+ return MINTER_FILTER_TYPE.toString();
58
+ }
42
59
 
43
60
  /// Core contract address this minter interacts with
44
61
  address public immutable genArt721CoreAddress;
@@ -106,6 +123,7 @@ contract MinterFilterV1 is IMinterFilterV0 {
106
123
  ) onlyNonZeroAddress(_genArt721Address) {
107
124
  genArt721CoreAddress = _genArt721Address;
108
125
  genArtCoreContract = IGenArt721CoreContractV3(_genArt721Address);
126
+ emit Deployed();
109
127
  }
110
128
 
111
129
  /**