> For the complete documentation index, see [llms.txt](https://woken-exchange.gitbook.io/wokenexchange/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://woken-exchange.gitbook.io/wokenexchange/tools/sample-erc20-protected-by-timekeeper.md).

# Sample ERC20 protected by Timekeeper

You haven't created your token yet and want to protect it from being transferred when your market is closed with the Woken Exchange's Timekeeper?&#x20;

We provide a free ERC20 template that allows you to protect your token from being transferred when your market is closed on the DEX.

<details>

<summary><mark style="color:blue;">modifier tradingMustBeOpen</mark></summary>

{% code title="exampletoken.sol" %}

```solidity
modifier tradingMustBeOpen() { //to check the trading status on the Woken Exchange
        if (timekeeperEnabled) {
            require(IWokenFactory(wokenFactory).isTradingOpen(pairAddress), "WokenExchange : Trading / Transfer is Closed");
        }
```

{% endcode %}

</details>

\
Of course, you can customize it with the functions you want: name, supply, mint, burn, buy or sell taxes, etc...

{% hint style="success" %}
The WKN, the erc20 token of Woken Exchange, is protected in the same way.
{% endhint %}

### Benefits

* [x] Your **ERC20 is protected** and guaranteed non-transferable (wallet to wallet for example) if your LP's market is closed on the DEX.<br>
* [x] Your **ERC20 is scalable** with its trading hours if you wish to create a new LP on another DEX<br>
* [x] You manage the trading hours on the Woken Exchange [Timekeeper](/wokenexchange/woken-v1-our-solution/timekeeper.md) page, your ERC20 token can only be traded (transferred) at the time you have set, wherever it is.

## How to setup the ERC20 Timekeeper ?

You just have to set your pair address and enable the erc20 timekeeper

### Step 1 : find your pair address

At the creation of your liquidity on Woken Exchange.\
Once you've created your LP, go to Arbiscan and find your Tx.

<figure><img src="/files/gJf2JqB5bSWVN0x2Nfvx" alt=""><figcaption><p>Your Tx after pair creation (example with the WKN token)</p></figcaption></figure>

and click on Woken LP Token (WLP) to open the WLP token details page on Arbiscan to get your pair address

<figure><img src="/files/fWxH1qvRqFEsNIM4JsCI" alt=""><figcaption><p>Pair Address (example with the pair address of the WKN token)</p></figcaption></figure>

### Step 2 : set the pair address on your erc20 token

Now that you have your pair address, go to Arbiscan to set it on your erc20 token

<figure><img src="/files/w9xAK64bdFst0VkYjKMo" alt=""><figcaption><p>add your pair address</p></figcaption></figure>

On your contract token address, go to "contract", "white contract" and "setPairAddress"\
Past here your pair address you get on the step 1 and click on "write" \
(be sure to be connected to your contract address on Arbiscan with the deployer address of your erc20 token)

### Step 3 : enable the erc20 timekeeper

<figure><img src="/files/yYMBS3LXEgHpgGraRqMI" alt=""><figcaption><p>write true</p></figcaption></figure>

Once the pair address has been set on your erc20 token, open "enableTimkeeper" and write "true".\
And click on "Write"

\
**Your erc20 token is now protected by the WokenExchange Timekeeper** \
\
\&#xNAN;*\*the woken factory address is already set to the exampletoken contract constructor, so you don't have to set it.*\
\
If you need some help, do not hesitate to contact the Team on the Discord server, we will help you !

{% embed url="<https://github.com/WokenExchange/example-erc20-token>" %}
