diff --git a/.github/workflows/solidity-test.yml b/.github/workflows/solidity-test.yml index 31967b0c..82d4e22f 100644 --- a/.github/workflows/solidity-test.yml +++ b/.github/workflows/solidity-test.yml @@ -135,3 +135,21 @@ jobs: with: name: gas-report path: ${{ env.working-directory }}/previous_gas_report.txt + + - name: Static analysis + uses: crytic/slither-action@v0.4.0 + id: slither + with: + target: 'solidity/' + slither-config: 'solidity/slither.config.json' + slither-args: --exclude incorrect-exponentiation + sarif: results.sarif + fail-on: none + compile-command: | + forge build + ignore-compile: false + + - name: Upload SARIF file + uses: github/codeql-action/upload-sarif@v3 + with: + sarif_file: ${{ steps.slither.outputs.sarif }} diff --git a/solidity/slither.config.json b/solidity/slither.config.json new file mode 100644 index 00000000..31dafb25 --- /dev/null +++ b/solidity/slither.config.json @@ -0,0 +1,6 @@ +{ + "filter_paths": "lib|node_modules|test|Mock*|Test*", + "compile_force_framework": "foundry", + "exclude_informational": true, + "no_fail": true + } \ No newline at end of file diff --git a/solidity/src/Pragma.sol b/solidity/src/Pragma.sol index 2c44f948..cf96fb87 100644 --- a/solidity/src/Pragma.sol +++ b/solidity/src/Pragma.sol @@ -7,6 +7,7 @@ import "./PragmaDecoder.sol"; import "./libraries/EventsLib.sol"; import "./libraries/ErrorsLib.sol"; import "./interfaces/PragmaStructs.sol"; +import "./libraries/DataParser.sol"; /// @title Pragma /// @author Pragma Labs @@ -16,7 +17,6 @@ contract Pragma is IPragma, PragmaDecoder { /* STORAGE */ uint256 public validTimePeriodSeconds; uint256 public singleUpdateFeeInWei; - mapping(bytes32 => uint64) public latestDataInfoPublishTime; constructor( address _hyperlane, @@ -111,7 +111,20 @@ contract Pragma is IPragma, PragmaDecoder { /// @inheritdoc IPragma function dataFeedExists(bytes32 id) external view returns (bool) { - return (latestDataInfoPublishTime[id] != 0); + FeedType feedType = DataParser.safeCastToFeedType(uint8(id[0])); + if (feedType == FeedType.SpotMedian) { + return (spotMedianFeeds[id].metadata.timestamp != 0); + } else if (feedType == FeedType.Twap) { + return (twapFeeds[id].metadata.timestamp != 0); + } else if (feedType == FeedType.RealizedVolatility) { + return (rvFeeds[id].metadata.timestamp != 0); + } else if (feedType == FeedType.Options) { + return (optionsFeeds[id].metadata.timestamp != 0); + } else if (feedType == FeedType.Perpetuals) { + return (perpFeeds[id].metadata.timestamp != 0); + } else { + revert ErrorsLib.InvalidDataFeedType(); + } } function getValidTimePeriod() public view returns (uint256) { diff --git a/solidity/src/PragmaDecoder.sol b/solidity/src/PragmaDecoder.sol index 669be6d4..7f9aca41 100644 --- a/solidity/src/PragmaDecoder.sol +++ b/solidity/src/PragmaDecoder.sol @@ -148,7 +148,7 @@ contract PragmaDecoder { virtual returns (bool valid, uint256 endOffset) { - return MerkleTree.isProofValid(encodedProof, offset, root, leafData); + (valid, endOffset) = MerkleTree.isProofValid(encodedProof, offset, root, leafData); } function extractDataInfoFromUpdate(bytes calldata encoded, uint256 offset, bytes32 checkpointRoot) diff --git a/solidity/src/interfaces/PragmaStructs.sol b/solidity/src/interfaces/PragmaStructs.sol index ba3e8c29..b1c05edf 100644 --- a/solidity/src/interfaces/PragmaStructs.sol +++ b/solidity/src/interfaces/PragmaStructs.sol @@ -65,8 +65,8 @@ struct RealizedVolatility { uint256 timePeriod; uint256 startPrice; uint256 endPrice; - uint256 high_price; - uint256 low_price; + uint256 highPrice; + uint256 lowPrice; uint256 numberOfDataPoints; } @@ -109,3 +109,70 @@ enum FeedType { Options, Perpetuals } + +library StructsInitializers { + function initializeParsedData() internal pure returns (ParsedData memory) { + return ParsedData({ + dataType: FeedType.SpotMedian, + spot: initializeSpotMedian(), + twap: initializeTwap(), + rv: initializeRV(), + options: initializeOptions(), + perp: initializePerpetuals() + }); + } + + function initializeMetadata() internal pure returns (Metadata memory) { + return Metadata({feedId: 0, timestamp: 0, numberOfSources: 0, decimals: 0}); + } + + function initializeSpotMedian() internal pure returns (SpotMedian memory) { + return SpotMedian({metadata: initializeMetadata(), price: 0, volume: 0}); + } + + function initializeTwap() internal pure returns (TWAP memory) { + return TWAP({ + metadata: initializeMetadata(), + twapPrice: 0, + timePeriod: 0, + startPrice: 0, + endPrice: 0, + totalVolume: 0, + numberOfDataPoints: 0 + }); + } + + function initializeRV() internal pure returns (RealizedVolatility memory) { + return RealizedVolatility({ + metadata: initializeMetadata(), + volatility: 0, + timePeriod: 0, + startPrice: 0, + endPrice: 0, + highPrice: 0, + lowPrice: 0, + numberOfDataPoints: 0 + }); + } + + function initializeOptions() internal pure returns (Options memory) { + return Options({ + metadata: initializeMetadata(), + strikePrice: 0, + impliedVolatility: 0, + timeToExpiry: 0, + isCall: false, + underlyingPrice: 0, + optionPrice: 0, + delta: 0, + gamma: 0, + vega: 0, + theta: 0, + rho: 0 + }); + } + + function initializePerpetuals() internal pure returns (Perp memory) { + return Perp({metadata: initializeMetadata(), markPrice: 0, fundingRate: 0, openInterest: 0, volume: 0}); + } +} diff --git a/solidity/src/libraries/DataParser.sol b/solidity/src/libraries/DataParser.sol index 10e03a4c..bf67aca1 100644 --- a/solidity/src/libraries/DataParser.sol +++ b/solidity/src/libraries/DataParser.sol @@ -10,10 +10,10 @@ library DataParser { function parse(bytes memory data) internal pure returns (ParsedData memory) { uint8 offset = 2; // type feed stored after asset class - uint16 rawDataType = data.toUint16(offset); + uint8 rawDataType = data.toUint8(offset); FeedType dataType = safeCastToFeedType(rawDataType); - ParsedData memory parsedData; + ParsedData memory parsedData = StructsInitializers.initializeParsedData(); parsedData.dataType = dataType; if (dataType == FeedType.SpotMedian) { parsedData.spot = parseSpotData(data); @@ -32,8 +32,8 @@ library DataParser { return parsedData; } - function safeCastToFeedType(uint16 rawDataType) internal pure returns (FeedType) { - if (rawDataType <= uint16(type(FeedType).max)) { + function safeCastToFeedType(uint8 rawDataType) internal pure returns (FeedType) { + if (rawDataType <= uint8(type(FeedType).max)) { return FeedType(rawDataType); } else { revert ErrorsLib.InvalidDataFeedType(); @@ -41,7 +41,7 @@ library DataParser { } function parseMetadata(bytes memory data, uint256 startIndex) internal pure returns (Metadata memory, uint256) { - Metadata memory metadata; + Metadata memory metadata = StructsInitializers.initializeMetadata(); uint256 index = startIndex; metadata.feedId = bytes32(data.toUint256(index)); @@ -60,7 +60,7 @@ library DataParser { } function parseSpotData(bytes memory data) internal pure returns (SpotMedian memory) { - SpotMedian memory entry; + SpotMedian memory entry = StructsInitializers.initializeSpotMedian(); uint256 index = 0; (entry.metadata, index) = parseMetadata(data, index); @@ -74,7 +74,7 @@ library DataParser { } function parseTWAPData(bytes memory data) internal pure returns (TWAP memory) { - TWAP memory entry; + TWAP memory entry = StructsInitializers.initializeTwap(); uint256 index = 0; (entry.metadata, index) = parseMetadata(data, index); @@ -100,7 +100,7 @@ library DataParser { } function parseRealizedVolatilityData(bytes memory data) internal pure returns (RealizedVolatility memory) { - RealizedVolatility memory entry; + RealizedVolatility memory entry = StructsInitializers.initializeRV(); uint256 index = 0; (entry.metadata, index) = parseMetadata(data, index); @@ -117,10 +117,10 @@ library DataParser { entry.endPrice = data.toUint256(index); index += 32; - entry.high_price = data.toUint256(index); + entry.highPrice = data.toUint256(index); index += 32; - entry.low_price = data.toUint256(index); + entry.lowPrice = data.toUint256(index); index += 32; entry.numberOfDataPoints = data.toUint256(index); @@ -129,7 +129,7 @@ library DataParser { } function parseOptionsData(bytes memory data) internal pure returns (Options memory) { - Options memory entry; + Options memory entry = StructsInitializers.initializeOptions(); uint256 index = 0; (entry.metadata, index) = parseMetadata(data, index); @@ -170,7 +170,7 @@ library DataParser { } function parsePerpData(bytes memory data) internal pure returns (Perp memory) { - Perp memory entry; + Perp memory entry = StructsInitializers.initializePerpetuals(); uint256 index = 0; (entry.metadata, index) = parseMetadata(data, index); diff --git a/solidity/test/DataParser.t.sol b/solidity/test/DataParser.t.sol index f7821b9e..6011d53b 100644 --- a/solidity/test/DataParser.t.sol +++ b/solidity/test/DataParser.t.sol @@ -11,7 +11,8 @@ contract DataParserTest is Test { abi.encodePacked( uint16(0), ///CRYPTO - uint16(0), //SPOT + uint8(0), //SPOT + uint8(0), //VARIANT bytes32("BTC/USD") ) ); @@ -40,7 +41,8 @@ contract DataParserTest is Test { abi.encodePacked( uint16(0), ///CRYPTO - uint16(1), //TWAP + uint8(1), //TWAP + uint8(0), //VARIANT bytes32("ETH/USD") ) ); @@ -77,7 +79,8 @@ contract DataParserTest is Test { abi.encodePacked( uint16(0), ///CRYPTO - uint16(2), //RV + uint8(2), //RV + uint8(0), //VARIANT bytes32("BTC/USD") ) ); @@ -90,8 +93,8 @@ contract DataParserTest is Test { uint256(86400), // timePeriod uint256(34000 ether), // startPrice uint256(36000 ether), // endPrice - uint256(37000 ether), // high_price - uint256(33000 ether), // low_price + uint256(37000 ether), // highPrice + uint256(33000 ether), // lowPrice uint256(1440) // numberOfDataPoints ); @@ -106,8 +109,8 @@ contract DataParserTest is Test { assertEq(result.rv.timePeriod, 86400); assertEq(result.rv.startPrice, 34000 ether); assertEq(result.rv.endPrice, 36000 ether); - assertEq(result.rv.high_price, 37000 ether); - assertEq(result.rv.low_price, 33000 ether); + assertEq(result.rv.highPrice, 37000 ether); + assertEq(result.rv.lowPrice, 33000 ether); assertEq(result.rv.numberOfDataPoints, 1440); } @@ -116,7 +119,8 @@ contract DataParserTest is Test { abi.encodePacked( uint16(0), ///CRYPTO - uint16(3), //Option + uint8(3), //Option + uint8(0), //VARIANT bytes32("ETH/USD") ) ); @@ -163,7 +167,8 @@ contract DataParserTest is Test { abi.encodePacked( uint16(0), ///CRYPTO - uint16(4), //PERP + uint8(4), //PERP + uint8(0), //VARIANT bytes32("BTC/USD") ) ); @@ -196,7 +201,8 @@ contract DataParserTest is Test { abi.encodePacked( uint16(0), ///CRYPTO - uint16(10), //Unkown data type + uint8(20), //Unkown data type + uint8(0), bytes32("BTC/USD") ) ); diff --git a/solidity/test/PragmaDecoder.t.sol b/solidity/test/PragmaDecoder.t.sol index 528548ad..850be44a 100644 --- a/solidity/test/PragmaDecoder.t.sol +++ b/solidity/test/PragmaDecoder.t.sol @@ -8,7 +8,6 @@ import "../src/interfaces/IHyperlane.sol"; import "../src/libraries/ErrorsLib.sol"; import "./../src/Hyperlane.sol"; import "../src/libraries/BytesLib.sol"; -import "forge-std/console2.sol"; import {TestUtils} from "./TestUtils.sol"; contract PragmaDecoderHarness is PragmaDecoder { @@ -97,37 +96,38 @@ contract PragmaDecoderTest is Test { // TWAP validatorSets[1] = new address[](5); - validatorSets[1][0] = address(0x005472c2afb8c5d5bdedd6fb15538aba4e5e954b68); - validatorSets[1][1] = address(0x009ee8d4936be96299e8eba08b99fc70962c56d476); - validatorSets[1][2] = address(0x00e04aa374e71c6b42009660ca18d64d48f1b49567); - validatorSets[1][3] = address(0x0093eeea4ec6424ca2f0fd2d5473a5b109b36e8aba); - validatorSets[1][4] = address(0x00d80848530176c5ec4d389d0a4a31c48710a51a11); + validatorSets[1][0] = address(0x00a7aac8c81227f598ae6ef3e9a50e5dcf29c03e89); + validatorSets[1][1] = address(0x00c33e5a769379a7f485a167e91e991121b0743b03); + validatorSets[1][2] = address(0x008991ee92f51430014bc7498d947366d05b0f9cc3); + validatorSets[1][3] = address(0x00d561fd65ee6c8ce3d4b7a93648c5aca312332be5); + validatorSets[1][4] = address(0x00fd344788ffb1668535d88016ae554f1f83a0c796); // Realized volatility validatorSets[2] = new address[](5); - validatorSets[2][0] = address(0x0081113a12d0677bfd9055722826be0608a79e485f); - validatorSets[2][1] = address(0x0075c554efa4c4061f5319cce671342c3a5ee7ca4f); - validatorSets[2][2] = address(0x00ac532f8758c2562be11476fea2a0c5a03e49ed1c); - validatorSets[2][3] = address(0x00b4902be8b8e9a3b2c1a2dda4b503caa6669935ec); - validatorSets[2][4] = address(0x00b472cd1688acb23bbe561353ad0a7d6be287b4f8); + validatorSets[2][0] = address(0x0033169619754376315c1471cab101e27fd6f8b04c); + validatorSets[2][1] = address(0x00eec7fdaa55ab594b43e0fd2c2cbfca4db7fad514); + validatorSets[2][2] = address(0x00833fa09fcde048fa09330135e7aa87dbda6e0ec1); + validatorSets[2][3] = address(0x00e32920bc862d733e0c5a7c3829a3fc5b0aac5f90); + validatorSets[2][4] = address(0x0061efabeabd9f0d4274786b1e8547335d733cbbe6); + // Options validatorSets[3] = new address[](5); - validatorSets[3][0] = address(0x000d1bd3a53d455401d7e9b35f2ebefa1e86d879f5); - validatorSets[3][1] = address(0x00059c488fdac0d66ccb790db20ac3881f2f81a0c6); - validatorSets[3][2] = address(0x003e961cf87c7e0d13b848f0654b6d37faea1e5666); - validatorSets[3][3] = address(0x006b78b4d7b33a15edd8bbc5b3b1e679ad3e6c0d27); - validatorSets[3][4] = address(0x009cc8b348632e9f38e88ebd2ca564542c4b7297c5); + validatorSets[3][0] = address(0x00c33a6edb6cd4501cf5300dac7a40f88c89781634); + validatorSets[3][1] = address(0x00434585d48bba02a80f5b72c028a34e5b641e71e8); + validatorSets[3][2] = address(0x00172d9a1d5895ad34cda871a146a710345c5071bd); + validatorSets[3][3] = address(0x000a8d40ca144dfc38d0773b4df85a38564608588d); + validatorSets[3][4] = address(0x00fbcd35d30825b8155d6702d168b0c80bdb9bf84c); // Perp validatorSets[4] = new address[](5); - validatorSets[4][0] = address(0x0054ef2963f3e6b6a77fffc3f7bbd5fc0e479412c2); - validatorSets[4][1] = address(0x000b78cc20dc1b484781c56d0ea806f34693833bd5); - validatorSets[4][2] = address(0x003dbecdde82fd8c8823daf0841bd1e75342588a41); - validatorSets[4][3] = address(0x004f437c9e4c5cbbe927945838601b8277d68e69e6); - validatorSets[4][4] = address(0x00fa73934abc5b756599d973d2906b2db58f506284); + validatorSets[4][0] = address(0x00e308fffa5d4928613c92b6b278401abb6a6a2782); + validatorSets[4][1] = address(0x001a21a61ada1a896b2b4284eb0c10821baa5a1b92); + validatorSets[4][2] = address(0x00de5d2ba26fab8a449867ee5b7542afa997f193c0); + validatorSets[4][3] = address(0x0042c1f70436a51336f29baee67e1a62b0f7455b62); + validatorSets[4][4] = address(0x0010d3948375ac01c5c4b24c0bcb279ef3acbff297); uint8 validatorSetIndex; if (dataType == FeedType.SpotMedian) { @@ -163,7 +163,8 @@ contract PragmaDecoderTest is Test { abi.encodePacked( uint16(0), ///CRYPTO - uint16(0), //SPOT + uint8(0), //SPOT + uint8(0), //VARIANT bytes32("ETH/USD") ) ); @@ -188,7 +189,8 @@ contract PragmaDecoderTest is Test { abi.encodePacked( uint16(0), ///CRYPTO - uint16(1), //TWAP + uint8(1), //TWAP + uint8(0), // VARIANT bytes32("BTC/USD") ) ); @@ -217,7 +219,8 @@ contract PragmaDecoderTest is Test { abi.encodePacked( uint16(0), ///CRYPTO - uint16(2), //RV + uint8(2), //RV + uint8(0), //VARIANT bytes32("ETH/USD") ) ); @@ -234,8 +237,8 @@ contract PragmaDecoderTest is Test { assertEq(rv.timePeriod, 86400, "Time period should match"); assertEq(rv.startPrice, 1900 * 1e8, "Start price should match"); assertEq(rv.endPrice, 2100 * 1e8, "End price should match"); - assertEq(rv.high_price, 2200 * 1e8, "High price should match"); - assertEq(rv.low_price, 1800 * 1e8, "Low price should match"); + assertEq(rv.highPrice, 2200 * 1e8, "High price should match"); + assertEq(rv.lowPrice, 1800 * 1e8, "Low price should match"); assertEq(rv.numberOfDataPoints, 1440, "Number of data points should match"); } @@ -245,7 +248,8 @@ contract PragmaDecoderTest is Test { abi.encodePacked( uint16(0), ///CRYPTO - uint16(3), //Options + uint8(3), //Options + uint8(0), bytes32("ETH/USD") ) ); @@ -279,7 +283,8 @@ contract PragmaDecoderTest is Test { abi.encodePacked( uint16(0), ///CRYPTO - uint16(4), //Perp + uint8(4), //Perp + uint8(0), //VARIANT bytes32("ETH/USD") ) ); diff --git a/solidity/test/TestUtils.sol b/solidity/test/TestUtils.sol index cc3a29c7..b5e00ff3 100644 --- a/solidity/test/TestUtils.sol +++ b/solidity/test/TestUtils.sol @@ -74,8 +74,8 @@ library TestUtils { uint256(86400), // timePeriod uint256(1900 * 1e8), // startPrice uint256(2100 * 1e8), // endPrice - uint256(2200 * 1e8), // high_price - uint256(1800 * 1e8), // low_price + uint256(2200 * 1e8), // highPrice + uint256(1800 * 1e8), // lowPrice uint256(1440) // numberOfDataPoints ); } else if (dataType == FeedType.Options) { diff --git a/solidity/test/benchmarks/PragmaDecoderGasTest.t.sol b/solidity/test/benchmarks/PragmaDecoderGasTest.t.sol index ac7ccc31..4a8a31ad 100644 --- a/solidity/test/benchmarks/PragmaDecoderGasTest.t.sol +++ b/solidity/test/benchmarks/PragmaDecoderGasTest.t.sol @@ -35,37 +35,38 @@ contract PragmaDecoderGasTest is Test { // TWAP validatorSets[1] = new address[](5); - validatorSets[1][0] = address(0x005472c2afb8c5d5bdedd6fb15538aba4e5e954b68); - validatorSets[1][1] = address(0x009ee8d4936be96299e8eba08b99fc70962c56d476); - validatorSets[1][2] = address(0x00e04aa374e71c6b42009660ca18d64d48f1b49567); - validatorSets[1][3] = address(0x0093eeea4ec6424ca2f0fd2d5473a5b109b36e8aba); - validatorSets[1][4] = address(0x00d80848530176c5ec4d389d0a4a31c48710a51a11); + validatorSets[1][0] = address(0x00a7aac8c81227f598ae6ef3e9a50e5dcf29c03e89); + validatorSets[1][1] = address(0x00c33e5a769379a7f485a167e91e991121b0743b03); + validatorSets[1][2] = address(0x008991ee92f51430014bc7498d947366d05b0f9cc3); + validatorSets[1][3] = address(0x00d561fd65ee6c8ce3d4b7a93648c5aca312332be5); + validatorSets[1][4] = address(0x00fd344788ffb1668535d88016ae554f1f83a0c796); // Realized volatility validatorSets[2] = new address[](5); - validatorSets[2][0] = address(0x0081113a12d0677bfd9055722826be0608a79e485f); - validatorSets[2][1] = address(0x0075c554efa4c4061f5319cce671342c3a5ee7ca4f); - validatorSets[2][2] = address(0x00ac532f8758c2562be11476fea2a0c5a03e49ed1c); - validatorSets[2][3] = address(0x00b4902be8b8e9a3b2c1a2dda4b503caa6669935ec); - validatorSets[2][4] = address(0x00b472cd1688acb23bbe561353ad0a7d6be287b4f8); + validatorSets[2][0] = address(0x0033169619754376315c1471cab101e27fd6f8b04c); + validatorSets[2][1] = address(0x00eec7fdaa55ab594b43e0fd2c2cbfca4db7fad514); + validatorSets[2][2] = address(0x00833fa09fcde048fa09330135e7aa87dbda6e0ec1); + validatorSets[2][3] = address(0x00e32920bc862d733e0c5a7c3829a3fc5b0aac5f90); + validatorSets[2][4] = address(0x0061efabeabd9f0d4274786b1e8547335d733cbbe6); + // Options validatorSets[3] = new address[](5); - validatorSets[3][0] = address(0x000d1bd3a53d455401d7e9b35f2ebefa1e86d879f5); - validatorSets[3][1] = address(0x00059c488fdac0d66ccb790db20ac3881f2f81a0c6); - validatorSets[3][2] = address(0x003e961cf87c7e0d13b848f0654b6d37faea1e5666); - validatorSets[3][3] = address(0x006b78b4d7b33a15edd8bbc5b3b1e679ad3e6c0d27); - validatorSets[3][4] = address(0x009cc8b348632e9f38e88ebd2ca564542c4b7297c5); + validatorSets[3][0] = address(0x00c33a6edb6cd4501cf5300dac7a40f88c89781634); + validatorSets[3][1] = address(0x00434585d48bba02a80f5b72c028a34e5b641e71e8); + validatorSets[3][2] = address(0x00172d9a1d5895ad34cda871a146a710345c5071bd); + validatorSets[3][3] = address(0x000a8d40ca144dfc38d0773b4df85a38564608588d); + validatorSets[3][4] = address(0x00fbcd35d30825b8155d6702d168b0c80bdb9bf84c); // Perp validatorSets[4] = new address[](5); - validatorSets[4][0] = address(0x0054ef2963f3e6b6a77fffc3f7bbd5fc0e479412c2); - validatorSets[4][1] = address(0x000b78cc20dc1b484781c56d0ea806f34693833bd5); - validatorSets[4][2] = address(0x003dbecdde82fd8c8823daf0841bd1e75342588a41); - validatorSets[4][3] = address(0x004f437c9e4c5cbbe927945838601b8277d68e69e6); - validatorSets[4][4] = address(0x00fa73934abc5b756599d973d2906b2db58f506284); + validatorSets[4][0] = address(0x00e308fffa5d4928613c92b6b278401abb6a6a2782); + validatorSets[4][1] = address(0x001a21a61ada1a896b2b4284eb0c10821baa5a1b92); + validatorSets[4][2] = address(0x00de5d2ba26fab8a449867ee5b7542afa997f193c0); + validatorSets[4][3] = address(0x0042c1f70436a51336f29baee67e1a62b0f7455b62); + validatorSets[4][4] = address(0x0010d3948375ac01c5c4b24c0bcb279ef3acbff297); uint8 validatorSetIndex; if (dataType == FeedType.SpotMedian) { @@ -105,7 +106,8 @@ contract PragmaDecoderGasTest is Test { bytes32 feedId = bytes32( abi.encodePacked( uint16(0), // CRYPTO - uint16(i), // Data type index + uint8(i), // Data type index + uint8(0), currencies[i] ) ); diff --git a/solidity/test/utils/HyperlaneTestUtils.t.sol b/solidity/test/utils/HyperlaneTestUtils.t.sol index 880fa24e..eaeac0e9 100644 --- a/solidity/test/utils/HyperlaneTestUtils.t.sol +++ b/solidity/test/utils/HyperlaneTestUtils.t.sol @@ -5,7 +5,6 @@ pragma solidity ^0.8.0; import "../../src/Hyperlane.sol"; import {IHyperlane, HyMsg, Signature} from "../../src/interfaces/IHyperlane.sol"; import "forge-std/Test.sol"; -import "forge-std/console2.sol"; abstract contract HyperlaneTestUtils is Test { uint256[] currentSigners;