usingtellorlayer
v1.3.0
Published
[](https://github.com/tellor-io/UsingTellorLayer/actions/workflows/tests.yml)
Readme
UsingTellorLayer
Use this package to install the Tellor user contracts and test helper functions, and to integrate Tellor into your contracts.
Contents
contracts/interfaces/ITellorDataBridge.sol- The TellorDataBridge interfacecontracts/testing/TellorLab.sol- A testing contract for rapid prototyping with Tellor oracle datacontracts/interfaces/ITellorDataBank.sol- The TellorDataBank interface, a standard interface for reading tellor datacontracts/bridge/TellorDataBridge.sol- The TellorDataBridge contractsrc/helpers/evmHelpers.js- Helper functions for testing
How to Use
Use this package with your own npm project. See the SampleLayerUser repo for usage examples.
Install
npm install usingtellorlayerUsage
import "usingtellorlayer/contracts/interfaces/ITellorDataBridge.sol";
contract PriceContract {
ITellorDataBridge public dataBridge;
uint256 public price;
constructor(address _dataBridge) {
dataBridge = ITellorDataBridge(_dataBridge);
}
function updateOracleData(
OracleAttestationData calldata _attestData,
Validator[] calldata _currentValidatorSet,
Signature[] calldata _sigs
) public {
// verify that data came from tellor chain
dataBridge.verifyOracleData(_attestData, _currentValidatorSet, _sigs);
// NOTE: This is a simplified example. More security checks should be done
// in production to ensure data integrity.
price = abi.decode(_attestData.report.value, (uint256));
}
}Addresses:
Find Tellor contract addresses here.
Testing this Repo
Open a terminal and run:
git clone https://github.com/tellor-io/UsingTellorLayer.git
cd UsingTellorLayer
npm i
npx hardhat testSecure Integrations
For secure integrations, refer to the tellor docs. Also, see example integrations in the SampleLayerUser repo.
Maintainers
@themandalore @brendaloya
How to Contribute
Check out our issues log here on Github out in our Discord
Contributors
This repository is maintained by the Tellor team - www.tellor.io
Copyright
Tellor Inc. 2025
