πŸ”XaiLocker

Overview

This contract implements basic interactions with XAI infrastructure with some additional integrity checks.

All functions are intended to be called only from the service contract.

This contract uses EIP-7201 to ensure storage integrity using a transparent proxy pattern

Structs

Misc

enum RequestStatus {
    Empty,
    Created,
    Completed,
    Cancelled
}

UnstakeRequest

struct UnstakeRequest {
    address pool;
    uint64 unstakeAfter;
    uint256 poolUnstakeIndex;
    uint128 amount;
    RequestStatus status;
}

RedemptionRequest

LockerInfo

UserInfo

Views

service

balance

This value is used to check the solvency of the contract to perform basic actions.

getUnstakeRequest

getRedemptionRequest

This view returns data from esXAI contract.

getUserRedemptionRequest

This view returns data from locker storage.

Functions

Locking

Lock functions work only with the service contract and assume that when calling the function, the required amount of tokens will be sent in advance. Function signatures contain an unused address value for possible backward compatibility.

lockXaiFor

Solvency check performed inside the XAI infrastructure.

lockEsXaiFor

The function checks that enough tokens have been received by the contract by comparing with the stored internal balance.

Redeeming

Start redemption

This function send esXAI to factory contract and starts redemption process for specified duration.

Cancel redemption

This function cancel specified request and returns esXAI to locker.

Complete redemption

This function completes redemption process with transfer output XAI to specified user.

Staking

Stake

Start unstake

Complete unstake

Claim rewards

Governance

Last updated