> For the complete documentation index, see [llms.txt](https://docs.meycoin.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.meycoin.com/technical-specifications/transaction-fees.md).

# Transaction Fees

The Meey protocol includes transaction fees that need to be paid according to the configuration of the network.

Gas is a numerical representation of execution and storage costs in the transaction and contract. But gas is not a fee. To calculate the fee, we need the gas price.

### Gas Price

Gas price is the GAS value corresponding to 1 gas. All transactions in a block have the same gas price. Gas price is determined by a DAO vote.

### Gas Limit

The gas limit allows the user to specify the maximum amount of gas used for transactions and contracts.&#x20;

### Gas Table

#### Transaction

Transactions other than governance transactions consume `100,000 gas` by default. If you have a payload, additional gas will be used depending on the size.

**Payload gas**: (*Bytes of a payload* - 200) \* 5

#### Instructions

The table below shows gas usage for Lua bytecode.

| Name                                                                           | GAS |
| ------------------------------------------------------------------------------ | --- |
| ISLT, ISGE, ISLE, ISGT, ISEQV, ISNEV, ISEQS, ISNES, ISEQN, ISNEN, ISEQP, ISNEP | 2   |
| ISTC, ISFC, IST, ISF, ISTYPE, ISNUM                                            | 1   |
| MOV                                                                            | 2   |
| NOT, UNM                                                                       | 1   |
| LEN                                                                            | 3   |
| ADDVN, SUBVN                                                                   | 2   |
| MULVN, DIVVN, MODVN                                                            | 3   |
| ADDNV, SUBVN                                                                   | 2   |
| MULNV, DIVNV, MODNV                                                            | 3   |
| ADDVV, SUBVV                                                                   | 2   |
| MULVV, DIVVV, MODVV                                                            | 3   |
| POW                                                                            | 3   |
| CAT                                                                            | 3   |
| KSTR, KCDATGA, KSHORT, KNUM, KPRI, KNIL                                        | 1   |
| UGET, USETV, USETS, USETN, USETP, UCLO, FNEW                                   | 2   |
| TNEW                                                                           | 2   |
| TDUP                                                                           | 5   |
| GGET, GSET                                                                     | 3   |
| TGETV, TGETS, TGETB, TGETR, TSETV, TSETS, TSETB, TSETM, TSETR                  | 2   |
| CALLM, CALL, CALLMT, CALLT, ITERC, ITERN                                       | 10  |
| VARG                                                                           | 5   |
| ISNEXT                                                                         | 2   |
| RETM                                                                           | 5   |
| RET, RET0, RET1                                                                | 3   |
| FORI, FORL, ITERL, LOOP, JMP                                                   | 2   |

#### Built-in Functions

Gas usage for built-in functions provided by the Lua VM

| Name                                                  | GAS                                             |
| ----------------------------------------------------- | ----------------------------------------------- |
| assert                                                | 3                                               |
| error                                                 | 5                                               |
| getfenv                                               | 5                                               |
| getmetable                                            | 3                                               |
| ipairs                                                | 3                                               |
| next                                                  | 3                                               |
| pairs                                                 | 3                                               |
| pcall                                                 | 10                                              |
| rawequal                                              | 5                                               |
| rawget                                                | 3                                               |
| rawset                                                | 5                                               |
| select                                                | 3 (length), 5 (get an element)                  |
| setfenv                                               | 5                                               |
| setmetatable                                          | 3                                               |
| tonumber                                              | 5                                               |
| tostring                                              | 5                                               |
| type                                                  | 2                                               |
| unpack                                                | 5 + (2 \* *number of arguments*)                |
| xpcall                                                | 10                                              |
| string.byte, string.char                              | 3 + (1 \* *number of string units (arguments)*) |
| string.dump                                           | 10                                              |
| string.find, string.gmatch, string.gsub, string.match | 3 + (5 \* *number of matching strings*)         |
| string.format                                         | 3 + (2 \* *number of format modifiers*)         |
| string.lower                                          | 3 + (1 \* *number of string units (argument)*)  |
| string.rep                                            | 3 + (2 \* *number of concatenation*)            |
| string.reverse                                        | 3 + (1 \* *number of string units (argument)*)  |
| string.sub                                            | 3 + (1 \* *number of string units (argument)*)  |
| string.upper                                          | 3 + (1 \* *number of string units (argument)*)  |
| table.concat                                          | 3 + (3 \* *number of arguments*)                |
| table.insert                                          | 3 + (3 \* *number of cells to move*)            |
| table.maxn, table.minn                                | 3 + (3 \* *comparison count*)                   |
| table.sort                                            | 3 + (5 \* *comparison count*)                   |
| math.abs, math.ceil, math.floor, math.pow             | 3                                               |
| math.max, math.min                                    | 3 + (1 \* *number of arguments*)                |
| bit.tobit                                             | 3                                               |
| bit.tohex                                             | 5                                               |
| bit.bnot                                              | 2                                               |
| bit.bor, bit.band, bit.xor                            | 3 + (2 \* *number of arguments*)                |
| bit.lshift, bit.rshift, bit.ashift, bit.rol, bit.ror  | 3                                               |
| bit.bswap                                             | 2                                               |
