File tree Expand file tree Collapse file tree 3 files changed +8
-10
lines changed
target_chains/ethereum/contracts Expand file tree Collapse file tree 3 files changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ abstract contract PythGovernance is
39
39
address newWormholeAddress
40
40
);
41
41
event TransactionFeeSet (uint oldFee , uint newFee );
42
- event FeeWithdrawn (address targetAddress , uint amount );
42
+ event FeeWithdrawn (address targetAddress , uint fee );
43
43
44
44
function verifyGovernanceVM (
45
45
bytes memory encodedVM
@@ -260,14 +260,12 @@ abstract contract PythGovernance is
260
260
}
261
261
262
262
function withdrawFee (WithdrawFeePayload memory payload ) internal {
263
- if (payload.amount > address (this ).balance)
263
+ if (payload.fee > address (this ).balance)
264
264
revert PythErrors.InsufficientFee ();
265
265
266
- (bool success , ) = payload.targetAddress.call {value: payload.amount}(
267
- ""
268
- );
266
+ (bool success , ) = payload.targetAddress.call {value: payload.fee}("" );
269
267
require (success, "Failed to withdraw fees " );
270
268
271
- emit FeeWithdrawn (payload.targetAddress, payload.amount );
269
+ emit FeeWithdrawn (payload.targetAddress, payload.fee );
272
270
}
273
271
}
Original file line number Diff line number Diff line change @@ -85,8 +85,8 @@ contract PythGovernanceInstructions {
85
85
86
86
struct WithdrawFeePayload {
87
87
address targetAddress;
88
- // Amount in wei, matching the native uint256 type used for address.balance in EVM
89
- uint256 amount ;
88
+ // Fee in wei, matching the native uint256 type used for address.balance in EVM
89
+ uint256 fee ;
90
90
}
91
91
92
92
/// @dev Parse a GovernanceInstruction
@@ -266,7 +266,7 @@ contract PythGovernanceInstructions {
266
266
uint64 expo = encodedPayload.toUint64 (index);
267
267
index += 8 ;
268
268
269
- wf.amount = uint256 (val) * uint256 (10 ) ** uint256 (expo);
269
+ wf.fee = uint256 (val) * uint256 (10 ) ** uint256 (expo);
270
270
271
271
if (encodedPayload.length != index)
272
272
revert PythErrors.InvalidGovernanceMessage ();
Original file line number Diff line number Diff line change @@ -705,5 +705,5 @@ contract PythGovernanceTest is
705
705
address newWormholeAddress
706
706
);
707
707
event TransactionFeeSet (uint oldFee , uint newFee );
708
- event FeeWithdrawn (address recipient , uint256 amount );
708
+ event FeeWithdrawn (address recipient , uint256 fee );
709
709
}
You can’t perform that action at this time.
0 commit comments