ICON Transaction Fee

Words
188
Reading
1 min
Listen
Play
7y

ICON Transaction Fee

Let's talk about ICON Transaction Fee. They are explained by ICON Foundation https://icon.foundation/?lang=en at

ICON Blockchain Network Transaction fee is calculated as:

  • usedStep * stepPrice

Where;

  • stepPrice is the ICX exchange rate,
  • usedStep is the sum of stepCost for each action processed in the transaction.

Note that;

  • if usedStep reaches the stepLimit before finishing the execution, the transaction will of course fail without of step error. However, remember that the amount of stepLimit will be deducted from your balance.

  • It is important to know that before executing your transaction, you must have in your account at least

    • stepLimit * stepPrice amount of ICX. Of course, you know that if you do not have sufficient ICX in your account, then your transaction will fail immediately.

You can always query;

  • the stepCost of each action,
  • the maximum possible stepLimit value you can set, and
  • the stepPrice.

Governance SCORE Address

The governance SCORE Address is: cx0000000000000000000000000000000000000001

Calling Fee Parameters from ICON Testnet

This is the ICON Testnet https://bicon.tracker.solidwallet.io/ . The API endpoint for ICON Testnet is https://bicon.net.solidwallet.io/api/v3 .

getStepCost

Ref: https://github.com/icon-project/governance/blob/master/README.md#getstepcosts

$ cat stepcost.json
{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "icx_call",
    "params": {
        "to": "cx0000000000000000000000000000000000000001",
        "dataType": "call",
        "data": {
            "method": "getStepCosts"
        }
    }
}
$ curl -H "Content-Type: application/json" -d @stepcost.json https://bicon.net.solidwallet.io/api/v3
{"jsonrpc": "2.0", "result": {"default": "0x186a0", "contractCall": "0x61a8", "contractCreate": "0x3b9aca00", "contractUpdate": "0x5f5e1000", "contractDestruct": "-0x11170", "contractSet": "0x7530", "get": "0x0", "set": "0x140", "replace": "0x50", "delete": "-0xf0", "input": "0xc8", "eventLog": "0x64", "apiCall": "0x0"}, "id": 1}

getMaxStepLimit

Ref: https://github.com/icon-project/governance/blob/master/README.md#getmaxsteplimit

$ cat maxsteplimit.json
{
    "jsonrpc": "2.0",
    "id": 2,
    "method": "icx_call",
    "params": {
        "to": "cx0000000000000000000000000000000000000001",
        "dataType": "call",
        "data": {
            "method": "getMaxStepLimit",
            "params": {
                "contextType": "invoke"
            }
        }
    }
}
$ curl -H "Content-Type: application/json" -d @maxsteplimit.json https://bicon.net.solidwallet.io/api/v3
{"jsonrpc": "2.0", "result": "0x9502f900", "id": 2}

getStepPrice

Ref: https://github.com/icon-project/governance/blob/master/README.md#getstepprice

$ cat stepprice.json
{
    "jsonrpc": "2.0",
    "id": 3,
    "method": "icx_call",
    "params": {
        "to": "cx0000000000000000000000000000000000000001",
        "dataType": "call",
        "data": {
            "method": "getStepPrice"
         }
    }
}
$ curl -H "Content-Type: application/json" -d @stepprice.json https://bicon.net.solidwallet.io/api/v3
{"jsonrpc": "2.0", "result": "0x2540be400", "id": 3}


Links/Social

Support and Vote for “ICON Sweden”

ICONSweden-logo-256.png

https://eossweden.eu/

ICON Transaction Fee | Ecency