KeepStake
IManagedGrant
grantee
KeepStake
T network staking contract supports existing KEEP stakes by allowing KEEP stakers to use their stakes in T network and weights them based on KEEP<>T token ratio. KEEP stake owner is cached in T staking contract and used to restrict access to all functions only owner or operator should call. To cache KEEP stake owner in T staking contract, T staking contract first needs to resolve the owner.
Resolving liquid KEEP stake owner is easy. Resolving token grant stake owner is complicated and not possible to do on-chain from a contract external to KEEP TokenStaking contract. Keep TokenStaking knows the grant ID but does not expose it externally.
KeepStake contract addresses this problem by exposing operator-owner mappings snapshotted off-chain based on events and information publicly available from KEEP TokenStaking contract and KEEP TokenGrant contract. Additionally, it gives the Governance ability to add new mappings in case they are ever needed; in practice, this will be needed only if someone decides to stake their KEEP token grant in KEEP network after 2021-11-11 when the snapshot was taken.
Operator-owner pairs were snapshotted 2021-11-11 in the following way:
Fetch all TokenStaking events from KEEP staking contract.
Filter out undelegated operators.
Filter out canceled delegations.
Fetch grant stake information from KEEP TokenGrant for that operator to determine if we are dealing with grant delegation.
Fetch grantee address from KEEP TokenGrant contract.
Check if we are dealing with ManagedGrant by looking for all created ManagedGrants and comparing their address against grantee address fetched from TokenGrant contract.
keepTokenStaking
operatorToManagedGrant
operatorToGrantee
constructor
setManagedGrant
Allows the Governance to set new operator-managed grant pair. This function should only be called for managed grants if the snapshot does include this pair.
setGrantee
Allows the Governance to set new operator-grantee pair. This function should only be called for non-managed grants if the snapshot does include this pair.
resolveOwner
Resolves KEEP stake owner for the provided operator address. Reverts if could not resolve the owner.
resolveSnapshottedManagedGrantees
resolveSnapshottedGrantees
Last updated