33pragma solidity ^ 0.8.0 ;
44
55import "@pythnetwork/pyth-sdk-solidity/IPyth.sol " ;
6- import "./PulseEvents .sol " ;
7- import "./PulseState .sol " ;
6+ import "./EchoEvents .sol " ;
7+ import "./EchoState .sol " ;
88
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
1212 // overridden by the consumer.
13- function _pulseCallback (
13+ function _echoCallback (
1414 uint64 sequenceNumber ,
1515 PythStructs.PriceFeed[] memory priceFeeds
1616 ) 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 " );
2020
21- pulseCallback (sequenceNumber, priceFeeds);
21+ echoCallback (sequenceNumber, priceFeeds);
2222 }
2323
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 );
2727
2828 // 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 (
3232 uint64 sequenceNumber ,
3333 PythStructs.PriceFeed[] memory priceFeeds
3434 ) internal virtual ;
3535}
3636
37- interface IPulse is PulseEvents {
37+ interface IEcho is EchoEvents {
3838 // Core functions
3939 /**
4040 * @notice Requests price updates with a callback
@@ -103,7 +103,7 @@ interface IPulse is PulseEvents {
103103
104104 function getRequest (
105105 uint64 sequenceNumber
106- ) external view returns (PulseState .Request memory req );
106+ ) external view returns (EchoState .Request memory req );
107107
108108 function setFeeManager (address manager ) external ;
109109
@@ -130,7 +130,7 @@ interface IPulse is PulseEvents {
130130
131131 function getProviderInfo (
132132 address provider
133- ) external view returns (PulseState .ProviderInfo memory );
133+ ) external view returns (EchoState .ProviderInfo memory );
134134
135135 function getDefaultProvider () external view returns (address );
136136
@@ -157,5 +157,5 @@ interface IPulse is PulseEvents {
157157 )
158158 external
159159 view
160- returns (PulseState .Request[] memory requests , uint256 actualCount );
160+ returns (EchoState .Request[] memory requests , uint256 actualCount );
161161}
0 commit comments