Skip to main content

ULXMirrorWorld (xULX)

The ULXMirrorWorld contract is used for wrapping/unwrapping your ULX from/to xULX. The xULX token is then used in governance, and to take part in the distribution of fees that come from the protocol.

The full contract can be found here.

State-Changing Functions

enter

function enter(uint256 _amount) public;

Allows a user to deposit ULX tokens into the contract in exchange for xULX tokens.

  • msg.sender should have already given the contract an allowance of at least _amount of ULX tokens.
  • The number of xULX tokens minted depends on the current ULX to xULX ratio, which can change over time.

Parameters

NameTypeDescription
_amountuint256number of ULX tokens to deposit

Returns

This function doesn't return any values.

Reverts

This function reverts if the transfer of ULX tokens from msg.sender to the contract fails.

Modifiers

This function doesn't use any modifiers.

Functions called

This function calls the _mint function of the ERC20 standard and the transferFrom function of the ULX token contract.


leave

function leave(uint256 _share) public;

Allows a user to burn xULX tokens in exchange for ULX tokens.

  • The number of ULX tokens returned depends on the current ULX to xULX ratio, which can change over time.

Parameters

NameTypeDescription
_shareuint256number of xULX tokens to burn

Returns

This function doesn't return any values.

Reverts

This function reverts if the burn of xULX tokens from msg.sender or the transfer of ULX tokens to msg.sender fails.

Modifiers

This function doesn't use any modifiers.

Functions called

This function calls the _burn function of the ERC20 standard and the transfer function of the ULX token contract.