Skip to content

Commit b7bc50c

Browse files
committed
gr
1 parent bd6fd22 commit b7bc50c

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

target_chains/ethereum/contracts/contracts/pulse/IPulse.sol

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ interface IPulse is PulseEvents {
4040
* @notice Requests price updates with a callback
4141
* @dev The msg.value must be equal to getFee(callbackGasLimit)
4242
* @param provider The provider to fulfill the request
43-
* @param callbackGasLimit The amount of gas allocated for the callback execution
4443
* @param publishTime The minimum publish time for price updates, it should be less than or equal to block.timestamp + 60
4544
* @param priceIds The price feed IDs to update. Maximum 10 price feeds per request.
4645
* Requests requiring more feeds should be split into multiple calls.
46+
* @param callbackGasLimit The amount of gas allocated for the callback execution
4747
* @return sequenceNumber The sequence number assigned to this request
4848
* @dev Security note: The 60-second future limit on publishTime prevents a DoS vector where
4949
* attackers could submit many low-fee requests for far-future updates when gas prices
@@ -84,8 +84,7 @@ interface IPulse is PulseEvents {
8484

8585
/**
8686
* @notice Calculates the total fee required for a price update request
87-
* FIXME: is this comment right?
88-
* @dev Total fee = base Pyth protocol fee + gas costs for callback
87+
* @dev Total fee = base Pyth protocol fee + base provider fee + provider fee per feed + gas costs for callback
8988
* @param provider The provider to fulfill the request
9089
* @param callbackGasLimit The amount of gas allocated for callback execution
9190
* @param priceIds The price feed IDs to update.
@@ -97,7 +96,10 @@ interface IPulse is PulseEvents {
9796
bytes32[] calldata priceIds
9897
) external view returns (uint128 feeAmount);
9998

100-
function getAccruedFees() external view returns (uint128 accruedFeesInWei);
99+
function getAccruedPythFees()
100+
external
101+
view
102+
returns (uint128 accruedFeesInWei);
101103

102104
function getRequest(
103105
uint64 sequenceNumber

target_chains/ethereum/contracts/contracts/pulse/Pulse.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ abstract contract Pulse is IPulse, PulseState {
251251
pythFeeInWei = _state.pythFeeInWei;
252252
}
253253

254-
function getAccruedFees()
254+
function getAccruedPythFees()
255255
public
256256
view
257257
override

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ contract PulseTest is Test, PulseEvents, IPulseConsumer {
643643

644644
// Get admin's balance before withdrawal
645645
uint256 adminBalanceBefore = admin.balance;
646-
uint128 accruedFees = pulse.getAccruedFees();
646+
uint128 accruedFees = pulse.getAccruedPythFees();
647647

648648
// Withdraw fees as admin
649649
vm.prank(admin);
@@ -656,7 +656,7 @@ contract PulseTest is Test, PulseEvents, IPulseConsumer {
656656
"Admin balance should increase by withdrawn amount"
657657
);
658658
assertEq(
659-
pulse.getAccruedFees(),
659+
pulse.getAccruedPythFees(),
660660
0,
661661
"Contract should have no fees after withdrawal"
662662
);

0 commit comments

Comments
 (0)