Skip to content
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 12 additions & 0 deletions lib/openzeppelin-contracts/.changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": [
"@changesets/changelog-github",
{
"repo": "OpenZeppelin/openzeppelin-contracts"
}
],
"commit": false,
"access": "public",
"baseBranch": "master"
}
16 changes: 16 additions & 0 deletions lib/openzeppelin-contracts/.codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
comment: off
github_checks:
annotations: false
coverage:
status:
patch:
default:
target: 95%
only_pulls: true
project:
default:
threshold: 1%
ignore:
- "test"
- "contracts/mocks"
- "contracts/vendor"
21 changes: 21 additions & 0 deletions lib/openzeppelin-contracts/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

[*]
charset = utf-8
end_of_line = lf
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = false
max_line_length = 120

[*.sol]
indent_size = 4

[*.js]
indent_size = 2

[*.{adoc,md}]
max_line_length = 0
21 changes: 21 additions & 0 deletions lib/openzeppelin-contracts/.github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: Bug report
about: Report a bug in OpenZeppelin Contracts

---

<!-- Briefly describe the issue you're experiencing. Tell us what you were trying to do and what happened instead. -->

<!-- Remember, this is not a place to ask for help debugging code. For that, we welcome you in the OpenZeppelin Community Forum: https://forum.openzeppelin.com/. -->

**💻 Environment**

<!-- Tell us what version of OpenZeppelin Contracts you're using, and how you're using it: Hardhat, Remix, etc. -->

**📝 Details**

<!-- Describe the problem you have been experiencing in more detail. Include as much information as you think is relevant. Keep in mind that transactions can fail for many reasons; context is key here. -->

**🔢 Code to reproduce bug**

<!-- We will be able to better help if you provide a minimal example that triggers the bug. -->
4 changes: 4 additions & 0 deletions lib/openzeppelin-contracts/.github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
contact_links:
- name: Questions & Support Requests
url: https://forum.openzeppelin.com/c/support/contracts/18
about: Ask in the OpenZeppelin Forum
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: Feature request
about: Suggest an idea for OpenZeppelin Contracts

---

**🧐 Motivation**
<!-- Is your feature request related to a specific problem? Is it just a crazy idea? Tell us about it! -->

**📝 Details**
<!-- Please describe your feature request in detail. -->

<!-- Make sure that you have reviewed the OpenZeppelin Contracts Contributor Guidelines. -->
<!-- https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/CONTRIBUTING.md -->
20 changes: 20 additions & 0 deletions lib/openzeppelin-contracts/.github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!-- Thank you for your interest in contributing to OpenZeppelin! -->

<!-- Consider opening an issue for discussion prior to submitting a PR. -->
<!-- New features will be merged faster if they were first discussed and designed with the team. -->

Fixes #???? <!-- Fill in with issue number -->

<!-- Describe the changes introduced in this pull request. -->
<!-- Include any context necessary for understanding the PR's purpose. -->


#### PR Checklist

<!-- Before merging the pull request all of the following must be complete. -->
<!-- Feel free to submit a PR or Draft PR even if some items are pending. -->
<!-- Some of the items may not apply. -->

- [ ] Tests
- [ ] Documentation
- [ ] Changeset entry (run `npx changeset add`)
51 changes: 51 additions & 0 deletions lib/openzeppelin-contracts/.github/actions/gas-compare/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Compare gas costs
description: Compare gas costs between branches
inputs:
token:
description: GitHub token, required to access GitHub API
required: true
report:
description: Path to the report to compare
required: false
default: gasReporterOutput.json
out_report:
description: Path to save the output report
required: false
default: ${{ github.ref_name }}.gasreport.json
ref_report:
description: Path to the reference report for comparison
required: false
default: ${{ github.base_ref }}.gasreport.json

runs:
using: composite
steps:
- name: Download reference report
if: github.event_name == 'pull_request'
run: |
RUN_ID=`gh run list --repo ${{ github.repository }} --branch ${{ github.base_ref }} --workflow ${{ github.workflow }} --limit 100 --json 'conclusion,databaseId,event' --jq 'map(select(.conclusion=="success" and .event!="pull_request"))[0].databaseId'`
gh run download ${RUN_ID} --repo ${{ github.repository }} -n gasreport
env:
GITHUB_TOKEN: ${{ inputs.token }}
shell: bash
continue-on-error: true
id: reference
- name: Compare reports
if: steps.reference.outcome == 'success' && github.event_name == 'pull_request'
run: |
node scripts/checks/compareGasReports.js ${{ inputs.report }} ${{ inputs.ref_report }} >> $GITHUB_STEP_SUMMARY
env:
STYLE: markdown
shell: bash
- name: Rename report for upload
if: github.event_name != 'pull_request'
run: |
mv ${{ inputs.report }} ${{ inputs.out_report }}
shell: bash
- name: Save report
if: github.event_name != 'pull_request'
uses: actions/upload-artifact@v4
with:
name: gasreport
overwrite: true
path: ${{ inputs.out_report }}
22 changes: 22 additions & 0 deletions lib/openzeppelin-contracts/.github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Setup
description: Common environment setup

runs:
using: composite
steps:
- uses: actions/setup-node@v4
with:
node-version: 20.x
- uses: actions/cache@v4
id: cache
with:
path: '**/node_modules'
key: npm-v3-${{ hashFiles('**/package-lock.json') }}
- name: Install dependencies
run: npm ci
shell: bash
if: steps.cache.outputs.cache-hit != 'true'
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: stable
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Compare storage layouts
description: Compare storage layouts between branches
inputs:
token:
description: github token
required: true
buildinfo:
description: compilation artifacts
required: false
default: artifacts/build-info/*.json
layout:
description: extracted storage layout
required: false
default: HEAD.layout.json
out_layout:
description: storage layout to upload
required: false
default: ${{ github.ref_name }}.layout.json
ref_layout:
description: storage layout for the reference branch
required: false
default: ${{ github.base_ref }}.layout.json

runs:
using: composite
steps:
- name: Extract layout
run: |
node scripts/checks/extract-layout.js ${{ inputs.buildinfo }} > ${{ inputs.layout }}
shell: bash
- name: Download reference
if: github.event_name == 'pull_request'
run: |
RUN_ID=`gh run list --repo ${{ github.repository }} --branch ${{ github.base_ref }} --workflow ${{ github.workflow }} --limit 100 --json 'conclusion,databaseId,event' --jq 'map(select(.conclusion=="success" and .event!="pull_request"))[0].databaseId'`
gh run download ${RUN_ID} --repo ${{ github.repository }} -n layout
env:
GITHUB_TOKEN: ${{ inputs.token }}
shell: bash
continue-on-error: true
id: reference
- name: Compare layouts
if: steps.reference.outcome == 'success' && github.event_name == 'pull_request'
run: |
node scripts/checks/compare-layout.js --head ${{ inputs.layout }} --ref ${{ inputs.ref_layout }}
shell: bash
- name: Rename artifacts for upload
if: github.event_name != 'pull_request'
run: |
mv ${{ inputs.layout }} ${{ inputs.out_layout }}
shell: bash
- name: Save artifacts
if: github.event_name != 'pull_request'
uses: actions/upload-artifact@v4
with:
name: layout
overwrite: true
path: ${{ inputs.out_layout }}
18 changes: 18 additions & 0 deletions lib/openzeppelin-contracts/.github/workflows/actionlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: lint workflows

on:
pull_request:
paths:
- '.github/**/*.ya?ml'

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Add problem matchers
run: |
# https://github.com/rhysd/actionlint/blob/3a2f2c7/docs/usage.md#problem-matchers
curl -LO https://raw.githubusercontent.com/rhysd/actionlint/main/.github/actionlint-matcher.json
echo "::add-matcher::actionlint-matcher.json"
- uses: docker://rhysd/actionlint:latest
28 changes: 28 additions & 0 deletions lib/openzeppelin-contracts/.github/workflows/changeset.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: changeset

on:
pull_request:
branches:
- master
types:
- opened
- synchronize
- labeled
- unlabeled

concurrency:
group: changeset-${{ github.ref }}
cancel-in-progress: true

jobs:
check:
runs-on: ubuntu-latest
if: ${{ !contains(github.event.pull_request.labels.*.name, 'ignore-changeset') }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Include history so Changesets finds merge-base
- name: Set up environment
uses: ./.github/actions/setup
- name: Check changeset
run: npx changeset status --since=origin/${{ github.base_ref }}
Loading