Skip to content

Commit bbd3d1a

Browse files
committed
chore(target_chains/eth): revert solidity version
This change reverts the solidity version to 0.8.4 as the current version troubles the Pyth price feeds contract deployment. Some tests are changed to use the methods available in the older version. Also, the Pyth contract version is updated. This is because we made a change to the Governance structs (to add Stacks) that results in a new bytecode.
1 parent 003cba2 commit bbd3d1a

File tree

5 files changed

+35
-19
lines changed

5 files changed

+35
-19
lines changed

target_chains/ethereum/contracts/contracts/executor/Executor.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: UNLICENSED
2-
pragma solidity ^0.8.12;
2+
pragma solidity ^0.8.0;
33

44
import "../pyth/PythGovernanceInstructions.sol";
55
import "../wormhole/interfaces/IWormhole.sol";

target_chains/ethereum/contracts/contracts/pyth/Pyth.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,6 @@ abstract contract Pyth is
727727
}
728728

729729
function version() public pure returns (string memory) {
730-
return "1.3.2";
730+
return "1.3.3";
731731
}
732732
}

target_chains/ethereum/contracts/forge-test/Executor.t.sol

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: Apache 2
22

3-
pragma solidity ^0.8.12;
3+
pragma solidity ^0.8.0;
44

55
import "forge-std/Test.sol";
66
import "@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(

target_chains/ethereum/contracts/foundry.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[profile.default]
2-
solc_version = '0.8.23'
2+
solc_version = '0.8.4'
33
optimizer = true
44
optimizer_runs = 200
55
src = 'contracts'

target_chains/ethereum/contracts/truffle-config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ module.exports = {
3333

3434
compilers: {
3535
solc: {
36-
version: "0.8.23",
36+
version: "0.8.4",
3737
settings: {
3838
optimizer: {
3939
enabled: true,

0 commit comments

Comments
 (0)