Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature/zksync 2 #109

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,7 @@ wiki/

generate-vanity.sh

.parcel-cache/
dist/


3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "lib/forge-std"]
path = lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "lib/solidity-examples"]
path = lib/solidity-examples
url = https://github.com/LayerZero-Labs/solidity-examples
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,29 @@ Then, to test your code:
npx hardhat test
```

### ZkSync

1. Setup env variable ZKSYNC=true when you compile

```bash
ZKSYNC=true hh compile
```

2. Deploy contracts

```bash
hh deploy-zksync --network zksync|zksyncEra
```

#### Gas Costs?

```
gasUsed * maxFeePerGas + pubdata * gasPerPubdata * gasPriceL1
(developer) (zksync load) (developer) (operator) (l1 load)
```

Also see `results.md` for more details.

### Checking different versions of ERC721CommunityImplementation:

```bash
Expand Down
23 changes: 2 additions & 21 deletions contracts/Artgene721Implementation.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import "./interfaces/IRenderer.sol";
import "./interfaces/IArtgene721.sol";
import "./interfaces/IArtgenePlatform.sol";
import "./utils/OpenseaProxy.sol";
import "./utils/operator-filterer/upgradable/DefaultOperatorFiltererUpgradeable.sol";

/**
* @title contract by artgene.xyz
Expand Down Expand Up @@ -88,7 +87,6 @@ contract Artgene721Implementation is
ERC721ABurnableUpgradeable,
ReentrancyGuardUpgradeable,
OwnableUpgradeable,
DefaultOperatorFiltererUpgradeable,
IArtgene721Implementation,
IArtgene721 // implements IERC2981, IERC4906
{
Expand Down Expand Up @@ -192,7 +190,6 @@ contract Artgene721Implementation is

maxPerMint = MAX_PER_MINT_LIMIT;
isOpenSeaProxyActive = true;
isOpenSeaTransferFilterEnabled = true;

// test if platform is deployed
require(
Expand All @@ -208,7 +205,6 @@ contract Artgene721Implementation is
__ERC721ABurnable_init();
__ReentrancyGuard_init();
__Ownable_init();
__DefaultOperatorFilterer_init();

_configure(
_config.publicPrice,
Expand Down Expand Up @@ -271,11 +267,9 @@ contract Artgene721Implementation is
// so the real initializer is the only initializer
/// @custom:oz-upgrades-unsafe-allow constructor
constructor() initializer {
// NB: this is run only once per implementation, when it's deployed
// NB: this is NOT run when deploying Proxy
require(
address(this) == ARTGENE_PROXY_IMPLEMENTATION,
"Only deployable to vanity address"
ARTGENE_PLATFORM_ADDRESS.code.length == 0,
"Artgene Platform is not deployed, revert"
);
}

Expand Down Expand Up @@ -333,10 +327,6 @@ contract Artgene721Implementation is

// ----- Admin functions -----

function toggleOpenSeaTransferFilter() public onlyOwner {
isOpenSeaTransferFilterEnabled = !isOpenSeaTransferFilterEnabled;
}

function setBaseURI(string calldata uri) public onlyOwner {
baseURI = uri;

Expand Down Expand Up @@ -738,15 +728,6 @@ contract Artgene721Implementation is

// -------- ERC721 overrides --------

function _beforeTokenTransfers(
address from,
address to,
uint256 startId,
uint256 quantity
) internal override onlyAllowedOperator(from) {
super._beforeTokenTransfers(from, to, startId, quantity);
}

function supportsInterface(
bytes4 interfaceId
)
Expand Down
6 changes: 0 additions & 6 deletions contracts/ArtgenePlatform.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/StorageSlot.sol";

import "./interfaces/IArtgenePlatform.sol";

Expand All @@ -11,11 +10,6 @@ contract ArtgenePlatform is Ownable, IArtgenePlatform {
address payable platformAddress;

constructor() {
require(
ARTGENE_PLATFORM_ADDRESS == address(this),
"ArtgenePlatformConfig: platform address mismatch"
);

platformFee = 500;
platformAddress = payable(0x3087c429ed4e7e5Cec78D006fCC772ceeaa67f00);
}
Expand Down
13 changes: 7 additions & 6 deletions contracts/DemoCollection.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
pragma solidity ^0.8.0;

import "./Artgene721.sol";
import "./Artgene721Base.sol";

// Want to launch your own collection?
// Check out https://buildship.xyz
Expand All @@ -27,15 +28,15 @@ import "./Artgene721.sol";
// ;c;,,,,' lx;
// ''' cc
// ,'
contract DemoCollection is Artgene721 {
contract DemoCollection is Artgene721Base {
constructor()
Artgene721(
Artgene721Base(
"Generative Endless NFT",
"GEN",
ARTGENE_MAX_SUPPLY_OPEN_EDITION,
1,
START_FROM_ONE,
"ipfs://QmABABABABABABABABABABABABABA/",
false,
"https://metadata.artgene.xyz/api/g/goerli/midline/",
// optionally, use defaultConfig()
MintConfig(
0.1 ether, // public price
Expand All @@ -44,8 +45,8 @@ contract DemoCollection is Artgene721 {
500, // basis points royalty fee
msg.sender, // payout receiver
false, // should lock payout receiver
0, // startTimestamp
0 // endTimestamp
1684290476, // startTimestamp
1684390476 // endTimestamp
)
)
{}
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/IArtgene721.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;

address constant ARTGENE_PROXY_IMPLEMENTATION = 0x00000721bEb748401E0390Bb1c635131cDe1Fae8;
address constant ARTGENE_PROXY_IMPLEMENTATION = 0x8A13A3ea74aC471dF04a1A04666059EF8F6e6be9;

uint256 constant ARTGENE_MAX_SUPPLY_OPEN_EDITION = 0;

Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/IArtgenePlatform.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

address constant ARTGENE_PLATFORM_ADDRESS = 0xAaaeEee77ED0D0ffCc2813333b796E367f1E12d9;
address constant ARTGENE_PLATFORM_ADDRESS = 0x983A23615aC3ECdeBe7d1438251403d57956Ccba;

interface IArtgenePlatform {
function getPlatformFee() external view returns (uint256);
Expand Down
Loading