github OpenZeppelin/openzeppelin-contracts v4.5.0

latest releases: v5.0.2, v4.9.6, v4.9.5...
2 years ago
  • ERC2981: add implementation of the royalty standard, and the respective extensions for ERC721 and ERC1155. (#3012)
  • GovernorTimelockControl: improve the state() 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 using encode(bytes memory) function, and provide examples to show how to use to build URL-safe tokenURIs. (#2884)
  • ERC20: reduce allowance before triggering transfer. (#3056)
  • ERC20: do not update allowance on transferFrom when allowance is type(uint256).max. (#3085)
  • ERC20: add a _spendAllowance internal function. (#3170)
  • ERC20Burnable: do not update allowance on burnFrom when allowance is type(uint256).max. (#3170)
  • ERC777: do not update allowance on transferFrom when allowance is type(uint256).max. (#3085)
  • ERC777: add a _spendAllowance internal function. (#3170)
  • SignedMath: a new signed version of the Math library with max, min, and average. (#2686)
  • SignedMath: add a abs(int256) method that returns the unsigned absolute value of a signed value. (#2984)
  • ERC1967Upgrade: Refactor the secure upgrade to use ERC1822 instead of the previous rollback mechanism. This reduces code complexity and attack surface with similar security guarantees. (#3021)
  • UUPSUpgradeable: Add ERC1822 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 the account.code.length syntax that replaces inline assembly. This may require users to bump their compiler version from 0.8.0 to 0.8.1 or later. Note that other parts of the code already include stricter requirements.

Don't miss a new openzeppelin-contracts release

NewReleases is sending notifications on new releases.