Skip to content

Commit 099dc7b

Browse files
committed
update again
1 parent 8cc4d9f commit 099dc7b

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

packages/hyperverse-evm-whitelist/contracts/WhitelistFactory.sol

+13-11
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,6 @@ contract WhitelistFactory is CloneFactory {
6565
_;
6666
}
6767

68-
modifier checkInstance(address _tenant) {
69-
if (!instance[_tenant]) {
70-
revert InstanceDoesNotExist();
71-
}
72-
_;
73-
}
74-
75-
7668
constructor(address _masterContract, address _owner) {
7769
masterContract = _masterContract;
7870
owner = _owner;
@@ -88,8 +80,15 @@ contract WhitelistFactory is CloneFactory {
8880
address _ERC721,
8981
address _ERC20,
9082
bytes32 _merkleRoot
91-
) external isAuthorized(_tenant) hasAnInstance(_tenant){
92-
if (_startTime == 0 && _endTime == 0 && _units == 0 && _ERC721 == address(0) && _ERC20 == address(0) && _merkleRoot == bytes32(0)) {
83+
) external isAuthorized(_tenant) hasAnInstance(_tenant) {
84+
if (
85+
_startTime == 0 &&
86+
_endTime == 0 &&
87+
_units == 0 &&
88+
_ERC721 == address(0) &&
89+
_ERC20 == address(0) &&
90+
_merkleRoot == bytes32(0)
91+
) {
9392
revert InvalidValuesToCreateInstance();
9493
}
9594

@@ -128,8 +127,11 @@ contract WhitelistFactory is CloneFactory {
128127
emit TenantCreated(_tenant, address(proxy));
129128
}
130129

131-
132130
function getProxy(address _tenant) public view checkInstance(_tenant) returns (Whitelist) {
131+
if (instance[_tenant]) {
132+
revert InstanceAlreadyInitialized();
133+
}
134+
_;
133135
return tenants[_tenant].proxy;
134136
}
135137
}

0 commit comments

Comments
 (0)