Summary
Added
SafeERC20DispatcherTraitinopenzeppelin_token::erc20::utilswithassert_transfer,assert_transfer_from,assert_increase_allowance, andassert_decrease_allowance(#1683)- ERC-3156 standard interfaces and
ERC20FlashMintComponentextension (#1608) IERC6909MetadataAdminandIERC6909ContentUriAdmininterfaces toopenzeppelin_interfaces::token::erc6909(#1676)- Embeddable Ownable, AccessControl, and AccessControlDefaultAdminRules admin impls for
ERC6909MetadataComponentandERC6909ContentURIComponent(#1676) openzeppelin_utilsERC721ConsecutiveComponentextension (#1630)- ERC-6909 standard implementation and extensions (#1594)
- Introduced ERC6909Component and extension components: ERC6909ContentURIComponent, ERC6909MetadataComponent, and ERC6909TokenSupplyComponent.
- Added standard interfaces: IERC6909, IERC6909Metadata, IERC6909TokenSupply, and IERC6909ContentUri.
- Added the ERC6909ABI trait, covering the full ERC-6909 token functionality, including all supported extensions.
IERC1155Supplyinterface andERC1155SupplyComponentextension for total supply tracking (#1632)IERC721Wrapperinterface andERC721WrapperComponentfor ERC-721 wrapping and unwrapping (#1625)IERC20Wrapperinterface andERC20WrapperComponentfor ERC-20 wrapping and unwrapping (#1617)ERC721URIStorageComponentfor customizable token URI storage (#1639)ERC1155URIStorageComponentfor customizable token URI storage (#1642)generate_spy_event_helpersmacro (#1481)with_componentssupport for the newly added components, including ERC-6909, ERC721Consecutive, and ERC20FlashMint (#1594, #1635, #1660, #1691)
Changed
Changed (Breaking)
ERC20WrapperComponentfailed-transfer error changed to'SafeERC20: failed operation'; removedErrors::TRANSFER_FAILED(#1683)ERC4626SelfAssetsManagementfailed-transfer error changed to'SafeERC20: failed operation'; removedERC4626Component::Errors::TOKEN_TRANSFER_FAILED(#1683)VestingComponent.releasefailed-transfer error changed to'SafeERC20: failed operation'; removedErrors::TOKEN_TRANSFER_FAILED(#1683)- Simplified
ERC6909MetadataComponent.initializerto only register the SRC5 interface, matching the other ERC-6909 extensions (#1676) - Renamed
ERC6909MetadataComponentinternal setters to_set_token_name,_set_token_symbol, and_set_token_decimals(#1676) - Renamed
ERC6909ContentURIComponentinternal setters to_set_contract_uriand_set_token_uri(#1676) - Added
ERC721TokenOwnerTraithook as a dependency toERC721Componentimplementations (#1630)- Included
ERC721OwnerOfDefaultImplto support the default use case
- Included
Fixed
- Recognize fully qualified trait paths when validating
with_componentsintegrations (#1731) - Recognize
initializer_no_metadataas a valid ERC-721 and ERC-1155 initializer (#1732) - Warn when the ERC-6909 token-supply hook is not wired (#1733)
- Warn when Votes hooks are missing or combined with integrations that require special handling (#1734)
- Reject reserved SNIP-12 type names in the
type_hashmacro (#1736) - Reject multiple or bare
snip12attributes instead of silently ignoring them (#1737) - Reject duplicate keys in a
snip12attribute (#1738) - Support the SNIP-12
boolandstringbasic types (#1739) - Detect duplicate encoded member and enum-variant names (#1740)
- JSON-escape user-provided names in encoded SNIP-12 types (#1741)
- Stop emitting the immutable-config warning for
ERC20FlashMintComponent(#1743) - Reject tuple members because SNIP-12 does not specify their encoding (#1744)
Full Changes List
- Backport v4.0.0 audit remediations by @ericnordelo in #1753
Full Changelog: v4.0.0-rc.1...v4.0.0