Skip to content
This repository was archived by the owner on Dec 14, 2022. It is now read-only.
/ eth-rub-oracle Public archive

🇷🇺 Реализация ETH/RUB оракула на блокчейне Ethereum.

License

Notifications You must be signed in to change notification settings

gulitsky/eth-rub-oracle

Repository files navigation

ETH/RUB оракул

Solidity 0.4.23 Лицензия MIT

Реализация ETH/RUB оракула на блокчейне Ethereum; для работы с API Cryptonator используется Oraclize.

Пример использования

pragma solidity ^0.4.23;

interface ETHRUBOracle {
    function price() public view returns (uint);
    function updatedAt() public view returns (uint);
    function update(uint delay) public payable;
    function isOutOfSync() public view returns (bool);
}

contract ETHToRUBConverter {
    ETHRUBOracle internal priceOracle;

    function constructor(address priceOracleAddress) public {
        priceOracle = ETHRUBOracle(priceOracleAddress);
    }

    function convert(uint amountInEther) public view returns (uint) {
        require(!priceOracle.isOutOfSync());
        return amountInEther * priceOracle.price();
    }
}

About

🇷🇺 Реализация ETH/RUB оракула на блокчейне Ethereum.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published