# XdYe Maker

XdYe Maker is the contract that converts trading fees generated by XdYe Platform to XdYe Tokens in order to reward XdYe holders that deposit their XdYe in XdYe Bar.&#x20;

In other words, rewards those who are holding xXdYe. In order to understand that concept check out [xdye-bar](https://rogercapone.gitbook.io/xdye-documentation/smart-contracts/xdye-bar "mention") diagram.

**XdYe Maker** Smart Contract can be found at:&#x20;

{% embed url="<https://github.com/rogerCapone/XdYe_Smart_Contracts/blob/main/XdYeMaker.sol>" %}
XdYe Bar Contract Source Code
{% endembed %}

### Contract main functions

* *`convert()`*

This method allows to convert generated LPs from XdYe platform to XDYE, those will be send to XdYe Bar Contract. This method calculates the ETH value and burns the generated LPs.

* *`_toWETH()`*

This method calculates the amount of ETH corresponding to a token address.

* *`_toXDYE()`*

This method converts a certain token to XdYe Token.

* *`_safeTransfer()`*

This method allows to check and verify transfer can be made, according to contract balance.

{% hint style="warning" %}
**Attention:** If you are trying to replicate the code, be sure to consider the imports or visit the corresponding [Github Repository](https://github.com/rogerCapone/XdYe_Smart_Contracts/tree/main) in order to have the whole source code.
{% endhint %}
