Compare commits
201 Commits
next-v5.0
...
v5.0.0-rc.
| Author | SHA1 | Date | |
|---|---|---|---|
| a14d8149ed | |||
| 7a4064d886 | |||
| bf629d4ea7 | |||
| aef22bddc9 | |||
| bc96591f65 | |||
| fb2aec6946 | |||
| 322df4226d | |||
| 4ce98d75bf | |||
| 3a1e1bd336 | |||
| 57c84f6bb8 | |||
| 8f3f4f7f17 | |||
| 621fc0fe99 | |||
| 011c8bb034 | |||
| 53f2721e8c | |||
| b805cc82d3 | |||
| 33894d2a5b | |||
| 9aaca67aa6 | |||
| abcec9e4a3 | |||
| b55b47d421 | |||
| 0d6703b852 | |||
| f7db0bea31 | |||
| 64da2c10a4 | |||
| 68204769a1 | |||
| 652d0c5fb3 | |||
| 2215d9fd5e | |||
| 618304cc01 | |||
| af06fdcfd4 | |||
| d555464c53 | |||
| a714fe6dbd | |||
| 05205ab2e1 | |||
| 224c23b38f | |||
| 80b2d1df38 | |||
| 3bd9ed377e | |||
| 75eb7c2d49 | |||
| e48f8fd0d2 | |||
| 6f1685c3eb | |||
| 60e3ffe6a3 | |||
| 63851f8de5 | |||
| 36bf1e46fa | |||
| b6111faac8 | |||
| 095c8e120c | |||
| 9e09e0653a | |||
| a07f28b00c | |||
| bba33516b1 | |||
| 01659449d4 | |||
| 7ae7f3ef4b | |||
| 26c22169f0 | |||
| 6f80048ce9 | |||
| d54f4ac4b7 | |||
| a05a529049 | |||
| 25c416d01c | |||
| 5a77c9995f | |||
| e2a9353dea | |||
| 87f7a2cd42 | |||
| bb7ca7d151 | |||
| 5abbd04933 | |||
| ff9d089dad | |||
| 33cab7cd25 | |||
| 9ef69c03d1 | |||
| 1523a4f071 | |||
| e7ba2f7784 | |||
| f154bc31d4 | |||
| 9d2adccf87 | |||
| 630844ef50 | |||
| e891ec587d | |||
| 9612083826 | |||
| a503ba1a0a | |||
| c0545f741b | |||
| 98b83dfbaa | |||
| 424149a682 | |||
| b7da617d8d | |||
| 00c5da2034 | |||
| 10e00c8ef5 | |||
| 8186c07a83 | |||
| 8a0b7bed82 | |||
| 3266bca150 | |||
| cd67894914 | |||
| 812404cee8 | |||
| a5ed318634 | |||
| b2e7bab920 | |||
| 98203a72a6 | |||
| adbb8c9d27 | |||
| fab65cd08b | |||
| 9e3f4d60c5 | |||
| 8643fd45fd | |||
| cb0ffefe2f | |||
| b5a3e693e7 | |||
| 48b860124c | |||
| 736091afc4 | |||
| 70578bbb44 | |||
| 9bb8008c23 | |||
| 1169bb1e51 | |||
| 54a235f895 | |||
| b81bec4552 | |||
| f715365ec4 | |||
| 21716722ad | |||
| d39df78f6c | |||
| 5ae630684a | |||
| 48cc8a92f5 | |||
| fa680739e9 | |||
| 00cbf5a236 | |||
| d6b63a48ba | |||
| f631d8a5f0 | |||
| aed5720a01 | |||
| 02ea01765a | |||
| 9445f96223 | |||
| 7c02b5cab2 | |||
| 7222a31d54 | |||
| 28d9ac2bdb | |||
| 19293f3ecd | |||
| f347b410cf | |||
| 21bb89ef5b | |||
| 121be5dd09 | |||
| 9cf873ea14 | |||
| 84db204a41 | |||
| a55af77c75 | |||
| 4d4a509b1f | |||
| b6c5abbde5 | |||
| 0abf18f305 | |||
| 921ac49ccb | |||
| 8b72e20e32 | |||
| 24ebff5ae9 | |||
| 3d0edbecf1 | |||
| cd981f6521 | |||
| 2a4396c9dd | |||
| 4bac6fa310 | |||
| e47b53bce4 | |||
| 5229b75785 | |||
| 6d74b91388 | |||
| f5bf7233cb | |||
| 0053ee040a | |||
| 996168f1f1 | |||
| 7ccea54dc1 | |||
| 6bf68a41d1 | |||
| 3fe28e19af | |||
| 3ff9b42ff5 | |||
| 63bfab1a0c | |||
| 90163661df | |||
| e3adf91e50 | |||
| 6e21422737 | |||
| bb64458928 | |||
| 06861dce54 | |||
| 37270eb08a | |||
| 621b867b1a | |||
| 04342118dc | |||
| 874c2d3c02 | |||
| d6a8b2ccd7 | |||
| 023894deef | |||
| f29307cfe0 | |||
| 8cab922347 | |||
| cb4bf950df | |||
| c44c220254 | |||
| da89c438f1 | |||
| a7a94c7746 | |||
| 1e0e4e20bb | |||
| 6ddacdbde8 | |||
| dac2457a80 | |||
| b66c77a1fc | |||
| 9fa550c62f | |||
| 2271e2c58d | |||
| 365aca6d60 | |||
| 1d0dbcf9ab | |||
| 1f4e33fb72 | |||
| fc19a7947c | |||
| c95a445130 | |||
| 1a77a508f9 | |||
| 002a7c8812 | |||
| cd48b3eab3 | |||
| 6724873895 | |||
| c014c8f148 | |||
| ff85c7b0eb | |||
| 05ef6924ac | |||
| 2477534260 | |||
| ac5480e7ca | |||
| ef103f37e4 | |||
| 5cc1ea0a39 | |||
| 7cc2cbfeb5 | |||
| 604025400f | |||
| d6c7cee321 | |||
| fe08f58c69 | |||
| b425a72240 | |||
| 08fd777f6d | |||
| e73f90fa9d | |||
| cc04263170 | |||
| 1d5bcd04e7 | |||
| d9474327a4 | |||
| df2778f38e | |||
| 4fd2f8be33 | |||
| 85696d80ad | |||
| 6c14de4f0c | |||
| 253bfa68c2 | |||
| ffceb3cd98 | |||
| eecd5e15c7 | |||
| 2d1da295e6 | |||
| 3902a410f1 | |||
| 5cef83d2c7 | |||
| 30256fa838 | |||
| 2ee1da12c4 | |||
| a522187b50 | |||
| 7f5e91062e | |||
| fa112be682 |
5
.changeset/afraid-walls-smell.md
Normal file
5
.changeset/afraid-walls-smell.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': major
|
||||
---
|
||||
|
||||
`ERC1155Receiver`: Removed in favor of `ERC1155Holder`.
|
||||
@ -1,5 +0,0 @@
|
||||
---
|
||||
'openzeppelin-solidity': major
|
||||
---
|
||||
|
||||
Remove deprecated GovernorProposalThreshold module.
|
||||
4
.changeset/big-plums-cover.md
Normal file
4
.changeset/big-plums-cover.md
Normal file
@ -0,0 +1,4 @@
|
||||
---
|
||||
'openzeppelin-solidity': major
|
||||
---
|
||||
Use `abi.encodeCall` in place of `abi.encodeWithSelector` and `abi.encodeWithSignature` for improved type-checking of parameters
|
||||
5
.changeset/blue-horses-do.md
Normal file
5
.changeset/blue-horses-do.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': major
|
||||
---
|
||||
|
||||
`ERC2771Forwarder`: Added `deadline` for expiring transactions, batching, and more secure handling of `msg.value`.
|
||||
5
.changeset/blue-scissors-design.md
Normal file
5
.changeset/blue-scissors-design.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': minor
|
||||
---
|
||||
|
||||
`Math`: Make `ceilDiv` to revert on 0 division even if the numerator is 0
|
||||
5
.changeset/brave-lobsters-punch.md
Normal file
5
.changeset/brave-lobsters-punch.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': major
|
||||
---
|
||||
|
||||
`Governor`: Refactored internals to implement common queuing logic in the core module of the Governor. Added `queue` and `_queueOperations` functions that act at different levels. Modules that implement queuing via timelocks are expected to override `_queueOperations` to implement the timelock-specific logic. Added `_executeOperations` as the equivalent for execution.
|
||||
@ -2,4 +2,4 @@
|
||||
'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))
|
||||
`ERC20`, `ERC721`, `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), [#4377](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4377))
|
||||
|
||||
5
.changeset/clever-bats-kick.md
Normal file
5
.changeset/clever-bats-kick.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': patch
|
||||
---
|
||||
|
||||
`Ownable`: Prevent using address(0) as the initial owner.
|
||||
@ -1,5 +0,0 @@
|
||||
---
|
||||
'openzeppelin-solidity': major
|
||||
---
|
||||
|
||||
Removed presets in favor of [OpenZeppelin Contracts Wizard](https://wizard.openzeppelin.com/).
|
||||
6
.changeset/dull-ghosts-sip.md
Normal file
6
.changeset/dull-ghosts-sip.md
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
'openzeppelin-solidity': patch
|
||||
---
|
||||
|
||||
`AccessManager`, `AccessManaged`, `GovernorTimelockAccess`: Ensure that calldata shorter than 4 bytes is not padded to 4 bytes.
|
||||
pr: #4624
|
||||
5
.changeset/eight-peaches-guess.md
Normal file
5
.changeset/eight-peaches-guess.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': minor
|
||||
---
|
||||
|
||||
`Proxy`: Removed redundant `receive` function.
|
||||
5
.changeset/eighty-crabs-listen.md
Normal file
5
.changeset/eighty-crabs-listen.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': patch
|
||||
---
|
||||
|
||||
Optimize `Strings.equal`
|
||||
5
.changeset/eighty-lemons-shake.md
Normal file
5
.changeset/eighty-lemons-shake.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': major
|
||||
---
|
||||
|
||||
`ERC721`: `_approve` no longer allows approving the owner of the tokenId. `_setApprovalForAll` no longer allows setting address(0) as an operator.
|
||||
5
.changeset/empty-cheetahs-hunt.md
Normal file
5
.changeset/empty-cheetahs-hunt.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': major
|
||||
---
|
||||
|
||||
`ERC721URIStorage`: Allow setting the token URI prior to minting.
|
||||
5
.changeset/empty-taxis-kiss.md
Normal file
5
.changeset/empty-taxis-kiss.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': major
|
||||
---
|
||||
|
||||
`UUPSUpgradeable`, `TransparentUpgradeableProxy` and `ProxyAdmin`: Removed `upgradeTo` and `upgrade` functions, and made `upgradeToAndCall` and `upgradeAndCall` ignore the data argument if it is empty. It is no longer possible to invoke the receive function (or send value with empty data) along with an upgrade.
|
||||
5
.changeset/fair-humans-peel.md
Normal file
5
.changeset/fair-humans-peel.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': major
|
||||
---
|
||||
|
||||
`ERC721URIStorage`, `ERC721Royalty`: Stop resetting token-specific URI and royalties when burning.
|
||||
5
.changeset/fifty-owls-retire.md
Normal file
5
.changeset/fifty-owls-retire.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': major
|
||||
---
|
||||
|
||||
`Address`: Removed the ability to customize error messages. A common custom error is always used if the underlying revert reason cannot be bubbled up.
|
||||
7
.changeset/flat-bottles-wonder.md
Normal file
7
.changeset/flat-bottles-wonder.md
Normal file
@ -0,0 +1,7 @@
|
||||
---
|
||||
'openzeppelin-solidity': minor
|
||||
---
|
||||
|
||||
Replace some uses of `abi.encodePacked` with clearer alternatives (e.g. `bytes.concat`, `string.concat`). (#4504)[https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4504]
|
||||
|
||||
pr: #4296
|
||||
5
.changeset/fluffy-countries-buy.md
Normal file
5
.changeset/fluffy-countries-buy.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': minor
|
||||
---
|
||||
|
||||
`Arrays`: Optimize `findUpperBound` by removing redundant SLOAD.
|
||||
@ -1,5 +0,0 @@
|
||||
---
|
||||
'openzeppelin-solidity': major
|
||||
---
|
||||
|
||||
Remove ERC1820Implementer.
|
||||
5
.changeset/four-adults-knock.md
Normal file
5
.changeset/four-adults-knock.md
Normal file
@ -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.
|
||||
@ -1,5 +0,0 @@
|
||||
---
|
||||
'openzeppelin-solidity': major
|
||||
---
|
||||
|
||||
Remove Checkpoints.History.
|
||||
5
.changeset/green-pumpkins-end.md
Normal file
5
.changeset/green-pumpkins-end.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': major
|
||||
---
|
||||
|
||||
`SafeERC20`: Removed `safePermit` in favor of documentation-only `permit` recommendations.
|
||||
5
.changeset/grumpy-bulldogs-call.md
Normal file
5
.changeset/grumpy-bulldogs-call.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': major
|
||||
---
|
||||
|
||||
`Governor`: Optimized use of storage for proposal data
|
||||
5
.changeset/grumpy-poets-rush.md
Normal file
5
.changeset/grumpy-poets-rush.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': major
|
||||
---
|
||||
|
||||
Upgradeable Contracts: No longer transpile interfaces, libraries, and stateless contracts.
|
||||
5
.changeset/grumpy-worms-tease.md
Normal file
5
.changeset/grumpy-worms-tease.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': major
|
||||
---
|
||||
|
||||
`ERC1967Utils`: Refactor the `ERC1967Upgrade` abstract contract as a library.
|
||||
5
.changeset/happy-falcons-walk.md
Normal file
5
.changeset/happy-falcons-walk.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': major
|
||||
---
|
||||
|
||||
`TransparentUpgradeableProxy`: Admin is now stored in an immutable variable (set during construction) to avoid unnecessary storage reads on every proxy call. This removed the ability to ever change the admin. Transfer of the upgrade capability is exclusively handled through the ownership of the `ProxyAdmin`.
|
||||
5
.changeset/healthy-gorillas-applaud.md
Normal file
5
.changeset/healthy-gorillas-applaud.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': major
|
||||
---
|
||||
|
||||
`VestingWallet`: Use `Ownable` instead of an immutable `beneficiary`.
|
||||
5
.changeset/heavy-drinks-fail.md
Normal file
5
.changeset/heavy-drinks-fail.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': major
|
||||
---
|
||||
|
||||
`ERC20`: Remove `Approval` event previously emitted in `transferFrom` to indicate that part of the allowance was consumed. With this change, allowances are no longer reconstructible from events. See the code for guidelines on how to re-enable this event if needed.
|
||||
5
.changeset/hip-beds-provide.md
Normal file
5
.changeset/hip-beds-provide.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': major
|
||||
---
|
||||
|
||||
Move the logic to validate ERC-1822 during an upgrade from `ERC1967Utils` to `UUPSUpgradeable`.
|
||||
5
.changeset/hip-goats-fail.md
Normal file
5
.changeset/hip-goats-fail.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': patch
|
||||
---
|
||||
|
||||
`VestingWallet`: Fix revert during 1 second time window when duration is 0.
|
||||
5
.changeset/hot-coins-judge.md
Normal file
5
.changeset/hot-coins-judge.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': minor
|
||||
---
|
||||
|
||||
`Arrays`: Add `unsafeMemoryAccess` helpers to read from a memory array without checking the length.
|
||||
5
.changeset/hot-dingos-kiss.md
Normal file
5
.changeset/hot-dingos-kiss.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': major
|
||||
---
|
||||
|
||||
`MessageHashUtils`: Add a new library for creating message digest to be used along with signing or recovery such as ECDSA or ERC-1271. These functions are moved from the `ECDSA` library.
|
||||
5
.changeset/hot-plums-approve.md
Normal file
5
.changeset/hot-plums-approve.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': minor
|
||||
---
|
||||
|
||||
`GovernorTimelockControl`: Clean up timelock id on execution for gas refund.
|
||||
@ -1,5 +0,0 @@
|
||||
---
|
||||
'openzeppelin-solidity': major
|
||||
---
|
||||
|
||||
`ERC165Storage`: Removed this contract in favor of inheritance based approach. ([#3880](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3880))
|
||||
5
.changeset/large-humans-remain.md
Normal file
5
.changeset/large-humans-remain.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': patch
|
||||
---
|
||||
|
||||
`MerkleProof`: Use custom error to report invalid multiproof instead of reverting with overflow panic.
|
||||
5
.changeset/lazy-rice-joke.md
Normal file
5
.changeset/lazy-rice-joke.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': minor
|
||||
---
|
||||
|
||||
`Initializable`: Use intermediate variables to improve readability.
|
||||
5
.changeset/little-falcons-build.md
Normal file
5
.changeset/little-falcons-build.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': minor
|
||||
---
|
||||
|
||||
`EIP712`: Add internal getters for the name and version strings
|
||||
5
.changeset/loud-shrimps-play.md
Normal file
5
.changeset/loud-shrimps-play.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': minor
|
||||
---
|
||||
|
||||
`TimelockController`: Add a state getter that returns an `OperationState` enum.
|
||||
5
.changeset/lovely-geckos-hide.md
Normal file
5
.changeset/lovely-geckos-hide.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': major
|
||||
---
|
||||
|
||||
Replace revert strings and require statements with custom errors.
|
||||
6
.changeset/mighty-donuts-smile.md
Normal file
6
.changeset/mighty-donuts-smile.md
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
'openzeppelin-solidity': patch
|
||||
---
|
||||
|
||||
`Governor`: Add validation in ERC1155 and ERC721 receiver hooks to ensure Governor is the executor.
|
||||
|
||||
5
.changeset/orange-apes-draw.md
Normal file
5
.changeset/orange-apes-draw.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': major
|
||||
---
|
||||
|
||||
Switched to using explicit Solidity import statements. Some previously available symbols may now have to be separately imported.
|
||||
5
.changeset/pink-suns-mix.md
Normal file
5
.changeset/pink-suns-mix.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': patch
|
||||
---
|
||||
|
||||
`Math`: Optimized stack operations in `mulDiv`.
|
||||
5
.changeset/popular-deers-raise.md
Normal file
5
.changeset/popular-deers-raise.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': major
|
||||
---
|
||||
|
||||
`Governor`: Add support for casting votes with ERC-1271 signatures by using a `bytes memory signature` instead of `r`, `s` and `v` arguments in the `castVoteBySig` and `castVoteWithReasonAndParamsBySig` functions.
|
||||
89
.changeset/pre.json
Normal file
89
.changeset/pre.json
Normal file
@ -0,0 +1,89 @@
|
||||
{
|
||||
"mode": "pre",
|
||||
"tag": "rc",
|
||||
"initialVersions": {
|
||||
"openzeppelin-solidity": "4.9.2"
|
||||
},
|
||||
"changesets": [
|
||||
"afraid-walls-smell",
|
||||
"angry-ties-switch",
|
||||
"big-plums-cover",
|
||||
"blue-horses-do",
|
||||
"blue-scissors-design",
|
||||
"brave-lobsters-punch",
|
||||
"bright-tomatoes-sing",
|
||||
"chilled-spiders-attack",
|
||||
"clever-bats-kick",
|
||||
"clever-pumas-beg",
|
||||
"dull-ghosts-sip",
|
||||
"eight-peaches-guess",
|
||||
"eighty-crabs-listen",
|
||||
"eighty-lemons-shake",
|
||||
"empty-cheetahs-hunt",
|
||||
"empty-taxis-kiss",
|
||||
"fair-humans-peel",
|
||||
"fifty-owls-retire",
|
||||
"flat-bottles-wonder",
|
||||
"fluffy-countries-buy",
|
||||
"four-adults-knock",
|
||||
"fresh-birds-kiss",
|
||||
"green-pumpkins-end",
|
||||
"grumpy-bulldogs-call",
|
||||
"grumpy-poets-rush",
|
||||
"grumpy-worms-tease",
|
||||
"happy-falcons-walk",
|
||||
"healthy-gorillas-applaud",
|
||||
"heavy-drinks-fail",
|
||||
"hip-beds-provide",
|
||||
"hip-goats-fail",
|
||||
"hot-coins-judge",
|
||||
"hot-dingos-kiss",
|
||||
"hot-plums-approve",
|
||||
"large-humans-remain",
|
||||
"lazy-rice-joke",
|
||||
"little-falcons-build",
|
||||
"loud-shrimps-play",
|
||||
"lovely-geckos-hide",
|
||||
"mean-walls-watch",
|
||||
"mighty-donuts-smile",
|
||||
"orange-apes-draw",
|
||||
"pink-suns-mix",
|
||||
"popular-deers-raise",
|
||||
"proud-seals-complain",
|
||||
"proud-spiders-attend",
|
||||
"purple-cats-cheer",
|
||||
"purple-squids-attend",
|
||||
"quiet-trainers-kick",
|
||||
"red-dots-fold",
|
||||
"rotten-insects-wash",
|
||||
"serious-books-lie",
|
||||
"short-eels-enjoy",
|
||||
"silly-bees-beam",
|
||||
"six-frogs-turn",
|
||||
"sixty-numbers-reply",
|
||||
"slimy-penguins-attack",
|
||||
"smooth-books-wink",
|
||||
"smooth-cougars-jump",
|
||||
"spicy-sheep-eat",
|
||||
"spotty-hotels-type",
|
||||
"strong-poems-thank",
|
||||
"swift-bags-divide",
|
||||
"swift-numbers-cry",
|
||||
"tasty-tomatoes-turn",
|
||||
"tender-shirts-turn",
|
||||
"thick-pumpkins-exercise",
|
||||
"thin-camels-matter",
|
||||
"thirty-drinks-happen",
|
||||
"tough-drinks-hammer",
|
||||
"two-wasps-punch",
|
||||
"unlucky-beans-obey",
|
||||
"violet-dancers-cough",
|
||||
"violet-melons-press",
|
||||
"warm-guests-rule",
|
||||
"wet-bears-heal",
|
||||
"wild-beds-visit",
|
||||
"wild-peas-remain",
|
||||
"wild-rockets-rush",
|
||||
"wild-windows-trade"
|
||||
]
|
||||
}
|
||||
5
.changeset/proud-seals-complain.md
Normal file
5
.changeset/proud-seals-complain.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': patch
|
||||
---
|
||||
|
||||
`BeaconProxy`: Use an immutable variable to store the address of the beacon. It is no longer possible for a `BeaconProxy` to upgrade by changing to another beacon.
|
||||
5
.changeset/proud-spiders-attend.md
Normal file
5
.changeset/proud-spiders-attend.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': major
|
||||
---
|
||||
|
||||
`ERC721`: Renamed `_requireMinted` to `_requireOwned` and added a return value with the current owner. Implemented `ownerOf` in terms of `_requireOwned`.
|
||||
5
.changeset/purple-cats-cheer.md
Normal file
5
.changeset/purple-cats-cheer.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': major
|
||||
---
|
||||
|
||||
`GovernorTimelockControl`: Add the Governor instance address as part of the TimelockController operation `salt` to avoid operation id collisions between governors using the same TimelockController.
|
||||
6
.changeset/purple-squids-attend.md
Normal file
6
.changeset/purple-squids-attend.md
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
'openzeppelin-solidity': patch
|
||||
---
|
||||
|
||||
`AccessManager`: Use named return parameters in functions that return multiple values.
|
||||
pr: #4624
|
||||
5
.changeset/quiet-trainers-kick.md
Normal file
5
.changeset/quiet-trainers-kick.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': minor
|
||||
---
|
||||
|
||||
`AccessManager`: Added a new contract for managing access control of complex systems in a consolidated location.
|
||||
5
.changeset/red-dots-fold.md
Normal file
5
.changeset/red-dots-fold.md
Normal file
@ -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`.
|
||||
@ -1,5 +0,0 @@
|
||||
---
|
||||
'openzeppelin-solidity': major
|
||||
---
|
||||
|
||||
Remove PullPayment and Escrow contracts (Escrow, ConditionalEscrow, RefundEscrow).
|
||||
5
.changeset/serious-books-lie.md
Normal file
5
.changeset/serious-books-lie.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': patch
|
||||
---
|
||||
|
||||
`ERC1155`: Optimize array allocation.
|
||||
@ -2,4 +2,4 @@
|
||||
'openzeppelin-solidity': major
|
||||
---
|
||||
|
||||
Bump minimum compiler version required to 0.8.19
|
||||
Bump minimum compiler version required to 0.8.20
|
||||
|
||||
@ -2,4 +2,6 @@
|
||||
'openzeppelin-solidity': major
|
||||
---
|
||||
|
||||
`ERC20Votes`: Changed internal vote accounting to reusable `Votes` module previously used by `ERC721Votes`. Removed implicit `ERC20Permit` inheritance. [#3816](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3816)
|
||||
`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
|
||||
|
||||
5
.changeset/six-frogs-turn.md
Normal file
5
.changeset/six-frogs-turn.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': major
|
||||
---
|
||||
|
||||
`ERC20`: Remove the non-standard `increaseAllowance` and `decreaseAllowance` functions.
|
||||
5
.changeset/sixty-numbers-reply.md
Normal file
5
.changeset/sixty-numbers-reply.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': major
|
||||
---
|
||||
|
||||
`Governor`: Add `voter` and `nonce` parameters in signed ballots, to avoid forging signatures for random addresses, prevent signature replay, and allow invalidating signatures. Add `voter` as a new parameter in the `castVoteBySig` and `castVoteWithReasonAndParamsBySig` functions.
|
||||
5
.changeset/smooth-cougars-jump.md
Normal file
5
.changeset/smooth-cougars-jump.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': major
|
||||
---
|
||||
|
||||
`ReentrancyGuard`, `Pausable`: Moved to `utils` directory.
|
||||
@ -1,5 +0,0 @@
|
||||
---
|
||||
'openzeppelin-solidity': major
|
||||
---
|
||||
|
||||
Remove the Timers library.
|
||||
5
.changeset/spicy-sheep-eat.md
Normal file
5
.changeset/spicy-sheep-eat.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': major
|
||||
---
|
||||
|
||||
`access`: Move `AccessControl` extensions to a dedicated directory.
|
||||
5
.changeset/strong-poems-thank.md
Normal file
5
.changeset/strong-poems-thank.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': major
|
||||
---
|
||||
|
||||
`DoubleEndedQueue`: refactor internal structure to use `uint128` instead of `int128`. This has no effect on the library interface.
|
||||
5
.changeset/swift-bags-divide.md
Normal file
5
.changeset/swift-bags-divide.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': patch
|
||||
---
|
||||
|
||||
`Governor`: Add a mechanism to restrict the address of the proposer using a suffix in the description.
|
||||
@ -1,5 +0,0 @@
|
||||
---
|
||||
'openzeppelin-solidity': major
|
||||
---
|
||||
|
||||
Remove ERC777 implementation.
|
||||
5
.changeset/swift-numbers-cry.md
Normal file
5
.changeset/swift-numbers-cry.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': minor
|
||||
---
|
||||
|
||||
`Governor`, `Initializable`, and `UUPSUpgradeable`: Use internal functions in modifiers to optimize bytecode size.
|
||||
@ -1,5 +0,0 @@
|
||||
---
|
||||
'openzeppelin-solidity': major
|
||||
---
|
||||
|
||||
Remove SafeMath and SignedSafeMath libraries.
|
||||
5
.changeset/tasty-tomatoes-turn.md
Normal file
5
.changeset/tasty-tomatoes-turn.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': major
|
||||
---
|
||||
|
||||
`Strings`: Rename `toString(int256)` to `toStringSigned(int256)`.
|
||||
5
.changeset/tender-shirts-turn.md
Normal file
5
.changeset/tender-shirts-turn.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': major
|
||||
---
|
||||
|
||||
`BeaconProxy`: Reject value in initialization unless a payable function is explicitly invoked.
|
||||
5
.changeset/thick-pumpkins-exercise.md
Normal file
5
.changeset/thick-pumpkins-exercise.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': major
|
||||
---
|
||||
|
||||
`Initializable`: Use the namespaced storage pattern to avoid putting critical variables in slot 0. Allow reinitializer versions greater than 256.
|
||||
5
.changeset/thin-camels-matter.md
Normal file
5
.changeset/thin-camels-matter.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': minor
|
||||
---
|
||||
|
||||
`ERC1155`: Bubble errors triggered in the `onERC1155Received` and `onERC1155BatchReceived` hooks.
|
||||
5
.changeset/thirty-drinks-happen.md
Normal file
5
.changeset/thirty-drinks-happen.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': major
|
||||
---
|
||||
|
||||
`AccessManager`: Make `schedule` and `execute` more conservative when delay is 0.
|
||||
@ -1,5 +0,0 @@
|
||||
---
|
||||
'openzeppelin-solidity': major
|
||||
---
|
||||
|
||||
Remove CrossChain contracts, including AccessControlCrossChain and all the vendored bridge interfaces.
|
||||
5
.changeset/tough-drinks-hammer.md
Normal file
5
.changeset/tough-drinks-hammer.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': patch
|
||||
---
|
||||
|
||||
`ERC1155`: Optimize array accesses by skipping bounds checking when unnecessary.
|
||||
5
.changeset/two-wasps-punch.md
Normal file
5
.changeset/two-wasps-punch.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': minor
|
||||
---
|
||||
|
||||
`AccessControl`: Add a boolean return value to the internal `_grantRole` and `_revokeRole` functions indicating whether the role was granted or revoked.
|
||||
5
.changeset/unlucky-beans-obey.md
Normal file
5
.changeset/unlucky-beans-obey.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': patch
|
||||
---
|
||||
|
||||
`ERC2771Context`: Return the forwarder address whenever the `msg.data` of a call originating from a trusted forwarder is not long enough to contain the request signer address (i.e. `msg.data.length` is less than 20 bytes), as specified by ERC-2771.
|
||||
@ -1,5 +0,0 @@
|
||||
---
|
||||
'openzeppelin-solidity': patch
|
||||
---
|
||||
|
||||
`Address`: Removed `isContract` because of its ambiguous nature and potential for misuse.
|
||||
5
.changeset/violet-dancers-cough.md
Normal file
5
.changeset/violet-dancers-cough.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': minor
|
||||
---
|
||||
|
||||
Remove the `override` specifier from functions that only override a single interface function.
|
||||
5
.changeset/violet-melons-press.md
Normal file
5
.changeset/violet-melons-press.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': major
|
||||
---
|
||||
|
||||
`GovernorTimelockAccess`: Added a module to connect a governor with an instance of `AccessManager`, allowing the governor to make calls that are delay-restricted by the manager using the normal `queue` workflow.
|
||||
5
.changeset/warm-guests-rule.md
Normal file
5
.changeset/warm-guests-rule.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': patch
|
||||
---
|
||||
|
||||
`ERC2771Context`: Prevent revert in `_msgData()` when a call originating from a trusted forwarder is not long enough to contain the request signer address (i.e. `msg.data.length` is less than 20 bytes). Return the full calldata in that case.
|
||||
5
.changeset/wet-bears-heal.md
Normal file
5
.changeset/wet-bears-heal.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': major
|
||||
---
|
||||
|
||||
Upgradeable contracts now use namespaced storage (EIP-7201).
|
||||
5
.changeset/wild-beds-visit.md
Normal file
5
.changeset/wild-beds-visit.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': major
|
||||
---
|
||||
|
||||
`GovernorStorage`: Added a new governor extension that stores the proposal details in storage, with an interface that operates on `proposalId`, as well as proposal enumerability. This replaces the old `GovernorCompatibilityBravo` module.
|
||||
5
.changeset/wild-peas-remain.md
Normal file
5
.changeset/wild-peas-remain.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': major
|
||||
---
|
||||
|
||||
`Votes`: Use Trace208 for checkpoints. This enables EIP-6372 clock support for keys but reduces the max supported voting power to uint208.
|
||||
5
.changeset/wild-rockets-rush.md
Normal file
5
.changeset/wild-rockets-rush.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'openzeppelin-solidity': major
|
||||
---
|
||||
|
||||
`Math`: Renamed members of `Rounding` enum, and added a new rounding mode for "away from zero".
|
||||
8
.github/actions/setup/action.yml
vendored
8
.github/actions/setup/action.yml
vendored
@ -5,7 +5,7 @@ runs:
|
||||
steps:
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 14.x
|
||||
node-version: 16.x
|
||||
- uses: actions/cache@v3
|
||||
id: cache
|
||||
with:
|
||||
@ -15,5 +15,7 @@ runs:
|
||||
run: npm ci
|
||||
shell: bash
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
env:
|
||||
SKIP_COMPILE: true
|
||||
- name: Install Foundry
|
||||
uses: foundry-rs/foundry-toolchain@v1
|
||||
with:
|
||||
version: nightly
|
||||
|
||||
2
.github/workflows/actionlint.yml
vendored
2
.github/workflows/actionlint.yml
vendored
@ -9,7 +9,7 @@ jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Add problem matchers
|
||||
run: |
|
||||
# https://github.com/rhysd/actionlint/blob/3a2f2c7/docs/usage.md#problem-matchers
|
||||
|
||||
2
.github/workflows/changeset.yml
vendored
2
.github/workflows/changeset.yml
vendored
@ -19,7 +19,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ !contains(github.event.pull_request.labels.*.name, 'ignore-changeset') }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0 # Include history so Changesets finds merge-base
|
||||
- name: Set up environment
|
||||
|
||||
35
.github/workflows/checks.yml
vendored
35
.github/workflows/checks.yml
vendored
@ -13,11 +13,14 @@ concurrency:
|
||||
group: checks-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
NODE_OPTIONS: --max_old_space_size=5120
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up environment
|
||||
uses: ./.github/actions/setup
|
||||
- run: npm run lint
|
||||
@ -26,10 +29,9 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
FORCE_COLOR: 1
|
||||
NODE_OPTIONS: --max_old_space_size=4096
|
||||
GAS: true
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up environment
|
||||
uses: ./.github/actions/setup
|
||||
- name: Run tests and generate gas report
|
||||
@ -40,6 +42,7 @@ jobs:
|
||||
run: npm run test:generation
|
||||
- name: Compare gas costs
|
||||
uses: ./.github/actions/gas-compare
|
||||
if: github.base_ref == 'master'
|
||||
with:
|
||||
token: ${{ github.token }}
|
||||
|
||||
@ -48,46 +51,46 @@ jobs:
|
||||
env:
|
||||
FORCE_COLOR: 1
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0 # Include history so patch conflicts are resolved automatically
|
||||
- name: Set up environment
|
||||
uses: ./.github/actions/setup
|
||||
- name: Copy non-upgradeable contracts as dependency
|
||||
run: |
|
||||
mkdir -p lib/openzeppelin-contracts
|
||||
cp -rnT contracts lib/openzeppelin-contracts/contracts
|
||||
- name: Transpile to upgradeable
|
||||
run: bash scripts/upgradeable/transpile.sh
|
||||
- name: Run tests
|
||||
run: npm run test
|
||||
env:
|
||||
NODE_OPTIONS: --max_old_space_size=4096
|
||||
- name: Check linearisation of the inheritance graph
|
||||
run: npm run test:inheritance
|
||||
- name: Check storage layout
|
||||
uses: ./.github/actions/storage-layout
|
||||
if: github.base_ref == 'master'
|
||||
continue-on-error: ${{ contains(github.event.pull_request.labels.*.name, 'breaking change') }}
|
||||
with:
|
||||
token: ${{ github.token }}
|
||||
|
||||
tests-foundry:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: Install Foundry
|
||||
uses: foundry-rs/foundry-toolchain@v1
|
||||
with:
|
||||
version: nightly
|
||||
- name: Set up environment
|
||||
uses: ./.github/actions/setup
|
||||
- name: Run tests
|
||||
run: forge test -vv
|
||||
|
||||
coverage:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up environment
|
||||
uses: ./.github/actions/setup
|
||||
- run: npm run coverage
|
||||
env:
|
||||
NODE_OPTIONS: --max_old_space_size=4096
|
||||
- uses: codecov/codecov-action@v3
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
@ -95,7 +98,7 @@ jobs:
|
||||
slither:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up environment
|
||||
uses: ./.github/actions/setup
|
||||
- run: rm foundry.toml
|
||||
@ -106,7 +109,7 @@ jobs:
|
||||
codespell:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Run CodeSpell
|
||||
uses: codespell-project/actions-codespell@v2.0
|
||||
with:
|
||||
|
||||
2
.github/workflows/docs.yml
vendored
2
.github/workflows/docs.yml
vendored
@ -11,7 +11,7 @@ jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up environment
|
||||
uses: ./.github/actions/setup
|
||||
- run: bash scripts/git-user-config.sh
|
||||
|
||||
6
.github/workflows/formal-verification.yml
vendored
6
.github/workflows/formal-verification.yml
vendored
@ -12,7 +12,7 @@ on:
|
||||
env:
|
||||
PIP_VERSION: '3.10'
|
||||
JAVA_VERSION: '11'
|
||||
SOLC_VERSION: '0.8.19'
|
||||
SOLC_VERSION: '0.8.20'
|
||||
|
||||
concurrency: ${{ github.workflow }}-${{ github.ref }}
|
||||
|
||||
@ -20,7 +20,7 @@ jobs:
|
||||
apply-diff:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Apply patches
|
||||
run: make -C certora apply
|
||||
|
||||
@ -28,7 +28,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'formal-verification')
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Set up environment
|
||||
|
||||
22
.github/workflows/release-cycle.yml
vendored
22
.github/workflows/release-cycle.yml
vendored
@ -27,7 +27,7 @@ jobs:
|
||||
pull-requests: read
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up environment
|
||||
uses: ./.github/actions/setup
|
||||
- id: state
|
||||
@ -58,7 +58,7 @@ jobs:
|
||||
if: needs.state.outputs.start == 'true'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up environment
|
||||
uses: ./.github/actions/setup
|
||||
- run: bash scripts/git-user-config.sh
|
||||
@ -81,7 +81,7 @@ jobs:
|
||||
if: needs.state.outputs.promote == 'true'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up environment
|
||||
uses: ./.github/actions/setup
|
||||
- run: bash scripts/git-user-config.sh
|
||||
@ -102,7 +102,7 @@ jobs:
|
||||
if: needs.state.outputs.changesets == 'true'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0 # To get all tags
|
||||
- name: Set up environment
|
||||
@ -134,7 +134,7 @@ jobs:
|
||||
if: needs.state.outputs.publish == 'true'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up environment
|
||||
uses: ./.github/actions/setup
|
||||
- id: pack
|
||||
@ -171,7 +171,7 @@ jobs:
|
||||
name: Tarball Integrity Check
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Download tarball artifact
|
||||
id: artifact
|
||||
# Replace with actions/upload-artifact@v3 when
|
||||
@ -192,15 +192,19 @@ jobs:
|
||||
pull-requests: write
|
||||
if: needs.state.outputs.merge == 'true'
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
MERGE_BRANCH: merge/${{ github.ref_name }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0 # All branches
|
||||
- name: Set up environment
|
||||
uses: ./.github/actions/setup
|
||||
- run: bash scripts/git-user-config.sh
|
||||
- name: Create branch to merge
|
||||
run: bash scripts/release/workflow/prepare-release-merge.sh
|
||||
run: |
|
||||
git checkout -B "$MERGE_BRANCH" "$GITHUB_REF_NAME"
|
||||
git push -f origin "$MERGE_BRANCH"
|
||||
- name: Create PR back to master
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
@ -208,7 +212,7 @@ jobs:
|
||||
await github.rest.pulls.create({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
head: 'merge/${{ github.ref_name }}',
|
||||
head: process.env.MERGE_BRANCH,
|
||||
base: 'master',
|
||||
title: '${{ format('Merge {0} branch', github.ref_name) }}'
|
||||
});
|
||||
|
||||
8
.github/workflows/upgradeable.yml
vendored
8
.github/workflows/upgradeable.yml
vendored
@ -11,20 +11,24 @@ jobs:
|
||||
environment: push-upgradeable
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
repository: OpenZeppelin/openzeppelin-contracts-upgradeable
|
||||
fetch-depth: 0
|
||||
token: ${{ secrets.GH_TOKEN_UPGRADEABLE }}
|
||||
- name: Fetch current non-upgradeable branch
|
||||
run: |
|
||||
git fetch "https://github.com/${{ github.repository }}.git" "$REF"
|
||||
git fetch "$REMOTE" master # Fetch default branch first for patch to apply cleanly
|
||||
git fetch "$REMOTE" "$REF"
|
||||
git checkout FETCH_HEAD
|
||||
env:
|
||||
REF: ${{ github.ref }}
|
||||
REMOTE: https://github.com/${{ github.repository }}.git
|
||||
- name: Set up environment
|
||||
uses: ./.github/actions/setup
|
||||
- run: bash scripts/git-user-config.sh
|
||||
- name: Transpile to upgradeable
|
||||
run: bash scripts/upgradeable/transpile-onto.sh ${{ github.ref_name }} origin/${{ github.ref_name }}
|
||||
env:
|
||||
SUBMODULE_REMOTE: https://github.com/${{ github.repository }}.git
|
||||
- run: git push origin ${{ github.ref_name }}
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@ -63,6 +63,7 @@ contracts-exposed
|
||||
|
||||
# Foundry
|
||||
/out
|
||||
/cache_forge
|
||||
|
||||
# Certora
|
||||
.certora*
|
||||
|
||||
@ -10,5 +10,6 @@
|
||||
"singleQuote": false
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"plugins": ["prettier-plugin-solidity"]
|
||||
}
|
||||
|
||||
@ -1,14 +0,0 @@
|
||||
{
|
||||
"rules": {
|
||||
"no-unused-vars": "error",
|
||||
"const-name-snakecase": "error",
|
||||
"contract-name-camelcase": "error",
|
||||
"event-name-camelcase": "error",
|
||||
"func-name-mixedcase": "error",
|
||||
"func-param-name-mixedcase": "error",
|
||||
"modifier-name-mixedcase": "error",
|
||||
"private-vars-leading-underscore": "error",
|
||||
"var-name-mixedcase": "error",
|
||||
"imports-on-top": "error"
|
||||
}
|
||||
}
|
||||
143
CHANGELOG.md
143
CHANGELOG.md
@ -1,14 +1,129 @@
|
||||
# Changelog
|
||||
|
||||
|
||||
## 5.0.0-rc.2 (2023-10-02)
|
||||
|
||||
- `AccessManager`: Make `schedule` and `execute` more conservative when delay is 0.
|
||||
|
||||
## 5.0.0-rc.1 (2023-09-28)
|
||||
|
||||
- Upgradeable Contracts: No longer transpile interfaces, libraries, and stateless contracts. ([#4636](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4636))
|
||||
- `AccessManager`, `AccessManaged`, `GovernorTimelockAccess`: Ensure that calldata shorter than 4 bytes is not padded to 4 bytes. ([#4624](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4624))
|
||||
- `AccessManager`: Use named return parameters in functions that return multiple values. ([#4624](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4624))
|
||||
|
||||
## 5.0.0-rc.0 (2023-09-19)
|
||||
|
||||
- `ERC1155Receiver`: Removed in favor of `ERC1155Holder`. ([#4450](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4450))
|
||||
- `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))
|
||||
|
||||
- Use `abi.encodeCall` in place of `abi.encodeWithSelector` and `abi.encodeWithSignature` for improved type-checking of parameters ([#4293](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4293))
|
||||
- `ERC2771Forwarder`: Added `deadline` for expiring transactions, batching, and more secure handling of `msg.value`. ([#4346](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4346))
|
||||
- `Governor`: Refactored internals to implement common queuing logic in the core module of the Governor. Added `queue` and `_queueOperations` functions that act at different levels. Modules that implement queuing via timelocks are expected to override `_queueOperations` to implement the timelock-specific logic. Added `_executeOperations` as the equivalent for execution. ([#4360](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4360))
|
||||
- `ERC20`, `ERC721`, `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), [#4377](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4377))
|
||||
|
||||
- `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 . ([#3962](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3962))
|
||||
- `Ownable`: Add an `initialOwner` parameter to the constructor, making the ownership initialization explicit. ([#4267](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4267))
|
||||
- `ERC721`: `_approve` no longer allows approving the owner of the tokenId. `_setApprovalForAll` no longer allows setting address(0) as an operator. ([#4377](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4377))
|
||||
- `ERC721URIStorage`: Allow setting the token URI prior to minting. ([#4559](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4559))
|
||||
- `UUPSUpgradeable`, `TransparentUpgradeableProxy` and `ProxyAdmin`: Removed `upgradeTo` and `upgrade` functions, and made `upgradeToAndCall` and `upgradeAndCall` ignore the data argument if it is empty. It is no longer possible to invoke the receive function (or send value with empty data) along with an upgrade. ([#4382](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4382))
|
||||
- `ERC721URIStorage`, `ERC721Royalty`: Stop resetting token-specific URI and royalties when burning. ([#4561](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4561))
|
||||
- `Address`: Removed the ability to customize error messages. A common custom error is always used if the underlying revert reason cannot be bubbled up. ([#4502](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4502))
|
||||
- `Checkpoints`: library moved from `utils` to `utils/structs` ([#4275](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4275))
|
||||
- `SafeERC20`: Removed `safePermit` in favor of documentation-only `permit` recommendations. ([#4582](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4582))
|
||||
- `Governor`: Optimized use of storage for proposal data ([#4268](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4268))
|
||||
- `ERC1967Utils`: Refactor the `ERC1967Upgrade` abstract contract as a library. ([#4325](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4325))
|
||||
- `TransparentUpgradeableProxy`: Admin is now stored in an immutable variable (set during construction) to avoid unnecessary storage reads on every proxy call. This removed the ability to ever change the admin. Transfer of the upgrade capability is exclusively handled through the ownership of the `ProxyAdmin`. ([#4354](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4354))
|
||||
- `VestingWallet`: Use `Ownable` instead of an immutable `beneficiary`. ([#4508](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4508))
|
||||
- `ERC20`: Remove `Approval` event previously emitted in `transferFrom` to indicate that part of the allowance was consumed. With this change, allowances are no longer reconstructible from events. See the code for guidelines on how to re-enable this event if needed. ([#4370](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4370))
|
||||
- Move the logic to validate ERC-1822 during an upgrade from `ERC1967Utils` to `UUPSUpgradeable`. ([#4356](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4356))
|
||||
- `MessageHashUtils`: Add a new library for creating message digest to be used along with signing or recovery such as ECDSA or ERC-1271. These functions are moved from the `ECDSA` library. ([#4430](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4430))
|
||||
- Replace revert strings and require statements with custom errors. ([#4261](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4261))
|
||||
- `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))
|
||||
|
||||
- Switched to using explicit Solidity import statements. Some previously available symbols may now have to be separately imported. ([#4399](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4399))
|
||||
- `Governor`: Add support for casting votes with ERC-1271 signatures by using a `bytes memory signature` instead of `r`, `s` and `v` arguments in the `castVoteBySig` and `castVoteWithReasonAndParamsBySig` functions. ([#4418](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4418))
|
||||
- `ERC721`: Renamed `_requireMinted` to `_requireOwned` and added a return value with the current owner. Implemented `ownerOf` in terms of `_requireOwned`. ([#4566](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4566))
|
||||
- `GovernorTimelockControl`: Add the Governor instance address as part of the TimelockController operation `salt` to avoid operation id collisions between governors using the same TimelockController.
|
||||
- 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`. ([#4299](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4299))
|
||||
- `ProxyAdmin`: Removed `getProxyAdmin` and `getProxyImplementation` getters. ([#3820](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3820))
|
||||
|
||||
- Bump minimum compiler version required to 0.8.20 ([#4288](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4288))
|
||||
- `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. ([#3816](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3816))
|
||||
- `ERC20`: Remove the non-standard `increaseAllowance` and `decreaseAllowance` functions. ([#4585](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4585))
|
||||
- `Governor`: Add `voter` and `nonce` parameters in signed ballots, to avoid forging signatures for random addresses, prevent signature replay, and allow invalidating signatures. Add `voter` as a new parameter in the `castVoteBySig` and `castVoteWithReasonAndParamsBySig` functions. ([#4378](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4378))
|
||||
- `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))
|
||||
|
||||
- `ERC1155`: Remove check for address zero in `balanceOf`. ([#4263](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4263))
|
||||
- `ReentrancyGuard`, `Pausable`: Moved to `utils` directory. ([#4551](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4551))
|
||||
- `access`: Move `AccessControl` extensions to a dedicated directory. ([#4359](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4359))
|
||||
- `DoubleEndedQueue`: refactor internal structure to use `uint128` instead of `int128`. This has no effect on the library interface. ([#4150](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4150))
|
||||
- `Strings`: Rename `toString(int256)` to `toStringSigned(int256)`. ([#4330](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4330))
|
||||
- `BeaconProxy`: Reject value in initialization unless a payable function is explicitly invoked. ([#4382](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4382))
|
||||
- `Initializable`: Use the namespaced storage pattern to avoid putting critical variables in slot 0. Allow reinitializer versions greater than 256. ([#4460](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4460))
|
||||
- `GovernorTimelockAccess`: Added a module to connect a governor with an instance of `AccessManager`, allowing the governor to make calls that are delay-restricted by the manager using the normal `queue` workflow. ([#4523](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4523))
|
||||
- Upgradeable contracts now use namespaced storage (EIP-7201). ([#4534](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4534))
|
||||
- `GovernorStorage`: Added a new governor extension that stores the proposal details in storage, with an interface that operates on `proposalId`, as well as proposal enumerability. This replaces the old `GovernorCompatibilityBravo` module. ([#4360](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4360))
|
||||
- `Votes`: Use Trace208 for checkpoints. This enables EIP-6372 clock support for keys but reduces the max supported voting power to uint208. ([#4539](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4539))
|
||||
- `Math`: Renamed members of `Rounding` enum, and added a new rounding mode for "away from zero". ([#4455](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4455))
|
||||
- `SafeERC20`: Refactor `safeDecreaseAllowance` and `safeIncreaseAllowance` to support USDT-like tokens. ([#4260](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4260))
|
||||
- `Math`: Make `ceilDiv` to revert on 0 division even if the numerator is 0 ([#4348](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4348))
|
||||
- `Proxy`: Removed redundant `receive` function. ([#4434](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4434))
|
||||
- Replace some uses of `abi.encodePacked` with clearer alternatives (e.g. `bytes.concat`, `string.concat`). (#4504)[https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4504] ([#4296](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4296))
|
||||
- `Arrays`: Optimize `findUpperBound` by removing redundant SLOAD. ([#4442](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4442))
|
||||
- `Arrays`: Add `unsafeMemoryAccess` helpers to read from a memory array without checking the length. ([#4300](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4300))
|
||||
- `GovernorTimelockControl`: Clean up timelock id on execution for gas refund. ([#4118](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4118))
|
||||
- `Initializable`: Use intermediate variables to improve readability. ([#4576](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4576))
|
||||
- `EIP712`: Add internal getters for the name and version strings ([#4303](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4303))
|
||||
- `TimelockController`: Add a state getter that returns an `OperationState` enum. ([#4358](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4358))
|
||||
- `AccessManager`: Added a new contract for managing access control of complex systems in a consolidated location. ([#4121](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4121))
|
||||
- `Governor`, `Initializable`, and `UUPSUpgradeable`: Use internal functions in modifiers to optimize bytecode size. ([#4472](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4472))
|
||||
- `ERC1155`: Bubble errors triggered in the `onERC1155Received` and `onERC1155BatchReceived` hooks. ([#4314](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4314))
|
||||
- `AccessControl`: Add a boolean return value to the internal `_grantRole` and `_revokeRole` functions indicating whether the role was granted or revoked. ([#4241](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4241))
|
||||
- Remove the `override` specifier from functions that only override a single interface function. ([#4315](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4315))
|
||||
- `Ownable`: Prevent using address(0) as the initial owner. ([#4531](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4531))
|
||||
- Optimize `Strings.equal` ([#4262](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4262))
|
||||
- `ECDSA`: Use unchecked arithmetic for the `tryRecover` function that receives the `r` and `vs` short-signature fields separately. ([#4301](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4301))
|
||||
- `VestingWallet`: Fix revert during 1 second time window when duration is 0. ([#4502](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4502))
|
||||
- `MerkleProof`: Use custom error to report invalid multiproof instead of reverting with overflow panic. ([#4564](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4564))
|
||||
- `Governor`: Add validation in ERC1155 and ERC721 receiver hooks to ensure Governor is the executor. ([#4314](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4314))
|
||||
- `Math`: Optimized stack operations in `mulDiv`. ([#4494](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4494))
|
||||
- `BeaconProxy`: Use an immutable variable to store the address of the beacon. It is no longer possible for a `BeaconProxy` to upgrade by changing to another beacon. ([#4435](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4435))
|
||||
- `ERC1155`: Optimize array allocation. ([#4196](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4196))
|
||||
- `ERC721Consecutive`: Add a `_firstConsecutiveId` internal function that can be overridden to change the id of the first token minted through `_mintConsecutive`. ([#4097](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4097))
|
||||
- `Governor`: Add a mechanism to restrict the address of the proposer using a suffix in the description.
|
||||
- `ERC1155`: Optimize array accesses by skipping bounds checking when unnecessary. ([#4300](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4300))
|
||||
- `ERC2771Context`: Return the forwarder address whenever the `msg.data` of a call originating from a trusted forwarder is not long enough to contain the request signer address (i.e. `msg.data.length` is less than 20 bytes), as specified by ERC-2771. ([#4481](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4481))
|
||||
- `ERC2771Context`: Prevent revert in `_msgData()` when a call originating from a trusted forwarder is not long enough to contain the request signer address (i.e. `msg.data.length` is less than 20 bytes). Return the full calldata in that case. ([#4484](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4484))
|
||||
|
||||
## Unreleased
|
||||
|
||||
> **Warning** Version 5.0 is under active development and should not be used. Install the releases from npm or use the version tags in the repository.
|
||||
|
||||
### Removals
|
||||
|
||||
The following contracts were removed:
|
||||
The following contracts, libraries and functions were removed:
|
||||
|
||||
- `Address.isContract` (because of its ambiguous nature and potential for misuse)
|
||||
- `Checkpoints.History`
|
||||
- `Counters`
|
||||
- `ERC20Snapshot`
|
||||
- `ERC20VotesComp`
|
||||
- `ERC165Storage` (in favor of inheritance based approach)
|
||||
- `ERC777`
|
||||
- `ERC1820Implementer`
|
||||
- `GovernorVotesComp`
|
||||
- `GovernorProposalThreshold` (deprecated since 4.4)
|
||||
- `PaymentSplitter`
|
||||
- `TokenTimelock` (removed in favor of `VestingWallet`)
|
||||
- `PullPayment`
|
||||
- `SafeMath`
|
||||
- `SignedSafeMath`
|
||||
- `Timers`
|
||||
- `TokenTimelock` (in favor of `VestingWallet`)
|
||||
- All escrow contracts (`Escrow`, `ConditionalEscrow` and `RefundEscrow`)
|
||||
- All cross-chain contracts, including `AccessControlCrossChain` and all the vendored bridge interfaces
|
||||
- All presets in favor of [OpenZeppelin Contracts Wizard](https://wizard.openzeppelin.com/)
|
||||
|
||||
These removals were implemented in the following PRs: [#3637](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3637), [#3880](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3880), [#3945](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3945), [#4258](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4258), [#4276](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4276), [#4289](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4289)
|
||||
|
||||
### How to upgrade from 4.x
|
||||
|
||||
@ -16,7 +131,7 @@ The following contracts were removed:
|
||||
|
||||
These breaking changes will require modifications to ERC20, ERC721, and ERC1155 contracts, since the `_afterTokenTransfer` and `_beforeTokenTransfer` functions were removed. Any customization made through those hooks should now be done overriding the new `_update` function instead.
|
||||
|
||||
Minting and burning are implemented by `_update` and customizations should be done by overriding this function as well. `_mint` and `_burn` are no longer virtual (meaning they are not overridable) to guard against possible inconsistencies.
|
||||
Minting and burning are implemented by `_update` and customizations should be done by overriding this function as well. `_transfer`, `_mint` and `_burn` are no longer virtual (meaning they are not overridable) to guard against possible inconsistencies.
|
||||
|
||||
For example, a contract using `ERC20`'s `_beforeTokenTransfer` hook would have to be changed in the following way.
|
||||
|
||||
@ -33,16 +148,36 @@ For example, a contract using `ERC20`'s `_beforeTokenTransfer` hook would have t
|
||||
}
|
||||
```
|
||||
|
||||
### More about ERC721
|
||||
|
||||
In the case of `ERC721`, the `_update` function does not include a `from` parameter, as the sender is implicitly the previous owner of the `tokenId`. The address of
|
||||
this previous owner is returned by the `_update` function, so it can be used for a posteriori checks. In addition to `to` and `tokenId`, a third parameter (`auth`) is
|
||||
present in this function. This parameter enabled an optional check that the caller/spender is approved to do the transfer. This check cannot be performed after the transfer (because the transfer resets the approval), and doing it before `_update` would require a duplicate call to `_ownerOf`.
|
||||
|
||||
In this logic of removing hidden SLOADs, the `_isApprovedOrOwner` function was removed in favor of a new `_isAuthorized` function. Overrides that used to target the
|
||||
`_isApprovedOrOwner` should now be performed on the `_isAuthorized` function. Calls to `_isApprovedOrOwner` that preceded a call to `_transfer`, `_burn` or `_approve`
|
||||
should be removed in favor of using the `auth` argument in `_update` and `_approve`. This is showcased in `ERC721Burnable.burn` and in `ERC721Wrapper.withdrawTo`.
|
||||
|
||||
The `_exists` function was removed. Calls to this function can be replaced by `_ownerOf(tokenId) != address(0)`.
|
||||
|
||||
#### ERC165Storage
|
||||
|
||||
Users that were registering EIP-165 interfaces with `_registerInterface` from `ERC165Storage` should instead do so so by overriding the `supportsInterface` function as seen below:
|
||||
|
||||
```solidity
|
||||
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
|
||||
return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
|
||||
return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
|
||||
}
|
||||
```
|
||||
|
||||
## 4.9.2 (2023-06-16)
|
||||
|
||||
- `MerkleProof`: Fix a bug in `processMultiProof` and `processMultiProofCalldata` that allows proving arbitrary leaves if the tree contains a node with value 0 at depth 1.
|
||||
|
||||
## 4.9.1 (2023-06-07)
|
||||
|
||||
- `Governor`: Add a mechanism to restrict the address of the proposer using a suffix in the description.
|
||||
|
||||
## 4.9.0 (2023-05-23)
|
||||
|
||||
- `ReentrancyGuard`: Add a `_reentrancyGuardEntered` function to expose the guard status. ([#3714](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3714))
|
||||
|
||||
@ -95,8 +95,18 @@ In addition to the official Solidity Style Guide we have a number of other conve
|
||||
}
|
||||
```
|
||||
|
||||
* Events should be emitted immediately after the state change that they
|
||||
represent, and should be named in the past tense.
|
||||
* Functions should be declared virtual, with few exceptions listed below. The
|
||||
contract logic should be written considering that these functions may be
|
||||
overridden by developers, e.g. getting a value using an internal getter rather
|
||||
than reading directly from a state variable.
|
||||
|
||||
If function A is an "alias" of function B, i.e. it invokes function B without
|
||||
significant additional logic, then function A should not be virtual so that
|
||||
any user overrides are implemented on B, preventing inconsistencies.
|
||||
|
||||
* Events should generally be emitted immediately after the state change that they
|
||||
represent, and should be named in the past tense. Some exceptions may be made for gas
|
||||
efficiency if the result doesn't affect observable ordering of events.
|
||||
|
||||
```solidity
|
||||
function _burn(address who, uint256 value) internal {
|
||||
@ -114,4 +124,25 @@ In addition to the official Solidity Style Guide we have a number of other conve
|
||||
interface IERC777 {
|
||||
```
|
||||
|
||||
* Contracts not intended to be used standalone should be marked abstract
|
||||
so they are required to be inherited to other contracts.
|
||||
|
||||
```solidity
|
||||
abstract contract AccessControl is ..., {
|
||||
```
|
||||
|
||||
* Unchecked arithmetic blocks should contain comments explaining why overflow is guaranteed not to happen. If the reason is immediately apparent from the line above the unchecked block, the comment may be omitted.
|
||||
|
||||
* Custom errors should be declared following the [EIP-6093](https://eips.ethereum.org/EIPS/eip-6093) rationale whenever reasonable. Also, consider the following:
|
||||
|
||||
* The domain prefix should be picked in the following order:
|
||||
1. Use `ERC<number>` if the error is a violation of an ERC specification.
|
||||
2. Use the name of the underlying component where it belongs (eg. `Governor`, `ECDSA`, or `Timelock`).
|
||||
|
||||
* The location of custom errors should be decided in the following order:
|
||||
1. Take the errors from their underlying ERCs if they're already defined.
|
||||
2. Declare the errors in the underlying interface/library if the error makes sense in its context.
|
||||
3. Declare the error in the implementation if the underlying interface/library is not suitable to do so (eg. interface/library already specified in an ERC).
|
||||
4. Declare the error in an extension if the error only happens in such extension or child contracts.
|
||||
|
||||
* Custom error names should not be declared twice along the library to avoid duplicated identifier declarations when inheriting from multiple contracts.
|
||||
|
||||
34
README.md
34
README.md
@ -1,5 +1,6 @@
|
||||
> **Warning**
|
||||
> Version 5.0 is under active development. The code in this branch is not recommended for use.
|
||||
> [!NOTE]
|
||||
> Version 5.0 is currently in release candidate period. Bug bounty rewards are boosted 50% until the release.
|
||||
> [See more details on Immunefi.](https://immunefi.com/bounty/openzeppelin/)
|
||||
|
||||
# <img src="logo.svg" alt="OpenZeppelin" height="40px">
|
||||
|
||||
@ -19,26 +20,41 @@
|
||||
|
||||
:building_construction: **Want to scale your decentralized application?** Check out [OpenZeppelin Defender](https://openzeppelin.com/defender) — a secure platform for automating and monitoring your operations.
|
||||
|
||||
> [!IMPORTANT]
|
||||
> OpenZeppelin Contracts uses semantic versioning to communicate backwards compatibility of its API and storage layout. For upgradeable contracts, the storage layout of different major versions should be assumed incompatible, for example, it is unsafe to upgrade from 4.9.3 to 5.0.0. Learn more at [Backwards Compatibility](https://docs.openzeppelin.com/contracts/backwards-compatibility).
|
||||
|
||||
## Overview
|
||||
|
||||
### Installation
|
||||
|
||||
#### Hardhat, Truffle (npm)
|
||||
|
||||
```
|
||||
$ npm install @openzeppelin/contracts
|
||||
```
|
||||
|
||||
OpenZeppelin Contracts features a [stable API](https://docs.openzeppelin.com/contracts/releases-stability#api-stability), which means that your contracts won't break unexpectedly when upgrading to a newer minor version.
|
||||
#### Foundry (git)
|
||||
|
||||
An alternative to npm is to use the GitHub repository (`openzeppelin/openzeppelin-contracts`) to retrieve the contracts. When doing this, make sure to specify the tag for a release such as `v4.5.0`, instead of using the `master` branch.
|
||||
> [!WARNING]
|
||||
> When installing via git, it is a common error to use the `master` branch. This is a development branch that should be avoided in favor of tagged releases. The release process involves security measures that the `master` branch does not guarantee.
|
||||
|
||||
> [!WARNING]
|
||||
> Foundry installs the latest version initially, but subsequent `forge update` commands will use the `master` branch.
|
||||
|
||||
```
|
||||
$ forge install OpenZeppelin/openzeppelin-contracts
|
||||
```
|
||||
|
||||
Add `@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/` in `remappings.txt.`
|
||||
|
||||
### Usage
|
||||
|
||||
Once installed, you can use the contracts in the library by importing them:
|
||||
|
||||
```solidity
|
||||
pragma solidity ^0.8.19;
|
||||
pragma solidity ^0.8.20;
|
||||
|
||||
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
|
||||
import {ERC721} from "@openzeppelin/contracts/token/ERC721/ERC721.sol";
|
||||
|
||||
contract MyCollectible is ERC721 {
|
||||
constructor() ERC721("MyCollectible", "MCO") {
|
||||
@ -60,7 +76,7 @@ The guides in the [documentation site](https://docs.openzeppelin.com/contracts)
|
||||
|
||||
The [full API](https://docs.openzeppelin.com/contracts/api/token/ERC20) is also thoroughly documented, and serves as a great reference when developing your smart contract application. You can also ask for help or follow Contracts's development in the [community forum](https://forum.openzeppelin.com).
|
||||
|
||||
Finally, you may want to take a look at the [guides on our blog](https://blog.openzeppelin.com/guides), which cover several common use cases and good practices. The following articles provide great background reading, though please note that some of the referenced tools have changed, as the tooling in the ecosystem continues to rapidly evolve.
|
||||
Finally, you may want to take a look at the [guides on our blog](https://blog.openzeppelin.com/), which cover several common use cases and good practices. The following articles provide great background reading, though please note that some of the referenced tools have changed, as the tooling in the ecosystem continues to rapidly evolve.
|
||||
|
||||
* [The Hitchhiker’s Guide to Smart Contracts in Ethereum](https://blog.openzeppelin.com/the-hitchhikers-guide-to-smart-contracts-in-ethereum-848f08001f05) will help you get an overview of the various tools available for smart contract development, and help you set up your environment.
|
||||
* [A Gentle Introduction to Ethereum Programming, Part 1](https://blog.openzeppelin.com/a-gentle-introduction-to-ethereum-programming-part-1-783cc7796094) provides very useful information on an introductory level, including many basic concepts from the Ethereum platform.
|
||||
@ -70,7 +86,9 @@ Finally, you may want to take a look at the [guides on our blog](https://blog.op
|
||||
|
||||
This project is maintained by [OpenZeppelin](https://openzeppelin.com) with the goal of providing a secure and reliable library of smart contract components for the ecosystem. We address security through risk management in various areas such as engineering and open source best practices, scoping and API design, multi-layered review processes, and incident response preparedness.
|
||||
|
||||
The security policy is detailed in [`SECURITY.md`](./SECURITY.md), and specifies how you can report security vulnerabilities, which versions will receive security patches, and how to stay informed about them. We run a [bug bounty program on Immunefi](https://immunefi.com/bounty/openzeppelin) to reward the responsible disclosure of vulnerabilities.
|
||||
The [OpenZeppelin Contracts Security Center](https://contracts.openzeppelin.com/security) contains more details about the secure development process.
|
||||
|
||||
The security policy is detailed in [`SECURITY.md`](./SECURITY.md) as well, and specifies how you can report security vulnerabilities, which versions will receive security patches, and how to stay informed about them. We run a [bug bounty program on Immunefi](https://immunefi.com/bounty/openzeppelin) to reward the responsible disclosure of vulnerabilities.
|
||||
|
||||
The engineering guidelines we follow to promote project quality can be found in [`GUIDELINES.md`](./GUIDELINES.md).
|
||||
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
# Releasing
|
||||
|
||||
> Visit the documentation for [details about release schedule](https://docs.openzeppelin.com/contracts/releases-stability).
|
||||
|
||||
OpenZeppelin Contracts uses a fully automated release process that takes care of compiling, packaging, and publishing the library, all of which is carried out in a clean CI environment (GitHub Actions), implemented in the ([`release-cycle`](.github/workflows/release-cycle.yml)) workflow. This helps to reduce the potential for human error and inconsistencies, and ensures that the release process is ongoing and reliable.
|
||||
|
||||
## Changesets
|
||||
|
||||
@ -1,14 +0,0 @@
|
||||
--- token/ERC721/ERC721.sol 2023-03-07 10:48:47.736822221 +0100
|
||||
+++ token/ERC721/ERC721.sol 2023-03-09 19:49:39.669338673 +0100
|
||||
@@ -199,6 +199,11 @@
|
||||
return _owners[tokenId];
|
||||
}
|
||||
|
||||
+ // FV
|
||||
+ function _getApproved(uint256 tokenId) internal view returns (address) {
|
||||
+ return _tokenApprovals[tokenId];
|
||||
+ }
|
||||
+
|
||||
/**
|
||||
* @dev Returns whether `tokenId` exists.
|
||||
*
|
||||
@ -1,8 +1,7 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.20;
|
||||
|
||||
pragma solidity ^0.8.19;
|
||||
|
||||
import "../patched/access/AccessControlDefaultAdminRules.sol";
|
||||
import {AccessControlDefaultAdminRules} from "../patched/access/extensions/AccessControlDefaultAdminRules.sol";
|
||||
|
||||
contract AccessControlDefaultAdminRulesHarness is AccessControlDefaultAdminRules {
|
||||
uint48 private _delayIncreaseWait;
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.20;
|
||||
|
||||
pragma solidity ^0.8.19;
|
||||
|
||||
import "../patched/access/AccessControl.sol";
|
||||
import {AccessControl} from "../patched/access/AccessControl.sol";
|
||||
|
||||
contract AccessControlHarness is AccessControl {}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user