Ver Fonte

Merge pull request #2610 from pyth-network/evm-gov

fix(pyth-governance): add no-op for SetFeeInToken action on EVM chains and update action indices
Daniel Chew há 7 meses atrás
pai
commit
e1c1f0afc5

+ 2 - 0
target_chains/ethereum/contracts/contracts/pyth/PythGovernance.sol

@@ -99,6 +99,8 @@ abstract contract PythGovernance is
                 parseSetWormholeAddressPayload(gi.payload),
                 encodedVM
             );
+        } else if (gi.action == GovernanceAction.SetFeeInToken) {
+            // No-op for EVM chains
         } else if (gi.action == GovernanceAction.SetTransactionFee) {
             setTransactionFee(parseSetTransactionFeePayload(gi.payload));
         } else if (gi.action == GovernanceAction.WithdrawFee) {

+ 5 - 4
target_chains/ethereum/contracts/contracts/pyth/PythGovernanceInstructions.sol

@@ -35,8 +35,9 @@ contract PythGovernanceInstructions {
         SetValidPeriod, // 4
         RequestGovernanceDataSourceTransfer, // 5
         SetWormholeAddress, // 6
-        SetTransactionFee, // 7
-        WithdrawFee // 8
+        SetFeeInToken, // 7 - No-op for EVM chains
+        SetTransactionFee, // 8
+        WithdrawFee // 9
     }
 
     struct GovernanceInstruction {
@@ -233,7 +234,7 @@ contract PythGovernanceInstructions {
             revert PythErrors.InvalidGovernanceMessage();
     }
 
-    /// @dev Parse a SetTransactionFeePayload (action 7) with minimal validation
+    /// @dev Parse a SetTransactionFeePayload (action 8) with minimal validation
     function parseSetTransactionFeePayload(
         bytes memory encodedPayload
     ) public pure returns (SetTransactionFeePayload memory stf) {
@@ -251,7 +252,7 @@ contract PythGovernanceInstructions {
             revert PythErrors.InvalidGovernanceMessage();
     }
 
-    /// @dev Parse a WithdrawFeePayload (action 8) with minimal validation
+    /// @dev Parse a WithdrawFeePayload (action 9) with minimal validation
     function parseWithdrawFeePayload(
         bytes memory encodedPayload
     ) public pure returns (WithdrawFeePayload memory wf) {