Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Chainlink interface #94

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft

feat: Chainlink interface #94

wants to merge 6 commits into from

Conversation

JordyRo1
Copy link
Contributor

@JordyRo1 JordyRo1 commented Nov 6, 2024

Resolves #76

Addition

  • Add chainlink adapter
  • Set getter in Pragma contract

Copy link

github-actions bot commented Nov 6, 2024

Gas Report Summary

SpotMedian

  • Gas used: 176855
  • Change: ⚪ No change

TWAP

  • Gas used: 269295
  • Change: ⚪ No change

RealizedVolatility

  • Gas used: 292606
  • Change: ⚪ No change

Options

  • Gas used: 384932
  • Change: ⚪ No change

Perpetuals

  • Gas used: 223711
  • Change: ⚪ No change

1 similar comment
Copy link

github-actions bot commented Nov 6, 2024

Gas Report Summary

SpotMedian

  • Gas used: 176855
  • Change: ⚪ No change

TWAP

  • Gas used: 269295
  • Change: ⚪ No change

RealizedVolatility

  • Gas used: 292606
  • Change: ⚪ No change

Options

  • Gas used: 384932
  • Change: ⚪ No change

Perpetuals

  • Gas used: 223711
  • Change: ⚪ No change

Copy link

github-actions bot commented Nov 6, 2024

Gas Report Summary

SpotMedian

  • Gas used: 176855
  • Change: ⚪ No change

TWAP

  • Gas used: 269295
  • Change: ⚪ No change

RealizedVolatility

  • Gas used: 292606
  • Change: ⚪ No change

Options

  • Gas used: 384932
  • Change: ⚪ No change

Perpetuals

  • Gas used: 223711
  • Change: ⚪ No change

1 similar comment
Copy link

github-actions bot commented Nov 6, 2024

Gas Report Summary

SpotMedian

  • Gas used: 176855
  • Change: ⚪ No change

TWAP

  • Gas used: 269295
  • Change: ⚪ No change

RealizedVolatility

  • Gas used: 292606
  • Change: ⚪ No change

Options

  • Gas used: 384932
  • Change: ⚪ No change

Perpetuals

  • Gas used: 223711
  • Change: ⚪ No change

* Users should deploy an instance of this contract to wrap every price feed id that they need to use.
*/
contract PragmaAggregatorV3 {
bytes32 public feedId;

Check warning

Code scanning / Slither

State variables that could be declared immutable

PragmaAggregatorV3.feedId (src/migrations/Chainlink.sol#16) should be immutable
*/
contract PragmaAggregatorV3 {
bytes32 public feedId;
IPragma public pragmaInterface;

Check warning

Code scanning / Slither

State variables that could be declared immutable

PragmaAggregatorV3.pragmaInterface (src/migrations/Chainlink.sol#17) should be immutable
Comment on lines 24 to 32
function updateFeeds(bytes[] calldata priceUpdateData) public payable {
// Update the prices to the latest available values and pay the required fee for it. The `priceUpdateData` data
// should be retrieved from the Theoros SDK, you can find additional information on https://docs.pragmaoracle.com/
uint256 fee = pragmaInterface.getUpdateFee(priceUpdateData);
pragmaInterface.updateDataFeeds{value: fee}(priceUpdateData);

// refund remaining eth
payable(msg.sender).call{value: address(this).balance}("");
}

Check failure

Code scanning / Slither

Functions that send Ether to arbitrary destinations

PragmaAggregatorV3.updateFeeds(bytes[]) (src/migrations/Chainlink.sol#24-32) sends eth to arbitrary user Dangerous calls: - pragmaInterface.updateDataFeeds{value: fee}(priceUpdateData) (src/migrations/Chainlink.sol#28) - address(msg.sender).call{value: address(this).balance}() (src/migrations/Chainlink.sol#31)
solidity/src/migrations/Chainlink.sol Fixed Show fixed Hide fixed
solidity/src/migrations/Chainlink.sol Fixed Show fixed Hide fixed
solidity/src/migrations/Chainlink.sol Fixed Show fixed Hide fixed
Copy link

github-actions bot commented Nov 6, 2024

Gas Report Summary

SpotMedian

  • Gas used: 176855
  • Change: ⚪ No change

TWAP

  • Gas used: 269295
  • Change: ⚪ No change

RealizedVolatility

  • Gas used: 292606
  • Change: ⚪ No change

Options

  • Gas used: 384932
  • Change: ⚪ No change

Perpetuals

  • Gas used: 223711
  • Change: ⚪ No change

1 similar comment
Copy link

github-actions bot commented Nov 6, 2024

Gas Report Summary

SpotMedian

  • Gas used: 176855
  • Change: ⚪ No change

TWAP

  • Gas used: 269295
  • Change: ⚪ No change

RealizedVolatility

  • Gas used: 292606
  • Change: ⚪ No change

Options

  • Gas used: 384932
  • Change: ⚪ No change

Perpetuals

  • Gas used: 223711
  • Change: ⚪ No change

Copy link

github-actions bot commented Nov 6, 2024

Gas Report Summary

SpotMedian

  • Gas used: 176855
  • Change: ⚪ No change

TWAP

  • Gas used: 269295
  • Change: ⚪ No change

RealizedVolatility

  • Gas used: 292606
  • Change: ⚪ No change

Options

  • Gas used: 384932
  • Change: ⚪ No change

Perpetuals

  • Gas used: 223711
  • Change: ⚪ No change

@JordyRo1 JordyRo1 self-assigned this Nov 6, 2024
Copy link

github-actions bot commented Nov 6, 2024

Gas Report Summary

SpotMedian

  • Gas used: 176855
  • Change: ⚪ No change

TWAP

  • Gas used: 269295
  • Change: ⚪ No change

RealizedVolatility

  • Gas used: 292606
  • Change: ⚪ No change

Options

  • Gas used: 384932
  • Change: ⚪ No change

Perpetuals

  • Gas used: 223711
  • Change: ⚪ No change

Copy link

github-actions bot commented Nov 6, 2024

Gas Report Summary

SpotMedian

  • Gas used: 176855
  • Change: ⚪ No change

TWAP

  • Gas used: 269295
  • Change: ⚪ No change

RealizedVolatility

  • Gas used: 292606
  • Change: ⚪ No change

Options

  • Gas used: 384932
  • Change: ⚪ No change

Perpetuals

  • Gas used: 223711
  • Change: ⚪ No change

1 similar comment
Copy link

github-actions bot commented Nov 6, 2024

Gas Report Summary

SpotMedian

  • Gas used: 176855
  • Change: ⚪ No change

TWAP

  • Gas used: 269295
  • Change: ⚪ No change

RealizedVolatility

  • Gas used: 292606
  • Change: ⚪ No change

Options

  • Gas used: 384932
  • Change: ⚪ No change

Perpetuals

  • Gas used: 223711
  • Change: ⚪ No change

solidity/src/migrations/Pyth.sol Fixed Show fixed Hide fixed
solidity/src/migrations/Pyth.sol Fixed Show fixed Hide fixed
solidity/src/migrations/Pyth.sol Fixed Show fixed Hide fixed
solidity/src/migrations/Pyth.sol Fixed Show fixed Hide fixed
solidity/src/migrations/Pyth.sol Fixed Show fixed Hide fixed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dev: chainlink interface
1 participant