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, |
uint256 | RAY | Private constant, |
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
canPush() - Permission for owner to call
pushToLocker()
. See ZivoeLocker.solcanPull() - Permission for owner to call
pullFromLocker()
. See ZivoeLocker.solcanPullPartial() - Permission for owner to call
pullFromLockerPartial()
. See ZivoeLocker.sol
pushToLocker() - This pulls capital from the DAO.
pullFromLocker() - Migrates entire ERC20 balance from locker to
owner()
.pullFromLockerPartial() - Migrates specific amount of ERC20 from locker to
owner()
.createRequest() - Creates a redemptions request.
destroyRequest() - Destroys a redemption request.
processRequest() - Processes a redemption request.
tickEpoch() - This function will start a new epoch.
updateRedemptionsFeeBIPS() - Updates the state variable "redemptionFeeBips".
Read Functions
canPush()
canPush()
Permission for owner to call pushToLocker()
. See ZivoeLocker.sol
canPull()
canPull()
Permission for owner to call pullFromLocker()
. See ZivoeLocker.sol
canPullPartial()
canPullPartial()
Permission for owner to call pullFromLockerPartial()
. See ZivoeLocker.sol
Write Functions
pushToLocker()
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()
pullFromLocker()
Migrates entire ERC20 balance from locker to owner()
.
Type | Name | Description |
---|---|---|
address | asset | The asset to migrate. |
bytes | data | Accompanying transaction data. |
pullFromLockerPartial()
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()
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()
destroyRequest()
Destroys a redemption request.
Type | Name | Description |
---|---|---|
uint256 | id | The ID of the request to destroy. |
Emits the RequestDestroyed() event
processRequest()
processRequest()
Processes a redemption request.
Type | Name | Description |
---|---|---|
uint256 | id | The ID of the request to process. |
Emits the RequestProcessed() event
tickEpoch()
tickEpoch()
This function will start a new epoch.
Emits the EpochTicked() event
updateRedemptionsFeeBIPS()
updateRedemptionsFeeBIPS()
Updates the state variable "redemptionFeeBips".
Type | Name | Description |
---|---|---|
uint256 | _redemptionsFee | The new value for redemptionsFeeBIPS (in BIPS). |
Emits the UpdatedRedemptionsFeeBIPS() event
Events
EpochTicked()
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()
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()
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()
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()
UpdatedRedemptionsFeeBIPS()
Emitted during #updateredemptionsfee
Type | Indexed | Name | Description |
---|---|---|---|
address | True | newOCT | The new OCT_YDL contract. |
address | True | oldOCT | The old OCT_YDL contract. |
Last updated