@layerzerolabs/oapp-evm-contracts 1.2.19 → 1.2.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -19,7 +19,7 @@ contracts/interfaces/IOAppCore.sol
19
19
  17:5 warning GC: [eid] on Event [PeerSet] could be Indexed gas-indexed-events
20
20
 
21
21
  contracts/interfaces/IOAppExtended.sol
22
- 17:1 warning Code contains empty blocks no-empty-blocks
22
+ 21:1 warning Code contains empty blocks no-empty-blocks
23
23
 
24
24
  contracts/interfaces/IOAppMsgInspection.sol
25
25
  15:5 warning GC: [msgInspector] on Event [MsgInspectorSet] could be Indexed gas-indexed-events
@@ -1,7 +1,9 @@
1
1
  // SPDX-License-Identifier: MIT
2
2
  pragma solidity ^0.8.22;
3
3
 
4
+ import { ILayerZeroReceiver } from "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroReceiver.sol";
4
5
  import { IOAppCore } from "./IOAppCore.sol";
6
+ import { IOAppMessagingChannel } from "./IOAppMessagingChannel.sol";
5
7
  import { IOAppMsgInspection } from "./IOAppMsgInspection.sol";
6
8
  import { IOAppOptionsType3 } from "./IOAppOptionsType3.sol";
7
9
  import { IOAppReceiver } from "./IOAppReceiver.sol";
@@ -9,9 +11,19 @@ import { IOAppReceiver } from "./IOAppReceiver.sol";
9
11
  /**
10
12
  * @title IOAppExtended
11
13
  * @author LayerZero Labs (@TRileySchwarz, tinom.eth)
12
- * @custom:version 1.0.0
14
+ * @custom:version 1.1.0
13
15
  * @notice Aggregate interface for extended OApp contracts.
14
- * @dev `IOAppReceiver` must precede `IOAppCore` for C3 linearization compatibility with `OApp`,
15
- * where `OAppReceiver`'s linearization places `IOAppReceiver` before `IOAppCore`.
16
+ * @dev `IOAppReceiver` must precede `IOAppCore` for C3 linearization compatibility with `OApp`, where `OAppReceiver`'s
17
+ * linearization places `IOAppReceiver` before `IOAppCore`.
18
+ * @dev `IOAppMessagingChannel` must precede `IOAppCore` for C3 linearization compatibility with messaging-channel OApp
19
+ * extensions that declare `IOAppMessagingChannel` before `OAppCoreBaseUpgradeable`.
16
20
  */
17
- interface IOAppExtended is IOAppReceiver, IOAppCore, IOAppOptionsType3, IOAppMsgInspection {}
21
+ interface IOAppExtended is IOAppReceiver, IOAppMessagingChannel, IOAppCore, IOAppOptionsType3, IOAppMsgInspection {}
22
+
23
+ /// @dev Flatten all leaf interface IDs.
24
+ bytes4 constant OAPP_EXTENDED_INTERFACE_ID = type(ILayerZeroReceiver).interfaceId ^
25
+ type(IOAppReceiver).interfaceId ^
26
+ type(IOAppMessagingChannel).interfaceId ^
27
+ type(IOAppCore).interfaceId ^
28
+ type(IOAppOptionsType3).interfaceId ^
29
+ type(IOAppMsgInspection).interfaceId;
@@ -0,0 +1,48 @@
1
+ // SPDX-License-Identifier: MIT
2
+ pragma solidity ^0.8.22;
3
+
4
+ import { Origin } from "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol";
5
+
6
+ /**
7
+ * @title IOAppMessagingChannel
8
+ * @author LayerZero Labs (tinom.eth)
9
+ * @custom:version 1.0.0
10
+ * @notice Interface for OApp wrappers around endpoint messaging channel operations.
11
+ * @dev Exposes `clear`, `skip`, `burn`, and `nilify` so that access is not limited to the endpoint delegate.
12
+ */
13
+ interface IOAppMessagingChannel {
14
+ /**
15
+ * @notice Permanently consumes a verified inbound message without the `lzReceive` callback.
16
+ * @param _origin Origin of the message
17
+ * @param _guid GUID of the message
18
+ * @param _message Message payload
19
+ */
20
+ function clear(Origin calldata _origin, bytes32 _guid, bytes calldata _message) external;
21
+
22
+ /**
23
+ * @notice Permanently skips the next inbound nonce for a path.
24
+ * @param _srcEid Source endpoint ID
25
+ * @param _sender Sender address on the source chain
26
+ * @param _nonce Nonce to skip, must equal `inboundNonce + 1`
27
+ */
28
+ function skip(uint32 _srcEid, bytes32 _sender, uint64 _nonce) external;
29
+
30
+ /**
31
+ * @notice Permanently burns a verified or nilified inbound nonce so it can never be executed or re-verified.
32
+ * @param _srcEid Source endpoint ID
33
+ * @param _sender Sender address on the source chain
34
+ * @param _nonce Nonce to burn, must be `<= lazyInboundNonce`
35
+ * @param _payloadHash Expected payload hash for the nonce
36
+ */
37
+ function burn(uint32 _srcEid, bytes32 _sender, uint64 _nonce, bytes32 _payloadHash) external;
38
+
39
+ /**
40
+ * @notice Nilifies an inbound nonce, preventing execution until it is re-verified.
41
+ * @dev An unverified nonce can be nilified by passing `bytes32(0)` for `_payloadHash`.
42
+ * @param _srcEid Source endpoint ID
43
+ * @param _sender Sender address on the source chain
44
+ * @param _nonce Nonce to nilify
45
+ * @param _payloadHash Expected payload hash for the nonce
46
+ */
47
+ function nilify(uint32 _srcEid, bytes32 _sender, uint64 _nonce, bytes32 _payloadHash) external;
48
+ }
package/foundry.toml CHANGED
@@ -1,5 +1,5 @@
1
1
  [profile.default]
2
- solc = '0.8.22'
2
+ solc = '0.8.26'
3
3
  verbosity = 3
4
4
  src = "contracts"
5
5
  test = "test"
@@ -7,7 +7,7 @@ out = "out"
7
7
  cache_path = "cache"
8
8
  libs = ['node_modules', 'node_modules/@layerzerolabs/toolbox-foundry/lib']
9
9
  optimizer = true
10
- optimizer_runs = 200
10
+ optimizer_runs = 20_000
11
11
 
12
12
  remappings = [
13
13
  'ds-test/=node_modules/@layerzerolabs/toolbox-foundry/lib/ds-test/',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@layerzerolabs/oapp-evm-contracts",
3
- "version": "1.2.19",
3
+ "version": "1.2.20",
4
4
  "private": false,
5
5
  "description": "LayerZero Labs reference EVM OApp implementation",
6
6
  "license": "MIT",
@@ -10,13 +10,13 @@
10
10
  "@layerzerolabs/lz-evm-v1-0.7": "3.0.168",
11
11
  "@layerzerolabs/test-devtools-evm-foundry": "8.0.1",
12
12
  "@layerzerolabs/toolbox-foundry": "^0.1.13",
13
- "@openzeppelin/contracts": ">=5.0.2 <5.5.0",
14
- "@openzeppelin/contracts-upgradeable": ">=5.0.2 <5.5.0",
13
+ "@openzeppelin/contracts": "^5.0.2",
14
+ "@openzeppelin/contracts-upgradeable": "^5.0.2",
15
15
  "ethers": "^5.8.0",
16
16
  "solhint": "^6.0.1",
17
17
  "solidity-bytes-utils": "^0.8.4",
18
- "@layerzerolabs/solhint-configuration": "1.2.19",
19
- "@layerzerolabs/vm-tooling-evm": "1.2.19"
18
+ "@layerzerolabs/solhint-configuration": "1.2.20",
19
+ "@layerzerolabs/vm-tooling-evm": "1.2.20"
20
20
  },
21
21
  "publishConfig": {
22
22
  "access": "public",