Skip to content

Commit 748be1a

Browse files
IsabellaSmallcombekulkarohanoveddaniainnash
authored
Zora Timed Sale Strategy (ourzora#474)
* wip: of zora mints sale strategy * feat: add reward payouts * feat: add natspec * fix: remove field from struct * fix: import * fix: rewards * draft: pair revisions (ourzora#481) * draft: various updates * feat: add protocol rewards deposit * feat: add rewardSettings * draft: erc20z (ourzora#484) * draft: erc20z * refactor: early return if deployed * draft: more changes to sale strategy * feat: update natspec --------- Co-authored-by: Isabella Smallcombe <[email protected]> * add various updates * more various updates * feat: new erc20z package (ourzora#487) * chore: remove prev erc20z folder * feat: new erc20z package * chore: temp import * chore: update deps * chore: clean up * chore: update mock * tests for zora mints sale strategy (ourzora#490) * feat: wip of tests for zora mints sale strategy * fix: revert error * feat: tests for zora sale strategy * feat: add tests for setZoraRewardRecipient * fix: tests * fix: interfaces * fix: import issue * feat: add updated saleset event * addded mint-fee to the SaleSet event (ourzora#491) Adding the mint fee to the SaleSet event - so that we can index it in the subgraph * refactor: rename tokenAddress to collection * chore: update mock * feat: temp deploy script * feat: add resetSale test (ourzora#493) * Zora Mints Sale Strategy + ERC20Z subgraph (ourzora#492) Added subgraph mapping for zora mints sale strategy. Added a new subgraph entity: ERC20Z Have not deployed this subgraph as waiting for strategy to be deployed. * feat: wip of royalties (ourzora#494) * feat: add reduce supply check (ourzora#500) * feat: add reduce supply check * fix: natspec * fix: remove deletion * fix: revert issue on createAndInitializePoolIfNecessary (ourzora#503) * feat: updated secondary market activation (ourzora#504) * chore: update interfaces * feat: updated secondary activation * feat: initial activation * chore: lint * feat: allowing updating sale start and end (ourzora#508) * feat: allowing updating sale start and end * fix: remove unused error * feat: uniswap v3 lp mint (ourzora#510) * chore: add block.prevrandao to salt (ourzora#511) * chore: ignore /broadcast * feat: rename ZoraMintsSaleStrategy to ZoraTimedSaleStrategy (ourzora#514) * feat: add new zora timed sale strategy names to subgraph (ourzora#518) * feat: add new zora timed sale strategy names to subgraph * fix: block numbers * feat: move royalties to erc20z package (ourzora#520) * refactor: move sale strategy (ourzora#521) * refactor: move sale strategy * chore: update import * feat: add royalties to deploy and tests (ourzora#522) * Adds metadata for erc20z tokens (ourzora#523) * Adds metadata for erc20z tokens# * feat: update uri * feat: sale strategy refactory (ourzora#524) * refactor: ignore no-op params * refactor: rename tokenContract to collection * feat: sale strategy refactor * feat: add custom errors to erc20z (ourzora#525) * feat: add custom errors to erc20z * feat: clean up redeem * fix: enforce reduced supply (ourzora#529) * chore: uncomment mock reverts * fix: remove return type * fix: param validation * feat: enforce reduced supply * feat: fixes update sale tests (ourzora#528) * feat: add deposit uniswap token (ourzora#526) * fix: updateSale validation (ourzora#530) * fix: updateSale validation * refactor: nonfungiblePositionManager as uniswap token address * 07 18 redo GitHub actions to support new package for erc20z (ourzora#531) * Redo github actions to support new package for erc20z * update coverage files naming * fix precache * check storage layout * cleanup yml files * fix build patterns * fix deployments tests * add build steps for abis and subgraph for erc20z * update package * update coverage * fix coverage args * fix test suite * fix keys * adding commenting for coverage * fix merge build * Iain rebase rohan storage changes (ourzora#537) * feat: add reduce supply check (ourzora#500) * feat: add reduce supply check * fix: natspec * fix: remove deletion * refactor: various updates * fix mints imports merge --------- Co-authored-by: Isabella Smallcombe <[email protected]> Co-authored-by: Rohan Kulkarni <[email protected]> * add version to erc20z (ourzora#536) * Fix tests (ourzora#538) * feat: tests for erc20z (ourzora#534) * feat: tests for erc20z * fix: tests * fix: remove logs * fix: tickMath code coverage * fix: change coverage * fix: try coverage ignore * feat: add redeem tests * feat: verify caller is in position (ourzora#539) * feat: verify caller is in position * feat: reentrancy guard on claim * fix: log address(0) instead of weth (ourzora#540) * chore: fix lint (ourzora#535) * feat: add natspec (ourzora#541) * feat: add natspec * feat: more natspec * feat: remove $ * feat: add missing natspec * chore: update sepolia deploy (#547) * chore: update zora sepolia deploy (#548) * chore: update uniswap files (#549) * chore: update uniswap interfaces * chore: update uniswap files * chore: add slither config (#550) * refactor: update conversion methods (#551) * chore: update testnets (#552) * fix: hot fix for IMinter1155 supported check from collection (#557) * docs: inline comments for market math and activation (#558) * Move interface to shared (#561) * Update contract workflow (#560) * feat: add constant for 1e18 (#563) * feat: add structs to functions returning more than 3 items (#562) * feat: move uniswap into seperate folder in interfaces (#565) * Add dev testing config (#568) * ZoraTimedSaleStrategy - add fuzz test that verifies liquidity ratio is correct [PRO-1253] (#556) In an effort to test out the ZoraTimedSalesStrategy calculation logic, I wanted to add a fuzz test that tests different mint quantities always results in the correct liquidity ratios when depositing to uniswap. This fuzz test adds that check. * updated erc20z to use pnpm properly * feat: update subgraph configs for new deploys (#553) * feat: add ZoraTimedSaleStrategyConstants contract * fix js build (#580) <!--- Provide a general summary of your changes in the Title above --> <!--- Describe your changes in detail --> <!--- Why is this change required? What problem does it solve? --> <!--- If it fixes an open issue, please link to the issue here. --> - [ ] This changes the ABI/API <!-- If so, please describe how and what potential impact this may have --> <!--- Please describe in detail how you tested your changes. --> <!--- Include details of your testing environment, tests ran to see how --> <!--- your change affects other areas of the code, etc. --> <!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New module / feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) <!--- Go over all the following points, and put an `x` in all the boxes that apply. --> <!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> - [ ] My code follows the code style of this project. - [ ] My change requires a change to the documentation. - [ ] I have updated the documentation accordingly. - [ ] I added a changeset to account for this change - [ ] My review includes a symposis of the changes and potential issues - [ ] The code style is enforced - [ ] There are no risky / concerning changes / additions to the PR * Use Receive Hooks (#566) * update tests * revert function name changes * Update generate strategy for codegen to pnpm instead of yarn (#589) * feat: add secondaryActivated to subgraph (#586) * feat: add secondaryActivated to subgraph * fix: block numbers * feat: add pool + erc20z address * feat: add contractURI to erc20z (#577) * feat: add contractURI to erc20z * feat: add internal _contractURI * feat: add more tests for convert functions (#593) * feat: add mint with mint comment test (#595) * feat: add validation when calling updateSale that a sale was set (#594) * Prevent end time from being in the past when calling setSale (#588) * Prevent end time from being in the past when calling setSale * update strategy test * feat: remove gas, got overwritten by rebase (#596) * Add missing subgraph deps (#590) * Subgraph fix build order * chore: fix lint (ourzora#535) * updated erc20z to use pnpm properly * fix js build (#580) <!--- Provide a general summary of your changes in the Title above --> <!--- Describe your changes in detail --> <!--- Why is this change required? What problem does it solve? --> <!--- If it fixes an open issue, please link to the issue here. --> - [ ] This changes the ABI/API <!-- If so, please describe how and what potential impact this may have --> <!--- Please describe in detail how you tested your changes. --> <!--- Include details of your testing environment, tests ran to see how --> <!--- your change affects other areas of the code, etc. --> <!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New module / feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) <!--- Go over all the following points, and put an `x` in all the boxes that apply. --> <!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> - [ ] My code follows the code style of this project. - [ ] My change requires a change to the documentation. - [ ] I have updated the documentation accordingly. - [ ] I added a changeset to account for this change - [ ] My review includes a symposis of the changes and potential issues - [ ] The code style is enforced - [ ] There are no risky / concerning changes / additions to the PR * Fix turbo json for subgraph build (#603) * Fix turbo json for subgraph build * remove dupe package.json keys * Fix fork block number in erc20z tests to speed up testing and get consistent results (#597) * Fix fork block number in tests for consistent results * fix: erc20z supply calculation. added a fuzz test around calculations, making sure that activate ratio from calculation is always correct (#598) * added a fuzz test around calculations, making sure that activate ratio from calculation is always correct * fix pnpm lock --------- Co-authored-by: Rohan Kulkarni <[email protected]> Co-authored-by: iain nash <[email protected]> * test: initial royalties w/ swap router (#602) * initial royalties test w/ swap router * chore: update interfaces * chore: initial royalties tests * chore: update other tests * Add event SecondaryMarketActivated with market details to erc20z token (#587) * SecondaryMarketActivated with market details to erc20z token * Move royalties config as position-id and erc20z based (#585) * chore: fix lint (ourzora#535) * Move royalties config as position-id and erc20z based * fix interface * fix tests --------- Co-authored-by: Rohan Kulkarni <[email protected]> * More tests, fix uri test and clean up data location (#606) * more tests, fix uri test and clean up data location * more test coverage * large test coverage update * code fixes * fix test for claim flow * undo changes to er20z calcs (#610) Undo the changes to erc20z that were overwritten in a rebase. * fix: add marketLaunched to subgraph template (#605) * feat: add test for supportsInterface (#619) * feat: add check that a sale was set (#616) * Add slither to github actions (#604) * Add slither to github actions * slither update * add slither ignore * Fix redeploy concern (#612) * Fix redeploy concern * fix redeploy concern and tests * remove unnecessary transfer balance check for 1155 (#614) * remove unnecessary transfer balance check for 1155 * update erc20z * feat: add fee recipient & bps to royalties (#617) * feat: add fee recipient & bps * chore: lint * test: fix emitted excess values * fix: clean up and fix build (#621) * feat: update subgraph to handle updateSale (#611) * feat: update subgraph to handle updateSale * feat: clean up check * Update impl (#613) * update impl (#618) * Update timed sale strategy payment methods (#622) * Update timed sale strategy payment methods * update royalties * remove error * add address lib * Fix safe transfer checks (#607) * Fix safe transfer checks * fix test for secondarymarketactivated event * safe transfer updates * Add specific error for market creation without any paid sales. Move storage getter to a new contract to clean up main contract. (#608) * Add specific error for market creation without any paid sales. Move storage getter to a new contract to clean up main contract. * Add safe increase allowance calls for erc20s in ERC20Z. (#609) * More tests, fix uri test and clean up data location (#606) * more tests, fix uri test and clean up data location * more test coverage Co-authored-by: Dan Oved <[email protected]> Co-authored-by: Isabella Smallcombe <[email protected]> Co-authored-by: Rohan Kulkarni <[email protected]> * Zora Timed Sale Strategy Deterministic Deployment (#623) ## Secure deterministic deployment scripts for the Royalties and ZoraTimedSaleStrategy contracts. Works with a new contract `DeterministicDeployerAndCaller` that takes a signature signed by a deployer, with a salt that must match first 20 bytes of a signers address, and deploys a contract deterministically using that salt and calls something on it. In our case, this is `initialize` on the royalties contract, and `upgradeToAndCall` on the `ZoraTimedSaleStrategy`. The nice thing about the new approach is all of the deployment now happens from foundry. We just do minimal calls to node.js + turnkey to sign the messages. It involved some major refactoring to move things into shared places like: * Shared deployment contracts + utils moved into `shared-contracts` * Common chain configs moved into `shared-contracts/chain-configs` * refactor: use wrap & unwrap (#632) * feat: fix natspec (#626) * feat: add check for address zero in royalties constructor (#625) * feat: unclaimed fees helper (#633) * feat: accrued fees helper * feat: add batch getter * test: first liquidity invariant (#637) * feat: add reentrancy check to erc20z activate (#641) * Slither runs ignore error for build. (#642) ### TL;DR Allow the Slither job to continue on errors by adding `continue-on-error: true` in the workflow file. ### What changed? Modified the `.github/workflows/slither.yml` file to include `continue-on-error: true` for the Slither step. This adjustment prevents the build from failing in case of errors detected by Slither. ### How to test? Trigger the GitHub Actions workflow and check if the Slither job continues even if errors are found. ### Why make this change? This change ensures that the build process is not halted due to Slither outputs, which can be handy during development and testing phases. * Final PR updates (#644) * docs: updated natspec (#643) --------- Co-authored-by: Rohan Kulkarni <[email protected]> Co-authored-by: Rohan Kulkarni <[email protected]> Co-authored-by: Dan Oved <[email protected]> Co-authored-by: Iain Nash <[email protected]>
1 parent 55dbf34 commit 748be1a

File tree

110 files changed

+9071
-467
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+9071
-467
lines changed

.github/workflows/1155-deployments.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

.github/workflows/1155.yml

Lines changed: 0 additions & 36 deletions
This file was deleted.

.github/workflows/contract.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: "Contract"
2+
on:
3+
workflow_call:
4+
inputs:
5+
package_folder:
6+
required: true
7+
type: string
8+
coverage_args:
9+
required: false
10+
type: string
11+
name:
12+
required: true
13+
type: string
14+
ignore_coverage_files:
15+
required: false
16+
type: string
17+
skip_storage_layout:
18+
type: boolean
19+
default: false
20+
21+
jobs:
22+
build:
23+
uses: ./.github/workflows/build.yml
24+
with:
25+
package_folder: ${{ inputs.package_folder }}
26+
27+
test:
28+
needs: build
29+
uses: ./.github/workflows/test.yml
30+
with:
31+
package_folder: ${{ inputs.package_folder }}
32+
name: ${{ inputs.name }}
33+
34+
storage_layout:
35+
needs: build
36+
uses: ./.github/workflows/storage_layout.yml
37+
if: ${{ inputs.skip_storage_layout == false }}
38+
with:
39+
package_folder: ${{ inputs.package_folder }}
40+
name: ${{ inputs.name }}
41+
42+
contract_sizes:
43+
needs: build
44+
uses: ./.github/workflows/contract_sizes.yml
45+
with:
46+
package_folder: ${{ inputs.package_folder }}
47+
name: ${{ inputs.name }}
48+
49+
slither:
50+
needs: build
51+
uses: ./.github/workflows/slither.yml
52+
with:
53+
package_folder: ${{ inputs.package_folder }}
54+
55+
coverage:
56+
uses: ./.github/workflows/coverage.yml
57+
secrets: inherit
58+
with:
59+
package_folder: ${{ inputs.package_folder }}
60+
files_to_ignore: ${{ inputs.ignore_coverage_files }}
61+
coverage_args: ${{ inputs.coverage_args }}

.github/workflows/contracts.yml

Lines changed: 45 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,58 @@ name: "Contracts"
33
on: "push"
44

55
jobs:
6+
contracts-erc20z:
7+
name: ERC20Z Contracts
8+
uses: ./.github/workflows/contract.yml
9+
secrets: inherit
10+
with:
11+
package_folder: packages/erc20z
12+
name: ERC20Z
13+
ignore_coverage_files: '"*lib*" "*Zora1155*" "*uniswap*"'
14+
# fixes stack too deep temporarily
15+
coverage_args: "--ir-minimum"
16+
skip_storage_layout: true
17+
618
contracts-1155:
719
name: 1155 Contracts
8-
uses: ./.github/workflows/1155.yml
9-
10-
contracts-1155-deployments:
11-
name: 1155 Deployments
12-
uses: ./.github/workflows/1155-deployments.yml
20+
uses: ./.github/workflows/contract.yml
1321
secrets: inherit
22+
with:
23+
package_folder: packages/1155-contracts
24+
ignore_coverage_files: '"*DeploymentConfig*" "*Redeem*" "*deployment*" "*packages*" "*test*"'
25+
name: 1155 Contracts
1426

1527
contracts-protocol-rewards:
1628
name: Protocol Rewards
17-
uses: ./.github/workflows/protocol-rewards.yml
29+
uses: ./.github/workflows/contract.yml
30+
secrets: inherit
31+
with:
32+
package_folder: packages/protocol-rewards
33+
name: Rewards
34+
ignore_coverage_files: '"*lib*"'
35+
skip_storage_layout: true
1836

1937
contracts-sparks:
2038
name: Sparks
21-
uses: ./.github/workflows/sparks.yml
39+
uses: ./.github/workflows/contract.yml
40+
secrets: inherit
41+
with:
42+
package_folder: packages/sparks
43+
ignore_coverage_files: '"*Ownable*" "*Mock*" "*BatchDataHelper*" "*test*"'
44+
skip_storage_layout: true
45+
name: Sparks
46+
47+
contracts-1155-deployments:
48+
name: 1155 Deployments
49+
uses: ./.github/workflows/deployment.yml
50+
secrets: inherit
51+
with:
52+
package_folder: packages/1155-deployments
53+
precache: "pnpm run generate"
54+
55+
contracts-sparks-deployments:
56+
name: Sparks Deployments
57+
uses: ./.github/workflows/deployment.yml
2258
secrets: inherit
59+
with:
60+
package_folder: packages/sparks-deployments

.github/workflows/coverage.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
on:
22
workflow_call:
33
inputs:
4-
package:
4+
package_folder:
55
required: true
66
type: string
77
files_to_ignore:
88
required: false
99
type: string
1010
default: ""
11+
coverage_args:
12+
required: false
13+
type: string
14+
default: ""
1115

1216
env:
13-
# Setting an environment variable with the value of a configuration variable
14-
package_folder: packages/${{ inputs.package }}
17+
package_folder: ${{ inputs.package_folder }}
1518
FOUNDRY_PROFILE: ci
1619

1720
jobs:
@@ -32,11 +35,15 @@ jobs:
3235
- name: Cache build
3336
uses: ./.github/actions/cache_foundry_build
3437
with:
35-
package_folder: packages/${{ inputs.package }}
38+
package_folder: ${{ env.package_folder }}
3639
foundry_profile: coverage
3740

3841
- name: Run Forge coverage
39-
run: cd $package_folder && forge coverage --report lcov
42+
run: cd $package_folder && forge coverage --report lcov ${{ inputs.coverage_args }}
43+
env:
44+
TENDERLY_KEY: ${{ secrets.TENDERLY_KEY }}
45+
ALCHEMY_KEY: ${{ secrets.ALCHEMY_KEY }}
46+
CONDUIT_KEY: ${{ secrets.CONDUIT_KEY }}
4047

4148
- name: Setup LCOV
4249
uses: hrishikesh-kadam/setup-lcov@v1

.github/workflows/deployment.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: "1155"
2+
on:
3+
workflow_call:
4+
inputs:
5+
package_folder:
6+
required: true
7+
type: string
8+
name:
9+
required: false
10+
type: string
11+
precache:
12+
required: false
13+
type: string
14+
15+
jobs:
16+
build:
17+
uses: ./.github/workflows/build.yml
18+
with:
19+
package_folder: ${{ inputs.package_folder }}
20+
precache: ${{ inputs.precache }}
21+
22+
test:
23+
needs: build
24+
uses: ./.github/workflows/test.yml
25+
secrets: inherit
26+
with:
27+
package_folder: ${{ inputs.package_folder }}
28+
precache: ${{ inputs.precache }}
29+
name: ${{ inputs.name }}

.github/workflows/protocol-rewards.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

.github/workflows/slither.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
on:
2+
workflow_call:
3+
inputs:
4+
package_folder:
5+
required: true
6+
type: string
7+
slither_args:
8+
required: false
9+
type: string
10+
default: ""
11+
12+
env:
13+
package_folder: ${{ inputs.package_folder }}
14+
FOUNDRY_PROFILE: ci
15+
16+
jobs:
17+
check:
18+
strategy:
19+
fail-fast: true
20+
21+
name: Slither
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v4
25+
with:
26+
submodules: recursive
27+
28+
- name: Install node deps and foundry
29+
uses: ./.github/actions/setup_deps
30+
31+
- name: Cache build
32+
uses: ./.github/actions/cache_foundry_build
33+
with:
34+
package_folder: ${{ env.package_folder }}
35+
foundry_profile: coverage
36+
37+
- uses: actions/setup-python@v5
38+
with:
39+
python-version: '3.10'
40+
41+
- name: Install Slither
42+
run: python3 -m pip install slither-analyzer
43+
44+
- name: Run slither
45+
working-directory: ${{ env.package_folder }}
46+
continue-on-error: true # disable failing the build for outputs with slither
47+
run: slither . --filter-paths "node_modules|src/uniswap|src/interfaces/uniswap"
48+

.github/workflows/sparks.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)