Skip to content

Commit

Permalink
Merge branch 'ourzora:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
GoodDaisy authored Nov 11, 2023
2 parents b42fa3e + 432abb2 commit 15f4727
Show file tree
Hide file tree
Showing 15 changed files with 182 additions and 160 deletions.
29 changes: 29 additions & 0 deletions .github/actions/cache_foundry_build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: 'Cache foundry build'
description: 'Caches foundry build by path'

inputs:
package_folder: # id of input
description: 'contracts package folder'
required: true
foundry_profile:
description: 'foundry profile for caching'

runs:
using: "composite"

steps:
- name: Cache contracts build
uses: actions/cache@v3
with:
# npm cache files are stored in out and cache
path: |
${{ inputs.package_folder }}/cache
${{ inputs.package_folder }}/out
# cache key is based on foundry config, contracts source tests, and scripts
key: ${{ inputs.package_folder }}${{ inputs.foundry_profile}}-${{ hashFiles(format('{0}/foundry.toml', inputs.package_folder)) }}-${{ hashFiles(format('{0}/src/**/*.sol', inputs.package_folder)) }}-${{ hashFiles(format('{0}/test/**/*.sol', inputs.package_folder)) }}-${{ hashFiles(format('{0}/script/**/*.sol', inputs.package_folder)) }}
# the following backups cache keys are searched, in case an exact match is not found
# see https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#matching-a-cache-key
restore-keys: |
${{ inputs.package_folder }}${{ inputs.foundry_profile}}-${{ hashFiles(format('{0}/foundry.toml', inputs.package_folder)) }}-${{ hashFiles(format('{0}/src/**/*.sol', inputs.package_folder)) }}-${{ hashFiles(format('{0}/test/**/*.sol', inputs.package_folder)) }}-
${{ inputs.package_folder }}${{ inputs.foundry_profile}}-${{ hashFiles(format('{0}/foundry.toml', inputs.package_folder)) }}-${{ hashFiles(format('{0}/src/**/*.sol', inputs.package_folder)) }}-
${{ inputs.package_folder }}${{ inputs.foundry_profile}}-${{ hashFiles(format('{0}/foundry.toml', inputs.package_folder)) }}-
21 changes: 21 additions & 0 deletions .github/workflows/1155.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: "1155"
on:
workflow_call:

jobs:
build:
uses: ./.github/workflows/build.yml
with:
package_folder: packages/1155-contracts

test:
needs: build
uses: ./.github/workflows/test.yml
with:
package_folder: packages/1155-contracts

coverage:
uses: ./.github/workflows/coverage.yml
with:
package: "1155-contracts"
files_to_ignore: '"*DeploymentConfig*" "*Redeem*" "*deployment*" "*packages*"'
28 changes: 28 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
on:
workflow_call:
inputs:
package_folder:
required: true
type: string

jobs:
check:
strategy:
fail-fast: true

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

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

- name: Cache build
uses: ./.github/actions/cache_foundry_build
with:
package_folder: ${{ inputs.package_folder }}

- name: Build contracts
run: |
cd ${{ inputs.package_folder}} && forge build
17 changes: 17 additions & 0 deletions .github/workflows/contracts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: "Contracts"

on: "push"

jobs:
contracts-1155:
name: 1155
uses: ./.github/workflows/1155.yml

contracts-protocol-rewards:
name: Protocol Rewards
uses: ./.github/workflows/protocol-rewards.yml

contracts-protocol-deployments:
name: Protocol Deployments
uses: ./.github/workflows/protocol-deployments.yml
secrets: inherit
8 changes: 7 additions & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
strategy:
fail-fast: true

name: Check solidity test coverage
name: Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -29,6 +29,12 @@ jobs:
- name: Install node deps and founry
uses: ./.github/actions/setup_deps

- name: Cache build
uses: ./.github/actions/cache_foundry_build
with:
package_folder: packages/${{ inputs.package }}
foundry_profile: coverage

- name: Run Forge coverage
run: cd $package_folder && forge coverage --report lcov

Expand Down
150 changes: 0 additions & 150 deletions .github/workflows/foundry.yml

This file was deleted.

16 changes: 16 additions & 0 deletions .github/workflows/protocol-deployments.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: "1155"
on:
workflow_call:

jobs:
build:
uses: ./.github/workflows/build.yml
with:
package_folder: packages/protocol-deployments

test:
needs: build
uses: ./.github/workflows/test.yml
with:
package_folder: packages/protocol-deployments
secrets: inherit
21 changes: 21 additions & 0 deletions .github/workflows/protocol-rewards.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: "Protocol Rewards"
on:
workflow_call:

jobs:
build:
uses: ./.github/workflows/build.yml
with:
package_folder: packages/protocol-rewards

test:
needs: build
uses: ./.github/workflows/test.yml
with:
package_folder: packages/protocol-rewards

coverage:
uses: ./.github/workflows/coverage.yml
with:
package: "protocol-rewards"
files_to_ignore: '"*lib*"'
30 changes: 30 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
on:
workflow_call:
inputs:
package_folder:
required: true
type: string

jobs:
check:
strategy:
fail-fast: true

name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

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

- name: Load foundry cache
uses: ./.github/actions/cache_foundry_build
with:
package_folder: ${{ inputs.package_folder }}

- name: Test
run: |
cd ${{ inputs.package_folder}} && yarn test
env:
ALCHEMY_KEY: ${{ secrets.ALCHEMY_KEY }}
7 changes: 7 additions & 0 deletions packages/1155-contracts/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @zoralabs/zora-1155-contracts

## 2.4.0

### Minor Changes

- 366ac20: Fix broken storage layout by not including an interface on CreatorRoyaltiesControl
- e25ac54: ignore nonzero supply royalty schedule

## 2.3.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/1155-contracts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@zoralabs/zora-1155-contracts",
"version": "2.3.1",
"version": "2.4.0",
"repository": "[email protected]:ourzora/zora-protocol.git",
"author": "Iain <[email protected]>",
"license": "MIT",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {IERC2981} from "@openzeppelin/contracts/interfaces/IERC2981.sol";
/// @title CreatorRoyaltiesControl
/// @author ZORA @iainnash / @tbtstl
/// @notice Contract for managing the royalties of an 1155 contract
abstract contract CreatorRoyaltiesControl is CreatorRoyaltiesStorageV1, SharedBaseConstants, ICreatorRoyaltyErrors {
abstract contract CreatorRoyaltiesControl is CreatorRoyaltiesStorageV1, SharedBaseConstants {
uint256 immutable ROYALTY_BPS_TO_PERCENT = 10_000;

/// @notice The royalty information for a given token.
Expand Down Expand Up @@ -41,7 +41,7 @@ abstract contract CreatorRoyaltiesControl is CreatorRoyaltiesStorageV1, SharedBa
}
// Don't allow setting royalties to burn address
if (configuration.royaltyRecipient == address(0) && configuration.royaltyBPS > 0) {
revert InvalidMintSchedule();
revert ICreatorRoyaltyErrors.InvalidMintSchedule();
}
royalties[tokenId] = configuration;

Expand Down
4 changes: 2 additions & 2 deletions packages/1155-contracts/src/version/ContractVersionBase.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file is automatically generated by code; do not manually update
// Last updated on 2023-11-06T00:58:51.853Z
// Last updated on 2023-11-09T00:33:12.481Z
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

Expand All @@ -10,6 +10,6 @@ import {IVersionedContract} from "../interfaces/IVersionedContract.sol";
contract ContractVersionBase is IVersionedContract {
/// @notice The version of the contract
function contractVersion() external pure override returns (string memory) {
return "2.3.1";
return "2.4.0";
}
}
Loading

0 comments on commit 15f4727

Please sign in to comment.