11// SPDX-License-Identifier: Apache 2
22
3- pragma solidity ^ 0.8.12 ;
3+ pragma solidity ^ 0.8.0 ;
44
55import "forge-std/Test.sol " ;
66import "@pythnetwork/entropy-sdk-solidity/EntropyStructs.sol " ;
@@ -61,7 +61,11 @@ contract ExecutorTest is Test, WormholeTestUtils {
6161
6262 uint32 c = callable.fooCount ();
6363 assertEq (callable.lastCaller (), address (bytes20 (0 )));
64- testExecute (address (callable), abi.encodeCall (ICallable.foo, ()), 1 );
64+ testExecute (
65+ address (callable),
66+ abi.encodeWithSelector (ICallable.foo.selector ),
67+ 1
68+ );
6569 assertEq (callable.fooCount (), c + 1 );
6670 assertEq (callable.lastCaller (), address (executor));
6771 // Sanity check to make sure the check above is meaningful.
@@ -75,7 +79,7 @@ contract ExecutorTest is Test, WormholeTestUtils {
7579 assertEq (callable.lastCaller (), address (bytes20 (0 )));
7680 testExecute (
7781 address (callable),
78- abi.encodeCall (ICallable.fooWithArgs, ( 17 ) ),
82+ abi.encodeWithSelector (ICallable.fooWithArgs. selector , 17 ),
7983 1
8084 );
8185 assertEq (callable.fooCount (), c + 17 );
@@ -86,7 +90,11 @@ contract ExecutorTest is Test, WormholeTestUtils {
8690
8791 function testCallerAddress () public {
8892 uint32 c = callable.fooCount ();
89- testExecute (address (callable), abi.encodeCall (ICallable.foo, ()), 1 );
93+ testExecute (
94+ address (callable),
95+ abi.encodeWithSelector (ICallable.foo.selector ),
96+ 1
97+ );
9098 assertEq (callable.fooCount (), c + 1 );
9199 }
92100
@@ -107,7 +115,7 @@ contract ExecutorTest is Test, WormholeTestUtils {
107115 CHAIN_ID,
108116 address (executor),
109117 address (callable),
110- abi.encodeCall (ICallable.foo, () )
118+ abi.encodeWithSelector (ICallable.foo. selector )
111119 );
112120
113121 bytes memory vaa = forgeVaa (
@@ -134,7 +142,7 @@ contract ExecutorTest is Test, WormholeTestUtils {
134142 CHAIN_ID,
135143 address (executor),
136144 address (callable),
137- abi.encodeCall (ICallable.foo, () )
145+ abi.encodeWithSelector (ICallable.foo. selector )
138146 );
139147
140148 bytes memory vaa = generateVaa (
@@ -158,7 +166,7 @@ contract ExecutorTest is Test, WormholeTestUtils {
158166 CHAIN_ID,
159167 address (executor),
160168 address (callable),
161- abi.encodeCall (ICallable.foo, () )
169+ abi.encodeWithSelector (ICallable.foo. selector )
162170 );
163171
164172 bytes memory vaa = generateVaa (
@@ -175,7 +183,11 @@ contract ExecutorTest is Test, WormholeTestUtils {
175183 }
176184
177185 function testOutOfOrder () public {
178- testExecute (address (callable), abi.encodeCall (ICallable.foo, ()), 3 );
186+ testExecute (
187+ address (callable),
188+ abi.encodeWithSelector (ICallable.foo.selector ),
189+ 3
190+ );
179191
180192 bytes memory payload = abi.encodePacked (
181193 uint32 (0x5054474d ),
@@ -184,7 +196,7 @@ contract ExecutorTest is Test, WormholeTestUtils {
184196 CHAIN_ID,
185197 address (executor),
186198 address (callable),
187- abi.encodeCall (ICallable.foo, () )
199+ abi.encodeWithSelector (ICallable.foo. selector )
188200 );
189201
190202 bytes memory vaa = generateVaa (
@@ -200,7 +212,11 @@ contract ExecutorTest is Test, WormholeTestUtils {
200212 executor.execute (vaa);
201213
202214 callable.reset ();
203- testExecute (address (callable), abi.encodeCall (ICallable.foo, ()), 4 );
215+ testExecute (
216+ address (callable),
217+ abi.encodeWithSelector (ICallable.foo.selector ),
218+ 4
219+ );
204220 assertEq (callable.fooCount (), 1 );
205221 }
206222
@@ -212,7 +228,7 @@ contract ExecutorTest is Test, WormholeTestUtils {
212228 CHAIN_ID,
213229 address (executor),
214230 address (callable),
215- abi.encodeCall (ICallable.foo, () )
231+ abi.encodeWithSelector (ICallable.foo. selector )
216232 );
217233
218234 bytes memory shortPayload = BytesLib.slice (
@@ -241,7 +257,7 @@ contract ExecutorTest is Test, WormholeTestUtils {
241257 uint16 (3 ),
242258 address (executor),
243259 address (callable),
244- abi.encodeCall (ICallable.foo, () )
260+ abi.encodeWithSelector (ICallable.foo. selector )
245261 );
246262
247263 bytes memory vaa = generateVaa (
@@ -265,7 +281,7 @@ contract ExecutorTest is Test, WormholeTestUtils {
265281 CHAIN_ID,
266282 address (0x1 ),
267283 address (callable),
268- abi.encodeCall (ICallable.foo, () )
284+ abi.encodeWithSelector (ICallable.foo. selector )
269285 );
270286
271287 bytes memory vaa = generateVaa (
@@ -289,7 +305,7 @@ contract ExecutorTest is Test, WormholeTestUtils {
289305 CHAIN_ID,
290306 address (executor),
291307 address (callable),
292- abi.encodeCall (ICallable.foo, () )
308+ abi.encodeWithSelector (ICallable.foo. selector )
293309 );
294310
295311 bytes memory vaa = generateVaa (
@@ -313,7 +329,7 @@ contract ExecutorTest is Test, WormholeTestUtils {
313329 CHAIN_ID,
314330 address (executor),
315331 address (callable),
316- abi.encodeCall (ICallable.reverts, () )
332+ abi.encodeWithSelector (ICallable.reverts. selector )
317333 );
318334
319335 bytes memory vaa = generateVaa (
0 commit comments