Changelog
v5.4.0 - 2025-07-17
Breaking changes
- Update minimum pragma to 0.8.24 in
SignatureChecker
,Governor
and Governor's extensions. (#5716).
Pragma changes
- Reduced pragma requirement of interface files
Changes by category
Account
Account
: Added a simple ERC-4337 account implementation with minimal logic to process user operations. (#5657)AccountERC7579
: Extension ofAccount
that implements support for ERC-7579 modules of type executor, validator, and fallback handler. (#5657)AccountERC7579Hooked
: Extension ofAccountERC7579
that implements support for ERC-7579 hook modules. (#5657)EIP7702Utils
: Add a library for checking if an address has an EIP-7702 delegation in place. (#5587)IERC7821
,ERC7821
: Interface and logic for minimal batch execution. No support for additionalopData
is included. (#5657)
Governance
GovernorNoncesKeyed
: Extension ofGovernor
that adds support for keyed nonces when voting by sig. (#5574)
Tokens
ERC20Bridgeable
: Implementation of ERC-7802 that makes an ERC-20 compatible with crosschain bridges. (#5739)
Cryptography
Signers
AbstractSigner
,SignerECDSA
,SignerP256
, andSignerRSA
: Add an abstract contract and various implementations for contracts that deal with signature verification. (#5657)SignerERC7702
: Implementation ofAbstractSigner
for Externally Owned Accounts (EOAs). Useful with ERC-7702. (#5657)SignerERC7913
: Abstract signer that verifies signatures using the ERC-7913 workflow. (#5659)MultiSignerERC7913
: Implementation ofAbstractSigner
that supports multiple ERC-7913 signers with a threshold-based signature verification system. (#5659)MultiSignerERC7913Weighted
: Extension ofMultiSignerERC7913
that supports assigning different weights to each signer, enabling more flexible governance schemes. (#5741)
Verifiers
ERC7913P256Verifier
andERC7913RSAVerifier
: Ready to use ERC-7913 verifiers that implement key verification for P256 (secp256r1) and RSA keys. (#5659)
Other
SignatureChecker
: Add support for ERC-7913 signatures alongside existing ECDSA and ERC-1271 signature verification. (#5659)ERC7739
: An abstract contract to validate signatures following the rehashing scheme fromERC7739Utils
. (#5664)ERC7739Utils
: Add a library that implements a defensive rehashing mechanism to prevent replayability of smart contract signatures based on the ERC-7739. (#5664)
Structures
EnumerableMap
: Add support forBytesToBytesMap
type. (#5658)EnumerableMap
: Addkeys(uint256,uint256)
that returns a subset (slice) of the keys in the map. (#5713)EnumerableSet
: Add support forStringSet
andBytesSet
types. (#5658)EnumerableSet
: Addvalues(uint256,uint256)
that returns a subset (slice) of the values in the set. (#5713)
Utils
Arrays
: AddunsafeAccess
,unsafeMemoryAccess
andunsafeSetLength
forbytes[]
andstring[]
. (#5568)Blockhash
: Add a library that provides access to historical block hashes using EIP-2935's history storage, extending the standard 256-block limit to 8191 blocks. (#5642)Bytes
: FixlastIndexOf(bytes,byte,uint256)
with empty buffers and finite position to correctly returntype(uint256).max
instead of accessing uninitialized memory sections. (#5797)
v5.3.0 - 2025-04-09
Breaking Changes
- Replace
GovernorCountingOverridable.VoteReceipt
struct parameter member nameshasOverriden
andoverridenWeight
forhasOverridden
andoverriddenWeight
respectively.
Custom error changes
- Replace
GovernorAlreadyOverridenVote
withGovernorAlreadyOverriddenVote
. - Replace
GovernorOnlyProposer
withGovernorUnableToCancel
.
Changes by category
Account
ERC4337Utils
: Update thehash
function to callgetUserOpHash
on the specified entrypoint and add anENTRYPOINT_V08
constant. (#5614)ERC7579Utils
: Add ABI decoding checks on calldata bounds withindecodeBatch
. (#5371)ERC7579Utils
: Replaceaddress(0)
withaddress(this)
during execution for calldata compression efficiency. (#5614)
Governance
IGovernor
: Add thegetProposalId
function to the governor interface. (#5290)GovernorProposalGuardian
: Add a governance extension that defines a proposal guardian who can cancel proposals at any stage in their lifecycle. (#5303)GovernorSequentialProposalId
: Adds aGovernor
extension that sequentially numbers proposal ids instead of using the hash. (#5290)GovernorSuperQuorum
: Add a governance extension to support a super quorum. Proposals that meet the super quorum (and have a majority of for votes) advance to theSucceeded
state before the proposal deadline. (#5526)GovernorVotesSuperQuorumFraction
: Add a variant of theGovernorSuperQuorum
extensions where the super quorum is expressed as a fraction of the total supply. (#5526)TimelockController
: Receive function is now virtual. (#5509)
Structures
EnumerableSet
: Addclear
function to EnumerableSets which deletes all values in the set. (#5486)EnumerableMap
: Addclear
function to EnumerableMaps which deletes all entries in the map. (#5486)MerkleTree
: Add an update function that replaces a previously inserted leaf with a new value, updating the tree root along the way. (#5526)
Tokens
ERC4626
: Use theasset
getter intotalAssets
,_deposit
and_withdraw
. (#5322)IERC6909
: Add the interface for ERC-6909. (#5343)ERC6909
: Add a standard implementation of ERC6909. (#5394)ERC6909TokenSupply
: Add an extension of ERC6909 which tracks total supply for each token id. (#5394)ERC6909Metadata
: Add an extension of ERC6909 which adds metadata functionality. (#5394)ERC6909ContentURI
: Add an extension of ERC6909 which adds content URI functionality. (#5394)SafeERC20
: AddtrySafeTransfer
andtrySafeTransferFrom
that do not revert and return false if the transfer is not successful. (#5483)
Other
Address
: bubble up revert data onsendValue
failed call. (#5379)Calldata
: Library withemptyBytes
andemptyString
functions to generate emptybytes
andstring
calldata types. (#5422)ERC2771Forwarder
: Expose the_isTrustedByTarget
internal function to check whether a target trusts the forwarder. (#5416)Hashes
: ExposeefficientKeccak256
for hashing non-commutative pairs of bytes32 without allocating extra memory. (#5442)Initializable
: Add_initializableStorageSlot
function that returns a pointer to the storage struct. The function allows customizing with a custom storage slot with anoverride
. (#5526)Math
: Addadd512
,mul512
andmulShr
. (#5526)Math
: Add saturating arithmetic operationssaturatingAdd
,saturatingSub
andsaturatingMul
. (#5526)MessageHashUtils
: AddtoDataWithIntendedValidatorHash(address, bytes32)
. (#5526)P256
: Adjust precompile detection inverifyNative
to consider emptyreturndata
on invalid verification. Previously, invalid signatures would've reverted with aMissingPrecompile
error in chains with RIP-7212 support. (#5620)Pausable
: Stop explicitly settingpaused
tofalse
during construction. (#5448)Strings
: AddespaceJSON
that escapes special characters in JSON strings. (#5526)
v5.2.0 - 2025-01-09
Breaking Changes
Custom error changes
This version comes with changes to the custom error identifiers. Contracts previously depending on the following errors should be replaced accordingly:
- Replace
Errors.FailedCall
with a bubbled-up revert reason inAddress.sendValue
.
Changes by category
General
- Update some pragma directives to ensure that all file requirements match that of the files they import. (#5273)
Account
ERC4337Utils
: Add a reusable library to manipulate user operations and interact with ERC-4337 contracts (#5274)ERC7579Utils
: Add a reusable library to interact with ERC-7579 modular accounts (#5274)
Governance
GovernorCountingOverridable
: Add a governor counting module that enables token holders to override the vote of their delegate. (#5192)VotesExtended
: Create an extension ofVotes
which checkpoints balances and delegates. (#5192)
Proxy
Clones
: AddcloneWithImmutableArgs
andcloneDeterministicWithImmutableArgs
variants that create clones with per-instance immutable arguments. The immutable arguments can be retrieved usingfetchCloneArgs
. The correspondingpredictDeterministicWithImmutableArgs
function is also included. (#5109)
Tokens
ERC1363Utils
: Add helper similar to the existingERC721Utils
andERC1155Utils
(#5133)
Utils
Address
: bubble up revert data onsendValue
failed call (#5418)Bytes
: Add a library of common operations that operate onbytes
objects. (#5252)CAIP2
andCAIP10
: Add libraries for formatting and parsing CAIP-2 and CAIP-10 identifiers. (#5252)NoncesKeyed
: Add a variant ofNonces
that implements the ERC-4337 entrypoint nonce system. (#5272)Packing
: Add variants for packingbytes10
andbytes22
(#5274)Strings
: AddparseUint
,parseInt
,parseHexUint
andparseAddress
to parse strings into numbers and addresses. Also provide variants of these functions that parse substrings, andtryXxx
variants that do not revert on invalid input. (#5166)
v5.1.0 - 2024-10-23
Breaking changes
ERC1967Utils
: Removed duplicate declaration of theUpgraded
,AdminChanged
andBeaconUpgraded
events. These events are still available through theIERC1967
interface located under thecontracts/interfaces/
directory. Minimum pragma version is now 0.8.21.Governor
,GovernorCountingSimple
: The_countVote
virtual function now returns anuint256
with the total votes casted. This change allows for more flexibility for partial and fractional voting. Upgrading users may get a compilation error that can be fixed by adding a return statement to the_countVote
function.
Custom error changes
This version comes with changes to the custom error identifiers. Contracts previously depending on the following errors should be replaced accordingly:
- Replace
Address.FailedInnerCall
withErrors.FailedCall
- Replace
Address.AddressInsufficientBalance
withErrors.InsufficientBalance
- Replace
Clones.Create2InsufficientBalance
withErrors.InsufficientBalance
- Replace
Clones.ERC1167FailedCreateClone
withErrors.FailedDeployment
- Replace
Clones.Create2FailedDeployment
withErrors.FailedDeployment
SafeERC20
: ReplaceAddress.AddressEmptyCode
withSafeERC20FailedOperation
if there is no code at the token's address.SafeERC20
: Replace genericError(string)
withSafeERC20FailedOperation
if the returned data can't be decoded asbool
.SafeERC20
: Replace genericSafeERC20FailedOperation
with the revert message from the contract call if it fails.
Changes by category
General
AccessManager
,VestingWallet
,TimelockController
andERC2771Forwarder
: Added a publicinitializer
function in their corresponding upgradeable variants. (#5008)
Access
AccessControlEnumerable
: Add agetRoleMembers
method to return all accounts that haverole
. (#4546)AccessManager
: Allow theonlyAuthorized
modifier to restrict functions added to the manager. (#5014)
Finance
VestingWalletCliff
: Add an extension of theVestingWallet
contract with an added cliff. (#4870)
Governance
GovernorCountingFractional
: Add a governor counting module that allows distributing voting power amongst 3 options (For, Against, Abstain). (#5045)Votes
: Set_moveDelegateVotes
visibility to internal instead of private. (#5007)
Proxy
Clones
: Add version ofclone
andcloneDeterministic
that support sending value at creation. (#4936)TransparentUpgradeableProxy
: Make internal_proxyAdmin()
getter haveview
visibility. (#4688)ProxyAdmin
: Fixed documentation forUPGRADE_INTERFACE_VERSION
getter. (#5031)
Tokens
ERC1363
: Add implementation of the token payable standard allowing execution of contract code after transfers and approvals. (#4631)ERC20TemporaryApproval
: Add an ERC-20 extension that implements temporary approval using transient storage, based on ERC7674 (draft). (#5071)SafeERC20
: Add "relaxed" function for interacting with ERC-1363 functions in a way that is compatible with EOAs. (#4631)SafeERC20
: Document risks ofsafeIncreaseAllowance
andsafeDecreaseAllowance
when associated with ERC-7674. (#5262)ERC721Utils
andERC1155Utils
: Add reusable libraries with functions to perform acceptance checks onIERC721Receiver
andIERC1155Receiver
implementers. (#4845)ERC1363Utils
: Add helper similar to the existing ERC721Utils and ERC1155Utils. (#5133)
Utils
Arrays
: add asort
functions foraddress[]
,bytes32[]
anduint256[]
memory arrays. (#4846)Arrays
: add new functionslowerBound
,upperBound
,lowerBoundMemory
andupperBoundMemory
for lookups in sorted arrays with potential duplicates. (#4842)Arrays
: deprecatefindUpperBound
in favor of the newlowerBound
. (#4842)Base64
: AddencodeURL
following section 5 of RFC4648 for URL encoding (#4822)Comparator
: A library of comparator functions, useful for customizing the behavior of the Heap structure. (#5084)Create2
: Bubbles up returndata from a deployed contract that reverted during construction. (#5052)Create2
,Clones
: MaskcomputeAddress
andcloneDeterministic
outputs to produce a clean value for anaddress
type (i.e. only use 20 bytes) (#4941)Errors
: New library of common custom errors. (#4936)Hashes
: A library with commonly used hash functions. (#3617)Packing
: Added a new utility for packing, extracting and replacing bytesXX values. (#4992)Panic
: Add a library for reverting with panic codes. (#3298)ReentrancyGuardTransient
: Added a variant ofReentrancyGuard
that uses transient storage. (#4988)Strings
: Added a utility function for converting an address to checksummed string. (#5067)SlotDerivation
: Add a library of methods for derivating common storage slots. (#4975)TransientSlot
: Add primitives for operating on the transient storage space using a typed-slot representation. (#4980)
Cryptography
SignatureChecker
: refactorisValidSignatureNow
to avoid validating ECDSA signatures if there is code deployed at the signer's address. (#4951)MerkleProof
: Add variations ofverify
,processProof
,multiProofVerify
andprocessMultiProof
(and equivalent calldata version) with support for custom hashing functions. (#4887)P256
: Library for verification and public key recovery of P256 (aka secp256r1) signatures. (#4881)RSA
: Library to verify signatures according to RFC 8017 Signature Verification Operation (#4952)
Math
Math
: add aninvMod
function to get the modular multiplicative inverse of a number in Z/nZ. (#4839)Math
: AddmodExp
function that exposes theEIP-198
precompile. Includesuint256
andbytes memory
versions. (#3298)Math
: Custom errors replaced with native panic codes. (#3298)Math
,SignedMath
: Add a branchlessternary
function that computescond ? a : b
in constant gas cost. (#4976)SafeCast
: AddtoUint(bool)
for operating onbool
values asuint256
. (#4878)
Structures
CircularBuffer
: Add a data structure that stores the lastN
values pushed to it. (#4913)DoubleEndedQueue
: Custom errors replaced with native panic codes. (#4872)EnumerableMap
: addUintToBytes32Map
,AddressToAddressMap
,AddressToBytes32Map
andBytes32ToAddressMap
. (#4843)Heap
: A data structure that implements a heap-based priority queue. (#5084)MerkleTree
: A data structure that allows inserting elements into a merkle tree and updating its root hash. (#3617)
v5.0.2 - 2024-02-29
Base64
: Fix issue where dirty memory located just after the input buffer is affecting the result. (#4926)
v4.9.6 - 2024-02-29
Base64
: Fix issue where dirty memory located just after the input buffer is affecting the result. (#4929)
v4.9.5 - 2023-12-08
Multicall
: Make aware of non-canonical context (i.e.msg.sender
is not_msgSender()
), allowing compatibility withERC2771Context
. Patch duplicatedAddress.functionDelegateCall
in v4.9.4 (removed).
v5.0.1 - 2023-12-07
ERC2771Context
andContext
: Introduce a_contextPrefixLength()
getter, used to trim extra information appended tomsg.data
.Multicall
: Make aware of non-canonical context (i.e.msg.sender
is not_msgSender()
), allowing compatibility withERC2771Context
.
v4.9.4 - 2023-12-07
ERC2771Context
andContext
: Introduce a_contextPrefixLength()
getter, used to trim extra information appended tomsg.data
.Multicall
: Make aware of non-canonical context (i.e.msg.sender
is not_msgSender()
), allowing compatibility withERC2771Context
.
v5.0.0 - 2023-10-05
Additions Summary
The following contracts and libraries were added:
AccessManager
: A consolidated system for managing access control in complex systems.AccessManaged
: A module for connecting a contract to an authority in charge of its access control.GovernorTimelockAccess
: An adapter for time-locking governance proposals using anAccessManager
.AuthorityUtils
: A library of utilities for interacting with authority contracts.
GovernorStorage
: A Governor module that stores proposal details in storage.ERC2771Forwarder
: An ERC2771 forwarder for meta transactions.ERC1967Utils
: A library with ERC1967 events, errors and getters.Nonces
: An abstraction for managing account nonces.MessageHashUtils
: A library for producing digests for ECDSA operations.Time
: A library with helpers for manipulating time-related objects.
Removals Summary
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
PullPayment
SafeMath
SignedSafeMath
Timers
TokenTimelock
(in favor ofVestingWallet
)- All escrow contracts (
Escrow
,ConditionalEscrow
andRefundEscrow
) - All cross-chain contracts, including
AccessControlCrossChain
and all the vendored bridge interfaces - All presets in favor of OpenZeppelin Contracts Wizard
These removals were implemented in the following PRs: #3637, #3880, #3945, #4258, #4276, #4289
Changes by category
General
- Replaced revert strings and require statements with custom errors. (#4261)
- Bumped minimum compiler version required to 0.8.20 (#4288)
- Use of
abi.encodeCall
in place ofabi.encodeWithSelector
andabi.encodeWithSignature
for improved type-checking of parameters (#4293) - Replaced some uses of
abi.encodePacked
with clearer alternatives (e.g.bytes.concat
,string.concat
). (#4504) (#4296) - 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
andERC721.totalSupply
inERC721Enumerable
,ERC20.totalSupply
inERC20FlashMint
, andERC1967._getImplementation
inERC1967Proxy
. (#4299) - Removed the
override
specifier from functions that only override a single interface function. (#4315) - Switched to using explicit Solidity import statements. Some previously available symbols may now have to be separately imported. (#4399)
Governor
,Initializable
, andUUPSUpgradeable
: Use internal functions in modifiers to optimize bytecode size. (#4472)- Upgradeable contracts now use namespaced storage (EIP-7201). (#4534)
- Upgradeable contracts no longer transpile interfaces and libraries. (#4628)
Access
Ownable
: Added aninitialOwner
parameter to the constructor, making the ownership initialization explicit. (#4267)Ownable
: Prevent using address(0) as the initial owner. (#4531)AccessControl
: Added a boolean return value to the internal_grantRole
and_revokeRole
functions indicating whether the role was granted or revoked. (#4241)access
: MovedAccessControl
extensions to a dedicated directory. (#4359)AccessManager
: Added a new contract for managing access control of complex systems in a consolidated location. (#4121)AccessManager
,AccessManaged
,GovernorTimelockAccess
: Ensure that calldata shorter than 4 bytes is not padded to 4 bytes. (#4624)AccessManager
: Use named return parameters in functions that return multiple values. (#4624)AccessManager
: Makeschedule
andexecute
more conservative when delay is 0. (#4644)
Finance
VestingWallet
: Fixed revert during 1 second time window when duration is 0. (#4502)VestingWallet
: UseOwnable
instead of an immutablebeneficiary
. (#4508)
Governance
Governor
: Optimized use of storage for proposal data (#4268)Governor
: Added validation in ERC1155 and ERC721 receiver hooks to ensure Governor is the executor. (#4314)Governor
: Refactored internals to implement common queuing logic in the core module of the Governor. Addedqueue
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)Governor
: Addedvoter
andnonce
parameters in signed ballots, to avoid forging signatures for random addresses, prevent signature replay, and allow invalidating signatures. Addvoter
as a new parameter in thecastVoteBySig
andcastVoteWithReasonAndParamsBySig
functions. (#4378)Governor
: Added support for casting votes with ERC-1271 signatures by using abytes memory signature
instead ofr
,s
andv
arguments in thecastVoteBySig
andcastVoteWithReasonAndParamsBySig
functions. (#4418)Governor
: Added a mechanism to restrict the address of the proposer using a suffix in the description.GovernorStorage
: Added a new governor extension that stores the proposal details in storage, with an interface that operates onproposalId
, as well as proposal enumerability. This replaces the oldGovernorCompatibilityBravo
module. (#4360)GovernorTimelockAccess
: Added a module to connect a governor with an instance ofAccessManager
, allowing the governor to make calls that are delay-restricted by the manager using the normalqueue
workflow. (#4523)GovernorTimelockControl
: Clean up timelock id on execution for gas refund. (#4118)GovernorTimelockControl
: Added the Governor instance address as part of the TimelockController operationsalt
to avoid operation id collisions between governors using the same TimelockController. (#4432)TimelockController
: Changed the role architecture to useDEFAULT_ADMIN_ROLE
as the admin for all roles, instead of the bespokeTIMELOCK_ADMIN_ROLE
that was used previously. This aligns with the general recommendation forAccessControl
and makes the addition of new roles easier. Accordingly, theadmin
parameter and timelock will now be grantedDEFAULT_ADMIN_ROLE
instead ofTIMELOCK_ADMIN_ROLE
. (#3799)TimelockController
: Added a state getter that returns anOperationState
enum. (#4358)Votes
: Use Trace208 for checkpoints. This enables EIP-6372 clock support for keys but reduces the max supported voting power to uint208. (#4539)
Metatx
ERC2771Forwarder
: Addeddeadline
for expiring transactions, batching, and more secure handling ofmsg.value
. (#4346)ERC2771Context
: Return the forwarder address whenever themsg.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)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)
Proxy
ProxyAdmin
: RemovedgetProxyAdmin
andgetProxyImplementation
getters. (#3820)TransparentUpgradeableProxy
: Removedadmin
andimplementation
getters, which were only callable by the proxy owner and thus not very useful. (#3820)ERC1967Utils
: Refactored theERC1967Upgrade
abstract contract as a library. (#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 theProxyAdmin
. (#4354)- Moved the logic to validate ERC-1822 during an upgrade from
ERC1967Utils
toUUPSUpgradeable
. (#4356) UUPSUpgradeable
,TransparentUpgradeableProxy
andProxyAdmin
: RemovedupgradeTo
andupgrade
functions, and madeupgradeToAndCall
andupgradeAndCall
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)BeaconProxy
: Reject value in initialization unless a payable function is explicitly invoked. (#4382)Proxy
: Removed redundantreceive
function. (#4434)BeaconProxy
: Use an immutable variable to store the address of the beacon. It is no longer possible for aBeaconProxy
to upgrade by changing to another beacon. (#4435)Initializable
: Use the namespaced storage pattern to avoid putting critical variables in slot 0. Allow reinitializer versions greater than 256. (#4460)Initializable
: Use intermediate variables to improve readability. (#4576)
Token
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, #3876, #4377)ERC20
: RemovedApproval
event previously emitted intransferFrom
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)ERC20
: Removed the non-standardincreaseAllowance
anddecreaseAllowance
functions. (#4585)ERC20Votes
: Changed internal vote accounting to reusableVotes
module previously used byERC721Votes
. Removed implicitERC20Permit
inheritance. Note that theDOMAIN_SEPARATOR
getter was previously guaranteed to be available forERC20Votes
contracts, but is no longer available unlessERC20Permit
is explicitly used; ERC-5267 support is included inERC20Votes
withEIP712
and is recommended as an alternative. (#3816)SafeERC20
: RefactoredsafeDecreaseAllowance
andsafeIncreaseAllowance
to support USDT-like tokens. (#4260)SafeERC20
: RemovedsafePermit
in favor of documentation-onlypermit
recommendations. Based on recommendations from @trust1995 (#4582)ERC721
:_approve
no longer allows approving the owner of the tokenId. (#4377)_setApprovalForAll
no longer allows setting address(0) as an operator. (#4377)ERC721
: Renamed_requireMinted
to_requireOwned
and added a return value with the current owner. ImplementedownerOf
in terms of_requireOwned
. (#4566)ERC721Consecutive
: Added a_firstConsecutiveId
internal function that can be overridden to change the id of the first token minted through_mintConsecutive
. (#4097)ERC721URIStorage
: Allow setting the token URI prior to minting. (#4559)ERC721URIStorage
,ERC721Royalty
: Stop resetting token-specific URI and royalties when burning. (#4561)ERC1155
: Optimized array allocation. (#4196)ERC1155
: Removed check for address zero inbalanceOf
. (#4263)ERC1155
: Optimized array accesses by skipping bounds checking when unnecessary. (#4300)ERC1155
: Bubble errors triggered in theonERC1155Received
andonERC1155BatchReceived
hooks. (#4314)ERC1155Supply
: Added atotalSupply()
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)ERC1155Receiver
: Removed in favor ofERC1155Holder
. (#4450)
Utils
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)Arrays
: AddedunsafeMemoryAccess
helpers to read from a memory array without checking the length. (#4300)Arrays
: OptimizedfindUpperBound
by removing redundant SLOAD. (#4442)Checkpoints
: Library moved fromutils
toutils/structs
(#4275)DoubleEndedQueue
: Refactored internal structure to useuint128
instead ofint128
. This has no effect on the library interface. (#4150)ECDSA
: Use unchecked arithmetic for thetryRecover
function that receives ther
andvs
short-signature fields separately. (#4301)EIP712
: Added internal getters for the name and version strings (#4303)Math
: MakesceilDiv
to revert on 0 division even if the numerator is 0 (#4348)Math
: Optimized stack operations inmulDiv
. (#4494)Math
: Renamed members ofRounding
enum, and added a new rounding mode for "away from zero". (#4455)MerkleProof
: Use custom error to report invalid multiproof instead of reverting with overflow panic. (#4564)MessageHashUtils
: Added 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 theECDSA
library. (#4430)Nonces
: Added a new contract to keep track of user nonces. Used for signatures inERC20Permit
,ERC20Votes
, andERC721Votes
. (#3816)ReentrancyGuard
,Pausable
: Moved toutils
directory. (#4551)Strings
: RenamedtoString(int256)
totoStringSigned(int256)
. (#4330)- Optimized
Strings.equal
(#4262)
How to migrate from 4.x
ERC20, ERC721, and ERC1155
These breaking changes will require modifications to ERC20, ERC721, and ERC1155 contracts, since the _afterTokenTransfer
and _beforeTokenTransfer
functions were removed. Thus, 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. _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.
-function _beforeTokenTransfer(
+function _update(
address from,
address to,
uint256 amount
) internal virtual override {
- super._beforeTokenTransfer(from, to, amount);
require(!condition(), "ERC20: wrong condition");
+ super._update(from, to, amount);
}
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)
.
More about ERC1155
Batch transfers will now emit TransferSingle
if the batch consists of a single token, while in previous versions the TransferBatch
event would be used for all transfers initiated through safeBatchTransferFrom
. Both behaviors are compliant with the ERC-1155 specification.
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:
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
}
SafeMath
Methods in SafeMath superseded by native overflow checks in Solidity 0.8.0 were removed along with operations providing an interface for revert strings. The remaining methods were moved to utils/Math.sol
.
- import "@openzeppelin/contracts/utils/math/SafeMath.sol";
+ import "@openzeppelin/contracts/utils/math/Math.sol";
function tryOperations(uint256 x, uint256 y) external view {
- (bool overflowsAdd, uint256 resultAdd) = SafeMath.tryAdd(x, y);
+ (bool overflowsAdd, uint256 resultAdd) = Math.tryAdd(x, y);
- (bool overflowsSub, uint256 resultSub) = SafeMath.trySub(x, y);
+ (bool overflowsSub, uint256 resultSub) = Math.trySub(x, y);
- (bool overflowsMul, uint256 resultMul) = SafeMath.tryMul(x, y);
+ (bool overflowsMul, uint256 resultMul) = Math.tryMul(x, y);
- (bool overflowsDiv, uint256 resultDiv) = SafeMath.tryDiv(x, y);
+ (bool overflowsDiv, uint256 resultDiv) = Math.tryDiv(x, y);
// ...
}
Adapting Governor modules
Custom Governor modules that override internal functions may require modifications if migrated to v5. In particular, the new internal functions _queueOperations
and _executeOperations
may need to be used. If assistance with this migration is needed reach out via the OpenZeppelin Support Forum.
ECDSA and MessageHashUtils
The ECDSA
library is now focused on signer recovery. Previously it also included utility methods for producing digests to be used with signing or recovery. These utilities have been moved to the MessageHashUtils
library and should be imported if needed:
import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
+import {MessageHashUtils} from "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol";
contract Verifier {
using ECDSA for bytes32;
+ using MessageHashUtils for bytes32;
function _verify(bytes32 data, bytes memory signature, address account) internal pure returns (bool) {
return data
.toEthSignedMessageHash()
.recover(signature) == account;
}
}
Interfaces and libraries in upgradeable contracts
The upgradeable version of the contracts library used to include a variant suffixed with Upgradeable
for every contract. These variants, which are produced automatically, mainly include changes for dealing with storage that don't apply to libraries and interfaces.
The upgradeable library no longer includes upgradeable variants for libraries and interfaces. Projects migrating to 5.0 should replace their library and interface imports with their corresponding non-upgradeable version:
// Libraries
-import {AddressUpgradeable} from '@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol';
+import {Address} from '@openzeppelin/contracts/utils/Address.sol';
// Interfaces
-import {IERC20Upgradeable} from '@openzeppelin/contracts-upgradeable/interfaces/IERC20.sol';
+import {IERC20} from '@openzeppelin/contracts/interfaces/IERC20.sol';
Offchain Considerations
Some changes may affect offchain systems if they rely on assumptions that are changed along with these new breaking changes. These cases are:
Relying on revert strings for processing errors
A concrete example is AccessControl, where it was previously advised to catch revert reasons using the following regex:
/^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
Instead, contracts now revert with custom errors. Systems that interact with smart contracts outside of the network should consider reliance on revert strings and possibly support the new custom errors.
Relying on storage locations for retrieving data
After 5.0, the storage location of some variables were changed. This is the case for Initializable
and all the upgradeable contracts since they now use namespaced storaged locations. Any system relying on storage locations for retrieving data or detecting capabilities should be updated to support these new locations.
v4.9.3 - 2023-07-28
Note This release contains a fix for GHSA-g4vp-m682-qqmp.
ERC2771Context
: Return the forwarder address whenever themsg.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)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)
v4.9.2 - 2023-06-16
Note This release contains a fix for GHSA-wprv-93r4-jj2p.
MerkleProof
: Fix a bug inprocessMultiProof
andprocessMultiProofCalldata
that allows proving arbitrary leaves if the tree contains a node with value 0 at depth 1.
v4.9.1 - 2023-06-07
Note This release contains a fix for GHSA-5h3x-9wvq-w4m2.
Governor
: Add a mechanism to restrict the address of the proposer using a suffix in the description.
v4.9.0 - 2023-05-23
ReentrancyGuard
: Add a_reentrancyGuardEntered
function to expose the guard status. (#3714)ERC721Wrapper
: add a new extension of theERC721
token which wraps an underlying token. Deposit and withdraw guarantee that the ownership of each token is backed by a corresponding underlying token with the same identifier. (#3863)EnumerableMap
: add akeys()
function that returns an array containing all the keys. (#3920)Governor
: add a publiccancel(uint256)
function. (#3983)Governor
: Enable timestamp operation for blockchains without a stable block time. This is achieved by connecting a Governor's internal clock to match a voting token's EIP-6372 interface. (#3934)Strings
: addequal
method. (#3774)IERC5313
: Add an interface for EIP-5313 that is now final. (#4013)IERC4906
: Add an interface for ERC-4906 that is now Final. (#4012)StorageSlot
: Add support forstring
andbytes
. (#4008)Votes
,ERC20Votes
,ERC721Votes
: support timestamp checkpointing using EIP-6372. (#3934)ERC4626
: Add mitigation to the inflation attack through virtual shares and assets. (#3979)Strings
: addtoString
method for signed integers. (#3773)ERC20Wrapper
: Make theunderlying
variable private and add a public accessor. (#4029)EIP712
: add EIP-5267 support for better domain discovery. (#3969)AccessControlDefaultAdminRules
: Add an extension ofAccessControl
with additional security rules for theDEFAULT_ADMIN_ROLE
. (#4009)SignatureChecker
: AddisValidERC1271SignatureNow
for checking a signature directly against a smart contract using ERC-1271. (#3932)SafeERC20
: Add aforceApprove
function to improve compatibility with tokens behaving like USDT. (#4067)ERC1967Upgrade
: removed contract-wideoz-upgrades-unsafe-allow delegatecall
annotation, replaced by granular annotation inUUPSUpgradeable
. (#3971)ERC20Wrapper
: self wrapping and deposit by the wrapper itself are now explicitly forbidden. (#4100)ECDSA
: optimize bytes32 computation by using assembly instead ofabi.encodePacked
. (#3853)ERC721URIStorage
: Emit ERC-4906MetadataUpdate
in_setTokenURI
. (#4012)ShortStrings
: Added a library for handling short strings in a gas efficient way, with fallback to storage for longer strings. (#4023)SignatureChecker
: Allow return data length greater than 32 from EIP-1271 signers. (#4038)UUPSUpgradeable
: added granularoz-upgrades-unsafe-allow-reachable
annotation to improve upgrade safety checks on latest version of the Upgrades Plugins (starting with@openzeppelin/upgrades-core@1.21.0
). (#3971)Initializable
: optimize_disableInitializers
by using!=
instead of<
. (#3787)Ownable2Step
: makeacceptOwnership
public virtual to enable usecases that require overriding it. (#3960)UUPSUpgradeable.sol
: Change visibility to the functionsupgradeTo
andupgradeToAndCall
fromexternal
topublic
. (#3959)TimelockController
: Add theCallSalt
event to emit on operation schedule. (#4001)- Reformatted codebase with latest version of Prettier Solidity. (#3898)
Math
: optimizelog256
rounding check. (#3745)ERC20Votes
: optimize by using unchecked arithmetic. (#3748)Multicall
: annotatemulticall
function as upgrade safe to not raise a flag for its delegatecall. (#3961)ERC20Pausable
,ERC721Pausable
,ERC1155Pausable
: Add note regarding missing public pausing functionality (#4007)ECDSA
: Add a functiontoDataWithIntendedValidatorHash
that encodes data with version 0x00 following EIP-191. (#4063)MerkleProof
: optimize by using unchecked arithmetic. (#3745)
Breaking changes
EIP712
: Addition of ERC5267 support requires support for user defined value types, which was released in Solidity version 0.8.8. This requires a pragma change from^0.8.0
to^0.8.8
.EIP712
: Optimization of the cache for the upgradeable version affects the wayname
andversion
are set. This is no longer done through an initializer, and is instead part of the implementation's constructor. As a consequence, all proxies using the same implementation will necessarily share the samename
andversion
. Additionally, an implementation upgrade risks changing the EIP712 domain unless the samename
andversion
are used when deploying the new implementation contract.
Deprecations
ERC20Permit
: Added the fileIERC20Permit.sol
andERC20Permit.sol
and deprecateddraft-IERC20Permit.sol
anddraft-ERC20Permit.sol
since EIP-2612 is no longer a Draft. Developers are encouraged to update their imports. (#3793)Timers
: TheTimers
library is now deprecated and will be removed in the next major release. (#4062)ERC777
: TheERC777
token standard is no longer supported by OpenZeppelin. Our implementation is now deprecated and will be removed in the next major release. The corresponding standard interfaces remain available. (#4066)ERC1820Implementer
: TheERC1820
pseudo-introspection mechanism is no longer supported by OpenZeppelin. Our implementation is now deprecated and will be removed in the next major release. The corresponding standard interfaces remain available. (#4066)
v4.8.3 - 2023-04-13
Note This release contains fixes for https://github.com/OpenZeppelin/openzeppelin-contracts/security/advisories/GHSA-mx2q-35m2-x2rh and https://github.com/OpenZeppelin/openzeppelin-contracts/security/advisories/GHSA-93hq-5wgc-jc82.
GovernorCompatibilityBravo
: Fix encoding of proposal data when signatures are missing.TransparentUpgradeableProxy
: Fix transparency in case of selector clash with non-decodable calldata or payable mutability. (#4154)
v4.8.2 - 2023-03-02
Note This release contains a fix for https://github.com/OpenZeppelin/openzeppelin-contracts/security/advisories/GHSA-878m-3g6q-594q.
ERC721Consecutive
: Fixed a bug when_mintConsecutive
is used for batches of size 1 that could lead to balance overflow. Refer to the breaking changes section in the changelog for a note on the behavior ofERC721._beforeTokenTransfer
.
Breaking changes
ERC721
: The internal function_beforeTokenTransfer
no longer updates balances, which it previously did whenbatchSize
was greater than 1. This change has no consequence unless a custom ERC721 extension is explicitly invoking_beforeTokenTransfer
. Balance updates in extensions must now be done explicitly using__unsafe_increaseBalance
, with a name that indicates that there is an invariant that has to be manually verified.
v4.8.1 - 2023-01-13
ERC4626
: Use staticcall instead of call when fetching underlying ERC-20 decimals. (#3943)
v4.8.0 - 2022-11-08
Note Don't miss the section on Breaking changes at the end.
TimelockController
: Added a newadmin
constructor parameter that is assigned the admin role instead of the deployer account. (#3722)Initializable
: add internal functions_getInitializedVersion
and_isInitializing
(#3598)ERC165Checker
: addsupportsERC165InterfaceUnchecked
for consulting individual interfaces without the full ERC165 protocol. (#3339)Address
: optimizefunctionCall
by callingfunctionCallWithValue
directly. (#3468)Address
: optimizefunctionCall
functions by checking contract size only if there is no returned data. (#3469)Governor
: make therelay
function payable, and add support for EOA payments. (#3730)GovernorCompatibilityBravo
: remove unusedusing
statements. (#3506)ERC20
: optimize_transfer
,_mint
and_burn
by usingunchecked
arithmetic when possible. (#3513)ERC20Votes
,ERC721Votes
: optimizegetPastVotes
for looking up recent checkpoints. (#3673)ERC20FlashMint
: add an internal_flashFee
function for overriding. (#3551)ERC4626
: use the samedecimals()
as the underlying asset by default (if available). (#3639)ERC4626
: add internal_initialConvertToShares
and_initialConvertToAssets
functions to customize empty vaults behavior. (#3639)ERC721
: optimize transfers by making approval clearing implicit instead of emitting an event. (#3481)ERC721
: optimize burn by making approval clearing implicit instead of emitting an event. (#3538)ERC721
: Fix balance accounting when a custom_beforeTokenTransfer
hook results in a transfer of the token under consideration. (#3611)ERC721
: use unchecked arithmetic for balance updates. (#3524)ERC721Consecutive
: Implementation of EIP-2309 that allows batch minting of ERC721 tokens during construction. (#3311)ReentrancyGuard
: Reduce code size impact of the modifier by using internal functions. (#3515)SafeCast
: optimize downcasting of signed integers. (#3565)ECDSA
: Remove redundant check on thev
value. (#3591)VestingWallet
: addreleasable
getters. (#3580)VestingWallet
: remove unused libraryMath.sol
. (#3605)VestingWallet
: make constructor payable. (#3665)Create2
: optimize address computation by using assembly instead ofabi.encodePacked
. (#3600)Clones
: optimized the assembly to use only the scratch space during deployments, and optimizedpredictDeterministicAddress
to use fewer operations. (#3640)Checkpoints
: Use procedural generation to support multiple key/value lengths. (#3589)Checkpoints
: Add new lookup mechanisms. (#3589)Arrays
: AddunsafeAccess
functions that allow reading and writing to an element in a storage array bypassing Solidity's "out-of-bounds" check. (#3589)Strings
: optimizetoString
. (#3573)Ownable2Step
: extension ofOwnable
that makes the ownership transfers a two step process. (#3620)Math
andSignedMath
: optimize functionmax
by using>
instead of>=
. (#3679)Math
: Addlog2
,log10
andlog256
. (#3670)- Arbitrum: Update the vendored arbitrum contracts to match the nitro upgrade. (#3692)
Breaking changes
ERC721
: In order to add support for batch minting viaERC721Consecutive
it was necessary to make a minor breaking change in the internal interface ofERC721
. Namely, the hooks_beforeTokenTransfer
and_afterTokenTransfer
have one additional argument that may need to be added to overrides:
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId,
+ uint256 batchSize
) internal virtual override
-
ERC4626
: Conversion from shares to assets (and vice-versa) in an empty vault used to consider the possible mismatch between the underlying asset's and the vault's decimals. This initial conversion rate is now set to 1-to-1 irrespective of decimals, which are meant for usability purposes only. The vault now uses the assets decimals by default, so off-chain the numbers should appear the same. Developers overriding the vault decimals to a value that does not match the underlying asset may want to override the_initialConvertToShares
and_initialConvertToAssets
to replicate the previous behavior. -
TimelockController
: During deployment, the TimelockController used to grant theTIMELOCK_ADMIN_ROLE
to the deployer and to the timelock itself. The deployer was then expected to renounce this role once configuration of the timelock is over. Failing to renounce that role allows the deployer to change the timelock permissions (but not to bypass the delay for any time-locked actions). The role is no longer given to the deployer by default. A new parameteradmin
can be set to a non-zero address to grant the admin role during construction (to the deployer or any other address). Just like previously, this admin role should be renounced after configuration. If this param is givenaddress(0)
, the role is not allocated and doesn't need to be revoked. In any case, the timelock itself continues to have this role.
Deprecations
EIP712
: Added the fileEIP712.sol
and deprecateddraft-EIP712.sol
since the EIP is no longer a Draft. Developers are encouraged to update their imports. (#3621)
-import "@openzeppelin/contracts/utils/cryptography/draft-EIP712.sol";
+import "@openzeppelin/contracts/utils/cryptography/EIP712.sol";
ERC721Votes
: Added the fileERC721Votes.sol
and deprecateddraft-ERC721Votes.sol
since it no longer depends on a Draft EIP (EIP-712). Developers are encouraged to update their imports. (#3699)
-import "@openzeppelin/contracts/token/ERC721/extensions/draft-ERC721Votes.sol";
+import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Votes.sol";
ERC-721 Compatibility Note
ERC-721 integrators that interpret contract state from events should make sure that they implement the clearing of approval that is implicit in every transfer according to the EIP. Previous versions of OpenZeppelin Contracts emitted an explicit Approval
event even though it was not required by the specification, and this is no longer the case.
With the new ERC721Consecutive
extension, the internal workings of ERC721
are slightly changed. Custom extensions to ERC721 should be reviewed to ensure they remain correct. The internal functions that should be considered are _ownerOf
(new), _beforeTokenTransfer
, and _afterTokenTransfer
.
v4.7.3 - 2022-08-10
:warning: This is a patch for a high severity issue. For more information visit the security advisory.
Breaking changes
ECDSA
:recover(bytes32,bytes)
andtryRecover(bytes32,bytes)
no longer accept compact signatures to prevent malleability. Compact signature support remains available usingrecover(bytes32,bytes32,bytes32)
andtryRecover(bytes32,bytes32,bytes32)
.
v4.7.2 - 2022-07-28
:warning: This is a patch for three issues, including a high severity issue in GovernorVotesQuorumFraction
. For more information visit the security advisories (1, 2, 3).
GovernorVotesQuorumFraction
: Fixed quorum updates so they do not affect past proposals that failed due to lack of quorum. (#3561)ERC165Checker
: Added protection against large returndata. (#3587)LibArbitrumL2
,CrossChainEnabledArbitrumL2
: Fixed detection of cross-chain calls for EOAs. Previously, calls from EOAs would be classified as cross-chain calls. (#3578)
v4.7.1 - 2022-07-20
:warning: This is a patch for a medium severity issue affecting SignatureChecker
and a high severity issue affecting ERC165Checker
. For more information visit the security advisories (1, 2).
SignatureChecker
: Fix an issue that causesisValidSignatureNow
to revert when the target contract returns ill-encoded data. (#3552)ERC165Checker
: Fix an issue that causessupportsInterface
to revert when the target contract returns ill-encoded data. (#3552)
v4.7.0 - 2022-06-30
TimelockController
: Migrate_call
to_execute
and allow inheritance and overriding similar toGovernor
. (#3317)CrossChainEnabledPolygonChild
: replace therequire
statement with the custom errorNotCrossChainCall
. (#3380)ERC20FlashMint
: Add customizable flash fee receiver. (#3327)ERC4626
: add an extension ofERC20
that implements the ERC4626 Tokenized Vault Standard. (#3171)SafeERC20
: addsafePermit
as mitigation against phantom permit functions. (#3280)Math
: add amulDiv
function that can round the result either up or down. (#3171)Math
: Add asqrt
function to compute square roots of integers, rounding either up or down. (#3242)Strings
: add a new overloaded functiontoHexString
that converts anaddress
with fixed length of 20 bytes to its not checksummed ASCIIstring
hexadecimal representation. (#3403)EnumerableMap
: add newUintToUintMap
map type. (#3338)EnumerableMap
: add newBytes32ToUintMap
map type. (#3416)SafeCast
: add support for many more types, using procedural code generation. (#3245)MerkleProof
: addmultiProofVerify
to prove multiple values are part of a Merkle tree. (#3276)MerkleProof
: add calldata versions of the functions to avoid copying input arrays to memory and save gas. (#3200)ERC721
,ERC1155
: simplified revert reasons. (#3254, (#3438))ERC721
: removed redundant require statement. (#3434)PaymentSplitter
: addreleasable
getters. (#3350)Initializable
: refactored implementation of modifiers for easier understanding. (#3450)Proxies
: remove runtime check of ERC1967 storage slots. (#3455)
Breaking changes
Initializable
: functions decorated with the modifierreinitializer(1)
may no longer invoke each other.
v4.6.0 - 2022-04-29
crosschain
: Add a new set of contracts for cross-chain applications.CrossChainEnabled
is a base contract with instantiations for several chains and bridges, andAccessControlCrossChain
is an extension of access control that allows cross-chain operation. (#3183)AccessControl
: add a virtual_checkRole(bytes32)
function that can be overridden to alter theonlyRole
modifier behavior. (#3137)EnumerableMap
: add newAddressToUintMap
map type. (#3150)EnumerableMap
: add newBytes32ToBytes32Map
map type. (#3192)ERC20FlashMint
: support infinite allowance when paying back a flash loan. (#3226)ERC20Wrapper
: thedecimals()
function now tries to fetch the value from the underlying token instance. If that calls revert, then the default value is used. (#3259)draft-ERC20Permit
: replaceimmutable
withconstant
for_PERMIT_TYPEHASH
since thekeccak256
of string literals is treated specially and the hash is evaluated at compile time. (#3196)ERC1155
: Add a_afterTokenTransfer
hook for improved extensibility. (#3166)ERC1155URIStorage
: add a new extension that implements a_setURI
behavior similar to ERC721's_setTokenURI
. (#3210)DoubleEndedQueue
: a new data structure that supports efficient push and pop to both front and back, useful for FIFO and LIFO queues. (#3153)Governor
: improved security ofonlyGovernance
modifier when using an external executor contract (e.g. a timelock) that can operate without necessarily going through the governance protocol. (#3147)Governor
: Add a way to parameterize votes. This can be used to implement voting systems such as fractionalized voting, ERC721 based voting, or any number of other systems. Theparams
argument added to_countVote
method, and included in the newly added_getVotes
method, can be used by counting and voting modules respectively for such purposes. (#3043)Governor
: rewording of revert reason for consistency. (#3275)Governor
: fix an inconsistency in data locations that could lead to invalid bytecode being produced. (#3295)Governor
: ImplementIERC721Receiver
andIERC1155Receiver
to improve token custody by governors. (#3230)TimelockController
: ImplementIERC721Receiver
andIERC1155Receiver
to improve token custody by timelocks. (#3230)TimelockController
: Add a separate canceller role for the ability to cancel. (#3165)Initializable
: add a reinitializer modifier that enables the initialization of new modules, added to already initialized contracts through upgradeability. (#3232)Initializable
: add an Initialized event that tracks initialized version numbers. (#3294)ERC2981
: makeroyaltiInfo
public to allow super call in overrides. (#3305)
Upgradeability notice
TimelockController
: (Action needed) The upgrade from<4.6 to >=4.6
introduces a newCANCELLER_ROLE
that requires set up to be assignable. After the upgrade, only addresses with this role will have the ability to cancel. Proposers will no longer be able to cancel. Assigning cancellers can be done by an admin (including the timelock itself) once the role admin is set up. To do this, we recommend upgrading to theTimelockControllerWith46MigrationUpgradeable
contract and then calling themigrateTo46
function.
Breaking changes
Governor
: Adds internal virtual_getVotes
method that must be implemented; this is a breaking change for existing concrete extensions toGovernor
. To fix this on an existing voting module extension, renamegetVotes
to_getVotes
and add abytes memory
argument. (#3043)Governor
: Addsparams
parameter to internal virtual_countVote
method; this is a breaking change for existing concrete extensions toGovernor
. To fix this on an existing counting module extension, add abytes memory
argument to_countVote
. (#3043)Governor
: Does not emitVoteCast
event when params data is non-empty; instead emitsVoteCastWithParams
event. To fix this on an integration that consumes theVoteCast
event, also fetch/monitorVoteCastWithParams
events. (#3043)Votes
: The internal virtual function_getVotingUnits
was madeview
(which was accidentally missing). Any overrides should now be updated so they areview
as well.
v4.5.0 - 2022-02-09
ERC2981
: add implementation of the royalty standard, and the respective extensions forERC721
andERC1155
. (#3012)GovernorTimelockControl
: improve thestate()
function to have it reflect cases where a proposal has been canceled directly on the timelock. (#2977)- Preset contracts are now deprecated in favor of Contracts Wizard. (#2986)
Governor
: add a relay function to help recover assets sent to a governor that is not its own executor (e.g. when using a timelock). (#2926)GovernorPreventLateQuorum
: add new module to ensure a minimum voting duration is available after the quorum is reached. (#2973)ERC721
: improved revert reason when transferring from wrong owner. (#2975)Votes
: Added a base contract for vote tracking with delegation. (#2944)ERC721Votes
: Added an extension of ERC721 enabled with vote tracking and delegation. (#2944)ERC2771Context
: use immutable storage to store the forwarder address, no longer an issue since Solidity >=0.8.8 allows reading immutable variables in the constructor. (#2917)Base64
: add a library to parse bytes into base64 strings usingencode(bytes memory)
function, and provide examples to show how to use to build URL-safetokenURIs
. (#2884)ERC20
: reduce allowance before triggering transfer. (#3056)ERC20
: do not update allowance ontransferFrom
when allowance istype(uint256).max
. (#3085)ERC20
: add a_spendAllowance
internal function. (#3170)ERC20Burnable
: do not update allowance onburnFrom
when allowance istype(uint256).max
. (#3170)ERC777
: do not update allowance ontransferFrom
when allowance istype(uint256).max
. (#3085)ERC777
: add a_spendAllowance
internal function. (#3170)SignedMath
: a new signed version of the Math library withmax
,min
, andaverage
. (#2686)SignedMath
: add aabs(int256)
method that returns the unsigned absolute value of a signed value. (#2984)ERC1967Upgrade
: Refactor the secure upgrade to useERC1822
instead of the previous rollback mechanism. This reduces code complexity and attack surface with similar security guarantees. (#3021)UUPSUpgradeable
: AddERC1822
compliance to support the updated secure upgrade mechanism. (#3021)- Some more functions have been made virtual to customize them via overrides. In many cases this will not imply that other functions in the contract will automatically adapt to the overridden definitions. People who wish to override should consult the source code to understand the impact and if they need to override any additional functions to achieve the desired behavior.
Breaking changes
ERC1967Upgrade
: The function_upgradeToAndCallSecure
was renamed to_upgradeToAndCallUUPS
, along with the change in security mechanism described above.Address
: The Solidity pragma is increased from^0.8.0
to^0.8.1
. This is required by theaccount.code.length
syntax that replaces inline assembly. This may require users to bump their compiler version from0.8.0
to0.8.1
or later. Note that other parts of the code already include stricter requirements.
v4.4.2 - 2022-01-11
:warning: This is a patch for a medium severity issue. For more information visit the security advisory.
GovernorCompatibilityBravo
: Fix error in the encoding of calldata for proposals submitted through the compatibility interface with explicit signatures. (#3100)
v4.4.1 - 2021-12-14
:warning: This is a patch for a low severity vulnerability. For more information visit the security advisory.
Initializable
: change the existinginitializer
modifier and add a newonlyInitializing
modifier to prevent reentrancy risk. (#3006)
Breaking change
It is no longer possible to call an initializer
-protected function from within another initializer
function outside the context of a constructor. Projects using OpenZeppelin upgradeable proxies should continue to work as is, since in the common case the initializer is invoked in the constructor directly. If this is not the case for you, the suggested change is to use the new onlyInitializing
modifier in the following way:
contract A {
- function initialize() public initializer { ... }
+ function initialize() internal onlyInitializing { ... }
}
contract B is A {
function initialize() public initializer {
A.initialize();
}
}
v4.4.0 - 2021-11-25
Check out the first OpenZeppelin Community Call where the team discussed everything that is included in this release.
And if you missed it, we recently announced an official bug bounty program for OpenZeppelin Contracts. Check it out!
Ownable
: add an internal_transferOwnership(address)
. (#2568)AccessControl
: add internal_grantRole(bytes32,address)
and_revokeRole(bytes32,address)
. (#2568)AccessControl
: mark_setupRole(bytes32,address)
as deprecated in favor of_grantRole(bytes32,address)
. (#2568)AccessControlEnumerable
: hook into_grantRole(bytes32,address)
and_revokeRole(bytes32,address)
. (#2946)EIP712
: cacheaddress(this)
to immutable storage to avoid potential issues if a vanilla contract is used in a delegatecall context. (#2852)- Add internal
_setApprovalForAll
toERC721
andERC1155
. (#2834) Governor
: shift vote start and end by one block to better match Compound's GovernorBravo and prevent voting at the Governor level if the voting snapshot is not ready. (#2892)GovernorCompatibilityBravo
: consider quorum an inclusive rather than exclusive minimum to match Compound's GovernorBravo. (#2974)GovernorSettings
: a new governor module that manages voting settings updatable through governance actions. (#2904)PaymentSplitter
: now supports ERC20 assets in addition to Ether. (#2858)ECDSA
: add a variant oftoEthSignedMessageHash
for arbitrary length message hashing. (#2865)MerkleProof
: add aprocessProof
function that returns the rebuilt root hash given a leaf and a proof. (#2841)VestingWallet
: new contract that handles the vesting of Ether and ERC20 tokens following a customizable vesting schedule. (#2748)Governor
: enable receiving Ether when a Timelock contract is not used. (#2748)GovernorTimelockCompound
: fix ability to use Ether stored in the Timelock contract. (#2748)
v4.3.3 - 2021-11-15
:warning: This is a security patch. For more information visit the security advisory.
ERC1155Supply
: HandletotalSupply
changes by hooking into_beforeTokenTransfer
to ensure consistency of balances and supply duringIERC1155Receiver.onERC1155Received
calls.
v4.3.2 - 2021-09-14
:warning: This is a security patch. For more information visit the security advisory.
UUPSUpgradeable
: Add modifiers to preventupgradeTo
andupgradeToAndCall
being executed on any contract that is not the active ERC1967 proxy. This prevents these functions being called on implementation contracts or minimal ERC1167 clones, in particular.
v4.3.1 - 2021-08-26
:warning: This is a security patch. For more information visit the security advisory.
TimelockController
: Add additional isOperationReady check.
v3.4.2-solc-0.7 - 2021-08-26
TimelockController
: Add additional isOperationReady check.
v3.4.2 - 2021-08-26
TimelockController
: Add additional isOperationReady check.
v4.3.0 - 2021-08-17
Visit our blog for the full 4.3 announcement as well as Governor announcement!
ERC2771Context
: use private variable from storage to store the forwarder address. Fixes issues where_msgSender()
was not callable from constructors. (#2754)EnumerableSet
: addvalues()
functions that returns an array containing all values in a single call. (#2768)Governor
: added a modular system ofGovernor
contracts based onGovernorAlpha
andGovernorBravo
. (#2672)- Add an
interfaces
folder containing solidity interfaces to final ERCs. (#2517) ECDSA
: addtryRecover
functions that will not throw if the signature is invalid, and will return an error flag instead. (#2661)SignatureChecker
: Reduce gas usage of theisValidSignatureNow
function for the "signature by EOA" case. (#2661)
v4.2.0 - 2021-06-30
Read the full announcement in the blog!
ERC20Votes
: add a new extension of theERC20
token with support for voting snapshots and delegation. (#2632)ERC20VotesComp
: Variant ofERC20Votes
that is compatible with Compound'sComp
token interface but restricts supply touint96
. (#2706)ERC20Wrapper
: add a new extension of theERC20
token which wraps an underlying token. Deposit and withdraw guarantee that the total supply is backed by a corresponding amount of underlying token. (#2633)- Enumerables: Improve gas cost of removal in
EnumerableSet
andEnumerableMap
. - Enumerables: Improve gas cost of lookup in
EnumerableSet
andEnumerableMap
. Counter
: add a reset method. (#2678)- Tokens: Wrap definitely safe subtractions in
unchecked
blocks. Math
: Add aceilDiv
method for performing ceiling division.ERC1155Supply
: add a newERC1155
extension that keeps track of the totalSupply of each tokenId. (#2593)BitMaps
: add a newBitMaps
library that provides a storage efficient datastructure foruint256
tobool
mapping with contiguous keys. (#2710)
Breaking Changes
ERC20FlashMint
is no longer a Draft ERC. (#2673))
How to update: Change your import paths by removing the draft-
prefix from @openzeppelin/contracts/token/ERC20/extensions/draft-ERC20FlashMint.sol
.
v4.1.0 - 2021-04-30
Read the full announcement in the blog or check out the changelog.
IERC20Metadata
: add a new extended interface that includes the optionalname()
,symbol()
anddecimals()
functions. (#2561)ERC777
: make reception acquirement optional in_mint
. (#2552)ERC20Permit
: add a_useNonce
to enable further usage of ERC712 signatures. (#2565)ERC20FlashMint
: add an implementation of the ERC3156 extension for flash-minting ERC20 tokens. (#2543)SignatureChecker
: add a signature verification library that supports both EOA and ERC1271 compliant contracts as signers. (#2532)Multicall
: add abstract contract withmulticall(bytes[] calldata data)
function to bundle multiple calls together (#2608)ECDSA
: add support for ERC2098 short-signatures. (#2582)AccessControl
: add aonlyRole
modifier to restrict specific function to callers bearing a specific role. (#2609)StorageSlot
: add a library for reading and writing primitive types to specific storage slots. (#2542)- UUPS Proxies: add
UUPSUpgradeable
to implement the UUPS proxy pattern together withEIP1967Proxy
. (#2542)
v4.0.0 - 2021-03-24
Read the full announcement in the blog or check out the changelog.
Changelog
- Now targeting the 0.8.x line of Solidity compilers. For 0.6.x (resp 0.7.x) support, use version 3.4.0 (resp 3.4.0-solc-0.7) of OpenZeppelin.
Context
: making_msgData
returnbytes calldata
instead ofbytes memory
(#2492)ERC20
: removed the_setDecimals
function and the storage slot associated to decimals. (#2502)Strings
: addition of atoHexString
function. (#2504)EnumerableMap
: change implementation to optimize forkey → value
lookups instead of enumeration. (#2518)GSN
: deprecate GSNv1 support in favor of upcoming support for GSNv2. (#2521)ERC165
: remove uses of storage in the base ERC165 implementation. ERC165 based contracts now use storage-less virtual functions. Old behavior remains available in theERC165Storage
extension. (#2505)Initializable
: make initializer check stricter during construction. (#2531)ERC721
: remove enumerability of tokens from the base implementation. This feature is now provided separately through theERC721Enumerable
extension. (#2511)AccessControl
: removed enumerability by default for a more lightweight contract. It is now opt-in throughAccessControlEnumerable
. (#2512)- Meta Transactions: add
ERC2771Context
and aMinimalForwarder
for meta-transactions. (#2508) - Overall reorganization of the contract folder to improve clarity and discoverability. (#2503)
ERC20Capped
: optimize gas usage by enforcing the check directly in_mint
. (#2524)- Rename
UpgradeableProxy
toERC1967Proxy
. (#2547) ERC777
: optimize the gas costs of the constructor. (#2551)ERC721URIStorage
: add a new extension that implements the_setTokenURI
behavior as it was available in 3.4.0. (#2555)AccessControl
: added ERC165 interface detection. (#2562)ERC1155
: makeuri
public so overloading function can call it using super. (#2576)
How to upgrade from 3.x
Since this version has moved a few contracts to different directories, users upgrading from a previous version will need to adjust their import statements. To make this easier, the package includes a script that will migrate import statements automatically. After upgrading to the latest version of the package, run:
npx openzeppelin-contracts-migrate-imports
Make sure you're using git or another version control system to be able to recover from any potential error in our script.
v3.4.0 - 2021-02-03
Read the full announcement in the blog or check out the changelog.
Security Fixes
ERC777
: fix potential reentrancy issues for custom extensions toERC777
. (#2483)
If you're using our implementation of ERC777 from version 3.3.0 or earlier, and you define a custom _beforeTokenTransfer
function that writes to a storage variable, you may be vulnerable to a reentrancy attack. If you're affected and would like assistance please write to security@openzeppelin.com. Read more in the pull request.
v3.3.0 - 2020-11-27
Read the full announcement in the forum or check out the changelog.
- Now supports both Solidity 0.6 and 0.7. Compiling with solc 0.7 will result in warnings. Install the
solc-0.7
tag to compile without warnings. TimelockController
: added a contract to augment access control schemes with a delay. (#2354)Address
: addedfunctionStaticCall
, similar to the existingfunctionCall
. (#2333)EnumerableSet
: addedBytes32Set
, for sets ofbytes32
. (#2395)
v3.2.1 for Solidity 0.7 (v3.2.1-solc-0.7) - 2020-09-15
This is a special release for Solidity 0.7 that gets rid of a warning in ERC777
using one of the new features of the language. (#2327)
Note: The variant for Solidity 0.7 can be installed using npm install @openzeppelin/contracts@solc-0.7
.
v3.2.0 - 2020-09-11
Welcome to a new release of OpenZeppelin Contracts! :dancers:
The big feature in this release is that we’ve migrated our proxy contracts from OpenZeppelin SDK into the Contracts project. We hope this will make more people aware of upgrades in Ethereum, and we also think the contracts will benefit greatly from the continued scrutiny by all of you in the community. This was also a migration of the proxies from Solidity 0.5 to 0.6, which we know some users have been waiting for.
For Solidity 0.7 users, a reminder that we have support for the newer compiler version published on npm under the tag
solc-0.7
, the latest release being3.2.0-solc-0.7
. We’re considering officially switching to 0.7 for the release after this one.
There is additionally a small breaking change in ERC20Snapshot
that may affect some of its users. If you’re one of them please take a look at the changelog.
v3.1.0 - 2020-06-29
This is the first release since v3.0, our last major release. It includes the long-awaited ERC1155 token and helpers for safe calls and downcasts, as well as a number of minor improvements.
To install this release, run:
npm install --save-dev @openzeppelin/contracts
ERC1155
This is a new token standard developed by the gaming industry, focusing on gas efficiency. It's key difference is that it is a multi-token contract: a single ERC1155 can be used to represent an arbitrary number of tokens, which is very useful in applications that require many tokens by removing the high gas costs associated with deploying them. Check out our new documentation page to learn more!.
More Replacements for call
The low-level call
primitive can be hard to use correctly and is often considered unsafe. With the addition of sendValue
in Contracts and try-catch
in Solidity, there's only a few scenarios in which call
is still needed, the most troublesome one being forwarding calls.
The new functionCall
helpers can forward call data to a recipient contract while imitating Solidity's function call semantics, such as bubbling up revert reasons and rejecting calls to EOAs. We expect the addition of these functions to greatly reduce the need to rely on call
.
Using SafeMath
on Small Signed Integers
We've expanded the scope of the SafeCast
library to also include signed integer downcasting, which allows for users that need small types (such as int8
or int32
) to perform checked arithmetic on them by using SafeMath
, and then downcast the result to the intended size.
OpenZeppelin Contracts 3.0.1 (v3.0.1) - 2020-04-27
This is a small bugfix release, addressing an issue that allowed for some internal
functions in ERC777 to be called with the zero address as one of their arguments.
This was reported in #2208, fixed in #2212 for the v2.5 branch, and ported to the v3.0 branch in #2213.
OpenZeppelin Contracts 2.5.1 (v2.5.1) - 2020-04-27
This is a small bugfix release, addressing an issue that allowed for some internal
functions in ERC777 to be called with the zero address as one of their arguments.
This was reported in #2208 and fixed in #2212.
OpenZeppelin Contracts 3.0 (v3.0.0) - 2020-04-20
We're thrilled to finally announce the release of OpenZeppelin Contracts v3.0 :sparkles:
Among other things, this release features the migration to Solidity v0.6, as well as a revamped access control system, streamlined token contracts, and new libraries for enumerable mappings.
To install this latest release, run:
npm install --save-dev @openzeppelin/contracts
What's New
- All contracts were migrated to Solidity v0.6.
AccessControl
was designed with help from the community and has replacedRoles
contracts (such asMinterRole
andPauserRole
), which were removed.- Crowdsales were removed: we'll continue to provide support for security issues on the v2.5 release, but will not bring them over to v3.0.
- We've added hooks, a new feature of the library that will make extending it easier than ever.
ERC20
andERC721
were simplified and streamlined, including all optional parts of the standard by default, and simplifying some of our own custom extensions.- Support for better
mapping
types that let you efficiently iterate over all keys usingEnumerableSet
andEnumerableMap
- Many, many breaking changes with small improvements. We've also moved some contracts around (e.g.
Ownable
is now found under theaccess
directory) and deleted some that were not being used. Head to our changelog to see the full list.
Compiling v0.6 Contracts
You can use the OpenZeppelin CLI to compile any Solidity v0.6 contract: just update the pragma
statement on your source code and you'll be good to go!
pragma solidity ^0.6.0;
Note that you will need to use the v2.7 release of the CLI or newer to have Solidity v0.6 support. For detailed information about using the CLI compiler, head to its documenation.
Revamped Access Control
One of our most widely-used contracts is Ownable
, providing a simple authorization scheme. However, this fell short in complex systems with multiple permissions.
The v3.0 release introduces AccessControl
, a one-stop-shop for all authorization needs. It lets you easily define multiple roles with different permissions, as well as which accounts are allowed to grant and revoke each role. It also boosts transparency by enabling enumeration of all privileged accounts in a system.
AccessControl
was designed with a security-first mindset, receiving input from a wide array of users and incorporating best practices in the field. Head to our Access Control guide for more information!
Preset Contracts
OpenZeppelin Contracts shine when you need the building blocks to get to the right feature set, but that's not all they can do! We've added a new family of Preset contracts starting with ERC20 and ERC721 tokens that you can quickly deploy as-is without having to write any Solidity code. Check out their documentation!
Migrating From OpenZeppelin Contracts v2.5
Other than the moved and deleted contracts mentioned above, the library API is pretty much the same as in the v2.5 release, so the migration should be straightforward. For instructions on how to update your Solidity v0.5 contracts to v0.6, refer to the official documentation.
If you're using the ERC20
or ERC721
tokens however, you'll have to remove all references to optional extensions (ERC20Detailed
, ERC721Enumerable
, etc.) - these have been included in the base contracts.
The other exception to this are contracts that use the Gas Station Network (GSN): if you're inheriting from GSNRecipient
or one of the other GSN contracts, you'll need to add the following snippet to your contracts:
function _msgSender() internal view override(Context, GSNRecipient) returns (address payable) {
return GSNRecipient._msgSender();
}
function _msgData() internal view override(Context, GSNRecipient) returns (bytes memory) {
return GSNRecipient._msgData();
}
Using Hooks
To improve library flexibility, we're introducing hooks: functions that are called at specific moments during a contract's operation that you can use to hook into the internals and extend as you wish.
For example, the _beforeTokenTransfer
hook in ERC20, ERC721 and ERC777 makes it very easy to add additional checks or actions to execute whenever tokens are transferred, minted or burned, regardless of what prompted it.
// Tokens can only be transferred, minted or burned if the contract is not paused
contract ERC20Pausable is ERC20, Pausable {
function _beforeTokenTransfer(address from, address to, uint256 amount)
internal virtual override
{
super._beforeTokenTransfer(from, to, amount);
require(!paused(), "ERC20Pausable: token transfer while paused");
}
}
As an additional benefit, using hooks will allow you to side-step some of the edge-cases product of the new override
keyword.
Head over to our brand new guide on Extending the OpenZeppelin Contracts to learn more!
What's Next
We've started work in some exciting features for the upcoming releases, including fixed-point arithmetic and the ERC1155 token standard. To read more and find out how you can contribute, check out our Q2 2020 roadmap!
OpenZeppelin Contracts 2.5 (v2.5.0) - 2020-02-05
We're very happy the announce the release of OpenZeppelin Contracts v2.5!
This new release features:
EnumerableSet
: similar to Solidity'smapping
, but that lets you retrieve all the keys! Useful for dapps that need to display a set of accounts with some property, and cannot rely on events alone.Create2
: a simple library for using the CREATE2 opcode, allowing for deployment and pre-computation of addresses when using it. To learn more about all the cool things you can do with it, head to Getting the Most out of CREATE2ERC721Metadata.baseURI
: a neat extension for massive gas savings when the token URIs share a prefix, likehttps://my.cool.app/token/<id>
There are also some minor improvements, such as gas optimizations for ReentrancyGuard
and additional extensibility of ERC777
, among others.
For the complete list of changes, head to our changelog.
To install the new release, run:
$ npm install @openzeppelin/contracts@latest
New Documentation :books:
We've also recently done some some improvements to our documentation website, including new detailed guides and documentation for our other tools, such as the Test Helpers, our blazing-fast Test Environment and the OpenZeppelin Command Line Interface. Check them out for a radically better development experience!
Saying Goodbye to Solidity v0.5 :wave:
December 2019 saw the release of Solidity v0.6. This new version of the language has major improvements, and we're already underway to release the next version of OpenZeppelin Contracts with support for Solidity v0.6.
However, it also includes a lot of breaking changes, making it difficult to support both v0.5 and v0.6 code at the same time. For this reason, we've decided OpenZeppelin Contracts v2.5 will be the last version supporting Solidity v0.5.
The exciting good news it that the next OpenZeppelin Contracts release will be v3.0, where we'll get to redesign some quirky bits of the library, improving ease of use and flexibility. Stay tuned!
OpenZeppelin 2.4 (v2.4.0) - 2019-11-01
In 2.4 we're releasing support for the Gas Station Network for user onboarding and metatransactions :fuelpump:, new functions to safeguard your contracts against the Istanbul hard fork, and improvements to error messages.
Read the full announcement in the OpenZeppelin Forum, and make sure to check out the details in the changelog!
Enjoy!
OpenZeppelin 2.3 (v2.3.0) - 2019-06-03
In 2.3 we're introducing ERC777, revert reasons, and a new documentation site. :fireworks: Take a look and tell us what you think in the announcement thread!
Take a look and tell us what you think!
ERC777
The long awaited sequel to ERC20. Its main additions are transfer hooks and operators. Hooks let your contracts react to token transfers. In other words, running code when a contract receives tokens is a built-in feature: no more messing around with approve
and transferFrom
!
The other special feature, operators, provides simpler and more flexible ways of delegating usage of your tokens to other people or contracts, like decentralized exchanges.
All of this with full compatibility with ERC20!
Start building on it and tell us what you think! We're looking for ideas for extensions, custom operators, or utilities. Share your ideas here or in a new thread.
Revert reasons
Are you tired of running into cryptic errors like VM Exception while processing transaction: revert
? All errors in OpenZeppelin now have proper error messages that will be displayed when you test your code! We've kept them succinct and to the point. Each error message is unique, so if you're having trouble figuring out exactly which require
statement you've hit, it is easy to look up the error string in the source code, and look at the actual condition that is not being met.
Documentation site
We've revamped the docs, take a look!
It'll be super helpful to both people looking to get started in smart contract development, and veteran OpenZeppelin users who just need to quickly recall a function signature. Among other improvements, we've bundled together related concepts, added overviews for each section, and added crosslinks to other contracts and functions to make exploring the docsite a breeze!
Everything is automatically generated from the comments in the source code, so if you spot a typo or have a suggestion, simply open an issue or PR to get it sorted out in no time!
Some sections still require a bit of work to get them to where we want them to be, stay tuned!
More
Some more things are included in this release such as an implementation of ERC1820, and a fix for a bug in PostDeliveryCrowdsale
. Take a look at the changelog!
We have revamped the documentation site infrastructure and feel, take a look! It'll be super helpful to both people looking to get started in smart contract development and OpenZeppelin, and veteran users who just need to quickly recall an API. Among other improvements, we've bundled together related concepts, added overviews for each section, and added crosslinks to other contracts and functions to make exploring the docsite a breeze!
Everything is automatically generated from the comments in the source code, so if you spot a typo or have a suggestion, simply open an issue or PR to get it sorted out in no time!
Some sections still require a bit of work to get them to where we want them to be, stay tuned!
More
Some more things are included in this release such as an implementation of ERC1820, and a fix for a bug in PostDeliveryCrowdsale
. Take a look at the changelog!
OpenZeppelin 2.2 (v2.2.0) - 2019-03-14
No changes from the release candidate for this one, we're ironing out the kinks in the release process! :no_entry_sign: :bug:
This minor release includes a way to store token balances and supply so that they can be later queried in a gas-efficient manner :bookmark:, allows safe interaction with some old, non-compliant tokens :lock:, prevents user errors when using ECDSA signatures :memo: (the magic behind metatransactions! :sparkles:), and provides multiple minor additions and improvements to the API.
To install the release run npm install openzeppelin-solidity@latest
.
We would love your help by reviewing newly added contracts, their interface and documentation so that we can make names clearer, features easier to use, and the library better as a whole! Your feedback is extremely useful to us :)
Highlights
New features
ERC20Snapshot
: this variant allows for snapshots to be created on demand, storing the current token balances and total supply so that they can be later retrieved in a gas-efficient manner and e.g. calculate dividends at a past time. (#1617)SafeERC20
: theERC20
standard requires that all function calls (e.g.transfer
,approve
, etc.) return a boolean value indicating success. However, they are multiple widely used tokens out there that return no such value: they simplyrevert
when encountering an error condition. Since Solidity v0.4.22, special code was needed to interact with this non-compliant tokens: now, all ofSafeERC20
can be used to safely call both compliant and non-compliant tokens, without the developer having to worry about it. (#1655)TimedCrowdsale
: an internal_extendTime(uint256 newClosingTime)
function was added (with a correspondingTimedCrowdsaleExtended(uint256 prevClosingTime, uint256 newClosingTime)
event) allowing for users to safely develop mechanisms to extend the durations of unclosed crowdsales. Note that due to it being internal, there's no out-of-the-box way to do it: this feature is opt-in and must be explicitly invoked by users.
Improvements
ECDSA
:recover
no longer accepts malleable signatures (those using upper-range values fors
, or 0/1 forv
). This helps prevent multiple issues when using signatures as unique identifiers. Read more about common ECDSA issues here. (#1622)ERC721
's transfers are now more gas efficient due to removal of unnecessarySafeMath
calls. (#1610)
Bugfixes:
- (minor)
SafeERC20
:safeApprove
wasn't properly checking for a zero allowance when attempting to set a non-zero allowance. This bug was reported independently by @nikeshnazareth. Thanks a lot! (#1647)
Breaking changes in drafts:
TokenMetadata
has been renamed toERC20Metadata
. (#1618)- The library
Counter
has been renamed toCounters
and its API has been improved. See an example inERC721
, lines 17 and 204. (#1610)
You can also see all details of this release in our changelog.
OpenZeppelin 2.1.3 (v2.1.3) - 2019-02-26
Bugfix release :bug: :wrench:
A minor issue with SafeERC20.safeApprove
was identified and reported independently by @nikeshnazareth (thanks once again!), this release contains the correspondig fix: OpenZeppelin/openzeppelin-solidity#1647.
This bug has been present since v2.0.0. Updating to this latest version is recommended, but no immediate emergency action should be required for production code using affected versions, due to the low severity of the issue.
These independent reviews are a great way to keep our code secure and correct: we'll be making a push for a properly funded bug bounty during these next weeks to continue encouraging them. Stay tuned!
OpenZeppelin 2.0.1 (v2.0.1) - 2019-02-26
Bugfix release :bug: :wrench:
This is a backport of the 2.1.3 bugfix release for the 2.0.x line, which features Solidity v0.4.25 support: if you're still using OpenZeppelin v2.0.0, you can upgrade to this version instead of migrating to v2.1 and Solidity v0.5.
OpenZeppelin 2.1.2 (v2.1.2) - 2019-03-01
This release was mostly the migration from Truffle 4 to Truffle 5, which should not affect end users.
The only user facing change here is removing the tests and tests helpers from the npm package. If you used the test helpers, you will now find them in the openzeppelin-test-helpers
package.
OpenZeppelin 2.1 (v2.1.1) - 2019-01-04
2.1 is finally out! :tada:
The most significant change is that OpenZeppelin now works with Solidity 0.5.0. This new release of the compiler introduced many breaking changes, and our old contracts were no longer compatible with it. After much discussion, we've decided to drop the Solidity compiler version out of our stability guarantees: in an attempt to both use the best possible tools and push the industry forward, our releases will target a recent compiler version, which may change between minor releases.
This means that installing this new OpenZeppelin version will require you to upgrade your compiler to the 0.5.x line, which can be easily done with the recently released truffle v5.0.0
. The 2.0 release will be the last OpenZeppelin release with support for Solidity ^0.4.24, which we will still support in the form of bugfixes, if any are found.
In general, if you're not sure whether you'll want to upgrade your compiler version, feel free to pin an OpenZeppelin version during installation: :pushpin:
npm install openzeppelin-solidity@2.1 --save-exact
If you want to know more about our rationale behind this decision, and why we discarded other possible approaches, read here.
Highlights
- Added
WhitelistCrowdsale
, a crowdsale where only whitelisted accounts (WhitelistedRole
) can purchase tokens. Adding or removing accounts from the whitelist is done by whitelister admins (WhitelistAdminRole
). Similar to the pre-2.0WhitelistedCrowdsale
. (#1525, #1589) ERC20
'stransferFrom
and_burnFrom
now emitApproval
events, to represent the token's state comprehensively through events. (#1524)SignedSafeMath
now supports signed integers (int256
). (#1559, #1588)ERC20
andERC721
are now more gas efficient due to removed redundantSSTORE
s andrequire
s. (#1409 and #1549)
The first 2.1 release will be 2.1.1, due to a minor mishap that caused a conflict in the npm registry :man_facepalming:
:new: See the details in our brand new CHANGELOG!
OpenZeppelin 2.0 (v2.0.0) - 2018-10-21
OpenZeppelin 2.0 is finally here!!!
The major feature in this release is that we are now commiting to a stable API. In the process of stabilizing we've also reviewed a lot of the existing API in order to ensure a more straightforward experience for users.
Featuring...
Stable API
So far OpenZeppelin's API has sometimes changed from release to release, in backwards-incompatible ways. This has enabled us to iterate on features and design ideas, but we're at a point now where we want to commit to having a stable API and delivering reliable updates.
You can expect the external and internal API of contracts to remain stable. We're only making an exception to this for the contracts in the drafts/
subdirectory; this is where ERCs in Draft status, as well as more experimental contracts will go, and might have breaking changes in minor versions. We'll be documenting exactly what stability guarantees we provide in the coming weeks.
Granular permissions
Features which require permissions have used the almighty Ownable
so far. We are now moving towards a more granular system of roles, like the MinterRole
. Just like Ownable
, the creator of a contract is assigned all roles at first, but they can selectively give them out to other accounts.
Improved test suite
Although this is not visible to users, we have been improving the test suite, increasing coverage to 100%, and cleaning up all of our tests, which had diverged in style. This is part of a bigger effort towards making contributing easier and involving our amazing contributors more in the entire process of building OpenZeppelin.
A new audit
The awesome LevelK team audited our 2.0.0 Release Candidate and they found some severe issues and suggested many improvements. We fixed almost all the issues and notes they reported, leaving only a few minor details for 2.1.0. Check out the LevelK Audit - OpenZeppelin 2.0 project for all the details.
We want to thank @cwhinfrey, @pcowgill and @shanefontaine for their very detailed reviews, high quality standards, and human support during the closing phase of this release. This audit gave us a great confidence boost on the code that we are now publishing.
Tons of community love
Now hold your breath, because this release was only possible because of the contributions of many, many people from everywhere in the world, and we want to thank all of them:
@3sGgpQ8H, @Aniket-Engg, @barakman, @BrendanChou, @cardmaniac992, @dougiebuckets, @dwardu, @facuspagnuolo, @fulldecent, @glesaint, @Glisch, @jacobherrington, @jbogacz, @jdetychey, @JeanoLee, @k06a, @lamengao, @ldub, @leonardoalt, @Miraj98, @mswezey23, @pw94, @shishir99111, @sohkai, @sweatyc, @tinchoabbate, @tinchou, @urvalla, @viquezclaudio, @vyomshm, @yaronvel, @ZumZoom.
Also we would like to thank all the people who are constantly helping others in our Slack channel, the ones who have given us feedback about the release, and the ones helping us triage and discuss our GitHub issues. If you are reading this wanting to jump in and make your first free software contributions, but you are unsure of where and how, talk to us! We can help you getting started, and we could use the extra hands.
With ❤️ from the maintainers team of this release. -- @shrugs, @nventuro, @frangio and @elopio
Changelog
The changelog is pretty big. We are introducing new concepts and new designs, together with many renames and restructures. If you have problems, comments or suggestions, please join our Slack channel.
https://github.com/OpenZeppelin/openzeppelin-solidity/compare/v1.12.0...v2.0.0
Ownable
contracts have moved to role based access. (#1291, #1302, #1303)- ERC contracts have all been renamed to follow the same convention. The interfaces are called
IERC##
, and their implementations areERC##
. Check out, for example,IERC20
andERC20
. (#1252, #1288) - All state variables are now
private
, which means that derived contracts cannot access them directly, but have to use getters. This is to increase encapsulation, to be able to reason better about the code. (#1197, #1265, #1267, #1269, #1270, #1268, #1281) - Events have been changed to be consistently in the past tense except for those which are defined by an ERC. (#1181)
- Separated
ERC721
into the different optional interfaces, and introducedERC721Full
which implements all. (#1304) - Added
ERC165Query
to query support for ERC165 interfaces. (#1086) - Added an experimental contract for migration between ERC20 tokens. (#1054)
- Added
SafeMath.mod
. (#915) - Added
Math.average
. (#1170) - Added
ERC721Pausable
. (#1154) - Changed
SafeMath
to userequire
instead ofassert
. (#1187, #1120, interesting discussion!) - Removed restriction on who can release funds in
PullPayments
,PaymentSplitter
,PostDeliveryCrowdsale
,RefundableCrowdsale
. (#1275) - Optimized
ReentrancyMutex
gas usage. (#1155) - Made
ERC721.exists
internal. (#1193) - Changed preconditions on
PaymentSplitter
constructor arguments. (#1131) - Fixed
ERC721.getApproved
to be in compliance with spec. (#1256) - Simplified interface of
IndividuallyCappedCrowdsale
. (#1296) - Renamed
ERC20.decreaseApproval
todecreaseAllowance
, and changed its semantics slightly to be more secure. (#1293) - Renamed
MerkleProof.verifyProof
toMerkleProof.verify
. (#1294) - Renamed
ECRecovery
toECDSA
, andAddressUtils
toAddress
. (#1253) - Moved
ECDSA
andMerkleProof
to acryptography/
subdirectory. (#1253) - Moved
ReentrancyGuard
, andAddress
to autils/
subdirectory. (#1253) - Renamed
proposals/
subdirectory todrafts/
. (#1271) - Moved
TokenVesting
,SignatureBouncer
todrafts/
. (#1271) - Removed
ERC20Basic
, now there's onlyERC20
. (#1125) - Removed
Math.min64
andMath.max64
, left only theuint256
variants. (#1156) - Removed
Mint
andBurn
events fromERC20Mintable
andERC20Burnable
. (#1305) - Removed underscores from event arguments. (#1258)
- Removed a few contracts that we thought were not generally secure enough:
LimitBalance
,HasNoEther
,HasNoTokens
,HasNoContracts
,NoOwner
,Destructible
,TokenDestructible
,CanReclaimToken
. (#1253, #1254, #1306) - Removed extensions of
Owable
:Claimable
,DelayedClaimable
,Heritable
. (#1274) - Renamed
AutoIncrementing
toCounter
and moved it todrafts\
. ((1307, #1332) - Added events to roles on construction and when renouncing. (#1329)
- Separated
ERC721Mintable
into two contracts, one with metadata (token URI) and one without. (#1365) - Added an ERC20 internal _transfer function. (#1370)
- Added an
Arrays
library. (#1375) - Improved the
OwnershipTransfer
event and removedOwnershipRenounced
. (#1397) - Removed the
BreakInvariantBounty
contract because of a front-running issue. (#1424) - Improved encapsulation on
ERC165
making the_supportedInterfaces
map private. (#1379) - Renamed
RefundsEscrow
event toRefundsClosed
. (#1418) - Moved
Escrow
andRefundsEscrow
tocontracts/payment/escrow/
. (#1430) - Made private the
TokenVesting
functions_releasableAmount
and_vestedAmount
. (#1427) - Made internal the constructors of contracts that should only be used inherited from others. (#1433, #1439)
- Renamed
ERC165
functionsupportsInterfaces
to_supportsAllInterfaces
. (#1435) - Added the
address
toPaused
andUnpaused
events. (#1410) - Renamed
SplitPayment
toPaymentSplitter
, and added the eventsPayeeAdded
,PaymentReleased
andPaymentReceived
. (#1417) - Renamed the
TokenVesting
events toTokensReleased
andTokenVestingRevoked
. (#1431) - Improved the
SafeERC20
allowance handling. (#1407) - Made
getCurrentRate
fromIncreasingPriceCrowdsale
return 0 when the crowdsale is not open. (#1442) - Made
tokenURI
fromERC721Metadata
external, to match the specification. (#1444) - Fixed a reentrancy issue on
FinalizableCrowdsale
. (#1447) - Fixed how allowance crowdsale checks remaining tokens. (#1449)
- Added the nonReentrant safeguard for buyTokens in the Crowdsale contract. (#1438)
v1.12.0 - 2018-08-11
And thus concludes another release cycle of OpenZeppelin! :smile:
Among other things, we have been busy enhancing the quality and consistency of the test suite. We think this will improve the experience for future contributors. Check it out! :bookmark_tabs: :raised_hands:
This is the last release before our planned 2.0 release, which will mark a commitment to a stable API. Keep an eye out for it! :eye:
Changelog
https://github.com/OpenZeppelin/openzeppelin-solidity/compare/v1.11.0...v1.12.0
Additions
- We now have a code of conduct! (#1061)
- A small library with a
Counter
datatype. (#1023) - A description in the README of the different categories of contracts we have and their organization. (#1089)
Improvements
- Moved ERC165 interface IDs to interface contracts. (#1070)
- Moved
RBAC
contract to theaccess
directory. (#1114) - Fixed an inheritance order that was causing some contracts to fail linearization. (#1128)
- Lots of test improvements, including the removal of Babel. (#1009, #1050, #1074, #1094, #1116, #1112, #1117)
- Fix
assertRevert
test helper. (#1123) - Some gas optimizations. (#1043, #1063, #1030, #1017, #1057)
- Removed unnecessary
payable
constructor fromDestructible
. (#1107) - Documentation tidbits. (#1035, #1082, #1084, #1083, #1060, #1101)
- Made code style more consistent with prefix underscore in all arguments. (#1133)
- Fixes for Solidity 0.5.0. (#1080, #1134)
- Silenced a compilation warning in
HasNoTokens
. (#1122)
v1.11.0 - 2018-07-13
We hit our 1000th issue during this release cycle! Congrats to everyone and thank you for the hard work. :smile:
Changelog
https://github.com/OpenZeppelin/openzeppelin-solidity/compare/v1.10.0...v1.11.0
Added
- :card_file_box:
Escrow
, a new class of contracts that we used to enhance the security ofPullPayments
. (#1014) - :writing_hand:
isValidSignatureAndData
, a new method ofSignatureBouncer
to validate signed function calls. (#973) - :memo: Initial implementation of ERC1046. (#933)
Changed
- :volcano: Updated the ERC721 contracts to the final version of the protocol. (#972, #993, #1047)
- :shark: Updated minor things for the newer versions of Solidity. (#951, #1002, #1008, #1033)
- :shield: Fixed unchecked token transfer in
Crowdsale
. (#1006) - :seat: Moved
Whitelist
toaccess
directory. (#994)
Removed
- :warning: We removed the implementation of ERC827 due to concerns about its security (#1044). The code was moved to windingtree/erc827.
v1.10.0 - 2018-06-05
The release includes the new constructor
syntax in Solidity (goodbye warnings :wave:).
:tada: :tada: :tada:
Changelog
https://github.com/OpenZeppelin/zeppelin-solidity/compare/v1.9.0...v1.10.0
- Updated contracts for Solidity 0.4.23 including the new
constructor
syntax (OpenZeppelin/openzeppelin-solidity#921) - Added
renounceOwnership
toOwnable
(OpenZeppelin/openzeppelin-solidity#907) - Added
Superuser
, an extension ofOwnable
with an emergency mechanism (OpenZeppelin/openzeppelin-solidity#952, OpenZeppelin/openzeppelin-solidity#978) - Added an
Ownable
"behavior" to test that your ownable contracts do not break the semantics (OpenZeppelin/openzeppelin-solidity#929)
v1.9.0 - 2018-04-27
:warning: Beginning with this release we're renaming the npm package to openzeppelin-solidity. Make sure to update your dependencies!
The release includes the new emit
keyword in Solidity, some new functionality, and other enhancements. Thanks everyone for participating!
:tada: :tada: :tada:
Changelog
https://github.com/OpenZeppelin/zeppelin-solidity/compare/v1.8.0...v1.9.0
- :ribbon: Updated our contracts for Solidity 0.4.21, including the new
emit
keyword (#876) - :fire: Added
StandardBurnableToken
with aburnFrom
function (#870) - :woman_teacher: Changed
MerkleProof
interface slightly (#879) - :policewoman: Removed admin functionality from RBAC (#836)
- :memo: Changes to ERC827 (#871, #838)
- :wrench: Cleaned up the npm package files and dependencies (#843, #904)
v1.8.0 - 2018-03-23
This release contains the full implementation of EIP721, following the last details settled in the recently closed EIP. Thanks to all the community for your contributions! 🚀
Changelog
https://github.com/OpenZeppelin/zeppelin-solidity/compare/v1.7.0...v1.8.0
- ✨ Final EIP721 implementation (#803)
- 🔥 Add
Transfer
event toBurnableToken
(#735) - 👨🏫
ECRecovery
recover
is now internal (#818) - 💅 Documentation and tests enhancements
v1.7.0 - 2018-02-20
This release contains a big refactor of the Crowdsale
contract, which allowed us to implement some really cool new crowdsale models. We also have a shiny new documentation site. Thanks to all the community for the awesome contributions! :rocket:
Changelog
https://github.com/OpenZeppelin/zeppelin-solidity/compare/v1.6.0...v1.7.0
- :warning: Big
Crowdsale
refactor, including breaking changes (OpenZeppelin/zeppelin-solidity#744) - :new: new crowdsale models (OpenZeppelin/zeppelin-solidity#744)
WhitelistedCrowdsale
IndividuallyCappedCrowdsale
,PostDeliveryCrowdsale
AllowanceCrowdsale
IncreasingPriceCrowdsale
- Original
Crowdsale
contract refactored intoCrowdsale
,TimedCrowdsale
andMintedCrowdsale
.
- :bow_and_arrow: Move token creation outside of
Crowdsale
contract (OpenZeppelin/zeppelin-solidity#690) - :crown:
Heritable
improvements (OpenZeppelin/zeppelin-solidity#702)
Project updates:
- :blue_book: New documentation site! (OpenZeppelin/zeppelin-solidity#750)
- :octocat: Update GitHub Pull Request templates (OpenZeppelin/zeppelin-solidity#699)
- :wrench: Minor tweaks for test artifact imports (OpenZeppelin/zeppelin-solidity#698)
- :male_detective: Improve test coverage (OpenZeppelin/zeppelin-solidity#712)
v1.6.0 - 2018-01-23
This time we bring you a new release, which includes the much hyped ERC721 for non-fungible tokens, to create your own digital collectibles and more. 🐈 🌍 🚀 🎉
During this release cycle the team has been very active improving the development process itself, and we're already seeing great results in the speed with which we respond to new issues and PRs. Take a peek at the status of development at our waffle.io board.
We'll be waiting for your contributions!
Changelog
- 🆕 Added
ERC721
non-fungible token implementation (#615) 🐈 - 🆕 Added
ERC827
token implementation providestransfer
,transferFrom
andapprove
methods which additionally perform a call to the recipients (#518) - 🆕 Added
Heritable
, an extension ofOwnable
with a designated heir (#680) - Added
getTokenAmount
for dynamic rate crowdsales (#638) - Added the
totalSupply
function to the ERC20 interface (#666)
Project changes
- Enhanced tests and documentation
- Updated documentation for contributors (#684)
- Added Issue/PR templates (#641)
- Added linting configuration and Travis CI step (#673)
v1.5.0 - 2017-12-22
A small release this time to keep the release cycle going! 🚀
Changelog
- 🆕 Added
RBAC
to enable more complex access control patterns. (#580) - Several enhancements to project quality. (#581)
- And a few small changes. 🙂
v1.4.0 - 2017-11-23
Thanks to all members of the community that contributed to this release! 🎉 🚀
Changelog
- 🆕 Added
TokenVesting
which implements vesting of tokens. It replaces the oldVestedToken
with a more modular approach. (#476) - 🆕 Added
SplitPayment
which implements distributing payments to multiple people proportionally to shares. (#417) - 🆕 Added
DetailedERC20
which adds to a token state variables with the optional ERC20 metadata. (#477) - 🆕 Added
CappedToken
which is aMintableToken
with capped supply. (#515) - Made
MintableToken
'sfinishMinting
executable only once. (#505) - Upgraded to Truffle 4.0.1 and Solidity 0.4.18. (#573, #460, #576, #506)
- Removed deprecated
claim()
fromTokenTimelock
. (#469)
And some additional changes to code style, tests, documentation and continuous integration.
v1.3.0 - 2017-09-21
After a long wait, we're finally releasing version 1.3.0 of OpenZeppelin. This is a big release with a lot of small fixes, exciting new features, and enhancements to the developer experience.
This release includes commits from 29 contributors! Huge thanks to all of you! 🎉 🎉
Changelog
- Removed
MultisigWallet
in favor of gnosis/MultiSigWallet. (#328) - Added a directory with examples. (#333, #342)
- Migrated the crowdsale contracts to timestamps instead of block numbers. (#350)
- Removed the call to
finishMinting
inFinalizableCrowdsale
. (#364) - Made
approve
pausable inPausableToken
. (#448) - Added an
OwnershipTransferred
event. (#424) - Added the
BurnableToken
contract. (#341) - Added the
CanReclaimToken
contract. (#348) - Added the
SafeERC20
library for interaction with ERC20 tokens. (#413) - Added the
MerkleProof
library for merkle proof verification. (#260) - Fixed some small issues in ERC20 compliance. (#345, #405, #446)
- Fixed a bug in
transferFrom
. (#377) - Fixed
transferOwnership
torevert
on failure instead of silently failing. (#323) - Fixed a bug in
TokenTimelock
. (#430) - Several enhancements to tests and documentation.
- Parallelized coverage and tests in Travis for faster test results in PRs. (#369)
- Removed the only production dependency (was actually a dev dependency). Now installing via
npm install --only=prod zeppelin-solidity
should install zero extra dependencies! (#357)
v1.2.0 - 2017-07-18
Changelog
- Fix ERC20 interface and implementations to conform to standard.
- Rename
claim
torelease
inTokenTimelock
. - Bugfixes in
VestedToken
. - Deprecated
throw
in favor ofrequire()
,assert()
andrevert()
. - Small improvements on crowdsale contracts.
- Added
ECRecovery
library.
v1.1.0 - 2017-07-02
Changelog
- Add Crowdsale contracts.
- Add a TokenTimelock contract.
- Add coveralls and move npm to yarn for TravisCI.
- Upgrade to Truffle version 3.2.2 and Solidity version 0.4.11
- Other minor refactors and fixes.
- Extract some functions of
SafeMath
intoMath
. - Remove all checks for short address attack (see: OpenZeppelin/zeppelin-solidity#261)
v1.0.6 - 2017-05-29
Changelog
- Add external audit report to repo.
- Minor improvements to
Destructible
. - Revert to usig npm as preferred installation method, as ethpm is still immature.
- Add solidity-coverage
- Add natspec documentation
- Add revokability and burnablity options to
VestedToken
and general refactor and optimizations
Security
- Add fix for the
approve()
mitigation. - Protect
transferFrom
against short hand attack. - Fix attack on
VestedToken#grantVestedTokens()
Thanks to @misteraverin, @miohtama, @izqui, @cgewecke, @maurelian, @JGcarv and @DavidKnott for your contributions to this release!
v1.0.5 - 2017-05-09
Changelog:
- Added new
TokenDestructible
lifecycle helper for contracts that want to transfer owned tokens when destroyed. - Decouple transferable logic from
VestedToken
asLimitedTransferToken
. - Added new ownership helpers
HasNoEther
,HasNoContracts
,NoOwner
. - Added
ReentrancyGuard
to prevent contract from calling itself, directly or indirectly. - Several refactors and small fixes.
- New
MintableToken
token with minting functions. - New
PausableToken
token with pausable transfers (it's aPausable
instance) - Make SafeMath a library.
- External audit security fixes. (Audit link will be published soon).
Thanks to @Recmo, @izqui, @demibrener, @frangio, @roderik, @jdetychey, @DavidKnott, @lastperson, @tatiesmars, @AugustoL, @ORBAT for your contributions! This release wouldn't be the same without your work.
v1.0.4 - 2017-03-09
- Add integration and publish to ethpm.