Skip to content

Commit

Permalink
deployments
Browse files Browse the repository at this point in the history
  • Loading branch information
ACC01ADE committed Jul 7, 2023
1 parent cfe1f68 commit 17928d0
Show file tree
Hide file tree
Showing 14 changed files with 2,460 additions and 86 deletions.
11 changes: 11 additions & 0 deletions contracts/HolographFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ import "./struct/BridgeSettings.sol";
import "./struct/DeploymentConfig.sol";
import "./struct/Verification.sol";

import "./library/Strings.sol";

/**
* @title Holograph Factory
* @author https://github.com/holographxyz
Expand Down Expand Up @@ -372,6 +374,15 @@ contract HolographFactory is Admin, Initializable, Holographable, HolographFacto
*/
return (signer != address(0) &&
(ecrecover(keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)), v, r, s) == signer ||
(
ecrecover(
keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n66", Strings.toHexString(uint256(hash), 32))),
v,
r,
s
)
) ==
signer ||
ecrecover(hash, v, r, s) == signer));
}

Expand Down
50 changes: 34 additions & 16 deletions contracts/drops/token/HolographDropERC721.sol
Original file line number Diff line number Diff line change
Expand Up @@ -284,10 +284,20 @@ contract HolographDropERC721 is NonReentrant, ERC721H, IHolographDropERC721 {
// this is a default filter that can be used for OS royalty filtering
// marketFilterAddress = 0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6;
// we just register to OS royalties and let OS handle it for us with their default filter contract
openseaOperatorFilterRegistry.register(address(this));
HolographERC721Interface(holographer()).sourceExternalCall(
address(openseaOperatorFilterRegistry),
abi.encodeWithSelector(IOperatorFilterRegistry.register.selector, holographer())
);
} else {
// allow user to specify custom filtering contract address
openseaOperatorFilterRegistry.registerAndSubscribe(address(this), marketFilterAddress);
HolographERC721Interface(holographer()).sourceExternalCall(
address(openseaOperatorFilterRegistry),
abi.encodeWithSelector(
IOperatorFilterRegistry.registerAndSubscribe.selector,
holographer(),
marketFilterAddress
)
);
}
assembly {
sstore(_osRegistryEnabledSlot, true)
Expand Down Expand Up @@ -581,36 +591,44 @@ contract HolographDropERC721 is NonReentrant, ERC721H, IHolographDropERC721 {
* @notice Requires admin permissions
* @param args Calldata args to pass to the registry
*/
function updateMarketFilterSettings(bytes calldata args) external onlyOwner returns (bytes memory) {
(bool success, bytes memory ret) = address(openseaOperatorFilterRegistry).call(args);
if (!success) {
revert RemoteOperatorFilterRegistryCallFailed();
}
bool osRegistryEnabled = openseaOperatorFilterRegistry.isRegistered(address(this));
function updateMarketFilterSettings(bytes calldata args) external onlyOwner {
HolographERC721Interface(holographer()).sourceExternalCall(address(openseaOperatorFilterRegistry), args);
bool osRegistryEnabled = openseaOperatorFilterRegistry.isRegistered(holographer());
assembly {
sstore(_osRegistryEnabledSlot, osRegistryEnabled)
}
return ret;
}

/**
* @notice Manage subscription for marketplace filtering based off royalty payouts.
* @param enable Enable filtering to non-royalty payout marketplaces
*/
function manageMarketFilterSubscription(bool enable) external onlyOwner {
address self = address(this);
address self = holographer();
if (marketFilterAddress == address(0)) {
revert MarketFilterAddressNotSupportedForChain();
}
if (!openseaOperatorFilterRegistry.isRegistered(self) && enable) {
openseaOperatorFilterRegistry.registerAndSubscribe(self, marketFilterAddress);
HolographERC721Interface(self).sourceExternalCall(
address(openseaOperatorFilterRegistry),
abi.encodeWithSelector(IOperatorFilterRegistry.registerAndSubscribe.selector, self, marketFilterAddress)
);
} else if (enable) {
openseaOperatorFilterRegistry.subscribe(self, marketFilterAddress);
HolographERC721Interface(self).sourceExternalCall(
address(openseaOperatorFilterRegistry),
abi.encodeWithSelector(IOperatorFilterRegistry.subscribe.selector, self, marketFilterAddress)
);
} else {
openseaOperatorFilterRegistry.unsubscribe(self, false);
openseaOperatorFilterRegistry.unregister(self);
}
bool osRegistryEnabled = openseaOperatorFilterRegistry.isRegistered(address(this));
HolographERC721Interface(self).sourceExternalCall(
address(openseaOperatorFilterRegistry),
abi.encodeWithSelector(IOperatorFilterRegistry.unsubscribe.selector, self, false)
);
HolographERC721Interface(self).sourceExternalCall(
address(openseaOperatorFilterRegistry),
abi.encodeWithSelector(IOperatorFilterRegistry.unregister.selector, self)
);
}
bool osRegistryEnabled = openseaOperatorFilterRegistry.isRegistered(self);
assembly {
sstore(_osRegistryEnabledSlot, osRegistryEnabled)
}
Expand Down
24 changes: 12 additions & 12 deletions deployments/develop/arbitrumTestnetGoerli/HolographFactory.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions deployments/develop/avalancheTestnet/HolographFactory.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions deployments/develop/ethereumTestnetGoerli/HolographFactory.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions deployments/develop/optimismTestnetGoerli/HolographFactory.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

42 changes: 21 additions & 21 deletions deployments/develop/polygonTestnet/HolographFactory.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,7 @@ const config: HardhatUserConfig = {
arbitrumOne: process.env.ARBISCAN_API_KEY || '',
arbitrumGoerli: process.env.ARBISCAN_API_KEY || '',
arbitrumNova: process.env.ARBISCAN_NOVA_API_KEY || '',
mantleTestnet: 'NO-API' || process.env.MANTLE_API_KEY,
},
customChains: [
{
Expand All @@ -409,6 +410,14 @@ const config: HardhatUserConfig = {
browserURL: 'https://nova.arbiscan.io',
},
},
{
network: 'mantleTestnet',
chainId: 5001,
urls: {
apiURL: 'https://explorer.testnet.mantle.xyz/api',
browserURL: 'https://explorer.testnet.mantle.xyz',
},
},
],
},
hardhatHolographContractBuilder: {
Expand Down
11 changes: 11 additions & 0 deletions src/HolographFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import "./struct/BridgeSettings.sol";
import "./struct/DeploymentConfig.sol";
import "./struct/Verification.sol";

import "./library/Strings.sol";

/**
* @title Holograph Factory
* @author https://github.com/holographxyz
Expand Down Expand Up @@ -273,6 +275,15 @@ contract HolographFactory is Admin, Initializable, Holographable, HolographFacto
*/
return (signer != address(0) &&
(ecrecover(keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)), v, r, s) == signer ||
(
ecrecover(
keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n66", Strings.toHexString(uint256(hash), 32))),
v,
r,
s
)
) ==
signer ||
ecrecover(hash, v, r, s) == signer));
}

Expand Down

0 comments on commit 17928d0

Please sign in to comment.