Created
January 13, 2023 14:10
-
-
Save jO-Osko/2a2883fb08da0ae59038d37b64c75482 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.6; | |
import { IFtso } from "@flarenetwork/flare-periphery-contracts/coston/ftso/userInterfaces/IFtso.sol"; | |
import { IPriceSubmitter } from "@flarenetwork/flare-periphery-contracts/coston/ftso/userInterfaces/IPriceSubmitter.sol"; | |
import { IFtsoRegistry } from "@flarenetwork/flare-periphery-contracts/coston/ftso/userInterfaces/IFtsoRegistry.sol"; | |
contract SimpleFtsoExample { | |
function getPriceSubmitter() public virtual view returns(IPriceSubmitter) { | |
return IPriceSubmitter(0x1000000000000000000000000000000000000003); | |
} | |
function getTokenPriceWei(string memory foreignTokenSymbol) public view returns(uint256 _price, uint256 _timestamp) { | |
IFtsoRegistry ftsoRegistry = IFtsoRegistry(address(getPriceSubmitter().getFtsoRegistry())); | |
(_price, _timestamp) = ftsoRegistry.getCurrentPrice(foreignTokenSymbol); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment