Smart Contract Integration
This document provides a high-level overview for developers who intend to integrate directly with the Noderr Protocol's smart contracts. Direct smart contract integration is a powerful method for building deeply integrated applications, but it requires a thorough understanding of the protocol's on-chain architecture.
Prerequisites
To begin integrating with the Noderr smart contracts, a developer will require the following:
- A Web3 Development Environment: A development environment such as Hardhat or Truffle is necessary for compiling, testing, and deploying smart contracts.
- Noderr Smart Contract ABIs: The Application Binary Interfaces (ABIs) for the Noderr smart contracts are available in the Smart Contract Interfaces section.
- Noderr Contract Addresses: The deployed addresses for the Noderr smart contracts on supported networks can be found on the Contract Addresses page.
Common Use Cases
Direct smart contract integration enables a wide range of use cases, which can be broadly categorized into data retrieval and state-changing interactions.
Reading Data from the Protocol
Data can be read from the Noderr smart contracts without incurring gas fees by calling view or pure functions. Common data points to read include:
- Vault balances and historical APYs
- Accrued staking rewards for a given address
- The current status and voting results of a governance proposal
- The TrustFingerprint™ score for a specific node operator
Sending Transactions to the Protocol
To alter the state of the protocol, transactions must be sent to the Noderr smart contracts. These transactions require gas fees to be paid. Common state-changing interactions include:
- Depositing capital into and withdrawing capital from yield vaults
- Staking and unstaking NODR tokens
- Casting votes on active governance proposals
Code Examples
For detailed code examples in JavaScript, Solidity, and Python, please refer to the Code Examples section of the developer documentation.