Skip to content

Commit 5444015

Browse files
authored
Merge branch 'master' into fix/erc7930/reject-empty-reference-and-addresse
2 parents b1b65be + 3c063fc commit 5444015

File tree

18 files changed

+101
-55
lines changed

18 files changed

+101
-55
lines changed

.changeset/bright-cooks-brush.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'openzeppelin-solidity': minor
3+
---
4+
5+
`RLP`: Perform a memory copy when decoding `bytes` objects containing a single byte instead of returning a reference to the input.

.changeset/happy-pants-decide.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'openzeppelin-solidity': patch
3+
---
4+
5+
Rename `BridgeERC20Core` to `BridgeFungible`

.changeset/spicy-seals-bake.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'openzeppelin-solidity': minor
3+
---
4+
5+
`WebAuthn`: Verification now returns `false` instead of reverting when client data contains an out-of-bounds `challengeIndex`.

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
- `ERC721` and `ERC1155`: Prevent setting an operator for `address(0)`. In the case of `ERC721` this type of operator allowance could lead to obfuscated mint permission. ([#6171](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/6171))
88
- `RLP`: The `encode(bytes32)` function now encodes `bytes32` as a fixed size item and not as a scalar in `encode(uint256)`. Users must replace calls to `encode(bytes32)` with `encode(uint256(bytes32))` to preserve the same behavior. ([#6167](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/6167))
99
- `ERC4337Utils`: The `parseValidationData` now returns a `ValidationRange` as the last return tuple value indicating whether the `validationData` is compared against a timestamp or block number. Developers must update their code to handle this new return value (e.g. `(aggregator, validAfter, validUntil) -> (aggregator, validAfter, validUntil, range)`).
10+
- `SignerWebAuthn`: The `_rawSignatureValidation` function now returns `false` when the signature is not a valid WebAuthn authentication assertion. P256 fallback is removed. Developers can add it back by overriding the function.
1011

1112
## 5.5.0 (2025-10-31)
1213

contracts/crosschain/CrosschainLinked.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {ERC7786Recipient} from "./ERC7786Recipient.sol";
1212
*
1313
* This contract contains the logic to register and send messages to counterparts on remote chains using ERC-7786
1414
* gateways. It ensure received messages originate from a counterpart. This is the base of token bridges such as
15-
* {BridgeERC20Core}.
15+
* {BridgeFungible}.
1616
*
1717
* Contracts that inherit from this contract can use the internal {_sendMessageToCounterpart} to send messages to their
1818
* counterpart on a foreign chain. They must override the {_processMessage} function to handle messages that have

contracts/crosschain/README.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This directory contains contracts for sending and receiving cross chain messages
1010
1111
Additionally there are multiple bridge constructions:
1212

13-
* {BridgeERC20Core}: Core bridging logic for crosschain ERC-20 transfer. Used by {BridgeERC20}, {BridgeERC7802} and {ERC20Crosschain},
13+
* {BridgeFungible}: Core bridging logic for crosschain ERC-20 transfer. Used by {BridgeERC20}, {BridgeERC7802} and {ERC20Crosschain},
1414
* {BridgeERC20}: Standalone bridge contract to connect an ERC-20 token contract with counterparts on remote chains,
1515
* {BridgeERC7802}: Standalone bridge contract to connect an ERC-7802 token contract with counterparts on remote chains.
1616
@@ -22,7 +22,7 @@ Additionally there are multiple bridge constructions:
2222

2323
== Bridges
2424

25-
{{BridgeERC20Core}}
25+
{{BridgeFungible}}
2626

2727
{{BridgeERC20}}
2828

contracts/crosschain/bridges/BridgeERC20.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
pragma solidity ^0.8.26;
44

55
import {IERC20, SafeERC20} from "../../token/ERC20/utils/SafeERC20.sol";
6-
import {BridgeERC20Core} from "./BridgeERC20Core.sol";
6+
import {BridgeFungible} from "./abstract/BridgeFungible.sol";
77

88
/**
9-
* @dev This is a variant of {BridgeERC20Core} that implements the bridge logic for ERC-20 tokens that do not expose a
9+
* @dev This is a variant of {BridgeFungible} that implements the bridge logic for ERC-20 tokens that do not expose a
1010
* crosschain mint and burn mechanism. Instead, it takes custody of bridged assets.
1111
*/
1212
// slither-disable-next-line locked-ether
13-
abstract contract BridgeERC20 is BridgeERC20Core {
13+
abstract contract BridgeERC20 is BridgeFungible {
1414
using SafeERC20 for IERC20;
1515

1616
IERC20 private immutable _token;

contracts/crosschain/bridges/BridgeERC7802.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
pragma solidity ^0.8.26;
44

55
import {IERC7802} from "../../interfaces/draft-IERC7802.sol";
6-
import {BridgeERC20Core} from "./BridgeERC20Core.sol";
6+
import {BridgeFungible} from "./abstract/BridgeFungible.sol";
77

88
/**
9-
* @dev This is a variant of {BridgeERC20Core} that implements the bridge logic for ERC-7802 compliant tokens.
9+
* @dev This is a variant of {BridgeFungible} that implements the bridge logic for ERC-7802 compliant tokens.
1010
*/
1111
// slither-disable-next-line locked-ether
12-
abstract contract BridgeERC7802 is BridgeERC20Core {
12+
abstract contract BridgeERC7802 is BridgeFungible {
1313
IERC7802 private immutable _token;
1414

1515
constructor(IERC7802 token_) {

contracts/crosschain/bridges/BridgeERC20Core.sol renamed to contracts/crosschain/bridges/abstract/BridgeFungible.sol

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
pragma solidity ^0.8.26;
44

5-
import {InteroperableAddress} from "../../utils/draft-InteroperableAddress.sol";
6-
import {Context} from "../../utils/Context.sol";
7-
import {ERC7786Recipient} from "../ERC7786Recipient.sol";
8-
import {CrosschainLinked} from "../CrosschainLinked.sol";
5+
import {InteroperableAddress} from "../../../utils/draft-InteroperableAddress.sol";
6+
import {Context} from "../../../utils/Context.sol";
7+
import {ERC7786Recipient} from "../../ERC7786Recipient.sol";
8+
import {CrosschainLinked} from "../../CrosschainLinked.sol";
99

1010
/**
1111
* @dev Base contract for bridging ERC-20 between chains using an ERC-7786 gateway.
@@ -18,11 +18,11 @@ import {CrosschainLinked} from "../CrosschainLinked.sol";
1818
* which interface with ERC-7802 to provide an approve-free user experience. It is also used by the {ERC20Crosschain}
1919
* extension, which embeds the bridge logic directly in the token contract.
2020
*/
21-
abstract contract BridgeERC20Core is Context, CrosschainLinked {
21+
abstract contract BridgeFungible is Context, CrosschainLinked {
2222
using InteroperableAddress for bytes;
2323

24-
event CrosschainERC20TransferSent(bytes32 indexed sendId, address indexed from, bytes to, uint256 amount);
25-
event CrosschainERC20TransferReceived(bytes32 indexed receiveId, bytes from, address indexed to, uint256 amount);
24+
event CrosschainFungibleTransferSent(bytes32 indexed sendId, address indexed from, bytes to, uint256 amount);
25+
event CrosschainFungibleTransferReceived(bytes32 indexed receiveId, bytes from, address indexed to, uint256 amount);
2626

2727
/**
2828
* @dev Transfer `amount` tokens to a crosschain receiver.
@@ -50,7 +50,7 @@ abstract contract BridgeERC20Core is Context, CrosschainLinked {
5050
new bytes[](0)
5151
);
5252

53-
emit CrosschainERC20TransferSent(sendId, from, to, amount);
53+
emit CrosschainFungibleTransferSent(sendId, from, to, amount);
5454

5555
return sendId;
5656
}
@@ -68,7 +68,7 @@ abstract contract BridgeERC20Core is Context, CrosschainLinked {
6868

6969
_onReceive(to, amount);
7070

71-
emit CrosschainERC20TransferReceived(receiveId, from, to, amount);
71+
emit CrosschainFungibleTransferReceived(receiveId, from, to, amount);
7272
}
7373

7474
/// @dev Virtual function: implementation is required to handle token being burnt or locked on the source chain.

contracts/token/ERC20/README.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Additionally there are multiple custom extensions, including:
1919
* {ERC20Bridgeable}: compatibility with crosschain bridges through ERC-7802.
2020
* {ERC20Burnable}: destruction of own tokens.
2121
* {ERC20Capped}: enforcement of a cap to the total supply when minting tokens.
22-
* {ERC20Crosschain}: embedded {BridgeERC20Core} bridge, making the token crosschain through the use of ERC-7786 gateways.
22+
* {ERC20Crosschain}: embedded {BridgeFungible} bridge, making the token crosschain through the use of ERC-7786 gateways.
2323
* {ERC20Pausable}: ability to pause token transfers.
2424
* {ERC20FlashMint}: token level support for flash loans through the minting and burning of ephemeral tokens (standardized as ERC-3156).
2525
* {ERC20Votes}: support for voting and vote delegation. xref:governance.adoc#token[See the governance guide for a minimal example (with the required overrides when combining ERC20 + ERC20Permit + ERC20Votes)].

0 commit comments

Comments
 (0)