OCR_Modular.sol

OCR -> On-Chain Redemption

Introduction

OCR stands for "On-Chain Redemption".

This locker is responsible for handling redemptions of tranche tokens to stablecoins.

State Variables

Type
Name
Description

address

GBL

The ZivoeGlobals contract.

address

stablecoin

The stablecoin redeemable in this contract.

uint256

epoch

The timestamp of current epoch.

uint256

epochDiscountJunior

Redemption discount for $zJTT (junior tranche).

uint256

epochDiscountSenior

Redemption discount for $zSTT (senior tranche).

uint256

redemptionsAllowedJunior

Redemptions allowed for $zJTT (junior tranche).

uint256

redemptionsAllowedSenior

Redemptions allowed for $zSTT (senior tranche).

uint256

redemptionsFeeBIPS

Fee for redemptions (in BIPS).

uint256

redemptionsQueuedJunior

Redemptions queued for $zJTT (junior tranche).

uint256

redemptionsQueuedSenior

Redemptions queued for $zSTT (senior tranche).

uint256

requestCounter

Increments with new requests.

uint256

BIPS

Private constant, 10000

uint256

RAY

Private constant, 10**27

mapping(uint256 => Request)

requests

Mapping of all requests.

Request

This struct stores information for redemptions requests.

Type
Variable
Description

address

account

The account making the request

uint256

amount

The amount of the request ($zSTT and $zJTT)

uint256

unlocks

The timestamp after which this request may be processed

bool

seniorElseJunior

The tranche this request is for (true = Senior, false = Junior)

Sections

Read Functions

Write Functions

Events

Read Functions

canPush()

Permission for owner to call pushToLocker(). See ZivoeLocker.sol

canPull()

Permission for owner to call pullFromLocker(). See ZivoeLocker.sol

canPullPartial()

Permission for owner to call pullFromLockerPartial(). See ZivoeLocker.sol

Write Functions

pushToLocker()

This pulls capital from the DAO.

Type
Name
Description

address

asset

The asset to pull from the DAO.

uint256

amount

The amount of asset to pull from the DAO.

bytes

data

Accompanying transaction data.

pullFromLocker()

Migrates entire ERC20 balance from locker to owner().

Type
Name
Description

address

asset

The asset to migrate.

bytes

data

Accompanying transaction data.

pullFromLockerPartial()

Migrates specific amount of ERC20 from locker to owner().

Type
Name
Description

address

asset

The asset to migrate.

uint256

amount

The amount of "asset" to migrate.

bytes

data

Accompanying transaction data.

createRequest()

Creates a redemptions request.

Type
Name
Description

uint256

amount

The amount to deposit for the request.

uint256

seniorElseJunior

he tranche to deposit for (true = Senior, false = Junior).

Emits the RequestCreated() event

destroyRequest()

Destroys a redemption request.

Type
Name
Description

uint256

id

The ID of the request to destroy.

Emits the RequestDestroyed() event

processRequest()

Processes a redemption request.

Type
Name
Description

uint256

id

The ID of the request to process.

Emits the RequestProcessed() event

tickEpoch()

This function will start a new epoch.

Emits the EpochTicked() event

updateRedemptionsFeeBIPS()

Updates the state variable "redemptionFeeBips".

Type
Name
Description

uint256

_redemptionsFee

The new value for redemptionsFeeBIPS (in BIPS).

Emits the UpdatedRedemptionsFeeBIPS() event

Events

EpochTicked()

Emitted during tickEpoch()

Type
Indexed
Name
Description

uint256

False

epoch

The timestamp of the start of this epoch.

uint256

False

redemptionsAllowedJunior

Redemptions allowed for $zJTT (junior tranche) for this epoch.

uint256

False

redemptionsAllowedSenior

Redemptions allowed for $zSTT (senior tranche) for this epoch.

uint256

False

epochDiscountJunior

Redemption discount for $zJTT (junior tranche) for this epoch.

uint256

False

epochDiscountSenior

Redemption discount for $zSTT (senior tranche) for this epoch.

RequestCreated()

Emitted during createRequest()

Type
Indexed
Name
Description

uint256

True

id

The ID of the request created.

address

True

account

The account creating a request.

uint256

False

amount

The amount deposited for the request ($zJTT or $zSTT).

bool

True

seniorElseJunior

The tranche deposited for (true = Senior, false = Junior).

RequestDestroyed()

Emitted during destroyRequest()

Type
Indexed
Name
Description

uint256

True

id

The ID of the request destroyed.

address

True

account

The account destroying the request.

uint256

False

amount

The amount returned from the request ($zJTT or $zSTT).

bool

True

seniorElseJunior

The tranche deposited for (true = Senior, false = Junior).

RequestProcessed()

Emitted during processRequest()

Type
Indexed
Name
Description

uint256

True

id

The ID of the request processed.

address

True

account

The account receiving the redeemed tokens.

uint256

False

burnAmount

The amount of tranche tokens ($zJTT or $zSTT) burned from the request.

uint256

False

redeemAmount

The amount reddeemed from the processed request.

bool

True

seniorElseJunior

The tranche deposited for (true = Senior, false = Junior).

UpdatedRedemptionsFeeBIPS()

Emitted during OCR_Modular.sol

Type
Indexed
Name
Description

address

True

newOCT

The new OCT_YDL contract.

address

True

oldOCT

The old OCT_YDL contract.

Last updated