# Custom Token

The best way for integrating lossless protection into your token contract that has custom functions is to inherit from LERC20.&#x20;

```solidity
import ./LERC20.sol

contract YourCustomToken is LERC20 {
    constructor(
         uint256 totalSupply_,
         string memory name_, 
         string memory symbol_
         address admin_,
         address recoveryAdmin_,
         uint256 timelockPeriod_,
         address lossless_
         ) LERC20(
               totalSupply_,
               name_,
               symbol_,
               admin_,
               recoveryAdmin_,
               timelockPeriod_,
               lossless_) {}
               
   // Your custom function goes here...
}

```

However in cases where you want to modify one of the public functions like:

* `transfer`
* `transferFrom`
* `approve`
* `increaseAllowance`
* `decreaseAllowance`

You must add before modifier to these functions. This modifier must call [lossless controller](/protocol/technical-reference/lossless-controller.md) hook function and forward all of the initial function call parameters. An example of how these modifiers can be found here:

{% embed url="<https://github.com/Lossless-Cash/lossless-v4/blob/master/contracts/utils/first-version/LERC20.sol>" %}
LERC20
{% endembed %}

{% embed url="<https://github.com/Lossless-Cash/lossless-v4/blob/master/contracts/LERC20Burnable.sol>" %}
LERC20Burnable
{% endembed %}

{% embed url="<https://github.com/Lossless-Cash/lossless-v4/blob/master/contracts/LERC20Mintable.sol>" %}
LERC20Mintable
{% endembed %}

{% embed url="<https://github.com/Lossless-Cash/lossless-v4/blob/master/contracts/LERC20MintableBurnable.sol>" %}
LERC20MintableBurnable
{% endembed %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.lossless.io/protocol/guides/lossless-integration-into-the-token/custom-token.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
