We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 74217f9 commit 671c6c3Copy full SHA for 671c6c3
target_chains/ethereum/contracts/contracts/pyth/Pyth.sol
@@ -373,11 +373,14 @@ abstract contract Pyth is
373
if (updateData.length != 2) {
374
revert PythErrors.InvalidUpdateData();
375
}
376
+ // We only charge fee for 1 update even though we need 2 updates to derive TWAP.
377
+ // This is for better UX since user's intention is to get a single TWAP price.
378
uint requiredFee = getUpdateFee(updateData[0]);
379
380
if (requiredFee != getUpdateFee(updateData[1])) {
381
382
383
+
384
if (msg.value < requiredFee) revert PythErrors.InsufficientFee();
385
386
unchecked {
0 commit comments