You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Razor Network is a decentralized oracle network offering price-feed data to applications. This can be utilized in various actions throughout DeFi and other more general Web3 use cases. Razor is available on the Calypso, Nebula, Titan Mainnet, and Testnets.
Implementation Example
To consume the Razor Network price feeds, your contract should reference ITransparentForwarder. This is an interface that defines the external functions implemented by Data Feeds
// SPDX-License-Identifier: MITpragma solidity^0.8.0;
interfaceITransparentForwarder {
/** * @dev using the hash of collection name, clients can query the result of that collection * @param _name bytes32 hash of the collection name * @return result of the collection and its power */function getResult(bytes32_name) externalpayablereturns (uint256, int8);
}
contractDataFeed {
ITransparentForwarder public transparentForwarder;
uint256public latestResult;
int8public latestPower;
constructor() {
transparentForwarder =ITransparentForwarder(
/* Transparent Forwarder contract address deployed on respective chains */
);
}
/// @notice fetch collection result by name/// @param name bytes32 hash of the collection name/// @return result of the collection and its power/// @return powerfunction getResult(bytes32name) publicpayablereturns (uint256, int8) {
(uint256result, int8power) = transparentForwarder.getResult{
value: msg.value
}(name);
latestResult = result;
latestPower = power;
return (result, power);
}
}
Razor Network
Razor Network is a decentralized oracle network offering price-feed data to applications. This can be utilized in various actions throughout DeFi and other more general Web3 use cases. Razor is available on the Calypso, Nebula, Titan Mainnet, and Testnets.
Implementation Example
To consume the Razor Network price feeds, your contract should reference ITransparentForwarder. This is an interface that defines the external functions implemented by Data Feeds
For more information go to the Razor data feed documentation.
The text was updated successfully, but these errors were encountered: