oz20Facet

Custom-made version of Open Zeppelin's ERC20 contract. It's the back-bone of the OZL token, holding as well its rebase mechanism.

Github repo here.

Open methods

balanceOf

function balanceOf(address user_) public view returns (uint256);

Whenever this function is called, a new rebase calculation is made, having the Ozel Index as a reference, and giving as an output the user's new OZL balance.

Parameters:

Name
Type
Description

user_

address

Holder of OZL tokens

Return values:

Type
Description

uint256

OZL balance of user_

System methods

burn

function burn(
        address user_, 
        uint amount_,
        uint lockNum_
) external isAuthorized(lockNum_) noReentrancy(4);

Initiates the modification of internal parameters that calculates the redeemed amount per OZL tokens.

It's not a burn mechanism per se since no tokens are taken out of circulation, but rebased between the rest of OZL holders.

Parameters:

Name
Type
Description

user_

address

Owner of the OZL tokens

amount_

uint256

OZL balance to "burn"

lockNum_

uint256

Index of bit that authorizes the call

_transfer

function _transfer( 
        address sender,
        address recipient,
        uint256 amount
) internal;

In conjunction with transferUserAllocation() , it transfers an OZL balance from one user to another.

Parameters:

Name
Type
Description

sender

address

Owner of the OZL balance to send

recipient

address

Receiver of the OZL balance being sent out

amount

uint256

OZL balance to send

Last updated