Skip to content

Commit c2f38ba

Browse files
refactor: rename pulse -> echo (#2606)
1 parent ff06b5e commit c2f38ba

20 files changed

+249
-253
lines changed

target_chains/ethereum/contracts/contracts/pulse/Pulse.sol renamed to target_chains/ethereum/contracts/contracts/echo/Echo.sol

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ pragma solidity ^0.8.0;
44

55
import "@openzeppelin/contracts/utils/math/SafeCast.sol";
66
import "@pythnetwork/pyth-sdk-solidity/IPyth.sol";
7-
import "./IPulse.sol";
8-
import "./PulseState.sol";
9-
import "./PulseErrors.sol";
7+
import "./IEcho.sol";
8+
import "./EchoState.sol";
9+
import "./EchoErrors.sol";
1010

11-
abstract contract Pulse is IPulse, PulseState {
11+
abstract contract Echo is IEcho, EchoState {
1212
function _initialize(
1313
address admin,
1414
uint96 pythFeeInWei,
@@ -174,7 +174,7 @@ abstract contract Pulse is IPulse, PulseState {
174174
}
175175

176176
try
177-
IPulseConsumer(req.requester)._pulseCallback{
177+
IEchoConsumer(req.requester)._echoCallback{
178178
gas: req.callbackGasLimit
179179
}(sequenceNumber, priceFeeds)
180180
{

target_chains/ethereum/contracts/contracts/pulse/PulseEvents.sol renamed to target_chains/ethereum/contracts/contracts/echo/EchoEvents.sol

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// SPDX-License-Identifier: Apache-2.0
22
pragma solidity ^0.8.0;
33

4-
import "./PulseState.sol";
4+
import "./EchoState.sol";
55

6-
interface PulseEvents {
7-
event PriceUpdateRequested(PulseState.Request request, bytes32[] priceIds);
6+
interface EchoEvents {
7+
event PriceUpdateRequested(EchoState.Request request, bytes32[] priceIds);
88

99
event PriceUpdateExecuted(
1010
uint64 indexed sequenceNumber,

target_chains/ethereum/contracts/contracts/pulse/PulseState.sol renamed to target_chains/ethereum/contracts/contracts/echo/EchoState.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
pragma solidity ^0.8.0;
44

5-
contract PulseState {
5+
contract EchoState {
66
uint8 public constant NUM_REQUESTS = 32;
77
bytes1 public constant NUM_REQUESTS_MASK = 0x1f;
88
// Maximum number of price feeds per request. This limit keeps gas costs predictable and reasonable. 10 is a reasonable number for most use cases.

target_chains/ethereum/contracts/contracts/pulse/PulseUpgradeable.sol renamed to target_chains/ethereum/contracts/contracts/echo/EchoUpgradeable.sol

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ pragma solidity ^0.8.0;
55
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
66
import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
77
import "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol";
8-
import "./Pulse.sol";
8+
import "./Echo.sol";
99

10-
contract PulseUpgradeable is
10+
contract EchoUpgradeable is
1111
Initializable,
1212
Ownable2StepUpgradeable,
1313
UUPSUpgradeable,
14-
Pulse
14+
Echo
1515
{
1616
event ContractUpgraded(
1717
address oldImplementation,
@@ -33,7 +33,7 @@ contract PulseUpgradeable is
3333
__Ownable_init();
3434
__UUPSUpgradeable_init();
3535

36-
Pulse._initialize(
36+
Echo._initialize(
3737
admin,
3838
pythFeeInWei,
3939
pythAddress,

target_chains/ethereum/contracts/contracts/pulse/IPulse.sol renamed to target_chains/ethereum/contracts/contracts/echo/IEcho.sol

+20-20
Original file line numberDiff line numberDiff line change
@@ -3,38 +3,38 @@
33
pragma solidity ^0.8.0;
44

55
import "@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

Comments
 (0)