3
3
pragma solidity ^ 0.8.0 ;
4
4
5
5
import "@pythnetwork/pyth-sdk-solidity/IPyth.sol " ;
6
- import "./PulseEvents .sol " ;
7
- import "./PulseState .sol " ;
6
+ import "./EchoEvents .sol " ;
7
+ import "./EchoState .sol " ;
8
8
9
- abstract contract IPulseConsumer {
10
- // This method is called by Pulse to provide the price updates to the consumer.
11
- // It asserts that the msg.sender is the Pulse contract. It is not meant to be
9
+ abstract contract IEchoConsumer {
10
+ // This method is called by Echo to provide the price updates to the consumer.
11
+ // It asserts that the msg.sender is the Echo contract. It is not meant to be
12
12
// overridden by the consumer.
13
- function _pulseCallback (
13
+ function _echoCallback (
14
14
uint64 sequenceNumber ,
15
15
PythStructs.PriceFeed[] memory priceFeeds
16
16
) external {
17
- address pulse = getPulse ();
18
- require (pulse != address (0 ), "Pulse address not set " );
19
- require (msg .sender == pulse , "Only Pulse can call this function " );
17
+ address echo = getEcho ();
18
+ require (echo != address (0 ), "Echo address not set " );
19
+ require (msg .sender == echo , "Only Echo can call this function " );
20
20
21
- pulseCallback (sequenceNumber, priceFeeds);
21
+ echoCallback (sequenceNumber, priceFeeds);
22
22
}
23
23
24
- // getPulse returns the Pulse contract address. The method is being used to check that the
25
- // callback is indeed from the Pulse contract. The consumer is expected to implement this method.
26
- function getPulse () internal view virtual returns (address );
24
+ // getEcho returns the Echo contract address. The method is being used to check that the
25
+ // callback is indeed from the Echo contract. The consumer is expected to implement this method.
26
+ function getEcho () internal view virtual returns (address );
27
27
28
28
// This method is expected to be implemented by the consumer to handle the price updates.
29
- // It will be called by _pulseCallback after _pulseCallback ensures that the call is
30
- // indeed from Pulse contract.
31
- function pulseCallback (
29
+ // It will be called by _echoCallback after _echoCallback ensures that the call is
30
+ // indeed from Echo contract.
31
+ function echoCallback (
32
32
uint64 sequenceNumber ,
33
33
PythStructs.PriceFeed[] memory priceFeeds
34
34
) internal virtual ;
35
35
}
36
36
37
- interface IPulse is PulseEvents {
37
+ interface IEcho is EchoEvents {
38
38
// Core functions
39
39
/**
40
40
* @notice Requests price updates with a callback
@@ -103,7 +103,7 @@ interface IPulse is PulseEvents {
103
103
104
104
function getRequest (
105
105
uint64 sequenceNumber
106
- ) external view returns (PulseState .Request memory req );
106
+ ) external view returns (EchoState .Request memory req );
107
107
108
108
function setFeeManager (address manager ) external ;
109
109
@@ -130,7 +130,7 @@ interface IPulse is PulseEvents {
130
130
131
131
function getProviderInfo (
132
132
address provider
133
- ) external view returns (PulseState .ProviderInfo memory );
133
+ ) external view returns (EchoState .ProviderInfo memory );
134
134
135
135
function getDefaultProvider () external view returns (address );
136
136
@@ -157,5 +157,5 @@ interface IPulse is PulseEvents {
157
157
)
158
158
external
159
159
view
160
- returns (PulseState .Request[] memory requests , uint256 actualCount );
160
+ returns (EchoState .Request[] memory requests , uint256 actualCount );
161
161
}
0 commit comments