Skip to content

Commit

Permalink
Premint (#161)
Browse files Browse the repository at this point in the history
* Premint

* Add back mint fee getter (#198)

* add back mint fee getter

* add mint fee to interface

* * Updated script to deploy preminter to now deploy the proxy (#189)

* Extracted common deployment tasks to reusable helper functions
* Added script to upgrade preminter

* Premint - move premint state to its own contract (#188)

Renamed Premint folder to delegated mint

* fix: redeem minter tests

* fix: token transfer hook for single token transfers

* feat: add unit tests

* Seperate upgrade gate new contract (#204)

* wip

* wip

* fix tests

* chore: run lint & update natspec

* update storage layout

---------

Co-authored-by: Rohan Kulkarni <[email protected]>

* refactor: add helper to read uups implementation

* fix: param name casing

* refactor: use updated zora 1155 impl getter

* refactor: add helper to read uups implementation

* fix: zora 1155 impl var name

* chore: run lint

* chore: run lint

* refactor: implement first minter reward on adminMint

* chore: update runs

* refactor: remove mint fee amount deploy param

* chore: run lint

* chore: run lint

* chore: remove mint fee amount from chain configs

* chore: update fork test

* fix: use mint w rewards to gurantee mint fee amount

* Premint: updated documentation (#199)

Premint - update documentation

* move upgrade gate to initializer pattern (#209)

* move upgrade gate to initalizer pattern

* formatting

* refactor: only mint if specified quantity is greater than 0 (#212)

* refactor: only mint if specified quantity is greater than 0

* fix tests

---------

Co-authored-by: Dan Oved <[email protected]>

* Premint - factory proxy 777 deployments (#191)

* Can mine for a determinstic address for the proxy shim in a script, and have a test that shows we can determinstically deploy proxy to that address with that salt and deployer account

* wip on deploy via script. nneed to create web ui

* cleanup

* update test to work with new params :)

* deployment works now!. lets genericize stuff :)

* consolidated into one

* end to end scripting works :)

* renamed and refactored to be more usable

* Determinstic deployer scripts are more generic and can deploy and verify :)

* rename

* another rename :)

* Premint proxy deploy (#211)

* made premint executor ugparde scripts.  renamed executor to proxy

* deploy preminter impl with script, and updated the config for that chain

* Have premint proxy deploy scripts.  can deploy both now

* preminter proxy pushed

* Refactor deterministic add upgrade gate (#210)

* large refactor

* update scripts

* updates to test code

* test naming updates

* compiler run correctly

* update with new deterministic configs

* make node deps only for scripts

* Premint deploy determinstic fix tests (#213)

* fixed tests by just making it more dyanmic

* fix stack too deep error for coverage

* ignore deployment folder for coverage

* properly filter out deployment

---------

Co-authored-by: Iain Nash <[email protected]>

* update deps

* add back release command

* fix version publish

* fix contract version

* move wagmi cli to proper version

* more things in dev deps

* move all into deps

* update protocol rewards package (#226)

* fix build

* fix wagmi build

* Clean Up Transfer Hook Mock (#229)

* fix: remove unused param names

* fix: linting

---------

Co-authored-by: Rohan Kulkarni <[email protected]>
Co-authored-by: Rohan Kulkarni <[email protected]>
Co-authored-by: Isabella Smallcombe <[email protected]>
Co-authored-by: Iain Nash <[email protected]>
Co-authored-by: Isabella Smallcombe <[email protected]>
  • Loading branch information
6 people authored Sep 29, 2023
1 parent 835269d commit 399b8e6
Show file tree
Hide file tree
Showing 102 changed files with 5,169 additions and 1,136 deletions.
5 changes: 5 additions & 0 deletions .changeset/curly-dolphins-sneeze.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@zoralabs/zora-1155-contracts": patch
---

Add back `mintFee` getter
5 changes: 5 additions & 0 deletions .changeset/happy-socks-melt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@zoralabs/zora-1155-contracts": minor
---

Adds first minter rewards to zora 1155 contracts.
5 changes: 5 additions & 0 deletions .changeset/long-avocados-visit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@zoralabs/zora-1155-contracts": minor
---

Added deterministic contract creation from the Zora1155 factory
5 changes: 5 additions & 0 deletions .changeset/popular-cows-grin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@zoralabs/zora-1155-contracts": patch
---

Move delegated token creation state to its own contract
5 changes: 5 additions & 0 deletions .changeset/spotty-horses-battle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@zoralabs/zora-1155-contracts": patch
---

Deprecate ZoraCreatorRedeemMinterStrategy at v1.0.1, a newer version will soon be released
5 changes: 5 additions & 0 deletions .changeset/twelve-comics-sniff.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@zoralabs/zora-1155-contracts": minor
---

Added the PremintExecutor contract, and updated erc1155 to support delegated minting
2 changes: 2 additions & 0 deletions .env.anvil
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FORK_RPC_URL="https://testnet.rpc.zora.co/"
FORK_BLOCK_NUMBER=916572
9 changes: 8 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
ALCHEMY_KEY={{ mainnet_rpc_url }}
ALCHEMY_KEY=

# Turnkey authentication and private key information
TURNKEY_API_PUBLIC_KEY=""
TURNKEY_API_PRIVATE_KEY=""
TURNKEY_ORGANIZATION_ID=""
TURNKEY_PRIVATE_KEY_ID="xxxx-xxx-xxxx-xxxx-xxxxxxxx"
TURNKEY_TARGET_ADDRESS="xxxxxxxx"
4 changes: 2 additions & 2 deletions .github/actions/setup_deps/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ runs:
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
cache: "yarn"

- name: Install project dependencies
shell: bash
run: yarn
run: yarn --production

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/changesets-prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
cache: "yarn"

- name: Install project dependencies
Expand All @@ -44,6 +44,7 @@ jobs:
uses: changesets/action@v1
with:
# This expects you to have a script called release which does a build for your packages and calls changeset publish
version: yarn update-version
publish: yarn release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/changesets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
cache: "yarn"

- name: Install project dependencies
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
cache: "yarn"

- name: Install project dependencies
Expand All @@ -40,9 +40,9 @@ jobs:

- name: Filter files to ignore
run: |
lcov --rc lcov_branch_coverage=1 \
--remove lcov.info \
--output-file lcov.info "*node_modules*" "*test*" "*script*" "*DeploymentConfig*"
lcov --rc lcov_branch_coverage=1 \
--remove lcov.info \
--output-file lcov.info "*node_modules*" "*test*" "*script*" "*DeploymentConfig*" "*Redeem*" "*deployment*"
- name: Report code coverage
uses: zgosalvez/github-actions-report-lcov@v2
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/foundry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,25 @@ jobs:
- name: "Inspect Storage Layout"
continue-on-error: false
run: yarn run storage-inspect:check

build_js:
needs: build
strategy:
fail-fast: true

name: Build JS Package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install node deps and founry
uses: ./.github/actions/setup_deps

- name: Download foundry artifacts
uses: actions/download-artifact@v3
with:
name: foundry-built-artifacts

- name: Build js package
run: |
yarn prepack
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
cache: "yarn"

- name: Install project dependencies
Expand Down
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,11 @@ lcov.info
dist/

.env
.env*
.env.*
!.env.example

package/wagmiGenerated.ts
package/chainConfigs.ts
package/chainConfigs.ts

# not currently using pnpm
pnpm-lock.yaml
22 changes: 11 additions & 11 deletions .storage-layout
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,19 @@
| permissions | mapping(uint256 => mapping(address => uint256)) | 510 | 0 | 32 | src/nft/ZoraCreator1155Impl.sol:ZoraCreator1155Impl |
| __gap | uint256[50] | 511 | 0 | 1600 | src/nft/ZoraCreator1155Impl.sol:ZoraCreator1155Impl |
| createReferrals | mapping(uint256 => address) | 561 | 0 | 32 | src/nft/ZoraCreator1155Impl.sol:ZoraCreator1155Impl |
| firstMinters | mapping(uint256 => address) | 562 | 0 | 32 | src/nft/ZoraCreator1155Impl.sol:ZoraCreator1155Impl |
| delegatedTokenId | mapping(uint32 => uint256) | 563 | 0 | 32 | src/nft/ZoraCreator1155Impl.sol:ZoraCreator1155Impl |

=======================
➡ ZoraCreator1155FactoryImpl
=======================

| Name | Type | Slot | Offset | Bytes | Contract |
|------------------|----------------------------------------------|------|--------|-------|-----------------------------------------------------------------------|
| _owner | address | 0 | 0 | 20 | src/factory/ZoraCreator1155FactoryImpl.sol:ZoraCreator1155FactoryImpl |
| _pendingOwner | address | 1 | 0 | 20 | src/factory/ZoraCreator1155FactoryImpl.sol:ZoraCreator1155FactoryImpl |
| __gap | uint256[50] | 2 | 0 | 1600 | src/factory/ZoraCreator1155FactoryImpl.sol:ZoraCreator1155FactoryImpl |
| _initialized | uint8 | 52 | 0 | 1 | src/factory/ZoraCreator1155FactoryImpl.sol:ZoraCreator1155FactoryImpl |
| _initializing | bool | 52 | 1 | 1 | src/factory/ZoraCreator1155FactoryImpl.sol:ZoraCreator1155FactoryImpl |
| isAllowedUpgrade | mapping(address => mapping(address => bool)) | 53 | 0 | 32 | src/factory/ZoraCreator1155FactoryImpl.sol:ZoraCreator1155FactoryImpl |
| __gap | uint256[50] | 54 | 0 | 1600 | src/factory/ZoraCreator1155FactoryImpl.sol:ZoraCreator1155FactoryImpl |
| __gap | uint256[50] | 104 | 0 | 1600 | src/factory/ZoraCreator1155FactoryImpl.sol:ZoraCreator1155FactoryImpl |
| __gap | uint256[50] | 154 | 0 | 1600 | src/factory/ZoraCreator1155FactoryImpl.sol:ZoraCreator1155FactoryImpl |
| Name | Type | Slot | Offset | Bytes | Contract |
|---------------|-------------|------|--------|-------|-----------------------------------------------------------------------|
| _owner | address | 0 | 0 | 20 | src/factory/ZoraCreator1155FactoryImpl.sol:ZoraCreator1155FactoryImpl |
| _pendingOwner | address | 1 | 0 | 20 | src/factory/ZoraCreator1155FactoryImpl.sol:ZoraCreator1155FactoryImpl |
| __gap | uint256[50] | 2 | 0 | 1600 | src/factory/ZoraCreator1155FactoryImpl.sol:ZoraCreator1155FactoryImpl |
| _initialized | uint8 | 52 | 0 | 1 | src/factory/ZoraCreator1155FactoryImpl.sol:ZoraCreator1155FactoryImpl |
| _initializing | bool | 52 | 1 | 1 | src/factory/ZoraCreator1155FactoryImpl.sol:ZoraCreator1155FactoryImpl |
| __gap | uint256[50] | 53 | 0 | 1600 | src/factory/ZoraCreator1155FactoryImpl.sol:ZoraCreator1155FactoryImpl |
| __gap | uint256[50] | 103 | 0 | 1600 | src/factory/ZoraCreator1155FactoryImpl.sol:ZoraCreator1155FactoryImpl |
14 changes: 8 additions & 6 deletions addresses/999.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{
"CONTRACT_1155_IMPL": "0x91C1863eD54809c45b53bb6090eb437036c792C4",
"CONTRACT_1155_IMPL": "0x1842522fEabF9143758EbEEB85A4B417b5b15A0f",
"CONTRACT_1155_IMPL_VERSION": "1.4.0",
"FACTORY_IMPL": "0xdF4A315443Ce2c11e6657D6A98B3a7143DE7B268",
"FACTORY_PROXY": "0x6a357139C1bcDcf0B3AB9bC447932dDdcb956703",
"FACTORY_IMPL": "0x39252E0b2Fd78687b3b9aD2103D38d6C18aD1522",
"FACTORY_PROXY": "0x777777267FA8D1C26EF7A2dffb33A290464D1b4B",
"FIXED_PRICE_SALE_STRATEGY": "0xd81351363b7d80b06E4Ec4De7989f0f91e41A846",
"MERKLE_MINT_SALE_STRATEGY": "0x2c4457D38A329526063b26a2bB2C31B61553Aa98",
"PREMINTER_IMPL": "0x852AdbCA541AC8b422e9d73a11e774d22577266a",
"PREMINTER_PROXY": "0x7777770cbcc9df2d3f3aeb158fd2106e20c598ba",
"REDEEM_MINTER_FACTORY": "0x27817bAef1341De9Ad04097Bbba4Ea8dA32c8552",
"timestamp": 1688509842,
"commit": "f60dd5f"
}
"timestamp": 1695924035,
"commit": "b5b1a73"
}
1 change: 0 additions & 1 deletion chainConfigs/1.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"FACTORY_OWNER": "0xDB392f4391462d60B8B4413ef72018Ab595Af9D0",
"MINT_FEE_AMOUNT": 777000000000000,
"MINT_FEE_RECIPIENT": "0xd1d1D4e36117aB794ec5d4c78cBD3a8904E691D0",
"PROTOCOL_REWARDS": "0x7777777F279eba3d3Ad8F4E708545291A6fDBA8B"
}
1 change: 0 additions & 1 deletion chainConfigs/10.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"FACTORY_OWNER": "0x4c7f7b6067fac9a737ecf2ca1a733fc85dd65a2b",
"MINT_FEE_AMOUNT": 777000000000000,
"MINT_FEE_RECIPIENT": "0x7A810DCd0f8d83B20212326813Db6EF7E9FD030c",
"PROTOCOL_REWARDS": "0x7777777F279eba3d3Ad8F4E708545291A6fDBA8B"
}
1 change: 0 additions & 1 deletion chainConfigs/11155111.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"FACTORY_OWNER": "0xE51051a204afb2fC071A2406914cdEA5638e5018",
"MINT_FEE_AMOUNT": 111000000000000,
"MINT_FEE_RECIPIENT": "0xE51051a204afb2fC071A2406914cdEA5638e5018"
}
1 change: 0 additions & 1 deletion chainConfigs/420.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"FACTORY_OWNER": "0xbb45052B2260707655Dfd916a416264f5981192c",
"MINT_FEE_AMOUNT": 777000000000000,
"MINT_FEE_RECIPIENT": "0x5dEe21327CD7CD6725C2578DA1c3E5bb2D2D34b2",
"PROTOCOL_REWARDS": "0x7777777F279eba3d3Ad8F4E708545291A6fDBA8B"
}
10 changes: 4 additions & 6 deletions chainConfigs/424.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
"FACTORY_OWNER": "0x8fbC66d36cceB3Ad69B4d672756da54CcFec1cD2",
"MINT_FEE_AMOUNT": 777000000000000,
"MINT_FEE_RECIPIENT": "0x95FD5d77B206cCc0B1f7D7A4077fbE8eb4fC31eF",
"PROTOCOL_REWARDS": "0x7777777A456fF23D9b6851184472c08FBDa73e32"
}

"FACTORY_OWNER": "0x8fbC66d36cceB3Ad69B4d672756da54CcFec1cD2",
"MINT_FEE_RECIPIENT": "0x95FD5d77B206cCc0B1f7D7A4077fbE8eb4fC31eF",
"PROTOCOL_REWARDS": "0x7777777A456fF23D9b6851184472c08FBDa73e32"
}
1 change: 0 additions & 1 deletion chainConfigs/5.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"FACTORY_OWNER": "0xDC498668B5e6CC518fD58A2ADBF614Fd3A13D3a0",
"MINT_FEE_AMOUNT": 10000,
"MINT_FEE_RECIPIENT": "0x9444390c01Dd5b7249E53FAc31290F7dFF53450D",
"PROTOCOL_REWARDS": "0x7777777F279eba3d3Ad8F4E708545291A6fDBA8B"
}
1 change: 0 additions & 1 deletion chainConfigs/58008.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"FACTORY_OWNER": "0xfAe426B462f4Bc9857ED28D8473Fb85192f23E9b",
"MINT_FEE_AMOUNT": 777000000000000,
"MINT_FEE_RECIPIENT": "0x917D86f1eBD1d9f59Dae1C00e5Af7f8689299EC4"
}
10 changes: 4 additions & 6 deletions chainConfigs/7777777.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
"FACTORY_OWNER": "0xdEA20c96253dc2d64897D2b8d27A8d935dE74955",
"MINT_FEE_AMOUNT": 777000000000000,
"MINT_FEE_RECIPIENT": "0xEcfc2ee50409E459c554a2b0376F882Ce916D853",
"PROTOCOL_REWARDS": "0x7777777F279eba3d3Ad8F4E708545291A6fDBA8B"
}

"FACTORY_OWNER": "0xdEA20c96253dc2d64897D2b8d27A8d935dE74955",
"MINT_FEE_RECIPIENT": "0xEcfc2ee50409E459c554a2b0376F882Ce916D853",
"PROTOCOL_REWARDS": "0x7777777F279eba3d3Ad8F4E708545291A6fDBA8B"
}
1 change: 0 additions & 1 deletion chainConfigs/8453.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"FACTORY_OWNER": "0x004d6611884B4A661749B64b2ADc78505c3e1AB3",
"MINT_FEE_AMOUNT": 777000000000000,
"MINT_FEE_RECIPIENT": "0x7bf90111Ad7C22bec9E9dFf8A01A44713CC1b1B6",
"PROTOCOL_REWARDS": "0x7777777F279eba3d3Ad8F4E708545291A6fDBA8B"
}
1 change: 0 additions & 1 deletion chainConfigs/84531.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"FACTORY_OWNER": "0x02539E813cA450C2c7334e885423f4A899a063Fe",
"MINT_FEE_AMOUNT": 777000000000000,
"MINT_FEE_RECIPIENT": "0x02539E813cA450C2c7334e885423f4A899a063Fe",
"PROTOCOL_REWARDS": "0x7777777F279eba3d3Ad8F4E708545291A6fDBA8B"
}
1 change: 0 additions & 1 deletion chainConfigs/999.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"FACTORY_OWNER": "0xE84DBB2B25F761751231a9D0DAfbdD4dC3aa8252",
"MINT_FEE_AMOUNT": 777000000000000,
"MINT_FEE_RECIPIENT": "0xE84DBB2B25F761751231a9D0DAfbdD4dC3aa8252",
"PROTOCOL_REWARDS": "0x7777777F279eba3d3Ad8F4E708545291A6fDBA8B"
}
Loading

0 comments on commit 399b8e6

Please sign in to comment.