Core Contracts

This document provides a detailed overview of the Noderr Protocol's core smart contracts, including their public interfaces and functions.


Vaults

For deployed contract addresses, see Contract Addresses.

Functions

  • deposit(uint256 amount): Deposits the specified amount of the underlying asset into the vault.
  • withdraw(uint256 amount): Initiates the withdrawal of the specified amount of vault tokens.
  • claim(): Claims withdrawn funds after the 21-day unstaking period.

StakingManager

Functions

  • stake(uint256 amount): Stakes the specified amount of NODR tokens.
  • unstake(uint256 amount): Initiates the unstaking of the specified amount of NODR tokens.
  • claimRewards(): Claims accumulated staking rewards.

TrustFingerprint

Functions

  • getScore(address user): Returns the TrustFingerprint score for the specified user.
  • updateScore(address user, uint256 newScore): (Guardian/Oracle only) Updates the score for the specified user.

Governance

Functions

  • propose(...): Submits a new governance proposal.
  • castVote(uint256 proposalId, bool support): Casts a vote on the specified proposal.
  • execute(uint256 proposalId): Executes a passed proposal.

ApprovedApplicantRegistry

For deployed contract address, see Contract Addresses.

Overview

The ApprovedApplicantRegistry is a critical infrastructure component designed to solve the "chicken-and-egg" problem for new node operators. To register as a node operator, an applicant needs a TrustFingerprint™ score, but they can only build a score by running a node. This contract provides a secure and governed on-ramp for pre-vetted applicants to join the network with an initial TrustFingerprint™ score and a grace period to establish their operational history.

This mechanism is essential for bootstrapping the network, allowing the protocol to controllably grow its operator base without compromising on quality or security.

Key Features

  • Pre-Approval Workflow: Admins with the APPROVER_ROLE can add applicants who have been vetted through an off-chain process (e.g., a Typeform application) to the registry.
  • Initial Score Assignment: Upon claiming their approval, applicants are assigned an initial TrustFingerprint™ score based on the tier they were approved for. These scores are set just above the minimum threshold for each tier, allowing them to begin operations immediately.
  • Grace Period: A configurable grace period (defaulting to 30 days) is automatically initiated when an applicant claims their approval. During this period, the new operator is protected from certain penalties, giving them time to set up their infrastructure and build an organic TrustFingerprint™ score.
  • Sybil Resistance: Each approval is tied to a unique wallet address and a unique application ID, and can only be claimed once, preventing a single entity from creating multiple nodes through this bootstrap mechanism.
  • Governance Control: The contract is managed by roles, allowing for decentralized control over who can approve applicants, update contract settings, and extend grace periods.

How It Works

  1. Application: A prospective node operator submits an application through an off-chain channel (e.g., a Typeform on the Noderr website).
  2. Vetting: The Noderr team or a delegated committee reviews the application. Factors may include technical expertise, hardware specifications, and commitment to the protocol.
  3. Approval: If the applicant is approved, an admin with APPROVER_ROLE calls the addApprovedApplicant() function, recording the applicant's wallet address, approved tier, and a unique application ID on-chain.
  4. Claim: The applicant calls the claimApproval() function from their approved wallet. This action:
    • Verifies their approval status.
    • Assigns them an initial TrustFingerprint™ score for all six components (Uptime, Quality, Governance, History, Peer, Stake).
    • Starts their 30-day grace period.
    • Marks the approval as claimed.
  5. Onboarding: The new operator can now register their node in the NodeRegistry, stake NODR, and begin performing work on the network, building their organic TrustFingerprint™ score.
  6. Grace Period End: After the grace period, the operator is subject to the same performance monitoring and slashing conditions as all other operators.

Core Functions

Approver Functions

  • addApprovedApplicant(address wallet, UtilityNFT.NodeTier tier, string calldata applicationId): Adds a new applicant to the registry. (Requires APPROVER_ROLE)
  • batchAddApprovedApplicants(...): Adds multiple applicants in a single transaction for gas efficiency. (Requires APPROPER_ROLE)
  • revokeApproval(address wallet, string calldata reason): Revokes an existing, unclaimed approval. (Requires APPROVER_ROLE)

Applicant Functions

  • claimApproval(): Called by the applicant to receive their initial score and start their grace period.

Governance Functions

  • extendGracePeriod(address operator, uint256 extension, string calldata reason): Extends the grace period for a specific operator. (Requires APPROVER_ROLE)
  • setInitialScores(...): Updates the default initial scores for each tier. (Requires DEFAULT_ADMIN_ROLE)
  • setGracePeriodDuration(uint256 newDuration): Adjusts the length of the grace period. (Requires DEFAULT_ADMIN_ROLE)

View Functions

  • isApproved(address wallet): Checks if a wallet is approved and has not yet claimed.
  • isInGracePeriod(address operator): Checks if an operator is currently within their grace period.
  • getRemainingGracePeriod(address operator): Returns the time remaining in an operator's grace period.

results matching ""

    No results matching ""