> For the complete documentation index, see [llms.txt](https://venom-docs.gitbook.io/knowledge-base/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://venom-docs.gitbook.io/knowledge-base/build/development-guides/how-to-create-your-own-fungible-tip-3-token/venom-in-action.-ways-of-code-enhancing.md).

# Venom In Action. Ways of code enhancing

Let's go over some best practice point, that will helps us to enhance a code we have. As you remember we have some tvm.rawReserve calls, like

```solidity
tvm.rawReserve(1 ever, 0);
```

Moving that gas constants to standalone library is a good form. Same for external calling:

```solidity
ITokenRoot(distributedTokenRoot).deployWallet {
    value: 0.2 ever,
    flag: 1,
    callback: Tokensale.onTokenWallet
}
(
    address(this),
    0.1 ever
);
```

Just create some library:

{% code title="TokensaleGas.sol" lineNumbers="true" %}

```solidity
pragma ever-solidity >= 0.61.2;

library TokensaleGas {
    uint128 constant INITIAL_BALANCE                                  = 0.7  ever;
    uint128 constant DEPLOY_EMPTY_WALLET_VALUE                        = 0.2  ever;
}
```

{% endcode %}

So that allow you to easily change gas variables for you contract

{% code title="Tokensale.sol" lineNumbers="true" %}

```solidity
pragma ever-solidity >= 0.61.2;
...
import "./gas/TokensaleGas.sol"

contract Tokensale {
...
        constructor(
                address distributedTokenRoot,
                uint256 supply,
                uint128 rate,
                address sendRemainingGasTo
            ) public {
                tvm.accept();
                tvm.rawReserve(TokesaleGas.INITIAL_BALANCE, 0);
...
                ITokenRoot(distributedTokenRoot).deployWallet {
                    value: TokesaleGas.DEPLOY_EMPTY_WALLET_VALUE,
                    flag: 1,
                    callback: Tokensale.onTokenWallet
                } (
                    address(this),
                    0.1 ever // create a constant for this variable too :)
                );
```

{% endcode %}

You can accept same idea for an error codes:

{% code title="TokensaleErrors.sol" lineNumbers="true" %}

```solidity
pragma ever-solidity >= 0.61.2;

library TokensaleErrors {
    uint8 constant BAD_ROOT_CALL               = 101;
}
```

{% endcode %}

{% code title="Tokensale.sol" lineNumbers="true" %}

```solidity
pragma ever-solidity >= 0.61.2;
...

import "./errors/TokensaleErrors.sol"

...

    function onTokenWallet(address value) external {
        require (
            msg.sender.value != 0 &&
            msg.sender == _distributedTokenRoot,
            TokensaleErrors.BAD_ROOT_CALL
        );

...
```

{% endcode %}
