OCR_Modular.sol
OCR -> On-Chain Redemption
Last updated
OCR -> On-Chain Redemption
Last updated
OCR stands for "On-Chain Redemption".
This locker is responsible for handling redemptions of tranche tokens to stablecoins.
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
requests
Mapping of all requests.
This struct stores information for redemptions requests.
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)
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
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".
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
pushToLocker()
This pulls capital from the DAO.
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()
.
address
asset
The asset to migrate.
bytes
data
Accompanying transaction data.
pullFromLockerPartial()
Migrates specific amount of ERC20 from locker to owner()
.
address
asset
The asset to migrate.
uint256
amount
The amount of "asset" to migrate.
bytes
data
Accompanying transaction data.
createRequest()
Creates a redemptions request.
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.
uint256
id
The ID of the request to destroy.
Emits the RequestDestroyed() event
processRequest()
Processes a redemption request.
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".
uint256
_redemptionsFee
The new value for redemptionsFeeBIPS (in BIPS).
Emits the UpdatedRedemptionsFeeBIPS() event
EpochTicked()
Emitted during tickEpoch()
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()
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()
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()
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 #updateredemptionsfee
address
True
newOCT
The new OCT_YDL contract.
address
True
oldOCT
The old OCT_YDL contract.
mapping(uint256 => )