@artblocks/contracts 1.0.4 → 1.1.0
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.
- package/README.md +2 -2
- package/artifacts/contracts/AdminACLV1.sol/AdminACLV1.json +2 -2
- package/artifacts/contracts/DependencyRegistryV0.sol/DependencyRegistryV0.json +97 -10
- package/artifacts/contracts/GenArt721CoreV3.sol/GenArt721CoreV3.json +4 -4
- package/artifacts/contracts/engine/V3/GenArt721CoreV3_Engine.sol/GenArt721CoreV3_Engine.json +4 -9
- package/artifacts/contracts/engine/V3/GenArt721CoreV3_Engine_Flex.sol/GenArt721CoreV3_Engine_Flex.json +4 -9
- package/artifacts/contracts/engine/V3/forks/GenArt721CoreV3_Engine_Flex_PROOF.sol/GenArt721CoreV3_Engine_Flex_PROOF.json +4 -9
- package/artifacts/contracts/engine/V3/forks/PROHIBITION/GenArt721CoreV3_Engine_Flex_PROHIBITION.sol/GenArt721CoreV3_Engine_Flex_PROHIBITION.json +4 -9
- package/artifacts/contracts/engine-registry/CoreRegistryV1.sol/CoreRegistryV1.json +12 -12
- package/artifacts/contracts/explorations/GenArt721CoreV3_Explorations.sol/GenArt721CoreV3_Explorations.json +4 -4
- package/artifacts/contracts/interfaces/v0.8.x/ICoreRegistryV1.sol/ICoreRegistryV1.json +6 -6
- package/artifacts/contracts/interfaces/v0.8.x/IDependencyRegistryV0.sol/IDependencyRegistryV0.json +19 -0
- package/artifacts/contracts/interfaces/v0.8.x/IMinterFilterV1.sol/IMinterFilterV1.json +22 -22
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterDAExpSettlementV0.sol/ISharedMinterDAExpSettlementV0.json +8 -101
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterDAExpV0.sol/ISharedMinterDAExpV0.json +1 -57
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterDALinV0.sol/ISharedMinterDALinV0.json +1 -57
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterDAV0.sol/ISharedMinterDAV0.json +2 -21
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterHolderERC20V0.sol/ISharedMinterHolderERC20V0.json +158 -0
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterHolderV0.sol/ISharedMinterHolderV0.json +15 -90
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterMerkleV0.sol/ISharedMinterMerkleV0.json +10 -36
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterSEAV0.sol/ISharedMinterSEAV0.json +4 -236
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterSimplePurchaseV0.sol/ISharedMinterSimplePurchaseV0.json +5 -5
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterV0.sol/ISharedMinterV0.json +7 -423
- package/artifacts/contracts/interfaces/v0.8.x/ISharedRandomizerV0.sol/ISharedRandomizerV0.json +17 -17
- package/artifacts/contracts/libs/v0.8.x/ABHelpers.sol/ABHelpers.json +2 -2
- package/artifacts/contracts/libs/v0.8.x/AuthLib.sol/AuthLib.json +2 -2
- package/artifacts/contracts/libs/v0.8.x/Bytes32Strings.sol/Bytes32Strings.json +2 -2
- package/artifacts/contracts/libs/v0.8.x/minter-libs/DAExpLib.sol/DAExpLib.json +60 -3
- package/artifacts/contracts/libs/v0.8.x/minter-libs/DALib.sol/DALib.json +30 -0
- package/artifacts/contracts/libs/v0.8.x/minter-libs/DALinLib.sol/DALinLib.json +60 -3
- package/artifacts/contracts/libs/v0.8.x/minter-libs/GenericMinterEventsLib.sol/GenericMinterEventsLib.json +346 -0
- package/artifacts/contracts/libs/v0.8.x/minter-libs/MaxInvocationsLib.sol/MaxInvocationsLib.json +29 -3
- package/artifacts/contracts/libs/v0.8.x/minter-libs/MerkleLib.sol/MerkleLib.json +30 -3
- package/artifacts/contracts/libs/v0.8.x/minter-libs/PolyptychLib.sol/PolyptychLib.json +2 -2
- package/artifacts/contracts/libs/v0.8.x/minter-libs/SEALib.sol/SEALib.json +254 -3
- package/artifacts/contracts/libs/v0.8.x/minter-libs/SetPriceLib.sol/SetPriceLib.json +48 -3
- package/artifacts/contracts/libs/v0.8.x/minter-libs/SettlementExpLib.sol/SettlementExpLib.json +41 -3
- package/artifacts/contracts/libs/v0.8.x/minter-libs/SplitFundsLib.sol/SplitFundsLib.json +35 -3
- package/artifacts/contracts/libs/v0.8.x/minter-libs/TokenHolderLib.sol/TokenHolderLib.json +79 -3
- package/artifacts/contracts/minter-suite/MinterFilter/MinterFilterV1.sol/MinterFilterV1.json +2 -2
- package/artifacts/contracts/minter-suite/MinterFilter/MinterFilterV2.sol/MinterFilterV2.json +41 -41
- package/artifacts/contracts/minter-suite/Minters/MinterDAExpHolderV5.sol/MinterDAExpHolderV5.json +66 -632
- package/artifacts/contracts/minter-suite/Minters/MinterDAExpSettlementV2.sol/MinterDAExpSettlementV2.json +2 -20
- package/artifacts/contracts/minter-suite/Minters/MinterDAExpSettlementV3.sol/MinterDAExpSettlementV3.json +67 -594
- package/artifacts/contracts/minter-suite/Minters/MinterDAExpV5.sol/MinterDAExpV5.json +33 -524
- package/artifacts/contracts/minter-suite/Minters/MinterDALinHolderV5.sol/MinterDALinHolderV5.json +66 -632
- package/artifacts/contracts/minter-suite/Minters/MinterDALinV5.sol/MinterDALinV5.json +33 -524
- package/artifacts/contracts/minter-suite/Minters/MinterSEAV1.sol/MinterSEAV1.json +51 -717
- package/artifacts/contracts/minter-suite/Minters/MinterSetPriceERC20V5.sol/MinterSetPriceERC20V5.json +58 -454
- package/artifacts/contracts/minter-suite/Minters/MinterSetPriceHolderV5.sol/MinterSetPriceHolderV5.json +61 -552
- package/artifacts/contracts/minter-suite/Minters/MinterSetPriceMerkleV5.sol/MinterSetPriceMerkleV5.json +55 -497
- package/artifacts/contracts/minter-suite/Minters/MinterSetPricePolyptychERC20V5.sol/MinterSetPricePolyptychERC20V5.json +110 -571
- package/artifacts/contracts/minter-suite/Minters/MinterSetPricePolyptychV5.sol/MinterSetPricePolyptychV5.json +69 -560
- package/artifacts/contracts/minter-suite/Minters/MinterSetPriceV5.sol/MinterSetPriceV5.json +28 -444
- package/artifacts/contracts/mock/DummySharedMinter.sol/DummySharedMinter.json +2 -2
- package/artifacts/contracts/mock/GenArt721CoreV3_Engine_IncorrectCoreType.sol/GenArt721CoreV3_Engine_IncorrectCoreType.json +4 -9
- package/artifacts/contracts/mock/OriginRegisterMock.sol/OriginRegisterMock.json +2 -2
- package/artifacts/contracts/mock/ReentrancyHolderMockShared.sol/ReentrancyHolderMockShared.json +136 -0
- package/artifacts/contracts/mock/ReentrancyMerkleMockShared.sol/ReentrancyMerkleMockShared.json +105 -0
- package/artifacts/contracts/mock/ReentrancyMockShared.sol/ReentrancyMockShared.json +100 -0
- package/artifacts/contracts/mock/ReentrancySEAMockShared.sol/ReentrancySEAAutoBidderMockShared.json +69 -0
- package/artifacts/contracts/randomizer/shared/SharedRandomizerV0.sol/SharedRandomizerV0.json +19 -19
- package/contracts/DependencyRegistryV0.sol +84 -16
- package/contracts/archive/readme.md +16 -0
- package/contracts/engine/README.md +21 -0
- package/contracts/engine/V3/GenArt721CoreV3_Engine.sol +4 -10
- package/contracts/engine/V3/GenArt721CoreV3_Engine_Flex.sol +4 -10
- package/contracts/engine/V3/forks/GenArt721CoreV3_Engine_Flex_PROOF.sol +4 -10
- package/contracts/engine/V3/forks/PROHIBITION/GenArt721CoreV3_Engine_Flex_PROHIBITION.sol +4 -10
- package/contracts/engine-registry/CoreRegistryV1.sol +58 -65
- package/contracts/interfaces/v0.8.x/ICoreRegistryV1.sol +6 -8
- package/contracts/interfaces/v0.8.x/IDependencyRegistryV0.sol +3 -0
- package/contracts/interfaces/v0.8.x/IMinterFilterV1.sol +25 -25
- package/contracts/interfaces/v0.8.x/ISharedMinterDAExpSettlementV0.sol +11 -20
- package/contracts/interfaces/v0.8.x/ISharedMinterDAExpV0.sol +1 -14
- package/contracts/interfaces/v0.8.x/ISharedMinterDALinV0.sol +1 -15
- package/contracts/interfaces/v0.8.x/ISharedMinterDAV0.sol +2 -8
- package/contracts/interfaces/v0.8.x/ISharedMinterHolderERC20V0.sol +47 -0
- package/contracts/interfaces/v0.8.x/ISharedMinterHolderV0.sol +15 -43
- package/contracts/interfaces/v0.8.x/ISharedMinterMerkleV0.sol +10 -20
- package/contracts/interfaces/v0.8.x/ISharedMinterSEAV0.sol +4 -67
- package/contracts/interfaces/v0.8.x/ISharedMinterSimplePurchaseV0.sol +5 -5
- package/contracts/interfaces/v0.8.x/ISharedMinterV0.sol +7 -155
- package/contracts/interfaces/v0.8.x/ISharedRandomizerV0.sol +37 -37
- package/contracts/libs/v0.8.x/ABHelpers.sol +14 -14
- package/contracts/libs/v0.8.x/AuthLib.sol +101 -102
- package/contracts/libs/v0.8.x/Bytes32Strings.sol +5 -5
- package/contracts/libs/v0.8.x/minter-libs/DAExpLib.sol +163 -38
- package/contracts/libs/v0.8.x/minter-libs/DALib.sol +26 -0
- package/contracts/libs/v0.8.x/minter-libs/DALinLib.sol +144 -37
- package/contracts/libs/v0.8.x/minter-libs/GenericMinterEventsLib.sol +171 -0
- package/contracts/libs/v0.8.x/minter-libs/MaxInvocationsLib.sol +250 -110
- package/contracts/libs/v0.8.x/minter-libs/MerkleLib.sol +257 -48
- package/contracts/libs/v0.8.x/minter-libs/PolyptychLib.sol +138 -58
- package/contracts/libs/v0.8.x/minter-libs/SEALib.sol +778 -103
- package/contracts/libs/v0.8.x/minter-libs/SetPriceLib.sol +135 -13
- package/contracts/libs/v0.8.x/minter-libs/SettlementExpLib.sol +567 -187
- package/contracts/libs/v0.8.x/minter-libs/SplitFundsLib.sol +480 -322
- package/contracts/libs/v0.8.x/minter-libs/TokenHolderLib.sol +214 -76
- package/contracts/minter-suite/MinterFilter/MinterFilterV2.sol +347 -304
- package/contracts/minter-suite/Minters/MinterDAExpHolderV5.sol +391 -491
- package/contracts/minter-suite/Minters/MinterDAExpSettlementV2.sol +1 -54
- package/contracts/minter-suite/Minters/MinterDAExpSettlementV3.sol +388 -628
- package/contracts/minter-suite/Minters/MinterDAExpV5.sol +212 -273
- package/contracts/minter-suite/Minters/MinterDALinHolderV5.sol +393 -488
- package/contracts/minter-suite/Minters/MinterDALinV5.sol +220 -277
- package/contracts/minter-suite/Minters/MinterSEAV1.sol +327 -664
- package/contracts/minter-suite/Minters/MinterSetPriceERC20V5.sol +278 -303
- package/contracts/minter-suite/Minters/MinterSetPriceHolderV5.sol +355 -446
- package/contracts/minter-suite/Minters/MinterSetPriceMerkleV5.sol +328 -416
- package/contracts/minter-suite/Minters/MinterSetPricePolyptychERC20V5.sol +538 -622
- package/contracts/minter-suite/Minters/MinterSetPricePolyptychV5.sol +429 -553
- package/contracts/minter-suite/Minters/MinterSetPriceV5.sol +180 -227
- package/contracts/mock/GenArt721CoreV3_Engine_IncorrectCoreType.sol +3 -10
- package/contracts/mock/ReentrancyHolderMockShared.sol +59 -0
- package/contracts/mock/ReentrancyMerkleMockShared.sol +58 -0
- package/contracts/mock/ReentrancyMockShared.sol +48 -0
- package/contracts/mock/ReentrancySEAMockShared.sol +40 -0
- package/contracts/randomizer/shared/SharedRandomizerV0.sol +78 -70
- package/package.json +39 -33
|
@@ -23,7 +23,7 @@ import "./libs/v0.8.x/Bytes32Strings.sol";
|
|
|
23
23
|
* Permissions managed by ACL contract. If/when we ever call
|
|
24
24
|
* renounceOwnership() this will becom a frozen, immutable registry
|
|
25
25
|
* as no upgrades will be possible.
|
|
26
|
-
* This contract
|
|
26
|
+
* This contract is intended to be an auxiliary reference registry
|
|
27
27
|
* to our non-upgradeable and immutable ERC-721 conforming core contracts,
|
|
28
28
|
* and has been made upgradeable as we expect its required functionality in
|
|
29
29
|
* relation to the Art Blocks ecosystem to evolve over time.
|
|
@@ -46,6 +46,7 @@ contract DependencyRegistryV0 is
|
|
|
46
46
|
IAdminACLV0 public adminACLContract;
|
|
47
47
|
|
|
48
48
|
struct Dependency {
|
|
49
|
+
bytes32 licenseType;
|
|
49
50
|
string preferredCDN;
|
|
50
51
|
// mapping from additional CDN index to CDN URLr
|
|
51
52
|
mapping(uint256 => string) additionalCDNs;
|
|
@@ -60,9 +61,14 @@ contract DependencyRegistryV0 is
|
|
|
60
61
|
uint24 scriptCount;
|
|
61
62
|
}
|
|
62
63
|
|
|
64
|
+
// dependency types, i.e. "type@version"
|
|
63
65
|
EnumerableSet.Bytes32Set private _dependencyTypes;
|
|
66
|
+
// mapping from dependencyTypes to Dependency, which stores the properties of each dependency
|
|
64
67
|
mapping(bytes32 => Dependency) dependencyDetails;
|
|
68
|
+
// source code license types, MIT, GPL, etc.
|
|
69
|
+
EnumerableSet.Bytes32Set private _licenseTypes;
|
|
65
70
|
|
|
71
|
+
// set of supported core ArtBlocks contracts
|
|
66
72
|
EnumerableSet.AddressSet private _supportedCoreContracts;
|
|
67
73
|
mapping(address => mapping(uint256 => bytes32)) projectDependencyTypeOverrides;
|
|
68
74
|
|
|
@@ -103,6 +109,13 @@ contract DependencyRegistryV0 is
|
|
|
103
109
|
require(_index < _length, "Index out of range");
|
|
104
110
|
}
|
|
105
111
|
|
|
112
|
+
function _onlyExistingLicenseType(bytes32 _licenseType) internal view {
|
|
113
|
+
require(
|
|
114
|
+
_licenseTypes.contains(_licenseType),
|
|
115
|
+
"License type does not exist"
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
|
|
106
119
|
/**
|
|
107
120
|
* @notice Initializes contract.
|
|
108
121
|
* @param _adminACLContract Address of admin access control contract, to be
|
|
@@ -114,23 +127,36 @@ contract DependencyRegistryV0 is
|
|
|
114
127
|
_transferOwnership(_adminACLContract);
|
|
115
128
|
}
|
|
116
129
|
|
|
130
|
+
/**
|
|
131
|
+
* @notice Adds a new license type that can be used by dependencies.
|
|
132
|
+
*/
|
|
133
|
+
function addLicenseType(bytes32 _licenseType) external {
|
|
134
|
+
_onlyAdminACL(this.addLicenseType.selector);
|
|
135
|
+
// @dev the add function returns false if set already contains value
|
|
136
|
+
require(_licenseTypes.add(_licenseType), "License type already exists");
|
|
137
|
+
require(
|
|
138
|
+
_licenseType != bytes32(""),
|
|
139
|
+
"License type cannot be empty string"
|
|
140
|
+
);
|
|
141
|
+
emit LicenseTypeAdded(_licenseType);
|
|
142
|
+
}
|
|
143
|
+
|
|
117
144
|
/**
|
|
118
145
|
* @notice Adds a new dependency.
|
|
119
146
|
* @param _dependencyType Name of dependency type (i.e. "type@version") used to identify dependency.
|
|
147
|
+
* @param _licenseType License type for dependency, must be a registered license type.
|
|
120
148
|
* @param _preferredCDN Preferred CDN for dependency.
|
|
121
149
|
* @param _preferredRepository Preferred repository for dependency.
|
|
122
150
|
*/
|
|
123
151
|
function addDependency(
|
|
124
152
|
bytes32 _dependencyType,
|
|
153
|
+
bytes32 _licenseType,
|
|
125
154
|
string memory _preferredCDN,
|
|
126
155
|
string memory _preferredRepository,
|
|
127
156
|
string memory _referenceWebsite
|
|
128
157
|
) external {
|
|
129
158
|
_onlyAdminACL(this.addDependency.selector);
|
|
130
|
-
|
|
131
|
-
!_dependencyTypes.contains(_dependencyType),
|
|
132
|
-
"Dependency type already exists"
|
|
133
|
-
);
|
|
159
|
+
_onlyExistingLicenseType(_licenseType);
|
|
134
160
|
require(
|
|
135
161
|
_dependencyType.containsExactCharacterQty(
|
|
136
162
|
AT_CHARACTER_CODE,
|
|
@@ -138,15 +164,21 @@ contract DependencyRegistryV0 is
|
|
|
138
164
|
),
|
|
139
165
|
"must contain exactly one @"
|
|
140
166
|
);
|
|
167
|
+
require(
|
|
168
|
+
// @dev the add function returns false if set already contains value
|
|
169
|
+
_dependencyTypes.add(_dependencyType),
|
|
170
|
+
"Dependency type already exists"
|
|
171
|
+
);
|
|
141
172
|
|
|
142
|
-
_dependencyTypes.add(_dependencyType);
|
|
143
173
|
Dependency storage dependency = dependencyDetails[_dependencyType];
|
|
174
|
+
dependency.licenseType = _licenseType;
|
|
144
175
|
dependency.preferredCDN = _preferredCDN;
|
|
145
176
|
dependency.preferredRepository = _preferredRepository;
|
|
146
177
|
dependency.referenceWebsite = _referenceWebsite;
|
|
147
178
|
|
|
148
179
|
emit DependencyAdded(
|
|
149
180
|
_dependencyType,
|
|
181
|
+
_licenseType,
|
|
150
182
|
_preferredCDN,
|
|
151
183
|
_preferredRepository,
|
|
152
184
|
_referenceWebsite
|
|
@@ -525,12 +557,10 @@ contract DependencyRegistryV0 is
|
|
|
525
557
|
_onlyAdminACL(this.addSupportedCoreContract.selector);
|
|
526
558
|
_onlyNonZeroAddress(_contractAddress);
|
|
527
559
|
require(
|
|
528
|
-
|
|
560
|
+
// @dev the add function returns false if set already contains value
|
|
561
|
+
_supportedCoreContracts.add(_contractAddress),
|
|
529
562
|
"Contract already supported"
|
|
530
563
|
);
|
|
531
|
-
|
|
532
|
-
_supportedCoreContracts.add(_contractAddress);
|
|
533
|
-
|
|
534
564
|
emit SupportedCoreContractAdded(_contractAddress);
|
|
535
565
|
}
|
|
536
566
|
|
|
@@ -540,9 +570,11 @@ contract DependencyRegistryV0 is
|
|
|
540
570
|
*/
|
|
541
571
|
function removeSupportedCoreContract(address _contractAddress) external {
|
|
542
572
|
_onlyAdminACL(this.removeSupportedCoreContract.selector);
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
573
|
+
require(
|
|
574
|
+
// @dev the remove function returns false if set does not contain value
|
|
575
|
+
_supportedCoreContracts.remove(_contractAddress),
|
|
576
|
+
"Core contract already removed or not in set"
|
|
577
|
+
);
|
|
546
578
|
emit SupportedCoreContractRemoved(_contractAddress);
|
|
547
579
|
}
|
|
548
580
|
|
|
@@ -603,10 +635,8 @@ contract DependencyRegistryV0 is
|
|
|
603
635
|
* execution where there is no gas limit.
|
|
604
636
|
*/
|
|
605
637
|
function getDependencyTypes() external view returns (string[] memory) {
|
|
606
|
-
string[] memory dependencyTypes = new string[](
|
|
607
|
-
_dependencyTypes.length()
|
|
608
|
-
);
|
|
609
638
|
uint256 numDependencyTypes = _dependencyTypes.length();
|
|
639
|
+
string[] memory dependencyTypes = new string[](numDependencyTypes);
|
|
610
640
|
|
|
611
641
|
for (uint256 i = 0; i < numDependencyTypes; i++) {
|
|
612
642
|
dependencyTypes[i] = _dependencyTypes.at(i).toString();
|
|
@@ -633,11 +663,47 @@ contract DependencyRegistryV0 is
|
|
|
633
663
|
return _dependencyTypes.at(_index).toString();
|
|
634
664
|
}
|
|
635
665
|
|
|
666
|
+
/**
|
|
667
|
+
* @notice Returns number of registered license types
|
|
668
|
+
* @return Number of registered license types.
|
|
669
|
+
* @dev This is only intended to be called outside of block
|
|
670
|
+
* execution where there is no gas limit.
|
|
671
|
+
*/
|
|
672
|
+
function getLicenseTypes() external view returns (string[] memory) {
|
|
673
|
+
uint256 numLicenseTypes = _licenseTypes.length();
|
|
674
|
+
string[] memory licenseTypes = new string[](numLicenseTypes);
|
|
675
|
+
|
|
676
|
+
for (uint256 i = 0; i < numLicenseTypes; i++) {
|
|
677
|
+
licenseTypes[i] = _licenseTypes.at(i).toString();
|
|
678
|
+
}
|
|
679
|
+
return licenseTypes;
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
/**
|
|
683
|
+
* @notice Returns number of registered license types
|
|
684
|
+
* @return Number of registered license types.
|
|
685
|
+
*/
|
|
686
|
+
function getLicenseTypeCount() external view returns (uint256) {
|
|
687
|
+
return _licenseTypes.length();
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
/**
|
|
691
|
+
* @notice Returns registered license type at index `_index`.
|
|
692
|
+
* @return Registered license type at `_index`, relative to the overall length of the license type set.
|
|
693
|
+
*/
|
|
694
|
+
function getLicenseType(
|
|
695
|
+
uint256 _index
|
|
696
|
+
) external view returns (string memory) {
|
|
697
|
+
_onlyInRangeIndex({_index: _index, _length: _licenseTypes.length()});
|
|
698
|
+
return _licenseTypes.at(_index).toString();
|
|
699
|
+
}
|
|
700
|
+
|
|
636
701
|
/**
|
|
637
702
|
* @notice Returns details for a given depedency type `_dependencyType`.
|
|
638
703
|
* @param _dependencyType Name of dependency type (i.e. "type@version") used to identify dependency.
|
|
639
704
|
* @return typeAndVersion String representation of `_dependencyType`.
|
|
640
705
|
* (e.g. "p5js(atSymbol)1.0.0")
|
|
706
|
+
* @return licenseType License type for dependency
|
|
641
707
|
* @return preferredCDN Preferred CDN URL for dependency
|
|
642
708
|
* @return additionalCDNCount Count of additional CDN URLs for dependency
|
|
643
709
|
* @return preferredRepository Preferred repository URL for dependency
|
|
@@ -653,6 +719,7 @@ contract DependencyRegistryV0 is
|
|
|
653
719
|
view
|
|
654
720
|
returns (
|
|
655
721
|
string memory typeAndVersion,
|
|
722
|
+
string memory licenseType,
|
|
656
723
|
string memory preferredCDN,
|
|
657
724
|
uint24 additionalCDNCount,
|
|
658
725
|
string memory preferredRepository,
|
|
@@ -666,6 +733,7 @@ contract DependencyRegistryV0 is
|
|
|
666
733
|
|
|
667
734
|
return (
|
|
668
735
|
_dependencyType.toString(),
|
|
736
|
+
dependency.licenseType.toString(),
|
|
669
737
|
dependency.preferredCDN,
|
|
670
738
|
dependency.additionalCDNCount,
|
|
671
739
|
dependency.preferredRepository,
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
## Directory Overview
|
|
2
|
+
|
|
3
|
+
The file(s) in this directory remain under the root `/contracts/` directory, and are therefore compiled. they are no longer being actively developed, however, and should be considered deprecated. The contracts are in this directory for one or more of the following reasons:
|
|
4
|
+
|
|
5
|
+
- They must be included in our published npm package
|
|
6
|
+
- For example, the legacy Art Blocks V1 core contract's ABI created by Hardhat during compiling, must be available in the npm package
|
|
7
|
+
- They must be available for integration testing purposes
|
|
8
|
+
- For example, tests may want to ensure new minters are compatible with legacy core contracts
|
|
9
|
+
|
|
10
|
+
## Directory Structure
|
|
11
|
+
|
|
12
|
+
In general, the directory structure of this directory mimics the directory structure of the `/contracts/` directory.
|
|
13
|
+
|
|
14
|
+
## Contract modifications
|
|
15
|
+
|
|
16
|
+
All contracts in this directory should be considered deprecated, and should not be modified. The exception is that when a contract is archived, import paths must be updated to continue to allow the contract to be compiled.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
## Overview of this Directory
|
|
2
|
+
|
|
3
|
+
This directory is intended to contain all common Art Blocks Engine smart contract source code, as well as any other relevant information about contracts that are in development. That may include directories specific to each partner prior to mainnet deployments.
|
|
4
|
+
|
|
5
|
+
## Forked Engine Contracts
|
|
6
|
+
|
|
7
|
+
We welcome submission of forked versions of our engine contracts. If you would like to fork our contracts, please create a new directory in this directory with the name of your project. Please include a CHANGELOG.md file with a description the changes implemnted in the fork.
|
|
8
|
+
|
|
9
|
+
Additionally, the following requirements must be met for all forked contracts:
|
|
10
|
+
|
|
11
|
+
- The forked contracts must conform to the same interface as the original contracts.
|
|
12
|
+
- They may implement a forked interface, as long as the new interface only extends the original interface.
|
|
13
|
+
- This requirement is to ensure that our indexing and other services can continue to function as expected.
|
|
14
|
+
- Core, AdminACL, and Minter contracts may be forked
|
|
15
|
+
- We do not recommend forking the MitnerFilter contract, as it is a critical component of our indexing model that is in active development.
|
|
16
|
+
|
|
17
|
+
## Data Management Process
|
|
18
|
+
|
|
19
|
+
After a partner's contracts are deployed to mainnet and no longer in development, the contracts should be migrated to the `/posterity/engine/` directory.
|
|
20
|
+
|
|
21
|
+
Note: any deployment logs should be maintained in the `/deployments/V3/partners/<partner>/` or `/deployments/V2/<partner>/` directory.
|
|
@@ -5,7 +5,6 @@ pragma solidity 0.8.19;
|
|
|
5
5
|
|
|
6
6
|
import "../../interfaces/v0.8.x/IRandomizer_V3CoreBase.sol";
|
|
7
7
|
import "../../interfaces/v0.8.x/IAdminACLV0.sol";
|
|
8
|
-
import "../../interfaces/v0.8.x/IEngineRegistryV0.sol";
|
|
9
8
|
import "../../interfaces/v0.8.x/IGenArt721CoreContractV3_Engine.sol";
|
|
10
9
|
import "../../interfaces/v0.8.x/IGenArt721CoreContractExposesHashSeed.sol";
|
|
11
10
|
import "../../interfaces/v0.8.x/IDependencyRegistryCompatibleV0.sol";
|
|
@@ -259,7 +258,7 @@ contract GenArt721CoreV3_Engine is
|
|
|
259
258
|
bool public immutable autoApproveArtistSplitProposals;
|
|
260
259
|
|
|
261
260
|
/// version & type of this core contract
|
|
262
|
-
bytes32 constant CORE_VERSION = "v3.1.
|
|
261
|
+
bytes32 constant CORE_VERSION = "v3.1.4";
|
|
263
262
|
|
|
264
263
|
function coreVersion() external pure returns (string memory) {
|
|
265
264
|
return CORE_VERSION.toString();
|
|
@@ -366,8 +365,7 @@ contract GenArt721CoreV3_Engine is
|
|
|
366
365
|
address _randomizerContract,
|
|
367
366
|
address _adminACLContract,
|
|
368
367
|
uint248 _startingProjectId,
|
|
369
|
-
bool _autoApproveArtistSplitProposals
|
|
370
|
-
address _engineRegistryContract
|
|
368
|
+
bool _autoApproveArtistSplitProposals
|
|
371
369
|
) ERC721_PackedHashSeed(_tokenName, _tokenSymbol) {
|
|
372
370
|
_onlyNonZeroAddress(_renderProviderAddress);
|
|
373
371
|
_onlyNonZeroAddress(_platformProviderAddress);
|
|
@@ -398,12 +396,8 @@ contract GenArt721CoreV3_Engine is
|
|
|
398
396
|
// initialize next project ID
|
|
399
397
|
_nextProjectId = _startingProjectId;
|
|
400
398
|
emit PlatformUpdated(FIELD_NEXT_PROJECT_ID);
|
|
401
|
-
//
|
|
402
|
-
|
|
403
|
-
address(this),
|
|
404
|
-
CORE_VERSION,
|
|
405
|
-
CORE_TYPE
|
|
406
|
-
);
|
|
399
|
+
// @dev follow-on action: This contract does not self-register. A core
|
|
400
|
+
// registry owner must register contract in a subsequent call.
|
|
407
401
|
}
|
|
408
402
|
|
|
409
403
|
/**
|
|
@@ -5,7 +5,6 @@ pragma solidity 0.8.19;
|
|
|
5
5
|
|
|
6
6
|
import "../../interfaces/v0.8.x/IRandomizer_V3CoreBase.sol";
|
|
7
7
|
import "../../interfaces/v0.8.x/IAdminACLV0.sol";
|
|
8
|
-
import "../../interfaces/v0.8.x/IEngineRegistryV0.sol";
|
|
9
8
|
import "../../interfaces/v0.8.x/IGenArt721CoreContractV3_Engine_Flex.sol";
|
|
10
9
|
import "../../interfaces/v0.8.x/IGenArt721CoreContractExposesHashSeed.sol";
|
|
11
10
|
import "../../interfaces/v0.8.x/IDependencyRegistryCompatibleV0.sol";
|
|
@@ -271,7 +270,7 @@ contract GenArt721CoreV3_Engine_Flex is
|
|
|
271
270
|
bool public immutable autoApproveArtistSplitProposals;
|
|
272
271
|
|
|
273
272
|
/// version & type of this core contract
|
|
274
|
-
bytes32 constant CORE_VERSION = "v3.1.
|
|
273
|
+
bytes32 constant CORE_VERSION = "v3.1.4";
|
|
275
274
|
|
|
276
275
|
function coreVersion() external pure returns (string memory) {
|
|
277
276
|
return CORE_VERSION.toString();
|
|
@@ -387,8 +386,7 @@ contract GenArt721CoreV3_Engine_Flex is
|
|
|
387
386
|
address _randomizerContract,
|
|
388
387
|
address _adminACLContract,
|
|
389
388
|
uint248 _startingProjectId,
|
|
390
|
-
bool _autoApproveArtistSplitProposals
|
|
391
|
-
address _engineRegistryContract
|
|
389
|
+
bool _autoApproveArtistSplitProposals
|
|
392
390
|
) ERC721_PackedHashSeed(_tokenName, _tokenSymbol) {
|
|
393
391
|
_onlyNonZeroAddress(_renderProviderAddress);
|
|
394
392
|
_onlyNonZeroAddress(_platformProviderAddress);
|
|
@@ -419,12 +417,8 @@ contract GenArt721CoreV3_Engine_Flex is
|
|
|
419
417
|
// initialize next project ID
|
|
420
418
|
_nextProjectId = _startingProjectId;
|
|
421
419
|
emit PlatformUpdated(FIELD_NEXT_PROJECT_ID);
|
|
422
|
-
//
|
|
423
|
-
|
|
424
|
-
address(this),
|
|
425
|
-
CORE_VERSION,
|
|
426
|
-
CORE_TYPE
|
|
427
|
-
);
|
|
420
|
+
// @dev follow-on action: This contract does not self-register. A core
|
|
421
|
+
// registry owner must register contract in a subsequent call.
|
|
428
422
|
}
|
|
429
423
|
|
|
430
424
|
/**
|
|
@@ -5,7 +5,6 @@ pragma solidity 0.8.19;
|
|
|
5
5
|
|
|
6
6
|
import "../../../interfaces/v0.8.x/IRandomizerV2.sol";
|
|
7
7
|
import "../../../interfaces/v0.8.x/IAdminACLV0.sol";
|
|
8
|
-
import "../../../interfaces/v0.8.x/IEngineRegistryV0.sol";
|
|
9
8
|
import "../../../interfaces/v0.8.x/IGenArt721CoreContractV3_Engine_Flex.sol";
|
|
10
9
|
import "../../../interfaces/v0.8.x/IDependencyRegistryCompatibleV0.sol";
|
|
11
10
|
import "../../../interfaces/v0.8.x/IManifold.sol";
|
|
@@ -272,7 +271,7 @@ contract GenArt721CoreV3_Engine_Flex_PROOF is
|
|
|
272
271
|
bool public immutable autoApproveArtistSplitProposals;
|
|
273
272
|
|
|
274
273
|
/// version & type of this core contract
|
|
275
|
-
bytes32 constant CORE_VERSION = "v3.1.
|
|
274
|
+
bytes32 constant CORE_VERSION = "v3.1.6";
|
|
276
275
|
|
|
277
276
|
function coreVersion() external pure returns (string memory) {
|
|
278
277
|
return CORE_VERSION.toString();
|
|
@@ -381,8 +380,7 @@ contract GenArt721CoreV3_Engine_Flex_PROOF is
|
|
|
381
380
|
address _randomizerContract,
|
|
382
381
|
address _adminACLContract,
|
|
383
382
|
uint248 _startingProjectId,
|
|
384
|
-
bool _autoApproveArtistSplitProposals
|
|
385
|
-
address _engineRegistryContract
|
|
383
|
+
bool _autoApproveArtistSplitProposals
|
|
386
384
|
) ERC721_PackedHashSeed(_tokenName, _tokenSymbol) {
|
|
387
385
|
_onlyNonZeroAddress(_renderProviderAddress);
|
|
388
386
|
_onlyNonZeroAddress(_platformProviderAddress);
|
|
@@ -413,12 +411,8 @@ contract GenArt721CoreV3_Engine_Flex_PROOF is
|
|
|
413
411
|
// initialize next project ID
|
|
414
412
|
_nextProjectId = _startingProjectId;
|
|
415
413
|
emit PlatformUpdated(FIELD_NEXT_PROJECT_ID);
|
|
416
|
-
//
|
|
417
|
-
|
|
418
|
-
address(this),
|
|
419
|
-
CORE_VERSION,
|
|
420
|
-
CORE_TYPE
|
|
421
|
-
);
|
|
414
|
+
// @dev follow-on action: This contract does not self-register. A core
|
|
415
|
+
// registry owner must register contract in a subsequent call.
|
|
422
416
|
}
|
|
423
417
|
|
|
424
418
|
/**
|
|
@@ -7,7 +7,6 @@ import "./interfaces/IAdminACLV0_PROHIBITION.sol";
|
|
|
7
7
|
import "./interfaces/IGenArt721CoreContractV3_Engine_Flex_PROHIBITION.sol";
|
|
8
8
|
|
|
9
9
|
import "../../../../interfaces/v0.8.x/IRandomizerV2.sol";
|
|
10
|
-
import "../../../../interfaces/v0.8.x/IEngineRegistryV0.sol";
|
|
11
10
|
import "../../../../interfaces/v0.8.x/IDependencyRegistryCompatibleV0.sol";
|
|
12
11
|
import "../../../../interfaces/v0.8.x/IManifold.sol";
|
|
13
12
|
|
|
@@ -271,7 +270,7 @@ contract GenArt721CoreV3_Engine_Flex_PROHIBITION is
|
|
|
271
270
|
bool public immutable autoApproveArtistSplitProposals;
|
|
272
271
|
|
|
273
272
|
/// version & type of this core contract
|
|
274
|
-
bytes32 constant CORE_VERSION = "v3.1.
|
|
273
|
+
bytes32 constant CORE_VERSION = "v3.1.5";
|
|
275
274
|
|
|
276
275
|
function coreVersion() external pure returns (string memory) {
|
|
277
276
|
return CORE_VERSION.toString();
|
|
@@ -392,8 +391,7 @@ contract GenArt721CoreV3_Engine_Flex_PROHIBITION is
|
|
|
392
391
|
address _randomizerContract,
|
|
393
392
|
address _adminACLContract,
|
|
394
393
|
uint248 _startingProjectId,
|
|
395
|
-
bool _autoApproveArtistSplitProposals
|
|
396
|
-
address _engineRegistryContract
|
|
394
|
+
bool _autoApproveArtistSplitProposals
|
|
397
395
|
) ERC721_PackedHashSeed(_tokenName, _tokenSymbol) {
|
|
398
396
|
_onlyNonZeroAddress(_renderProviderAddress);
|
|
399
397
|
_onlyNonZeroAddress(_platformProviderAddress);
|
|
@@ -424,12 +422,8 @@ contract GenArt721CoreV3_Engine_Flex_PROHIBITION is
|
|
|
424
422
|
// initialize next project ID
|
|
425
423
|
_nextProjectId = _startingProjectId;
|
|
426
424
|
emit PlatformUpdated(FIELD_NEXT_PROJECT_ID);
|
|
427
|
-
//
|
|
428
|
-
|
|
429
|
-
address(this),
|
|
430
|
-
CORE_VERSION,
|
|
431
|
-
CORE_TYPE
|
|
432
|
-
);
|
|
425
|
+
// @dev follow-on action: This contract does not self-register. A core
|
|
426
|
+
// registry owner must register contract in a subsequent call.
|
|
433
427
|
}
|
|
434
428
|
|
|
435
429
|
/**
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
|
|
3
|
+
// @dev fixed to specific solidity version for clarity and for more clear
|
|
4
|
+
// source code verification purposes.
|
|
3
5
|
pragma solidity 0.8.19;
|
|
4
6
|
|
|
5
|
-
import "../interfaces/v0.8.x/ICoreRegistryV1.sol";
|
|
6
|
-
|
|
7
|
-
import "@openzeppelin-4.7/contracts/
|
|
7
|
+
import {ICoreRegistryV1} from "../interfaces/v0.8.x/ICoreRegistryV1.sol";
|
|
8
|
+
|
|
9
|
+
import {Ownable} from "@openzeppelin-4.7/contracts/access/Ownable.sol";
|
|
10
|
+
import {EnumerableSet} from "@openzeppelin-4.7/contracts/utils/structs/EnumerableSet.sol";
|
|
8
11
|
|
|
9
12
|
/**
|
|
10
13
|
* @title Art Blocks Core Contract Registry, V1.
|
|
@@ -57,20 +60,11 @@ contract CoreRegistryV1 is Ownable, ICoreRegistryV1 {
|
|
|
57
60
|
using EnumerableSet for EnumerableSet.AddressSet;
|
|
58
61
|
|
|
59
62
|
/// private enumerable set of registered contracts
|
|
60
|
-
EnumerableSet.AddressSet private
|
|
63
|
+
EnumerableSet.AddressSet private _registeredContracts;
|
|
61
64
|
|
|
62
65
|
/// private mapping of registered contract addresses to
|
|
63
66
|
EnumerableSet.AddressSet
|
|
64
|
-
private
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* @notice Reverts if `tx.origin` is not the owner.
|
|
68
|
-
* @dev Warning that this check is only against tx.origin, which may be
|
|
69
|
-
* misleading when used for security.
|
|
70
|
-
*/
|
|
71
|
-
function _onlyOwnerOrigin() internal view {
|
|
72
|
-
require(tx.origin == owner(), "Only tx origin of owner");
|
|
73
|
-
}
|
|
67
|
+
private _registeredMinterFilterV2CompatibleContracts;
|
|
74
68
|
|
|
75
69
|
constructor() Ownable() {}
|
|
76
70
|
|
|
@@ -82,24 +76,19 @@ contract CoreRegistryV1 is Ownable, ICoreRegistryV1 {
|
|
|
82
76
|
* registered.
|
|
83
77
|
*/
|
|
84
78
|
function registerContract(
|
|
85
|
-
address
|
|
86
|
-
bytes32
|
|
87
|
-
bytes32
|
|
79
|
+
address contractAddress,
|
|
80
|
+
bytes32 coreVersion,
|
|
81
|
+
bytes32 coreType
|
|
88
82
|
) external {
|
|
89
83
|
// CHECKS
|
|
90
|
-
//
|
|
91
|
-
|
|
92
|
-
// fashion at the time of contract deployment of `_contractAddress`.
|
|
93
|
-
// @dev Security implications of using `tx.origin` are acknowledged
|
|
94
|
-
_onlyOwnerOrigin();
|
|
95
|
-
// only allow registration of a contract registering itself, or allow
|
|
96
|
-
// the owner to register any contract.
|
|
97
|
-
require(
|
|
98
|
-
msg.sender == _contractAddress || msg.sender == owner(),
|
|
99
|
-
"Only owner or registrant"
|
|
100
|
-
);
|
|
84
|
+
// revert if not called by owner
|
|
85
|
+
Ownable._checkOwner();
|
|
101
86
|
// EFFECTS
|
|
102
|
-
_registerContract(
|
|
87
|
+
_registerContract({
|
|
88
|
+
contractAddress: contractAddress,
|
|
89
|
+
coreVersion: coreVersion,
|
|
90
|
+
coreType: coreType
|
|
91
|
+
});
|
|
103
92
|
}
|
|
104
93
|
|
|
105
94
|
/**
|
|
@@ -108,12 +97,12 @@ contract CoreRegistryV1 is Ownable, ICoreRegistryV1 {
|
|
|
108
97
|
* Reverts if authorization fails, or if the contract is not already
|
|
109
98
|
* registered.
|
|
110
99
|
*/
|
|
111
|
-
function unregisterContract(address
|
|
100
|
+
function unregisterContract(address contractAddress) external {
|
|
112
101
|
// CHECKS
|
|
113
102
|
// revert if not called by owner
|
|
114
103
|
Ownable._checkOwner();
|
|
115
104
|
// EFFECTS
|
|
116
|
-
_unregisterContract(
|
|
105
|
+
_unregisterContract(contractAddress);
|
|
117
106
|
}
|
|
118
107
|
|
|
119
108
|
/**
|
|
@@ -122,32 +111,32 @@ contract CoreRegistryV1 is Ownable, ICoreRegistryV1 {
|
|
|
122
111
|
* Reverts if any contract is already registered.
|
|
123
112
|
* @dev This should primarily be used for backfilling the registry with
|
|
124
113
|
* existing contracts shortly after deployment.
|
|
125
|
-
* @param
|
|
126
|
-
* @param
|
|
127
|
-
* @param
|
|
114
|
+
* @param contractAddresses Array of contract addresses to register.
|
|
115
|
+
* @param coreVersions Array of core versions for each contract (aligned).
|
|
116
|
+
* @param coreTypes Array of core types for each contract (aligned).
|
|
128
117
|
*/
|
|
129
118
|
function registerContracts(
|
|
130
|
-
address[] calldata
|
|
131
|
-
bytes32[] calldata
|
|
132
|
-
bytes32[] calldata
|
|
119
|
+
address[] calldata contractAddresses,
|
|
120
|
+
bytes32[] calldata coreVersions,
|
|
121
|
+
bytes32[] calldata coreTypes
|
|
133
122
|
) external {
|
|
134
123
|
// CHECKS
|
|
135
124
|
// revert if not called by owner
|
|
136
125
|
Ownable._checkOwner();
|
|
137
126
|
// validate same length arrays
|
|
138
|
-
uint256 numContracts =
|
|
127
|
+
uint256 numContracts = contractAddresses.length;
|
|
139
128
|
require(
|
|
140
|
-
numContracts ==
|
|
141
|
-
numContracts ==
|
|
129
|
+
numContracts == coreVersions.length &&
|
|
130
|
+
numContracts == coreTypes.length,
|
|
142
131
|
"Mismatched array lengths"
|
|
143
132
|
);
|
|
144
133
|
// EFFECTS
|
|
145
134
|
for (uint256 i = 0; i < numContracts; ) {
|
|
146
|
-
_registerContract(
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
);
|
|
135
|
+
_registerContract({
|
|
136
|
+
contractAddress: contractAddresses[i],
|
|
137
|
+
coreVersion: coreVersions[i],
|
|
138
|
+
coreType: coreTypes[i]
|
|
139
|
+
});
|
|
151
140
|
unchecked {
|
|
152
141
|
++i;
|
|
153
142
|
}
|
|
@@ -158,18 +147,18 @@ contract CoreRegistryV1 is Ownable, ICoreRegistryV1 {
|
|
|
158
147
|
* @notice Unregister multiple contracts at once.
|
|
159
148
|
* Only callable by the owner.
|
|
160
149
|
* Reverts if any contract is not already registered.
|
|
161
|
-
* @param
|
|
150
|
+
* @param contractAddresses Array of contract addresses to unregister.
|
|
162
151
|
*/
|
|
163
152
|
function unregisterContracts(
|
|
164
|
-
address[] calldata
|
|
153
|
+
address[] calldata contractAddresses
|
|
165
154
|
) external {
|
|
166
155
|
// CHECKS
|
|
167
156
|
// revert if not called by owner
|
|
168
157
|
Ownable._checkOwner();
|
|
169
158
|
// EFFECTS
|
|
170
|
-
uint256 numContracts =
|
|
159
|
+
uint256 numContracts = contractAddresses.length;
|
|
171
160
|
for (uint256 i = 0; i < numContracts; ) {
|
|
172
|
-
_unregisterContract(
|
|
161
|
+
_unregisterContract(contractAddresses[i]);
|
|
173
162
|
unchecked {
|
|
174
163
|
++i;
|
|
175
164
|
}
|
|
@@ -181,18 +170,18 @@ contract CoreRegistryV1 is Ownable, ICoreRegistryV1 {
|
|
|
181
170
|
* @return The number of registered contracts.
|
|
182
171
|
*/
|
|
183
172
|
function getNumRegisteredContracts() external view returns (uint256) {
|
|
184
|
-
return
|
|
173
|
+
return _registeredContracts.length();
|
|
185
174
|
}
|
|
186
175
|
|
|
187
176
|
/**
|
|
188
177
|
* @notice Get the address of a registered contract by index.
|
|
189
|
-
* @param
|
|
178
|
+
* @param index The index of the contract to get.
|
|
190
179
|
* @return The address of the contract at the given index.
|
|
191
180
|
*/
|
|
192
181
|
function getRegisteredContractAt(
|
|
193
|
-
uint256
|
|
182
|
+
uint256 index
|
|
194
183
|
) external view returns (address) {
|
|
195
|
-
return
|
|
184
|
+
return _registeredContracts.at(index);
|
|
196
185
|
}
|
|
197
186
|
|
|
198
187
|
/**
|
|
@@ -207,19 +196,19 @@ contract CoreRegistryV1 is Ownable, ICoreRegistryV1 {
|
|
|
207
196
|
view
|
|
208
197
|
returns (address[] memory)
|
|
209
198
|
{
|
|
210
|
-
return
|
|
199
|
+
return _registeredContracts.values();
|
|
211
200
|
}
|
|
212
201
|
|
|
213
202
|
/**
|
|
214
203
|
* @notice Returns boolean representing if contract is registered on this
|
|
215
204
|
* registry.
|
|
216
|
-
* @param
|
|
205
|
+
* @param contractAddress The address of the contract to check.
|
|
217
206
|
* @return isRegistered True if the contract is registered.
|
|
218
207
|
*/
|
|
219
208
|
function isRegisteredContract(
|
|
220
|
-
address
|
|
209
|
+
address contractAddress
|
|
221
210
|
) external view returns (bool isRegistered) {
|
|
222
|
-
return
|
|
211
|
+
return _registeredContracts.contains(contractAddress);
|
|
223
212
|
}
|
|
224
213
|
|
|
225
214
|
/**
|
|
@@ -227,28 +216,32 @@ contract CoreRegistryV1 is Ownable, ICoreRegistryV1 {
|
|
|
227
216
|
* Reverts if the contract is already registered.
|
|
228
217
|
*/
|
|
229
218
|
function _registerContract(
|
|
230
|
-
address
|
|
231
|
-
bytes32
|
|
232
|
-
bytes32
|
|
219
|
+
address contractAddress,
|
|
220
|
+
bytes32 coreVersion,
|
|
221
|
+
bytes32 coreType
|
|
233
222
|
) internal {
|
|
234
223
|
// @dev add returns true only if not already registered
|
|
235
224
|
require(
|
|
236
|
-
|
|
225
|
+
_registeredContracts.add(contractAddress),
|
|
237
226
|
"Contract already registered"
|
|
238
227
|
);
|
|
239
|
-
emit ContractRegistered(
|
|
228
|
+
emit ContractRegistered({
|
|
229
|
+
_contractAddress: contractAddress,
|
|
230
|
+
_coreVersion: coreVersion,
|
|
231
|
+
_coreType: coreType
|
|
232
|
+
});
|
|
240
233
|
}
|
|
241
234
|
|
|
242
235
|
/**
|
|
243
236
|
* @notice Internal function to unregister a contract.
|
|
244
237
|
* Reverts if the contract is not already registered.
|
|
245
238
|
*/
|
|
246
|
-
function _unregisterContract(address
|
|
239
|
+
function _unregisterContract(address contractAddress) internal {
|
|
247
240
|
// @dev remove returns true only if already in set
|
|
248
241
|
require(
|
|
249
|
-
|
|
242
|
+
_registeredContracts.remove(contractAddress),
|
|
250
243
|
"Only registered contracts"
|
|
251
244
|
);
|
|
252
|
-
emit ContractUnregistered(_contractAddress);
|
|
245
|
+
emit ContractUnregistered({_contractAddress: contractAddress});
|
|
253
246
|
}
|
|
254
247
|
}
|