forked from OpenZeppelin/openzeppelin-contracts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into modular-exponentiat…
…ion-precompile-wrapper-OpenZeppelin#1985
- Loading branch information
Showing
683 changed files
with
40,115 additions
and
28,766 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'openzeppelin-solidity': major | ||
--- | ||
|
||
`TimelockController`: Changed the role architecture to use `DEFAULT_ADMIN_ROLE` as the admin for all roles, instead of the bespoke `TIMELOCK_ADMIN_ROLE` that was used previously. This aligns with the general recommendation for `AccessControl` and makes the addition of new roles easier. Accordingly, the `admin` parameter and timelock will now be granted `DEFAULT_ADMIN_ROLE` instead of `TIMELOCK_ADMIN_ROLE`. ([#3799](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3799)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
'openzeppelin-solidity': major | ||
--- | ||
Use `abi.encodeCall` in place of `abi.encodeWithSelector` and `abi.encodeWithSignature` for improved type-checking of parameters |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'openzeppelin-solidity': major | ||
--- | ||
|
||
`ERC20`, `ERC1155`: Deleted `_beforeTokenTransfer` and `_afterTokenTransfer` hooks, added a new internal `_update` function for customizations, and refactored all extensions using those hooks to use `_update` instead. ([#3838](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3838), [#3876](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3876)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'openzeppelin-solidity': major | ||
--- | ||
|
||
`ERC1155Supply`: add a `totalSupply()` function that returns the total amount of token circulating, this change will restrict the total tokens minted across all ids to 2\*\*256-1 . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'openzeppelin-solidity': major | ||
--- | ||
|
||
`Ownable`: Add an `initialOwner` parameter to the constructor, making the ownership initialization explicit. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'openzeppelin-solidity': patch | ||
--- | ||
|
||
Optimize `Strings.equal` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'openzeppelin-solidity': patch | ||
--- | ||
|
||
`ECDSA`: Use unchecked arithmetic for the `tryRecover` function that receives the `r` and `vs` short-signature fields separately. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'openzeppelin-solidity': major | ||
--- | ||
|
||
`Checkpoints`: library moved from `utils` to `utils/structs` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'openzeppelin-solidity': major | ||
--- | ||
|
||
`Nonces`: Added a new contract to keep track of user nonces. Used for signatures in `ERC20Permit`, `ERC20Votes`, and `ERC721Votes`. ([#3816](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3816)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'openzeppelin-solidity': major | ||
--- | ||
|
||
Overrides are now used internally for a number of functions that were previously hardcoded to their default implementation in certain locations: `ERC1155Supply.totalSupply`, `ERC721.ownerOf`, `ERC721.balanceOf` and `ERC721.totalSupply` in `ERC721Enumerable`, `ERC20.totalSupply` in `ERC20FlashMint`, and `ERC1967._getImplementation` in `ERC1967Proxy`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'openzeppelin-solidity': major | ||
--- | ||
|
||
`ProxyAdmin`: Removed `getProxyAdmin` and `getProxyImplementation` getters. ([#3820](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3820)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'openzeppelin-solidity': patch | ||
--- | ||
|
||
`ERC1155`: Optimize array allocation. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'openzeppelin-solidity': major | ||
--- | ||
|
||
Bump minimum compiler version required to 0.8.19 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
'openzeppelin-solidity': major | ||
--- | ||
|
||
`ERC20Votes`: Changed internal vote accounting to reusable `Votes` module previously used by `ERC721Votes`. Removed implicit `ERC20Permit` inheritance. Note that the `DOMAIN_SEPARATOR` getter was previously guaranteed to be available for `ERC20Votes` contracts, but is no longer available unless `ERC20Permit` is explicitly used; ERC-5267 support is included in `ERC20Votes` with `EIP712` and is recommended as an alternative. | ||
|
||
pr: #3816 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'openzeppelin-solidity': major | ||
--- | ||
|
||
`TransparentUpgradeableProxy`: Removed `admin` and `implementation` getters, which were only callable by the proxy owner and thus not very useful. ([#3820](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3820)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'openzeppelin-solidity': major | ||
--- | ||
|
||
`ERC1155`: Remove check for address zero in `balanceOf`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'openzeppelin-solidity': patch | ||
--- | ||
|
||
`ERC721Consecutive`: Add a `_firstConsecutiveId` internal function that can be overridden to change the id of the first token minted through `_mintConsecutive`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'openzeppelin-solidity': patch | ||
--- | ||
|
||
`Governor`: Add a mechanism to restrict the address of the proposer using a suffix in the description. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'openzeppelin-solidity': minor | ||
--- | ||
|
||
Remove the `override` specifier from functions that only override a single interface function. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'openzeppelin-solidity': major | ||
--- | ||
|
||
`SafeERC20`: Refactor `safeDecreaseAllowance` and `safeIncreaseAllowance` to support USDT-like tokens. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,20 @@ | ||
{ | ||
"root": true, | ||
"extends" : [ | ||
"standard" | ||
], | ||
"plugins": [ | ||
"mocha" | ||
"eslint:recommended", | ||
"prettier", | ||
], | ||
"env": { | ||
"browser" : true, | ||
"node" : true, | ||
"mocha" : true, | ||
"jest" : true, | ||
"es2022": true, | ||
"browser": true, | ||
"node": true, | ||
"mocha": true, | ||
}, | ||
"globals" : { | ||
"artifacts": false, | ||
"contract": false, | ||
"assert": false, | ||
"web3": false, | ||
"usePlugin": false, | ||
"extendEnvironment": false, | ||
}, | ||
"rules": { | ||
|
||
// Strict mode | ||
"strict": ["error", "global"], | ||
|
||
// Code style | ||
"array-bracket-spacing": ["off"], | ||
"camelcase": ["error", {"properties": "always"}], | ||
"comma-dangle": ["error", "always-multiline"], | ||
"comma-spacing": ["error", {"before": false, "after": true}], | ||
"dot-notation": ["error", {"allowKeywords": true, "allowPattern": ""}], | ||
"eol-last": ["error", "always"], | ||
"eqeqeq": ["error", "smart"], | ||
"generator-star-spacing": ["error", "before"], | ||
"indent": ["error", 2], | ||
"linebreak-style": ["error", "unix"], | ||
"max-len": ["error", 120, 2], | ||
"no-debugger": "off", | ||
"no-dupe-args": "error", | ||
"no-dupe-keys": "error", | ||
"no-mixed-spaces-and-tabs": ["error", "smart-tabs"], | ||
"no-redeclare": ["error", {"builtinGlobals": true}], | ||
"no-trailing-spaces": ["error", { "skipBlankLines": false }], | ||
"no-undef": "error", | ||
"no-use-before-define": "off", | ||
"no-var": "error", | ||
"object-curly-spacing": ["error", "always"], | ||
"prefer-const": "error", | ||
"quotes": ["error", "single"], | ||
"semi": ["error", "always"], | ||
"space-before-function-paren": ["error", "always"], | ||
|
||
"mocha/no-exclusive-tests": ["error"], | ||
|
||
"promise/always-return": "off", | ||
"promise/avoid-new": "off", | ||
}, | ||
"parserOptions": { | ||
"ecmaVersion": 2020 | ||
"artifacts": "readonly", | ||
"contract": "readonly", | ||
"web3": "readonly", | ||
"extendEnvironment": "readonly", | ||
"expect": "readonly", | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: Compare storage layouts | ||
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@v3 | ||
with: | ||
name: layout | ||
path: ${{ inputs.out_layout }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@v3 | ||
- 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 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@v3 | ||
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 }} |
Oops, something went wrong.