@layerzerolabs/oapp-upgradeable-evm-contracts 0.2.74

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.
@@ -0,0 +1,216 @@
1
+
2
+ > @layerzerolabs/oapp-upgradeable-evm-contracts@0.0.0 lint /home/runner/work/monorepo-internal/monorepo-internal/apps/oapp-app/contracts/evm/upgradeable
3
+ > solhint --config solhint.config.js 'contracts/**/*.sol' 'test/**/*.sol' --fix --noPrompt
4
+
5
+ A new version of Solhint is available: 6.2.1
6
+ Please consider updating your Solhint package.
7
+
8
+ contracts/oapp/alt/OAppAltUpgradeable.sol
9
+ 29:5 warning Missing @notice tag in function '<anonymous>' use-natspec
10
+ 41:5 warning Missing @notice tag in function '_payNative' use-natspec
11
+
12
+ contracts/oapp/msg-inspection/OAppMsgInspectionBaseUpgradeable.sol
13
+ 29:5 warning Mismatch in @return names for function '_getOAppMsgInspectionStorage'. Expected: [$], Found: [] use-natspec
14
+ 39:71 warning Code contains empty blocks no-empty-blocks
15
+ 45:81 warning Code contains empty blocks no-empty-blocks
16
+
17
+ contracts/oapp/msg-inspection/OAppMsgInspectionRBACUpgradeable.sol
18
+ 20:71 warning Code contains empty blocks no-empty-blocks
19
+ 26:81 warning Code contains empty blocks no-empty-blocks
20
+
21
+ contracts/oapp/OAppCoreBaseUpgradeable.sol
22
+ 32:5 warning Mismatch in @return names for function '_getOAppCoreStorage'. Expected: [$], Found: [] use-natspec
23
+ 42:5 warning Missing @notice tag in function '<anonymous>' use-natspec
24
+
25
+ contracts/oapp/OAppCoreRBACUpgradeable.sol
26
+ 31:62 warning Code contains empty blocks no-empty-blocks
27
+ 37:72 warning Code contains empty blocks no-empty-blocks
28
+
29
+ contracts/oapp/OAppReceiverUpgradeable.sol
30
+ 25:62 warning Code contains empty blocks no-empty-blocks
31
+ 31:72 warning Code contains empty blocks no-empty-blocks
32
+ 59:5 warning Mismatch in @param count for function 'isComposeMsgSender'. Expected: 3, Found: 1 use-natspec
33
+ 91:5 warning Missing @param tag in function 'nextNonce' use-natspec
34
+ 91:5 warning Mismatch in @param count for function 'nextNonce'. Expected: 2, Found: 0 use-natspec
35
+ 108:5 warning Missing @notice tag in function 'lzReceive' use-natspec
36
+ 128:5 warning Missing @notice tag in function '_lzReceive' use-natspec
37
+ 128:5 warning Missing @param tag in function '_lzReceive' use-natspec
38
+ 128:5 warning Mismatch in @param names for function '_lzReceive'. Expected: [_origin, _guid, _message, _executor, _extraData], Found: [] use-natspec
39
+
40
+ contracts/oapp/OAppSenderUpgradeable.sol
41
+ 33:60 warning Code contains empty blocks no-empty-blocks
42
+ 39:70 warning Code contains empty blocks no-empty-blocks
43
+ 64:5 warning Missing @notice tag in function '_quote' use-natspec
44
+ 91:5 warning Missing @notice tag in function '_lzSend' use-natspec
45
+ 121:5 warning Missing @notice tag in function '_payNative' use-natspec
46
+ 133:5 warning Missing @notice tag in function '_payLzToken' use-natspec
47
+
48
+ contracts/oapp/OAppUpgradeable.sol
49
+ 23:5 warning Missing @notice tag in function '<anonymous>' use-natspec
50
+ 29:54 warning Code contains empty blocks no-empty-blocks
51
+ 35:64 warning Code contains empty blocks no-empty-blocks
52
+
53
+ contracts/oapp/options-type-3/OAppOptionsType3BaseUpgradeable.sol
54
+ 33:5 warning Mismatch in @return names for function '_getOAppOptionsType3Storage'. Expected: [$], Found: [] use-natspec
55
+ 43:70 warning Code contains empty blocks no-empty-blocks
56
+ 49:80 warning Code contains empty blocks no-empty-blocks
57
+ 81:13 warning GC: Non strict inequality found. Try converting to a strict one gas-strict-inequalities
58
+ 95:5 warning Missing @notice tag in function '_assertOptionsType3' use-natspec
59
+ 116:58 warning GC: For [ i ] variable, increment/decrement by 1 using: [ ++variable ] to save gas gas-increment-by-one
60
+
61
+ contracts/oapp/options-type-3/OAppOptionsType3RBACUpgradeable.sol
62
+ 20:70 warning Code contains empty blocks no-empty-blocks
63
+ 26:80 warning Code contains empty blocks no-empty-blocks
64
+
65
+ test/OAppAltUpgradeable.t.sol
66
+ 2:1 warning Found more than One contract per file. 2 contracts found! one-contract-per-file
67
+ 13:1 warning Missing @title tag in contract 'OAppAltUpgradeableHarness' use-natspec
68
+ 13:1 warning Missing @author tag in contract 'OAppAltUpgradeableHarness' use-natspec
69
+ 13:1 warning Missing @notice tag in contract 'OAppAltUpgradeableHarness' use-natspec
70
+ 14:5 warning Missing @notice tag in function '<anonymous>' use-natspec
71
+ 14:5 warning Missing @param tag in function '<anonymous>' use-natspec
72
+ 14:5 warning Mismatch in @param names for function '<anonymous>'. Expected: [_endpoint], Found: [] use-natspec
73
+ 16:5 warning Missing @notice tag in function 'initialize' use-natspec
74
+ 16:5 warning Missing @param tag in function 'initialize' use-natspec
75
+ 16:5 warning Mismatch in @param names for function 'initialize'. Expected: [_delegate], Found: [] use-natspec
76
+ 20:5 warning Missing @notice tag in function 'oAppVersion' use-natspec
77
+ 20:5 warning Missing @return tag in function 'oAppVersion' use-natspec
78
+ 20:5 warning Mismatch in @return names for function 'oAppVersion'. Expected: [senderVersion, receiverVersion], Found: [] use-natspec
79
+ 24:5 warning Missing @notice tag in function 'payNative' use-natspec
80
+ 24:5 warning Missing @param tag in function 'payNative' use-natspec
81
+ 24:5 warning Mismatch in @param names for function 'payNative'. Expected: [_nativeFee], Found: [] use-natspec
82
+ 24:5 warning Missing @return tag in function 'payNative' use-natspec
83
+ 24:5 warning Mismatch in @return names for function 'payNative'. Expected: [nativeFee], Found: [] use-natspec
84
+ 28:5 warning Missing @notice tag in function '_payNative' use-natspec
85
+ 28:5 warning Missing @param tag in function '_payNative' use-natspec
86
+ 28:5 warning Mismatch in @param names for function '_payNative'. Expected: [_nativeFee], Found: [] use-natspec
87
+ 28:5 warning Missing @return tag in function '_payNative' use-natspec
88
+ 28:5 warning Mismatch in @return names for function '_payNative'. Expected: [nativeFee], Found: [] use-natspec
89
+ 32:5 warning Missing @notice tag in function 'setPeer' use-natspec
90
+ 32:5 warning Missing @param tag in function 'setPeer' use-natspec
91
+ 32:5 warning Mismatch in @param names for function 'setPeer'. Expected: [_eid, _peer], Found: [] use-natspec
92
+ 36:5 warning Missing @notice tag in function 'setDelegate' use-natspec
93
+ 36:5 warning Missing @param tag in function 'setDelegate' use-natspec
94
+ 36:5 warning Mismatch in @param names for function 'setDelegate'. Expected: [_delegate], Found: [] use-natspec
95
+ 41:1 warning Missing @title tag in contract 'OAppAltUpgradeableTest' use-natspec
96
+ 41:1 warning Missing @author tag in contract 'OAppAltUpgradeableTest' use-natspec
97
+ 41:1 warning Missing @notice tag in contract 'OAppAltUpgradeableTest' use-natspec
98
+ 42:5 warning Explicitly mark visibility of state state-visibility
99
+ 43:5 warning Explicitly mark visibility of state state-visibility
100
+ 44:5 warning Explicitly mark visibility of state state-visibility
101
+ 45:5 warning Explicitly mark visibility of state state-visibility
102
+ 47:5 warning Explicitly mark visibility of state state-visibility
103
+ 48:5 warning Explicitly mark visibility of state state-visibility
104
+ 49:5 warning Explicitly mark visibility of state state-visibility
105
+ 51:5 warning Missing @notice tag in function 'setUp' use-natspec
106
+ 67:5 warning Missing @notice tag in function 'test_constructor' use-natspec
107
+ 71:5 warning Missing @notice tag in function 'test_constructor_Revert_InvalidNativeToken' use-natspec
108
+ 78:5 warning Missing @notice tag in function 'test_payNative' use-natspec
109
+ 88:9 warning GC: String exceeds 32 bytes gas-small-strings
110
+ 93:5 warning Missing @notice tag in function 'test_payNative_ZeroFee' use-natspec
111
+ 103:5 warning Missing @notice tag in function 'test_payNative_Revert_OnlyAltToken' use-natspec
112
+ 116:5 warning Missing @notice tag in function 'test_payNative_Fuzz' use-natspec
113
+ 116:5 warning Missing @param tag in function 'test_payNative_Fuzz' use-natspec
114
+ 116:5 warning Mismatch in @param names for function 'test_payNative_Fuzz'. Expected: [_fee], Found: [] use-natspec
115
+
116
+ test/OAppCoreRBACUpgradeable.t.sol
117
+ 2:1 warning Found more than One contract per file. 2 contracts found! one-contract-per-file
118
+ 10:1 warning Missing @title tag in contract 'OAppCoreRBACHarness' use-natspec
119
+ 10:1 warning Missing @author tag in contract 'OAppCoreRBACHarness' use-natspec
120
+ 10:1 warning Missing @notice tag in contract 'OAppCoreRBACHarness' use-natspec
121
+ 11:5 warning Missing @notice tag in function '<anonymous>' use-natspec
122
+ 11:5 warning Missing @param tag in function '<anonymous>' use-natspec
123
+ 11:5 warning Mismatch in @param names for function '<anonymous>'. Expected: [_endpoint], Found: [] use-natspec
124
+ 13:5 warning Missing @notice tag in function 'initialize' use-natspec
125
+ 13:5 warning Missing @param tag in function 'initialize' use-natspec
126
+ 13:5 warning Mismatch in @param names for function 'initialize'. Expected: [_initialAdmin], Found: [] use-natspec
127
+ 18:5 warning Missing @notice tag in function 'oAppVersion' use-natspec
128
+ 18:5 warning Missing @return tag in function 'oAppVersion' use-natspec
129
+ 18:5 warning Mismatch in @return names for function 'oAppVersion'. Expected: [senderVersion, receiverVersion], Found: [] use-natspec
130
+ 23:1 warning Missing @title tag in contract 'OAppCoreRBACUpgradeableTest' use-natspec
131
+ 23:1 warning Missing @author tag in contract 'OAppCoreRBACUpgradeableTest' use-natspec
132
+ 23:1 warning Missing @notice tag in contract 'OAppCoreRBACUpgradeableTest' use-natspec
133
+ 24:5 warning Explicitly mark visibility of state state-visibility
134
+ 25:5 warning Explicitly mark visibility of state state-visibility
135
+ 27:5 warning Explicitly mark visibility of state state-visibility
136
+ 28:5 warning Explicitly mark visibility of state state-visibility
137
+ 29:5 warning Explicitly mark visibility of state state-visibility
138
+ 30:5 warning Explicitly mark visibility of state state-visibility
139
+ 32:5 warning Missing @notice tag in function 'setUp' use-natspec
140
+ 54:5 warning Missing @notice tag in function 'test_initialize_SetsDelegate' use-natspec
141
+ 60:5 warning Missing @notice tag in function 'test_setDelegate_Revert_CannotDirectlySetDelegate_Admin' use-natspec
142
+ 65:5 warning Missing @notice tag in function 'test_setDelegate_Revert_CannotDirectlySetDelegate_NonAdmin' use-natspec
143
+ 73:5 warning Missing @notice tag in function 'test_acceptDefaultAdminTransfer' use-natspec
144
+ 84:5 warning Missing @notice tag in function 'test_acceptDefaultAdminTransfer_ChainedTransfers' use-natspec
145
+ 101:5 warning Missing @notice tag in function 'test_acceptDefaultAdminTransfer_Fuzz' use-natspec
146
+ 101:5 warning Missing @param tag in function 'test_acceptDefaultAdminTransfer_Fuzz' use-natspec
147
+ 101:5 warning Mismatch in @param names for function 'test_acceptDefaultAdminTransfer_Fuzz'. Expected: [_newAdmin], Found: [] use-natspec
148
+
149
+ test/OAppOptionsType3BaseUpgradeable.t.sol
150
+ 2:1 warning Found more than One contract per file. 2 contracts found! one-contract-per-file
151
+ 8:1 warning Import in test/OAppOptionsType3BaseUpgradeable.t.sol doesn't exist in: forge-std/Test.sol import-path-check
152
+ 11:1 warning Missing @title tag in contract 'OAppOptionsType3BaseHarness' use-natspec
153
+ 11:1 warning Missing @author tag in contract 'OAppOptionsType3BaseHarness' use-natspec
154
+ 11:1 warning Missing @notice tag in contract 'OAppOptionsType3BaseHarness' use-natspec
155
+ 12:5 warning Missing @notice tag in function '<anonymous>' use-natspec
156
+ 16:5 warning Missing @notice tag in function 'initialize' use-natspec
157
+ 20:5 warning Missing @notice tag in function 'setEnforcedOptions' use-natspec
158
+ 20:5 warning Missing @param tag in function 'setEnforcedOptions' use-natspec
159
+ 20:5 warning Mismatch in @param names for function 'setEnforcedOptions'. Expected: [_enforcedOptions], Found: [] use-natspec
160
+ 25:1 warning Missing @title tag in contract 'OAppOptionsType3BaseUpgradeableTest' use-natspec
161
+ 25:1 warning Missing @author tag in contract 'OAppOptionsType3BaseUpgradeableTest' use-natspec
162
+ 25:1 warning Missing @notice tag in contract 'OAppOptionsType3BaseUpgradeableTest' use-natspec
163
+ 28:5 warning Explicitly mark visibility of state state-visibility
164
+ 33:5 warning Missing @notice tag in function '_createOApp' use-natspec
165
+ 33:5 warning Missing @return tag in function '_createOApp' use-natspec
166
+ 33:5 warning Mismatch in @return count for function '_createOApp'. Expected: 1, Found: 0 use-natspec
167
+ 43:5 warning Missing @notice tag in function 'setUp' use-natspec
168
+ 49:5 warning Missing @notice tag in function 'test_initialize_Revert_AlreadyInitialized' use-natspec
169
+ 56:5 warning Missing @notice tag in function 'test_enforcedOptions' use-natspec
170
+ 67:5 warning Missing @notice tag in function 'test_enforcedOptions_Empty' use-natspec
171
+ 73:5 warning Missing @notice tag in function 'test_setEnforcedOptions' use-natspec
172
+ 94:5 warning Missing @notice tag in function 'test_setEnforcedOptions_EmptyOptionsResetsEnforced' use-natspec
173
+ 109:5 warning Missing @notice tag in function 'test_setEnforcedOptions_Fuzz' use-natspec
174
+ 109:5 warning Missing @param tag in function 'test_setEnforcedOptions_Fuzz' use-natspec
175
+ 109:5 warning Mismatch in @param names for function 'test_setEnforcedOptions_Fuzz'. Expected: [_eid, _msgType, _gas], Found: [] use-natspec
176
+ 121:5 warning Missing @notice tag in function 'test_setEnforcedOptions_Fuzz_Revert_InvalidOptionsType' use-natspec
177
+ 121:5 warning Missing @param tag in function 'test_setEnforcedOptions_Fuzz_Revert_InvalidOptionsType' use-natspec
178
+ 121:5 warning Mismatch in @param names for function 'test_setEnforcedOptions_Fuzz_Revert_InvalidOptionsType'. Expected: [_optionsType], Found: [] use-natspec
179
+ 134:5 warning Missing @notice tag in function 'test_combineOptions_CombinesType3Options' use-natspec
180
+ 152:5 warning Missing @notice tag in function 'test_combineOptions_NoExtraOptions' use-natspec
181
+ 166:5 warning Missing @notice tag in function 'test_combineOptions_NoEnforcedOptions' use-natspec
182
+ 171:5 warning Missing @notice tag in function 'test_combineOptions_PassthroughAfterReset' use-natspec
183
+ 195:5 warning Missing @notice tag in function 'test_combineOptions_Revert_SingleByteExtraOptions' use-natspec
184
+ 207:5 warning Missing @notice tag in function 'test_combineOptions_Fuzz' use-natspec
185
+ 207:5 warning Missing @param tag in function 'test_combineOptions_Fuzz' use-natspec
186
+ 207:5 warning Mismatch in @param names for function 'test_combineOptions_Fuzz'. Expected: [_eid, _msgType, _enforcedGas, _extraGas], Found: [] use-natspec
187
+ 226:5 warning Missing @notice tag in function 'test_combineOptions_Fuzz_Revert_InvalidExtraOptionsType' use-natspec
188
+ 226:5 warning Missing @param tag in function 'test_combineOptions_Fuzz_Revert_InvalidExtraOptionsType' use-natspec
189
+ 226:5 warning Mismatch in @param names for function 'test_combineOptions_Fuzz_Revert_InvalidExtraOptionsType'. Expected: [_optionsType], Found: [] use-natspec
190
+
191
+ test/OAppOptionsType3RBACUpgradeable.t.sol
192
+ 2:1 warning Found more than One contract per file. 2 contracts found! one-contract-per-file
193
+ 12:1 warning Missing @title tag in contract 'OAppOptionsType3RBACHarness' use-natspec
194
+ 12:1 warning Missing @author tag in contract 'OAppOptionsType3RBACHarness' use-natspec
195
+ 12:1 warning Missing @notice tag in contract 'OAppOptionsType3RBACHarness' use-natspec
196
+ 13:5 warning Missing @notice tag in function '<anonymous>' use-natspec
197
+ 17:5 warning Missing @notice tag in function 'initialize' use-natspec
198
+ 17:5 warning Missing @param tag in function 'initialize' use-natspec
199
+ 17:5 warning Mismatch in @param names for function 'initialize'. Expected: [_initialAdmin], Found: [] use-natspec
200
+ 22:1 warning Missing @title tag in contract 'OAppOptionsType3RBACUpgradeableTest' use-natspec
201
+ 22:1 warning Missing @author tag in contract 'OAppOptionsType3RBACUpgradeableTest' use-natspec
202
+ 22:1 warning Missing @notice tag in contract 'OAppOptionsType3RBACUpgradeableTest' use-natspec
203
+ 25:5 warning Explicitly mark visibility of state state-visibility
204
+ 27:5 warning Missing @notice tag in function '_createOApp' use-natspec
205
+ 27:5 warning Missing @return tag in function '_createOApp' use-natspec
206
+ 27:5 warning Mismatch in @return count for function '_createOApp'. Expected: 1, Found: 0 use-natspec
207
+ 37:5 warning Missing @notice tag in function 'setUp' use-natspec
208
+ 44:5 warning Missing @notice tag in function 'test_initialize_Revert_AlreadyInitialized' use-natspec
209
+ 51:5 warning Missing @notice tag in function 'test_setEnforcedOptions_Revert_Unauthorized' use-natspec
210
+
211
+ ✖ 175 problems (0 errors, 175 warnings)
212
+
213
+ --------------------------------------------------------------------------
214
+ ===> Join SOLHINT Community at: https://discord.com/invite/4TYGq3zpjs <===
215
+ --------------------------------------------------------------------------
216
+
@@ -0,0 +1,124 @@
1
+
2
+ > @layerzerolabs/oapp-upgradeable-evm-contracts@0.0.0 test /home/runner/work/monorepo-internal/monorepo-internal/apps/oapp-app/contracts/evm/upgradeable
3
+ > pnpm lz-tool forge test
4
+
5
+ ✅ forge-1.3.6-hardhat-2.26.3
6
+ 🔧 forge version: 1.3.6
7
+ $ docker image inspect --format {{.Id}} 438003944538.dkr.ecr.us-east-1.amazonaws.com/layerzerolabs/evm-tooling:forge-1.3.6-hardhat-2.26.3-patch-3
8
+ (node:67123) [MODULE_TYPELESS_PACKAGE_JSON] Warning: Module type of file:///home/runner/work/monorepo-internal/monorepo-internal/configs/vm-tooling/values/docker-image-repo.ts is not specified and it doesn't parse as CommonJS.
9
+ Reparsing as ES module because module syntax was detected. This incurs a performance overhead.
10
+ To eliminate this warning, add "type": "module" to /home/runner/work/monorepo-internal/monorepo-internal/package.json.
11
+ (Use `node --trace-warnings ...` to show where the warning was created)
12
+ Error response from daemon: No such image: 438003944538.dkr.ecr.us-east-1.amazonaws.com/layerzerolabs/evm-tooling:forge-1.3.6-hardhat-2.26.3-patch-3
13
+ 📥 Pulling Docker image from: 438003944538.dkr.ecr.us-east-1.amazonaws.com/layerzerolabs/evm-tooling:forge-1.3.6-hardhat-2.26.3-patch-3
14
+ $ docker pull 438003944538.dkr.ecr.us-east-1.amazonaws.com/layerzerolabs/evm-tooling:forge-1.3.6-hardhat-2.26.3-patch-3
15
+ forge-1.3.6-hardhat-2.26.3-patch-3: Pulling from layerzerolabs/evm-tooling
16
+ 86ec798129ac: Already exists
17
+ eef7c391911c: Already exists
18
+ cc2ecf4065b7: Pulling fs layer
19
+ 5760fdd70374: Pulling fs layer
20
+ c70db14240a1: Pulling fs layer
21
+ 0cb2c6965bde: Pulling fs layer
22
+ 885bca26f927: Pulling fs layer
23
+ 8e167e77288f: Pulling fs layer
24
+ 45d43cc973ba: Pulling fs layer
25
+ 44c09156221f: Pulling fs layer
26
+ f2fb700979ad: Pulling fs layer
27
+ 2a1ced882ba9: Pulling fs layer
28
+ 597168d5c38e: Pulling fs layer
29
+ e431adaf232f: Pulling fs layer
30
+ 36e15e3f2788: Pulling fs layer
31
+ 36e15e3f2788: Waiting
32
+ 8e167e77288f: Download complete
33
+ 5760fdd70374: Download complete
34
+ c70db14240a1: Download complete
35
+ 0cb2c6965bde: Download complete
36
+ f2fb700979ad: Download complete
37
+ 45d43cc973ba: Download complete
38
+ 44c09156221f: Download complete
39
+ 597168d5c38e: Download complete
40
+ cc2ecf4065b7: Pull complete
41
+ 5760fdd70374: Pull complete
42
+ c70db14240a1: Pull complete
43
+ 2a1ced882ba9: Verifying Checksum
44
+ 2a1ced882ba9: Download complete
45
+ 36e15e3f2788: Verifying Checksum
46
+ 36e15e3f2788: Download complete
47
+ 0cb2c6965bde: Pull complete
48
+ e431adaf232f: Download complete
49
+ 885bca26f927: Verifying Checksum
50
+ 885bca26f927: Download complete
51
+ 885bca26f927: Pull complete
52
+ 8e167e77288f: Pull complete
53
+ 45d43cc973ba: Pull complete
54
+ 44c09156221f: Pull complete
55
+ f2fb700979ad: Pull complete
56
+ 2a1ced882ba9: Pull complete
57
+ 597168d5c38e: Pull complete
58
+ e431adaf232f: Pull complete
59
+ 36e15e3f2788: Pull complete
60
+ Digest: sha256:08b858b586759ec59f4df44c0bc5eac9f856a1eb32b6ce37f79f31a20a89ed52
61
+ Status: Image is up to date for 438003944538.dkr.ecr.us-east-1.amazonaws.com/layerzerolabs/evm-tooling:forge-1.3.6-hardhat-2.26.3-patch-3
62
+ 438003944538.dkr.ecr.us-east-1.amazonaws.com/layerzerolabs/evm-tooling:forge-1.3.6-hardhat-2.26.3-patch-3
63
+ ✅ Successfully pulled: 438003944538.dkr.ecr.us-east-1.amazonaws.com/layerzerolabs/evm-tooling:forge-1.3.6-hardhat-2.26.3-patch-3
64
+ 👤 Running container as UID:GID 1001:1001
65
+ $ docker run --rm --add-host=host.docker.internal:host-gateway -e LOCAL_UID=1001 -e LOCAL_GID=1001 -v /home/runner/work/monorepo-internal/monorepo-internal:/workspace -w /workspace/apps/oapp-app/contracts/evm/upgradeable 438003944538.dkr.ecr.us-east-1.amazonaws.com/layerzerolabs/evm-tooling:forge-1.3.6-hardhat-2.26.3-patch-3 forge test
66
+ Compiling 150 files with Solc 0.8.22
67
+ Solc 0.8.22 finished in 16.53s
68
+ Compiler run successful!
69
+
70
+ Ran 6 tests for test/OAppCoreRBACUpgradeable.t.sol:OAppCoreRBACUpgradeableTest
71
+ [PASS] test_acceptDefaultAdminTransfer() (gas: 107512)
72
+ [PASS] test_acceptDefaultAdminTransfer_ChainedTransfers() (gas: 175705)
73
+ [PASS] test_acceptDefaultAdminTransfer_Fuzz(address) (runs: 1000, μ: 108498, ~: 108498)
74
+ [PASS] test_initialize_SetsDelegate() (gas: 15127)
75
+ [PASS] test_setDelegate_Revert_CannotDirectlySetDelegate_Admin() (gas: 15597)
76
+ [PASS] test_setDelegate_Revert_CannotDirectlySetDelegate_NonAdmin() (gas: 16016)
77
+ Suite result: ok. 6 passed; 0 failed; 0 skipped; finished in 412.51ms (400.90ms CPU time)
78
+
79
+ Ran 15 tests for test/OAppOptionsType3RBACUpgradeable.t.sol:OAppOptionsType3RBACUpgradeableTest
80
+ [PASS] test_combineOptions_CombinesType3Options() (gas: 58107)
81
+ [PASS] test_combineOptions_Fuzz(uint32,uint16,uint128,uint128) (runs: 1000, μ: 60838, ~: 60830)
82
+ [PASS] test_combineOptions_Fuzz_Revert_InvalidExtraOptionsType(uint16) (runs: 1000, μ: 53266, ~: 53266)
83
+ [PASS] test_combineOptions_NoEnforcedOptions() (gas: 19925)
84
+ [PASS] test_combineOptions_NoExtraOptions() (gas: 97203)
85
+ [PASS] test_combineOptions_PassthroughAfterReset() (gas: 82500)
86
+ [PASS] test_combineOptions_Revert_SingleByteExtraOptions() (gas: 51905)
87
+ [PASS] test_enforcedOptions() (gas: 49826)
88
+ [PASS] test_enforcedOptions_Empty() (gas: 17366)
89
+ [PASS] test_initialize_Revert_AlreadyInitialized() (gas: 17898)
90
+ [PASS] test_setEnforcedOptions() (gas: 135081)
91
+ [PASS] test_setEnforcedOptions_EmptyOptionsResetsEnforced() (gas: 44859)
92
+ [PASS] test_setEnforcedOptions_Fuzz(uint32,uint16,uint128) (runs: 1000, μ: 53638, ~: 53630)
93
+ [PASS] test_setEnforcedOptions_Fuzz_Revert_InvalidOptionsType(uint16) (runs: 1000, μ: 20171, ~: 20171)
94
+ [PASS] test_setEnforcedOptions_Revert_Unauthorized() (gas: 23046)
95
+ Suite result: ok. 15 passed; 0 failed; 0 skipped; finished in 725.32ms (1.64s CPU time)
96
+
97
+ Ran 6 tests for test/OAppAltUpgradeable.t.sol:OAppAltUpgradeableTest
98
+ [PASS] test_constructor() (gas: 15583)
99
+ [PASS] test_constructor_Revert_InvalidNativeToken() (gas: 4353096)
100
+ [PASS] test_payNative() (gas: 97285)
101
+ [PASS] test_payNative_Fuzz(uint96) (runs: 1000, μ: 99271, ~: 99198)
102
+ [PASS] test_payNative_Revert_OnlyAltToken() (gas: 101951)
103
+ [PASS] test_payNative_ZeroFee() (gas: 18992)
104
+ Suite result: ok. 6 passed; 0 failed; 0 skipped; finished in 750.88ms (741.47ms CPU time)
105
+
106
+ Ran 14 tests for test/OAppOptionsType3BaseUpgradeable.t.sol:OAppOptionsType3BaseUpgradeableTest
107
+ [PASS] test_combineOptions_CombinesType3Options() (gas: 55506)
108
+ [PASS] test_combineOptions_Fuzz(uint32,uint16,uint128,uint128) (runs: 1000, μ: 58345, ~: 58337)
109
+ [PASS] test_combineOptions_Fuzz_Revert_InvalidExtraOptionsType(uint16) (runs: 1000, μ: 50697, ~: 50697)
110
+ [PASS] test_combineOptions_NoEnforcedOptions() (gas: 19825)
111
+ [PASS] test_combineOptions_NoExtraOptions() (gas: 94671)
112
+ [PASS] test_combineOptions_PassthroughAfterReset() (gas: 80107)
113
+ [PASS] test_combineOptions_Revert_SingleByteExtraOptions() (gas: 49368)
114
+ [PASS] test_enforcedOptions() (gas: 47289)
115
+ [PASS] test_enforcedOptions_Empty() (gas: 17289)
116
+ [PASS] test_initialize_Revert_AlreadyInitialized() (gas: 15583)
117
+ [PASS] test_setEnforcedOptions() (gas: 132440)
118
+ [PASS] test_setEnforcedOptions_EmptyOptionsResetsEnforced() (gas: 42400)
119
+ [PASS] test_setEnforcedOptions_Fuzz(uint32,uint16,uint128) (runs: 1000, μ: 51099, ~: 51093)
120
+ [PASS] test_setEnforcedOptions_Fuzz_Revert_InvalidOptionsType(uint16) (runs: 1000, μ: 17649, ~: 17649)
121
+ Suite result: ok. 14 passed; 0 failed; 0 skipped; finished in 861.35ms (1.48s CPU time)
122
+
123
+ Ran 4 test suites in 893.04ms (2.75s CPU time): 41 tests passed, 0 failed, 0 skipped (41 total tests)
124
+ ⏳ forge test: 19.453s
package/LICENSE ADDED
@@ -0,0 +1,23 @@
1
+ Copyright (c) 2026 - LayerZero Labs Ltd.
2
+
3
+ Permission is hereby granted, free of charge, to any
4
+ person obtaining a copy of this software and associated
5
+ documentation files (the "Software"), to deal in the
6
+ Software without restriction, including without
7
+ limitation the rights to use, copy, modify, merge,
8
+ publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software
10
+ is furnished to do so, subject to the following
11
+ conditions:
12
+ The above copyright notice and this permission notice
13
+ shall be included in all copies or substantial portions
14
+ of the Software.
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
16
+ ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
17
+ TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
18
+ PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
19
+ SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
22
+ IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23
+ DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,111 @@
1
+ // SPDX-License-Identifier: MIT
2
+ pragma solidity ^0.8.22;
3
+
4
+ import { IOAppCore, ILayerZeroEndpointV2 } from "@layerzerolabs/oapp-evm-contracts/contracts/interfaces/IOAppCore.sol";
5
+ import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
6
+
7
+ /**
8
+ * @title OAppCoreBaseUpgradeable
9
+ * @author LayerZero Labs
10
+ * @custom:version 1.0.0
11
+ * @notice Abstract upgradeable contract implementing the IOAppCore interface with basic OApp configurations.
12
+ * @dev No public management functions are exposed by this contract, wrappers should be used with access control.
13
+ * Alternatively, refer to `OAppCoreRBACUpgradeable` for a permissioned implementation.
14
+ */
15
+ abstract contract OAppCoreBaseUpgradeable is IOAppCore, Initializable {
16
+ /// @notice The LayerZero endpoint associated with the given OApp.
17
+ ILayerZeroEndpointV2 public immutable endpoint;
18
+
19
+ /// @custom:storage-location erc7201:layerzerov2.storage.oappcore
20
+ struct OAppCoreStorage {
21
+ mapping(uint32 => bytes32) peers;
22
+ }
23
+
24
+ // keccak256(abi.encode(uint256(keccak256("layerzerov2.storage.oappcore")) - 1)) & ~bytes32(uint256(0xff))
25
+ bytes32 private constant OAPP_CORE_STORAGE_LOCATION =
26
+ 0x72ab1bc1039b79dc4724ffca13de82c96834302d3c7e0d4252232d4b2dd8f900;
27
+
28
+ /**
29
+ * @notice Internal function to get the OAppCore storage.
30
+ * @return $ Storage pointer
31
+ */
32
+ function _getOAppCoreStorage() internal pure returns (OAppCoreStorage storage $) {
33
+ assembly {
34
+ $.slot := OAPP_CORE_STORAGE_LOCATION
35
+ }
36
+ }
37
+
38
+ /**
39
+ * @dev Constructor to initialize the OAppCoreBase with the provided endpoint.
40
+ * @param _endpoint The address of the LOCAL LayerZero endpoint.
41
+ */
42
+ constructor(address _endpoint) {
43
+ endpoint = ILayerZeroEndpointV2(_endpoint);
44
+ }
45
+
46
+ /**
47
+ * @notice Initializes the OAppCoreBase with the provided delegate.
48
+ * @param _delegate The delegate capable of making OApp configurations inside of the endpoint.
49
+ */
50
+ function __OAppCoreBase_init(address _delegate) internal onlyInitializing {
51
+ __OAppCoreBase_init_unchained(_delegate);
52
+ }
53
+
54
+ /**
55
+ * @notice Unchained initialization function for the contract.
56
+ * @param _delegate The delegate capable of making OApp configurations inside of the endpoint.
57
+ */
58
+ function __OAppCoreBase_init_unchained(address _delegate) internal onlyInitializing {
59
+ if (_delegate == address(0)) revert InvalidDelegate();
60
+ endpoint.setDelegate(_delegate);
61
+ }
62
+
63
+ /**
64
+ * @notice Returns the peer address (OApp instance) associated with a specific endpoint.
65
+ * @param _eid The endpoint ID.
66
+ * @return peer The address of the peer associated with the specified endpoint.
67
+ */
68
+ function peers(uint32 _eid) public view virtual override returns (bytes32 peer) {
69
+ OAppCoreStorage storage $ = _getOAppCoreStorage();
70
+ return $.peers[_eid];
71
+ }
72
+
73
+ /**
74
+ * @notice Internal function to get the peer address associated with a specific endpoint; reverts if NOT set.
75
+ * @param _eid The endpoint ID.
76
+ * @return peer The address of the peer associated with the specified endpoint.
77
+ */
78
+ function _getPeerOrRevert(uint32 _eid) internal view virtual returns (bytes32) {
79
+ OAppCoreStorage storage $ = _getOAppCoreStorage();
80
+ bytes32 peer = $.peers[_eid];
81
+ if (peer == bytes32(0)) revert NoPeer(_eid);
82
+ return peer;
83
+ }
84
+
85
+ // ============ Internal Functions to Wrap with Access Control ============
86
+
87
+ /**
88
+ * @notice Internal function to set the peer address (OApp instance) for a corresponding endpoint.
89
+ * @dev To be wrapped with access control.
90
+ * @dev Indicates that the peer is trusted to send LayerZero messages to this OApp.
91
+ * @dev Set this to bytes32(0) to remove the peer address.
92
+ * @dev Peer is a bytes32 to accommodate non-evm chains.
93
+ * @param _eid The endpoint ID.
94
+ * @param _peer The address of the peer to be associated with the corresponding endpoint.
95
+ */
96
+ function _setPeer(uint32 _eid, bytes32 _peer) internal virtual {
97
+ OAppCoreStorage storage $ = _getOAppCoreStorage();
98
+ $.peers[_eid] = _peer;
99
+ emit PeerSet(_eid, _peer);
100
+ }
101
+
102
+ /**
103
+ * @notice Internal function to set the delegate address for the OApp.
104
+ * @dev To be wrapped with access control.
105
+ * @dev Provides the ability for a delegate to set configs, on behalf of the OApp, directly on the Endpoint contract.
106
+ * @param _delegate The address of the delegate to be set.
107
+ */
108
+ function _setDelegate(address _delegate) internal virtual {
109
+ endpoint.setDelegate(_delegate);
110
+ }
111
+ }
@@ -0,0 +1,71 @@
1
+ // SPDX-License-Identifier: MIT
2
+ pragma solidity ^0.8.22;
3
+
4
+ import { IOAppCore } from "@layerzerolabs/oapp-evm-contracts/contracts/interfaces/IOAppCore.sol";
5
+ import { AccessControl2StepUpgradeable } from "@layerzerolabs/utils-upgradeable-evm-contracts/contracts/access/AccessControl2StepUpgradeable.sol";
6
+ import { OAppCoreBaseUpgradeable } from "./OAppCoreBaseUpgradeable.sol";
7
+
8
+ /**
9
+ * @title OAppCoreRBACUpgradeable
10
+ * @author LayerZero Labs
11
+ * @custom:version 1.0.0
12
+ * @notice Abstract upgradeable contract implementing the IOAppCore interface with RBAC access control.
13
+ * @dev Exposes public management functions through `AccessControl2StepUpgradeable`.
14
+ * @dev Does not initialize `AccessControl2StepUpgradeable`. Inheriting contracts must call `__AccessControl2Step_init`
15
+ * to set the `DEFAULT_ADMIN_ROLE`.
16
+ * @dev Endpoint delegate is permanently synced with the `DEFAULT_ADMIN_ROLE` holder. Calling `setDelegate` directly
17
+ * will revert. The delegate is updated automatically when `acceptDefaultAdminTransfer` is called. Inheriting
18
+ * contracts must call `__OAppCoreBase_init` with the initial default admin to ensure that both roles are synced on
19
+ * initialization.
20
+ */
21
+ abstract contract OAppCoreRBACUpgradeable is OAppCoreBaseUpgradeable, AccessControl2StepUpgradeable {
22
+ /**
23
+ * @notice Thrown when `setDelegate` is called directly. The delegate is synced with `DEFAULT_ADMIN_ROLE`.
24
+ */
25
+ error CannotDirectlySetDelegate();
26
+
27
+ /**
28
+ * @notice Initializes the contract.
29
+ * @dev This function is empty on purpose, as no custom logic is needed.
30
+ */
31
+ function __OAppCoreRBAC_init() internal onlyInitializing {}
32
+
33
+ /**
34
+ * @notice Unchained initialization function for the contract.
35
+ * @dev This function is empty on purpose, as no custom logic is needed.
36
+ */
37
+ function __OAppCoreRBAC_init_unchained() internal onlyInitializing {}
38
+
39
+ /**
40
+ * @notice Sets the peer address (OApp instance) for a corresponding endpoint.
41
+ * @param _eid The endpoint ID.
42
+ * @param _peer The address of the peer to be associated with the corresponding endpoint.
43
+ *
44
+ * @dev Only accounts with `DEFAULT_ADMIN_ROLE` can call this function.
45
+ * @dev Indicates that the peer is trusted to send LayerZero messages to this OApp.
46
+ * @dev Set this to bytes32(0) to remove the peer address.
47
+ * @dev Peer is a bytes32 to accommodate non-evm chains.
48
+ */
49
+ function setPeer(uint32 _eid, bytes32 _peer) public virtual onlyRole(DEFAULT_ADMIN_ROLE) {
50
+ _setPeer(_eid, _peer);
51
+ }
52
+
53
+ /**
54
+ * @dev Always reverts. The delegate is synced with `DEFAULT_ADMIN_ROLE` and transfers automatically.
55
+ * To change the delegate, use `beginDefaultAdminTransfer` followed by `acceptDefaultAdminTransfer`.
56
+ * @inheritdoc IOAppCore
57
+ */
58
+ function setDelegate(address) public virtual {
59
+ revert CannotDirectlySetDelegate();
60
+ }
61
+
62
+ /**
63
+ * @notice Accepts a pending `DEFAULT_ADMIN_ROLE` transfer and updates the endpoint delegate.
64
+ * @dev Overrides `AccessControl2StepUpgradeable.acceptDefaultAdminTransfer` to keep the endpoint delegate
65
+ * in sync with the new `DEFAULT_ADMIN_ROLE` holder.
66
+ */
67
+ function acceptDefaultAdminTransfer() public virtual override {
68
+ super.acceptDefaultAdminTransfer();
69
+ _setDelegate(defaultAdmin());
70
+ }
71
+ }