pno sub-class
The following readme describes all the functions and their parameters exposed by the pno
class of the K2 SDK. This sub-class contains all the important functions from the PNO registry and Lien contracts of the K2 Lending protocol.
onDelegatedRecipientSet function
Handle the case where delegated recipient is being adjusted to make sure no redelegations remain when lien is in force.
Input Parameters
currentRecipient: Address of the current recipient
Using onDelegatedRecipientSet function
Return Parameters
Transaction details if the transaction was successful.
onSBPUpdated function
Poke the PNO registry to allow it to check whether kNetwork is mapped to current SBP.
Input Parameters
debtor: ETH address of the debtor
Using onSBPUpdated function
Return Parameters
Transaction details if the transaction was successful.
createKNetwork function
SBP owner can call this function to spin up their own kNetwork which will take care of deploying a fund splitter.
Input Parameters
defaultRewardToken: Address of the default reward token
Using createKNetwork function
Return Parameters
Transaction details if the transaction was successful.
banNodeOperator function
Allows the lien contract to ban a node operator in the event that a PNO has severely violated protocol rules.
Input Parameters
sbpIndexId: SBP index in string
pno: Address of the PNO
Using banNodeOperator function
Return Parameters
Transaction details if the transaction was successful.
managePNO function
Allows the DAO to manage the global PNO inclusion list.
Input Parameters
pno: Address of the PNO
enabled: Boolean value, true if enabled
Using managePNO function
Return Parameters
Transaction details if the transaction was successful.
removePNO function
Allow a SBP owner to use a PNO from the global inclusion list in their kNetwork.
Input Parameters
pno: Address of the PNO
Using removePNO function
Return Parameters
Transaction details if the transaction was successful.
togglePNOGatekeepingForKNetwork function
Allow a kNetwork to enable PNO gatekeeping for their network before and after network creation.
Using togglePNOGatekeepingForKNetwork function
Return Parameters
Transaction details if the transaction was successful.
manageKNetworkInclusionList function
Allow a kNetwork that has gatekeeping enabled to manage inclusion list for the opt in to work.
Input Parameters
PNOs: Array of all PNO addresses enabled: Boolean value, true if enabled
Using manageKNetworkInclusionList function
Return Parameters
Transaction details if the transaction was successful.
optIntoKNetwork function
Lets the PNO to opt into node running for a kNetwork.
Input Parameters
sbpIndexId: SBP index in string
Using optIntoKNetwork function
Return Parameters
Transaction details if the transaction was successful.
optOutOfKNetwork function
Lets the PNO to opt out of node running for a kNetwork.
Input Parameters
sbpIndexId: SBP index in string
Using optOutOfKNetwork function
Return Parameters
Transaction details if the transaction was successful.
setPNOPayoutRecipient function
Allow PNO to set their payout recipient across all kNetwork payout processing fund splitter contracts.
Input Parameters
payoutRecipient: Address of the payout recipient
Using setPNOPayoutRecipient function
Return Parameters
Transaction details if the transaction was successful.
reDelegateToPreferredNodeOperator function
Re-delegate K2 re-staked balance to a PNO using K2 LP balance.
Input Parameters
pno: Address of the PNO
amount: Restaked balance to be re-delegated
Using reDelegateToPreferredNodeOperator function
Return Parameters
Transaction details if the transaction was successful.
removeRedelegation function
Remove the re-delegation given to a PNO by a K2 LP balance and obtain K2 LP back.
Input Parameters
pno: Address of the PNO
amount: Re-delegated amount to be obtained back
Using removeRedelegation function
Return Parameters
Transaction details if the transaction was successful.
reDelegateToPreferredNodeOperatorFromNativeDelegation function
Re-delegate K2 re-staked balance to a PNO using K2 native delegation balance.
Input Parameters
pno: Address of the PNO
amountToRedelegateInETH: Amount to be re-delegated in ETH
Using reDelegateToPreferredNodeOperatorFromNativeDelegation function
Return Parameters
Transaction details if the transaction was successful.
removeRedelegationFromNativeDelegation function
Remove re-delegation from a PNO that was given from a native delegation K2 balance.
Input Parameters
pno: Address of the PNO
amountToRedelegateInETH: Re-delegated amount to be obtained back
Using removeRedelegationFromNativeDelegation function
Return Parameters
Transaction details if the transaction was successful.
totalReDelegationsInETHToPNO function
Query function to get total re-delegations to PNO in ETH.
Input Parameters
user: ETH address of the user
pno: Address of the PNO
Using totalReDelegationsInETHToPNO function
Return Parameters
Returns the total re-delegated amount in bigint.
totalReDelegationsInETHToPNOForTimestamp function
Query function to get total re-delegations to PNO in ETH for the given timestamp.
Input Parameters
user: ETH address of the user
pno: Address of the PNO
timestamp: The timestamp value in string
Using totalReDelegationsInETHToPNOForTimestamp function
Return Parameters
Returns the total re-delegated amount in bigint.
isPreferredNodeOperator function
To check if the PNO is eligible to receive liquid re-delegations.
Input Parameters
pno: Address of the PNO
Using isPreferredNodeOperator function
Return Parameters
Returns true if the PNO is eligible, else false.
onNodeOperatorWithdraw function
Check the active re-delegations before allowing the node operator to remove their native delegation.
Input Parameters
user: ETH address of the user.
Using onNodeOperatorWithdraw function
Return Parameters
Transaction details if the transaction was successful.
configureDesignatedVerifierAsKNetwork function
Allow a kNetwork to specify the public key of their PNO designated verifier for slashing.
Input Parameters
designatedVerifier: Address of the PNO designated verifier
Using configureDesignatedVerifierAsKNetwork function
Return Parameters
Transaction details if the transaction was successful.
slashPNO function
Slash the given PNO.
Input Parameters
kNetwork: Address of the kNetwork
reportIdentifier: Nonce for the report
pno: Address of the PNO
amount: The slash amount in string
designatedVerifierSignature: List of verifier signatures of the format SignatureECDSAT (defined in the K2-SDK) for the respective BLS public keys
deadline: Deadline for the validity of the signatures
liquidDelegators: Array of all the liquid delegators
Using slashPNO function
Return Parameters
Transaction details if the transaction was successful.
onSBPUpdatedLien function
Poke the Lien to allow it to check whether kNetwork is mapped to current SBP.
Input Parameters
debtor: ETH address of the debtor
Using onSBPUpdatedLien function
Return Parameters
Transaction details if the transaction was successful.
isValidReport function
Check if the given report is valid.
Input Parameters
kNetwork: Address of the kNetwork
reportIdentifier: Nonce for the report
pno: Address of the PNO
amount: The slash amount in string
designatedVerifierSignature: List of verifier signatures of the format SignatureECDSAT (defined in the K2-SDK) for the respective BLS public keys
deadline: Deadline for the validity of the signatures
Using isValidReport function
Return Parameters
Return true if the report is valid, else false.
reportTypedHash function
Get the typed hash of the given report.
Input Parameters
kNetwork: Address of the kNetwork
reportIdentifier: Nonce for the report
pno: Address of the PNO
amount: The slash amount in string
deadline: Deadline for the validity of the signatures
Using reportTypedHash function
Return Parameters
Returns the 32-byte hash of the report.
claimKETH function
This function allows claiming K2 yield on undelegated balance for liquid delegations to kNetworks.
Using claimKETH function
Return Parameters
Transaction details if the transaction was successful.
claimLockedKETH function
This functions allows a user with no more liquid delegations to claim any locked kETH.
Using claimLockedKETH function
Return Parameters
Transaction details if the transaction was successful.