First commit

This commit is contained in:
2025-05-13 19:41:33 +02:00
commit 1ec1154796
21 changed files with 7373 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import {AggregatorV3Interface} from "@chainlink/contracts/src/v0.8/shared/interfaces/AggregatorV3Interface.sol";
contract SargaTrxUsdPrice {
AggregatorV3Interface internal _priceFeed;
/**
* Network: Tron
* Aggregator: TRX/USD
* Address: TC6o8AakUg4Xz9nHY9qXpJNsgF7CQkwBqF
*/
constructor(address priceFeedAddress) {
_priceFeed = AggregatorV3Interface(priceFeedAddress);
}
/**
* Returns the latest price
*/
function getLatestPrice() public view returns (int) {
(
,
/* uint80 roundID */ int price /* uint startedAt */ /* uint timeStamp */ /* uint80 answeredInRound */,
,
,
) = _priceFeed.latestRoundData();
return price;
}
}