# Fee Limit

It is highly recommended to set an appropriate fee limit before deploying a contract to Mainnet. The fee limit refers to the upper limit of the smart contract deploy/execution cost, in TRX. See [Energy](🔗) for energy cost models. This limit is measured in SUN, which is 1e-6 TRX. The maximum limit is 1000 TRX, or 1e9 SUN. Setting it to a value larger than 1e9 will produce an error.

When deploying large contracts or running complex functions, this limit may need to be increased up to 1000 TRX. However, check out timeouts, infinite loops, illegal operations, and non-existent account transfer sections are why setting a higher limit may sometimes be bad practice.

This value can be set in both Tron-Box and Tron-Web:

### Tron-Box

For Tron-Box smart contract deployment, all global settings are in the **tronbox.js** file. Within this file, there is a parameter called _feeLimit_, which refers to the fee limit.

### Tron-Web

The _tronweb.contract.new_ API call takes in a parameter called _feeLimit_. This parameter refers to the fee limit.