KUB Docs
  • Introduction to KUB
  • Connect to KUB
  • KUB PoS
    • Increase block gas limit to 90M
    • Update GasPrice Instruction
    • Incident from chaophaya hardfork
    • Overview
    • Considerations
    • Validator Node
      • Node Requirements
      • Run Validator Node
      • Validator Staking
      • StakeManager Contract
      • ValidatorShare Contract
      • Slashing
    • Run Full Node
    • Run Archive Node
    • Chaindata Snapshot
    • Migration PoSA to PoS
    • Delegator
      • How to delegate
      • How to claim reward
      • How to unstake
    • Lausanne Upgrade
  • Developer Center
    • ✨Getting Started
    • 🏆Project Tiers
    • 👨‍💻Connect Bitkub NEXT to register as a new user
    • ✔️Verify your identity via Bitkub NEXT (KYC or KYB)
    • 💰Subscribe to the KUB Developer Package
    • 🗳️Submit your project
      • 📗Create submit project
      • 📘Manage your project
        • Submit project
        • Create a new project version
        • Status of project version
      • 📙Manage project information
  • KUB SDK
    • NEXT SDK
      • NEXT SDK Code Cookbook
      • KUB SDK Compatible Smart Contract
        • Example Smart Contract for Testing
        • Example KUB SDK Compatible KAP20 Smart Contract
        • Example KUB SDK Compatible KAP721 Smart Contract
  • KUB Playground
    • Quick Start Guide on KUB Playground
  • KUB Layer 2
  • KUB Scan
  • RPC Service
    • JSON-RPC Endpoint
  • IPFS Service
    • IPFS Guideline
  • FAQ
  • Glossary
  • Reference and Service
    • KUB Whitepaper Version 3.3
    • Technical Paper Version 3.2
    • KUB Explorer
    • KUB Faucet
    • KUB Oracle
    • KUB Bridge
    • KKUB OTP
Powered by GitBook
On this page
  • What is ValidatorShare Contract?
  • Functions
  • Delegate
  • Undelegate
  • ClaimRewards

Was this helpful?

  1. KUB PoS
  2. Validator Node

ValidatorShare Contract

What you should know about ValidatorShare Contract?

PreviousStakeManager ContractNextSlashing

Last updated 3 months ago

Was this helpful?

What is ValidatorShare Contract?

The ValidatorShare contract is the core of the delegation mechanism of the KUB network. All delegation-related actions that users can interact with can be executed through this contract. In this contract, it's possible to delegate, undelegate, and claim your reward.

A ValidatorShare contract is created when a node validator is staked with the ValidatorShareFactory contract by the StakeManager contract. It is not intended to hold any funds through its own capabilities. The ValidatorShare contract can be replaced as it is merely an implementation, with the data and funds located in other contracts.

Functions

including the following function:

Delegate

delegate() payable
  • payable - Native KUB required.

This method requires native KUB to be sent as a value along with the transaction that calls this method.

This function can only be called when the delegation flag in the ValidatorShare contract is set to true.

Upon delegation, a KAP20 token of the ValidatorShare contract will be minted in the same amount as the delegated amount to the sender. The KAP20 token is the proof of ownership of the sender’s shares in the contract. It can be transferred and has the same standard functionality as other KAP20 tokens.

When this function is called, the ValidatorShare contract’s states will be updated, and the pending reward of the sender will be sent to the sender. The sender's final total delegated amount (original delegated amount plus newly delegated amount) must be more than or equal to the minimum delegated amount. The funds will be sent to the StakeManagerVault contract.

Undelegate

undelegate(uint256 claimAmount)

Upon calling this function, the ValidatorShare contract’s states will be updated, and the pending reward of the sender will be sent to the sender.

The maximum value of the claimAmount argument is the balance of the sender's KAP20 ownership token, and it cannot be 0.

In the case where the final total delegated amount (the balance of the sender's ownership token as deduced by the claimAmount argument) is less than the minimum delegated amount, the value of the claimAmount argument will be adjusted to the sender's ownership token balance, meaning all shares of the sender will be undelegated. The ownership token will be burnt (removed from existence, and the total supply decreased) according to the claimAmount argument, which may have been adjusted. The funds will be sent from the StakeManagerVault contract to the sender.

ClaimRewards

claimRewards()
  • claimRewards- Upon calling this function, the ValidatorShare contract’s states will be updated, and the pending reward of the sender will be sent to the sender.

claimAmount - The amount of native KUB in unit that will be retrieved from the ValidatorShare contract.

Delegate
Undelegate
ClaimRewards
wei