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

Premint prerelease #180

Closed
wants to merge 33 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
9c2c41f
upgrade viem
oveddan Aug 16, 2023
f3c86d8
Gasless
oveddan May 31, 2023
91db21c
Creator attribution - reduce optimizer runs to get contracts to build…
oveddan Aug 22, 2023
b3df454
fix hanging test
oveddan Aug 23, 2023
6ebdd7e
prettier fix
oveddan Aug 23, 2023
0283519
Creator attribution deployed contracts
oveddan Aug 16, 2023
f13beef
hack - only test fork on zora goerli for premint
oveddan Aug 23, 2023
a8d4388
deployed new creator attribution
oveddan Aug 18, 2023
a851160
fix: factory tests
kulkarohan Aug 28, 2023
46b89bc
chore: remove alt deploy script
kulkarohan Aug 29, 2023
970fedf
refactor: early return token id if token exists
kulkarohan Aug 29, 2023
63d6d5d
refactor: store 1155 factory as immutable
kulkarohan Aug 29, 2023
df3fc9e
chore: update tests
kulkarohan Aug 29, 2023
6920a93
chore: update tests
kulkarohan Sep 1, 2023
091a032
chore: lint
kulkarohan Sep 1, 2023
b9c80e4
Premint: fix fork tests (#164)
oveddan Sep 11, 2023
fbde89a
Premint: add creator to creator attribution event (#163)
oveddan Sep 12, 2023
75b1a59
fix coverage compilation issue
oveddan Sep 12, 2023
b598662
filter coverage files to ignore
oveddan Sep 13, 2023
bb8069e
Premint: first minter rewards (#162)
oveddan Sep 14, 2023
cb2cfa4
Made premint executor upgradeable via a proxy. (#168)
oveddan Sep 14, 2023
b197446
Extracted erc1155 errors to an interface, and importing that into pre…
oveddan Sep 14, 2023
26327b1
Reverted manual premint version update, and just pointing to origin v…
oveddan Sep 14, 2023
610120f
fix: read fee from config for fork test
kulkarohan Sep 14, 2023
74b9307
created prerelease action
oveddan Sep 18, 2023
7d69263
* Updated script to deploy preminter to now deploy the proxy
oveddan Sep 14, 2023
4044120
added upgrade preminter script
oveddan Sep 14, 2023
4a67eee
exposing preminter
oveddan Sep 18, 2023
1bfd2c3
Fix changeset description
oveddan Sep 18, 2023
803afd4
enterer gasless tag
oveddan Sep 18, 2023
32c7acf
Version Packages (gasless) (#177)
github-actions[bot] Sep 18, 2023
3ed269f
fix lint
oveddan Sep 18, 2023
99790be
Version Packages (gasless) (#182)
github-actions[bot] Sep 18, 2023
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
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/mighty-kiwis-compete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@zoralabs/zora-1155-contracts": patch
---

Export preminter from package.json
14 changes: 14 additions & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"mode": "pre",
"tag": "gasless",
"initialVersions": {
"@zoralabs/zora-1155-contracts": "1.4.0"
},
"changesets": [
"happy-socks-melt",
"long-avocados-visit",
"mighty-kiwis-compete",
"spotty-horses-battle",
"twelve-comics-sniff"
]
}
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
50 changes: 50 additions & 0 deletions .github/workflows/changesets-prerelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Release

on:
push:
branches:
- "*prerelease*"

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3

- name: Check pre.json existence
id: check_pre
uses: andstor/file-existence-action@v1
with:
files: ".changeset/pre.json"

- name: Ensure pre.json exists
if: steps.check_pre.outputs.files_exists != 'true'
run: echo "pre.json does not exist, enter prerelease mode with 'yarn changeset pre enter {prereleaseName}'"; exit 1

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16
cache: "yarn"

- name: Install project dependencies
run: yarn

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Create Release Pull Request or Publish to npm
id: changesets
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
publish: yarn release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
6 changes: 6 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ jobs:
- name: Setup LCOV
uses: hrishikesh-kadam/setup-lcov@v1

- name: Filter files to ignore
run: |
lcov --rc lcov_branch_coverage=1 \
--remove lcov.info \
--output-file lcov.info "*node_modules*" "*test*" "*script*" "*DeploymentConfig*" "*Redeem*"

- name: Report code coverage
uses: zgosalvez/github-actions-report-lcov@v2
with:
Expand Down
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ lcov.info
dist/

.env
.env*
!.env.example

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

# not currently using pnpm
pnpm-lock.yaml
2 changes: 2 additions & 0 deletions .storage-layout
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
| 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
Expand Down
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# @zoralabs/zora-1155-contracts

## 1.5.0-gasless.1

### Patch Changes

- 4a67eee: Export preminter from package.json

## 1.5.0-gasless.0

### Minor Changes

- bb8069e: Adds first minter rewards to zora 1155 contracts.
- f3c86d8: Added deterministic contract creation from the Zora1155 factory
- 91db21c: Added the PremintExecutor contract, and updated erc1155 to support delegated minting

### Patch Changes

- bb8069e: Deprecate ZoraCreatorRedeemMinterStrategy at v1.0.1, a newer version will soon be released

## 1.4.0

### Minor Changes
Expand Down
13 changes: 7 additions & 6 deletions addresses/999.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"CONTRACT_1155_IMPL": "0x91C1863eD54809c45b53bb6090eb437036c792C4",
"CONTRACT_1155_IMPL": "0x324bA85dAE97331D8256D96D7e45BdC4688f665C",
"CONTRACT_1155_IMPL_VERSION": "1.4.0",
"FACTORY_IMPL": "0xdF4A315443Ce2c11e6657D6A98B3a7143DE7B268",
"FACTORY_PROXY": "0x6a357139C1bcDcf0B3AB9bC447932dDdcb956703",
"FACTORY_IMPL": "0xd360c892c69A70F900352d142e78A9C0a59544c5",
"FACTORY_PROXY": "0x415015A8d73582DF01d83CFa16D11b6c7aD8AF24",
"FIXED_PRICE_SALE_STRATEGY": "0xd81351363b7d80b06E4Ec4De7989f0f91e41A846",
"MERKLE_MINT_SALE_STRATEGY": "0x2c4457D38A329526063b26a2bB2C31B61553Aa98",
"PREMINTER": "0xcb81DbF6DB4526fe2Cdf59Bd8a2Ef627899B9Ef2",
"REDEEM_MINTER_FACTORY": "0x27817bAef1341De9Ad04097Bbba4Ea8dA32c8552",
"timestamp": 1688509842,
"commit": "f60dd5f"
}
"timestamp": 1694716506,
"commit": "b197446"
}
4 changes: 2 additions & 2 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
fs_permissions = [{access = "read", path = "./addresses"}, {access = "read", path = "./chainConfigs"}, {access = "read", path = "./package.json"}]
libs = ['_imagine', 'node_modules', 'script']
optimizer = true
optimizer_runs = 3000
optimizer_runs = 250
out = 'out'
solc_version = '0.8.17'
src = 'src'
via_ir = true

[profile.optimized]
optimizer = true
optimizer_runs = 3000
optimizer_runs = 250
out = 'out'
script = 'src'
solc_version = '0.8.17'
Expand Down
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@zoralabs/zora-1155-contracts",
"version": "1.4.0",
"version": "1.5.0-gasless.1",
"repository": "git@github.com:ourzora/creator-contracts.git",
"author": "Iain <iain@zora.co>",
"license": "MIT",
Expand All @@ -14,17 +14,17 @@
"prettier": "prettier --write 'src/**/*.sol' 'test/**/*.sol' 'package/**/*.ts' 'wagmi.config.ts'",
"coverage": "forge coverage --report lcov",
"write-gas-report": "forge test --gas-report > gasreport.ansi",
"prepack": "node script/copy-deployed-contracts.mjs && yarn wagmi && yarn bundle-configs && yarn build",
"prepack": "yarn wagmi && yarn bundle-configs && yarn build",
"update-new-deployment-addresses": "node script/copy-deployed-contracts.mjs deploy",
"build": "tsup",
"bundle-configs": "node script/bundle-chainConfigs.mjs && yarn prettier",
"wagmi": "wagmi generate",
"publish-packages": "yarn prepack && changeset publish",
"storage-inspect:check": "./script/storage-check.sh check ZoraCreator1155Impl ZoraCreator1155FactoryImpl",
"storage-inspect:generate": "./script/storage-check.sh generate ZoraCreator1155Impl ZoraCreator1155FactoryImpl",
"release": "yarn run prepack && changeset publish",
"js-test:watch": "vitest dev",
"anvil": "anvil --fork-url https://rpc.zora.energy --fork-block-number 2550000 --chain-id 31337"
"anvil": "source .env.anvil && anvil --fork-url $FORK_RPC_URL --fork-block-number $FORK_BLOCK_NUMBER --chain-id 31337",
"release": "yarn run prepack && changeset publish"
},
"files": [
"dist/",
Expand All @@ -36,9 +36,10 @@
"dependencies": {
"@openzeppelin/contracts": "4.9.2",
"@zoralabs/openzeppelin-contracts-upgradeable": "4.8.4",
"@zoralabs/protocol-rewards": "1.1.1",
"@zoralabs/protocol-rewards": "1.1.2",
"ds-test": "https://github.com/dapphub/ds-test#cd98eff28324bfac652e63a239a60632a761790b",
"forge-std": "https://github.com/foundry-rs/forge-std#cd7d533f9a0ee0ec02ad81e0a8f262bc4203c653"
"forge-std": "https://github.com/foundry-rs/forge-std#705263c95892a906d7af65f0f73ce8a4a0c80b80",
"solmate": "^6.1.0"
},
"devDependencies": {
"@changesets/cli": "^2.26.1",
Expand Down
1 change: 1 addition & 0 deletions package/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
// built at build time. They are not checked in to git.
// The can be generated by running `yarn prepack` in the root
export * from "./wagmiGenerated";
export * as preminter from "./preminter";
export { chainConfigs } from "./chainConfigs";
Loading