@layerzerolabs/oapp-upgradeable-evm-contracts 1.2.9 → 1.2.11

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.
@@ -64,9 +64,9 @@ contracts/oapp/options-type-3/OAppOptionsType3RBACUpgradeable.sol
64
64
 
65
65
  test/OAppAltUpgradeable.t.sol
66
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
67
+ 13:1 warning Missing @title tag in contract 'OAppAltHarness' use-natspec
68
+ 13:1 warning Missing @author tag in contract 'OAppAltHarness' use-natspec
69
+ 13:1 warning Missing @notice tag in contract 'OAppAltHarness' use-natspec
70
70
  14:5 warning Missing @notice tag in function '<anonymous>' use-natspec
71
71
  14:5 warning Missing @param tag in function '<anonymous>' use-natspec
72
72
  14:5 warning Mismatch in @param names for function '<anonymous>'. Expected: [_endpoint], Found: [] use-natspec
@@ -98,20 +98,22 @@ test/OAppAltUpgradeable.t.sol
98
98
  42:5 warning Explicitly mark visibility of state state-visibility
99
99
  43:5 warning Explicitly mark visibility of state state-visibility
100
100
  44:5 warning Explicitly mark visibility of state state-visibility
101
- 45:5 warning Explicitly mark visibility of state state-visibility
101
+ 46:5 warning Explicitly mark visibility of state state-visibility
102
102
  47:5 warning Explicitly mark visibility of state state-visibility
103
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
104
+ 50:5 warning Missing @notice tag in function 'setUp' use-natspec
105
+ 61:5 warning Missing @notice tag in function '_deployOApp' use-natspec
106
+ 61:5 warning Missing @return tag in function '_deployOApp' use-natspec
107
+ 61:5 warning Mismatch in @return count for function '_deployOApp'. Expected: 1, Found: 0 use-natspec
108
+ 68:5 warning Missing @notice tag in function 'test_constructor' use-natspec
109
+ 72:5 warning Missing @notice tag in function 'test_constructor_Revert_InvalidNativeToken' use-natspec
110
+ 79:5 warning Missing @notice tag in function 'test_payNative' use-natspec
111
+ 89:9 warning GC: String exceeds 32 bytes gas-small-strings
112
+ 94:5 warning Missing @notice tag in function 'test_payNative_ZeroFee' use-natspec
113
+ 104:5 warning Missing @notice tag in function 'test_payNative_Revert_OnlyAltToken' use-natspec
114
+ 117:5 warning Missing @notice tag in function 'test_payNative_Fuzz' use-natspec
115
+ 117:5 warning Missing @param tag in function 'test_payNative_Fuzz' use-natspec
116
+ 117:5 warning Mismatch in @param names for function 'test_payNative_Fuzz'. Expected: [_fee], Found: [] use-natspec
115
117
 
116
118
  test/OAppCoreRBACUpgradeable.t.sol
117
119
  2:1 warning Found more than One contract per file. 2 contracts found! one-contract-per-file
@@ -137,14 +139,17 @@ test/OAppCoreRBACUpgradeable.t.sol
137
139
  29:5 warning Explicitly mark visibility of state state-visibility
138
140
  30:5 warning Explicitly mark visibility of state state-visibility
139
141
  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
142
+ 40:5 warning Missing @notice tag in function '_deployOApp' use-natspec
143
+ 40:5 warning Missing @return tag in function '_deployOApp' use-natspec
144
+ 40:5 warning Mismatch in @return count for function '_deployOApp'. Expected: 1, Found: 0 use-natspec
145
+ 60:5 warning Missing @notice tag in function 'test_initialize_SetsDelegate' use-natspec
146
+ 66:5 warning Missing @notice tag in function 'test_setDelegate_Revert_CannotDirectlySetDelegate_Admin' use-natspec
147
+ 71:5 warning Missing @notice tag in function 'test_setDelegate_Revert_CannotDirectlySetDelegate_NonAdmin' use-natspec
148
+ 79:5 warning Missing @notice tag in function 'test_acceptDefaultAdminTransfer' use-natspec
149
+ 90:5 warning Missing @notice tag in function 'test_acceptDefaultAdminTransfer_ChainedTransfers' use-natspec
150
+ 107:5 warning Missing @notice tag in function 'test_acceptDefaultAdminTransfer_Fuzz' use-natspec
151
+ 107:5 warning Missing @param tag in function 'test_acceptDefaultAdminTransfer_Fuzz' use-natspec
152
+ 107:5 warning Mismatch in @param names for function 'test_acceptDefaultAdminTransfer_Fuzz'. Expected: [_newAdmin], Found: [] use-natspec
148
153
 
149
154
  test/OAppOptionsType3BaseUpgradeable.t.sol
150
155
  2:1 warning Found more than One contract per file. 2 contracts found! one-contract-per-file
@@ -161,9 +166,9 @@ test/OAppOptionsType3BaseUpgradeable.t.sol
161
166
  25:1 warning Missing @author tag in contract 'OAppOptionsType3BaseUpgradeableTest' use-natspec
162
167
  25:1 warning Missing @notice tag in contract 'OAppOptionsType3BaseUpgradeableTest' use-natspec
163
168
  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
169
+ 33:5 warning Missing @notice tag in function '_deployOApp' use-natspec
170
+ 33:5 warning Missing @return tag in function '_deployOApp' use-natspec
171
+ 33:5 warning Mismatch in @return count for function '_deployOApp'. Expected: 1, Found: 0 use-natspec
167
172
  43:5 warning Missing @notice tag in function 'setUp' use-natspec
168
173
  49:5 warning Missing @notice tag in function 'test_initialize_Revert_AlreadyInitialized' use-natspec
169
174
  56:5 warning Missing @notice tag in function 'test_enforcedOptions' use-natspec
@@ -190,25 +195,25 @@ test/OAppOptionsType3BaseUpgradeable.t.sol
190
195
 
191
196
  test/OAppOptionsType3RBACUpgradeable.t.sol
192
197
  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)
198
+ 15:1 warning Missing @title tag in contract 'OAppOptionsType3RBACHarness' use-natspec
199
+ 15:1 warning Missing @author tag in contract 'OAppOptionsType3RBACHarness' use-natspec
200
+ 15:1 warning Missing @notice tag in contract 'OAppOptionsType3RBACHarness' use-natspec
201
+ 16:5 warning Missing @notice tag in function '<anonymous>' use-natspec
202
+ 20:5 warning Missing @notice tag in function 'initialize' use-natspec
203
+ 20:5 warning Missing @param tag in function 'initialize' use-natspec
204
+ 20:5 warning Mismatch in @param names for function 'initialize'. Expected: [_initialAdmin], Found: [] use-natspec
205
+ 25:1 warning Missing @title tag in contract 'OAppOptionsType3RBACUpgradeableTest' use-natspec
206
+ 25:1 warning Missing @author tag in contract 'OAppOptionsType3RBACUpgradeableTest' use-natspec
207
+ 25:1 warning Missing @notice tag in contract 'OAppOptionsType3RBACUpgradeableTest' use-natspec
208
+ 28:5 warning Explicitly mark visibility of state state-visibility
209
+ 29:5 warning Explicitly mark visibility of state state-visibility
210
+ 31:5 warning Missing @notice tag in function '_deployOApp' use-natspec
211
+ 31:5 warning Missing @return tag in function '_deployOApp' use-natspec
212
+ 31:5 warning Mismatch in @return count for function '_deployOApp'. Expected: 1, Found: 0 use-natspec
213
+ 45:5 warning Missing @notice tag in function 'test_initialize_Revert_AlreadyInitialized' use-natspec
214
+ 52:5 warning Missing @notice tag in function 'test_setEnforcedOptions_Revert_Unauthorized' use-natspec
215
+
216
+ 180 problems (0 errors, 180 warnings)
212
217
 
213
218
  --------------------------------------------------------------------------
214
219
  ===> Join SOLHINT Community at: https://discord.com/invite/4TYGq3zpjs <===
@@ -4,25 +4,52 @@
4
4
 
5
5
  ✅ forge-1.3.6-hardhat-2.26.3
6
6
  🔧 forge version: 1.3.6
7
- 📦 Using scoped workspace: /tmp/lz-scoped-workspace-URR7lS
7
+ 📦 Using scoped workspace: /tmp/lz-scoped-workspace-A1VKDf
8
8
  📦 Copied 11 workspace package source(s)
9
9
  📦 No scoped-workspace pruner configured; using unpruned package-level source copy fallback.
10
- (node:282294) [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.
10
+ (node:148516) [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.
11
11
  Reparsing as ES module because module syntax was detected. This incurs a performance overhead.
12
12
  To eliminate this warning, add "type": "module" to /home/runner/work/monorepo-internal/monorepo-internal/package.json.
13
13
  (Use `node --trace-warnings ...` to show where the warning was created)
14
14
  📦 Docker volumes:
15
- -v /tmp/lz-scoped-workspace-URR7lS:/workspace
15
+ -v /tmp/lz-scoped-workspace-A1VKDf:/workspace
16
16
  -v /home/runner/work/monorepo-internal/monorepo-internal/apps/oapp-app/contracts/evm/upgradeable:/workspace/apps/oapp-app/contracts/evm/upgradeable
17
17
  -v /home/runner/work/monorepo-internal/monorepo-internal/node_modules/.pnpm:/workspace/node_modules/.pnpm:ro
18
18
  $ docker image inspect --format {{.Architecture}} 438003944538.dkr.ecr.us-east-1.amazonaws.com/layerzerolabs/evm-tooling:forge-1.3.6-hardhat-2.26.3-patch-3
19
19
  ✅ Using cached Docker image: 438003944538.dkr.ecr.us-east-1.amazonaws.com/layerzerolabs/evm-tooling:forge-1.3.6-hardhat-2.26.3-patch-3 (amd64)
20
20
  👤 Running container as UID:GID 1001:1001
21
- $ docker run --rm --add-host=host.docker.internal:host-gateway -e LOCAL_UID=1001 -e LOCAL_GID=1001 -v /tmp/lz-scoped-workspace-URR7lS:/workspace -v /home/runner/work/monorepo-internal/monorepo-internal/apps/oapp-app/contracts/evm/upgradeable:/workspace/apps/oapp-app/contracts/evm/upgradeable -v /home/runner/work/monorepo-internal/monorepo-internal/node_modules/.pnpm:/workspace/node_modules/.pnpm:ro -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
21
+ $ docker run --rm --add-host=host.docker.internal:host-gateway -e LOCAL_UID=1001 -e LOCAL_GID=1001 -v /tmp/lz-scoped-workspace-A1VKDf:/workspace -v /home/runner/work/monorepo-internal/monorepo-internal/apps/oapp-app/contracts/evm/upgradeable:/workspace/apps/oapp-app/contracts/evm/upgradeable -v /home/runner/work/monorepo-internal/monorepo-internal/node_modules/.pnpm:/workspace/node_modules/.pnpm:ro -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
22
22
  Compiling 150 files with Solc 0.8.22
23
- Solc 0.8.22 finished in 11.42s
23
+ Solc 0.8.22 finished in 19.12s
24
24
  Compiler run successful!
25
25
 
26
+ Ran 6 tests for test/OAppAltUpgradeable.t.sol:OAppAltUpgradeableTest
27
+ [PASS] test_constructor() (gas: 15583)
28
+ [PASS] test_constructor_Revert_InvalidNativeToken() (gas: 4353096)
29
+ [PASS] test_payNative() (gas: 97285)
30
+ [PASS] test_payNative_Fuzz(uint96) (runs: 1000, μ: 99260, ~: 99198)
31
+ [PASS] test_payNative_Revert_OnlyAltToken() (gas: 101951)
32
+ [PASS] test_payNative_ZeroFee() (gas: 18992)
33
+ Suite result: ok. 6 passed; 0 failed; 0 skipped; finished in 151.87ms (145.51ms CPU time)
34
+
35
+ Ran 15 tests for test/OAppOptionsType3RBACUpgradeable.t.sol:OAppOptionsType3RBACUpgradeableTest
36
+ [PASS] test_combineOptions_CombinesType3Options() (gas: 58123)
37
+ [PASS] test_combineOptions_Fuzz(uint32,uint16,uint128,uint128) (runs: 1000, μ: 60856, ~: 60846)
38
+ [PASS] test_combineOptions_Fuzz_Revert_InvalidExtraOptionsType(uint16) (runs: 1000, μ: 53270, ~: 53270)
39
+ [PASS] test_combineOptions_NoEnforcedOptions() (gas: 19929)
40
+ [PASS] test_combineOptions_NoExtraOptions() (gas: 97207)
41
+ [PASS] test_combineOptions_PassthroughAfterReset() (gas: 82507)
42
+ [PASS] test_combineOptions_Revert_SingleByteExtraOptions() (gas: 51909)
43
+ [PASS] test_enforcedOptions() (gas: 49830)
44
+ [PASS] test_enforcedOptions_Empty() (gas: 17366)
45
+ [PASS] test_initialize_Revert_AlreadyInitialized() (gas: 17887)
46
+ [PASS] test_setEnforcedOptions() (gas: 135089)
47
+ [PASS] test_setEnforcedOptions_EmptyOptionsResetsEnforced() (gas: 44862)
48
+ [PASS] test_setEnforcedOptions_Fuzz(uint32,uint16,uint128) (runs: 1000, μ: 53638, ~: 53634)
49
+ [PASS] test_setEnforcedOptions_Fuzz_Revert_InvalidOptionsType(uint16) (runs: 1000, μ: 20171, ~: 20171)
50
+ [PASS] test_setEnforcedOptions_Revert_Unauthorized() (gas: 24948)
51
+ Suite result: ok. 15 passed; 0 failed; 0 skipped; finished in 214.63ms (580.74ms CPU time)
52
+
26
53
  Ran 6 tests for test/OAppCoreRBACUpgradeable.t.sol:OAppCoreRBACUpgradeableTest
27
54
  [PASS] test_acceptDefaultAdminTransfer() (gas: 107512)
28
55
  [PASS] test_acceptDefaultAdminTransfer_ChainedTransfers() (gas: 175705)
@@ -30,20 +57,11 @@ Ran 6 tests for test/OAppCoreRBACUpgradeable.t.sol:OAppCoreRBACUpgradeableTest
30
57
  [PASS] test_initialize_SetsDelegate() (gas: 15127)
31
58
  [PASS] test_setDelegate_Revert_CannotDirectlySetDelegate_Admin() (gas: 15597)
32
59
  [PASS] test_setDelegate_Revert_CannotDirectlySetDelegate_NonAdmin() (gas: 16016)
33
- Suite result: ok. 6 passed; 0 failed; 0 skipped; finished in 68.43ms (66.84ms CPU time)
34
-
35
- Ran 6 tests for test/OAppAltUpgradeable.t.sol:OAppAltUpgradeableTest
36
- [PASS] test_constructor() (gas: 15583)
37
- [PASS] test_constructor_Revert_InvalidNativeToken() (gas: 4353096)
38
- [PASS] test_payNative() (gas: 97285)
39
- [PASS] test_payNative_Fuzz(uint96) (runs: 1000, μ: 99264, ~: 99198)
40
- [PASS] test_payNative_Revert_OnlyAltToken() (gas: 101951)
41
- [PASS] test_payNative_ZeroFee() (gas: 18992)
42
- Suite result: ok. 6 passed; 0 failed; 0 skipped; finished in 68.86ms (67.35ms CPU time)
60
+ Suite result: ok. 6 passed; 0 failed; 0 skipped; finished in 246.98ms (241.96ms CPU time)
43
61
 
44
62
  Ran 14 tests for test/OAppOptionsType3BaseUpgradeable.t.sol:OAppOptionsType3BaseUpgradeableTest
45
63
  [PASS] test_combineOptions_CombinesType3Options() (gas: 55506)
46
- [PASS] test_combineOptions_Fuzz(uint32,uint16,uint128,uint128) (runs: 1000, μ: 58347, ~: 58337)
64
+ [PASS] test_combineOptions_Fuzz(uint32,uint16,uint128,uint128) (runs: 1000, μ: 58345, ~: 58337)
47
65
  [PASS] test_combineOptions_Fuzz_Revert_InvalidExtraOptionsType(uint16) (runs: 1000, μ: 50697, ~: 50697)
48
66
  [PASS] test_combineOptions_NoEnforcedOptions() (gas: 19825)
49
67
  [PASS] test_combineOptions_NoExtraOptions() (gas: 94671)
@@ -54,27 +72,9 @@ Ran 14 tests for test/OAppOptionsType3BaseUpgradeable.t.sol:OAppOptionsType3Base
54
72
  [PASS] test_initialize_Revert_AlreadyInitialized() (gas: 15583)
55
73
  [PASS] test_setEnforcedOptions() (gas: 132440)
56
74
  [PASS] test_setEnforcedOptions_EmptyOptionsResetsEnforced() (gas: 42400)
57
- [PASS] test_setEnforcedOptions_Fuzz(uint32,uint16,uint128) (runs: 1000, μ: 51098, ~: 51093)
75
+ [PASS] test_setEnforcedOptions_Fuzz(uint32,uint16,uint128) (runs: 1000, μ: 51095, ~: 51093)
58
76
  [PASS] test_setEnforcedOptions_Fuzz_Revert_InvalidOptionsType(uint16) (runs: 1000, μ: 17649, ~: 17649)
59
- Suite result: ok. 14 passed; 0 failed; 0 skipped; finished in 133.32ms (286.49ms CPU time)
60
-
61
- Ran 15 tests for test/OAppOptionsType3RBACUpgradeable.t.sol:OAppOptionsType3RBACUpgradeableTest
62
- [PASS] test_combineOptions_CombinesType3Options() (gas: 58107)
63
- [PASS] test_combineOptions_Fuzz(uint32,uint16,uint128,uint128) (runs: 1000, μ: 60837, ~: 60830)
64
- [PASS] test_combineOptions_Fuzz_Revert_InvalidExtraOptionsType(uint16) (runs: 1000, μ: 53266, ~: 53266)
65
- [PASS] test_combineOptions_NoEnforcedOptions() (gas: 19925)
66
- [PASS] test_combineOptions_NoExtraOptions() (gas: 97203)
67
- [PASS] test_combineOptions_PassthroughAfterReset() (gas: 82500)
68
- [PASS] test_combineOptions_Revert_SingleByteExtraOptions() (gas: 51905)
69
- [PASS] test_enforcedOptions() (gas: 49826)
70
- [PASS] test_enforcedOptions_Empty() (gas: 17366)
71
- [PASS] test_initialize_Revert_AlreadyInitialized() (gas: 17898)
72
- [PASS] test_setEnforcedOptions() (gas: 135081)
73
- [PASS] test_setEnforcedOptions_EmptyOptionsResetsEnforced() (gas: 44859)
74
- [PASS] test_setEnforcedOptions_Fuzz(uint32,uint16,uint128) (runs: 1000, μ: 53634, ~: 53630)
75
- [PASS] test_setEnforcedOptions_Fuzz_Revert_InvalidOptionsType(uint16) (runs: 1000, μ: 20171, ~: 20171)
76
- [PASS] test_setEnforcedOptions_Revert_Unauthorized() (gas: 23046)
77
- Suite result: ok. 15 passed; 0 failed; 0 skipped; finished in 135.15ms (314.31ms CPU time)
77
+ Suite result: ok. 14 passed; 0 failed; 0 skipped; finished in 289.29ms (816.20ms CPU time)
78
78
 
79
- Ran 4 test suites in 137.83ms (405.75ms CPU time): 41 tests passed, 0 failed, 0 skipped (41 total tests)
80
- ⏳ forge test: 14.331s
79
+ Ran 4 test suites in 299.77ms (902.77ms CPU time): 41 tests passed, 0 failed, 0 skipped (41 total tests)
80
+ ⏳ forge test: 22.020s
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@layerzerolabs/oapp-upgradeable-evm-contracts",
3
- "version": "1.2.9",
3
+ "version": "1.2.11",
4
4
  "private": false,
5
5
  "description": "LayerZero Labs reference EVM upgradeable OApp implementation",
6
6
  "license": "MIT",
@@ -15,12 +15,12 @@
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.9",
19
- "@layerzerolabs/oapp-evm-contracts": "1.2.9",
20
- "@layerzerolabs/test-utils-evm-contracts": "1.2.9",
21
- "@layerzerolabs/utils-evm-contracts": "1.2.9",
22
- "@layerzerolabs/utils-upgradeable-evm-contracts": "1.2.9",
23
- "@layerzerolabs/vm-tooling-evm": "1.2.9"
18
+ "@layerzerolabs/oapp-evm-contracts": "1.2.11",
19
+ "@layerzerolabs/solhint-configuration": "1.2.11",
20
+ "@layerzerolabs/test-utils-evm-contracts": "1.2.11",
21
+ "@layerzerolabs/utils-evm-contracts": "1.2.11",
22
+ "@layerzerolabs/utils-upgradeable-evm-contracts": "1.2.11",
23
+ "@layerzerolabs/vm-tooling-evm": "1.2.11"
24
24
  },
25
25
  "publishConfig": {
26
26
  "access": "public",
@@ -10,7 +10,7 @@ import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
10
10
  import { OAppAltUpgradeable } from "./../contracts/oapp/alt/OAppAltUpgradeable.sol";
11
11
  import { OAppCoreBaseUpgradeable } from "./../contracts/oapp/OAppCoreBaseUpgradeable.sol";
12
12
 
13
- contract OAppAltUpgradeableHarness is OAppCoreBaseUpgradeable, OAppAltUpgradeable {
13
+ contract OAppAltHarness is OAppCoreBaseUpgradeable, OAppAltUpgradeable {
14
14
  constructor(address _endpoint) OAppCoreBaseUpgradeable(_endpoint) {}
15
15
 
16
16
  function initialize(address _delegate) public initializer {
@@ -39,8 +39,7 @@ contract OAppAltUpgradeableHarness is OAppCoreBaseUpgradeable, OAppAltUpgradeabl
39
39
  }
40
40
 
41
41
  contract OAppAltUpgradeableTest is TestHelperOz5 {
42
- OAppAltUpgradeableHarness impl;
43
- OAppAltUpgradeableHarness oapp;
42
+ OAppAltHarness oapp;
44
43
  MockERC20 nativeToken;
45
44
  address endpoint;
46
45
 
@@ -56,12 +55,14 @@ contract OAppAltUpgradeableTest is TestHelperOz5 {
56
55
  createEndpoints(2, LibraryType.SimpleMessageLib, nativeTokenAddrs);
57
56
  endpoint = address(endpointSetup.endpointList[0]);
58
57
 
59
- impl = new OAppAltUpgradeableHarness(endpoint);
58
+ oapp = _deployOApp();
59
+ }
60
60
 
61
- bytes memory initData = abi.encodeWithSelector(OAppAltUpgradeableHarness.initialize.selector, delegate);
61
+ function _deployOApp() internal returns (OAppAltHarness) {
62
+ OAppAltHarness impl = new OAppAltHarness(endpoint);
63
+ bytes memory initData = abi.encodeWithSelector(OAppAltHarness.initialize.selector, delegate);
62
64
  TransparentUpgradeableProxy proxy = new TransparentUpgradeableProxy(address(impl), delegate, initData);
63
-
64
- oapp = OAppAltUpgradeableHarness(address(proxy));
65
+ return OAppAltHarness(address(proxy));
65
66
  }
66
67
 
67
68
  function test_constructor() public view {
@@ -72,7 +73,7 @@ contract OAppAltUpgradeableTest is TestHelperOz5 {
72
73
  EndpointV2AltMock endpointZeroNative = new EndpointV2AltMock(1, address(this), address(0));
73
74
 
74
75
  vm.expectRevert(IOAppAlt.InvalidNativeToken.selector);
75
- new OAppAltUpgradeableHarness(address(endpointZeroNative));
76
+ new OAppAltHarness(address(endpointZeroNative));
76
77
  }
77
78
 
78
79
  function test_payNative() public {
@@ -33,20 +33,26 @@ contract OAppCoreRBACUpgradeableTest is TestHelperOz5 {
33
33
  owner = address(this);
34
34
  setUpEndpoints(2, LibraryType.SimpleMessageLib);
35
35
  endpoint = endpointSetup.endpointList[0];
36
+
37
+ oapp = _deployOApp();
38
+ }
39
+
40
+ function _deployOApp() internal returns (OAppCoreRBACHarness) {
36
41
  OAppCoreRBACHarness impl = new OAppCoreRBACHarness(address(endpoint));
37
42
 
38
43
  uint256 currentNonce = vm.getNonce(address(this));
39
44
  proxyAdmin = vm.computeCreateAddress(vm.computeCreateAddress(address(this), currentNonce), 1);
40
45
 
41
- oapp = OAppCoreRBACHarness(
42
- address(
43
- new TransparentUpgradeableProxy(
44
- address(impl),
45
- address(this),
46
- abi.encodeWithSelector(OAppCoreRBACHarness.initialize.selector, owner)
46
+ return
47
+ OAppCoreRBACHarness(
48
+ address(
49
+ new TransparentUpgradeableProxy(
50
+ address(impl),
51
+ address(this),
52
+ abi.encodeWithSelector(OAppCoreRBACHarness.initialize.selector, owner)
53
+ )
47
54
  )
48
- )
49
- );
55
+ );
50
56
  }
51
57
 
52
58
  // ============ initialize ============
@@ -25,30 +25,30 @@ contract OAppOptionsType3BaseHarness is OAppOptionsType3BaseUpgradeable {
25
25
  contract OAppOptionsType3BaseUpgradeableTest is Test {
26
26
  using OptionsBuilder for bytes;
27
27
 
28
- IOAppOptionsType3 oapp;
28
+ OAppOptionsType3BaseHarness oapp;
29
29
 
30
30
  uint16 internal constant SEND = 1;
31
31
  uint16 internal constant SEND_AND_CALL = 2;
32
32
 
33
- function _createOApp() internal virtual returns (IOAppOptionsType3) {
33
+ function _deployOApp() internal virtual returns (OAppOptionsType3BaseHarness) {
34
34
  OAppOptionsType3BaseHarness impl = new OAppOptionsType3BaseHarness();
35
35
  TransparentUpgradeableProxy proxy = new TransparentUpgradeableProxy(
36
36
  address(impl),
37
37
  address(this),
38
38
  abi.encodeWithSelector(OAppOptionsType3BaseHarness.initialize.selector)
39
39
  );
40
- return IOAppOptionsType3(address(proxy));
40
+ return OAppOptionsType3BaseHarness(address(proxy));
41
41
  }
42
42
 
43
43
  function setUp() public virtual {
44
- oapp = _createOApp();
44
+ oapp = _deployOApp();
45
45
  }
46
46
 
47
47
  // ============ initialize ============
48
48
 
49
49
  function test_initialize_Revert_AlreadyInitialized() public virtual {
50
50
  vm.expectRevert(Initializable.InvalidInitialization.selector);
51
- OAppOptionsType3BaseHarness(address(oapp)).initialize();
51
+ oapp.initialize();
52
52
  }
53
53
 
54
54
  // ============ enforcedOptions ============
@@ -7,7 +7,10 @@ import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/I
7
7
  import { IAccessControl } from "@openzeppelin/contracts/access/IAccessControl.sol";
8
8
  import { TransparentUpgradeableProxy } from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";
9
9
  import { OAppOptionsType3RBACUpgradeable } from "./../contracts/oapp/options-type-3/OAppOptionsType3RBACUpgradeable.sol";
10
- import { OAppOptionsType3BaseUpgradeableTest } from "./OAppOptionsType3BaseUpgradeable.t.sol";
10
+ import {
11
+ OAppOptionsType3BaseUpgradeableTest,
12
+ OAppOptionsType3BaseHarness
13
+ } from "./OAppOptionsType3BaseUpgradeable.t.sol";
11
14
 
12
15
  contract OAppOptionsType3RBACHarness is OAppOptionsType3RBACUpgradeable {
13
16
  constructor() {
@@ -23,19 +26,17 @@ contract OAppOptionsType3RBACUpgradeableTest is OAppOptionsType3BaseUpgradeableT
23
26
  using OptionsBuilder for bytes;
24
27
 
25
28
  address alice = makeAddr("alice");
29
+ OAppOptionsType3RBACHarness oappRbac;
26
30
 
27
- function _createOApp() internal virtual override returns (IOAppOptionsType3) {
31
+ function _deployOApp() internal virtual override returns (OAppOptionsType3BaseHarness) {
28
32
  OAppOptionsType3RBACHarness impl = new OAppOptionsType3RBACHarness();
29
33
  TransparentUpgradeableProxy proxy = new TransparentUpgradeableProxy(
30
34
  address(impl),
31
35
  address(this),
32
36
  abi.encodeWithSelector(OAppOptionsType3RBACHarness.initialize.selector, address(this))
33
37
  );
34
- return IOAppOptionsType3(address(proxy));
35
- }
36
-
37
- function setUp() public override {
38
- oapp = _createOApp();
38
+ oappRbac = OAppOptionsType3RBACHarness(address(proxy));
39
+ return OAppOptionsType3BaseHarness(address(proxy));
39
40
  }
40
41
 
41
42
  // ============ initialize ============
@@ -43,7 +44,7 @@ contract OAppOptionsType3RBACUpgradeableTest is OAppOptionsType3BaseUpgradeableT
43
44
  /// @dev Override since `OAppOptionsType3RBACHarness.initialize(address)` has a different signature.
44
45
  function test_initialize_Revert_AlreadyInitialized() public override {
45
46
  vm.expectRevert(Initializable.InvalidInitialization.selector);
46
- OAppOptionsType3RBACHarness(address(oapp)).initialize(alice);
47
+ oappRbac.initialize(alice);
47
48
  }
48
49
 
49
50
  // ============ setEnforcedOptions ============
@@ -58,7 +59,7 @@ contract OAppOptionsType3RBACUpgradeableTest is OAppOptionsType3BaseUpgradeableT
58
59
  abi.encodeWithSelector(
59
60
  IAccessControl.AccessControlUnauthorizedAccount.selector,
60
61
  alice,
61
- OAppOptionsType3RBACHarness(address(oapp)).DEFAULT_ADMIN_ROLE()
62
+ oappRbac.DEFAULT_ADMIN_ROLE()
62
63
  )
63
64
  );
64
65
  vm.prank(alice);