Transaction fee is calculated as usedStep * stepPrice.
-
Where
stepPriceis the ICX exchange rate, andusedStepis the sum ofstepCostfor each action processed in the transaction. -
If
usedStepreaches thestepLimitbefore finishing the execution, the transaction will fail without of steperror, but the amount ofstepLimitis deducted from your balance. -
Before executing your transaction, your account must hold at least
stepLimit * stepPriceamount of ICX. If you do not have sufficient ICX, your transaction will fail immediately.
You can query the stepCost of each action, the maximum possible stepLimit value you can set, and the stepPrice.
- SCORE Address - cx0000000000000000000000000000000000000001
- getStepCost
- getMaxStepLimit
- getStepPrice
root@b65c6a4cccf8:/tbears# cat stepcost.json
{
"jsonrpc": "2.0",
"id": 1,
"method": "icx_call",
"params": {
"to": "cx0000000000000000000000000000000000000001",
"dataType": "call",
"data": {
"method": "getStepCosts"
}
}
}
root@b65c6a4cccf8:/tbears# tbears call -u https://bicon.net.solidwallet.io/api/v3 stepcost.json
response : {
"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
}root@b65c6a4cccf8:/tbears# cat maxsteplimit.json
{
"jsonrpc": "2.0",
"id": 2,
"method": "icx_call",
"params": {
"to": "cx0000000000000000000000000000000000000001",
"dataType": "call",
"data": {
"method": "getMaxStepLimit",
"params": {
"contextType": "invoke"
}
}
}
}
root@b65c6a4cccf8:/tbears# tbears call -u https://bicon.net.solidwallet.io/api/v3 maxsteplimit.json
response : {
"jsonrpc": "2.0",
"result": "0x9502f900",
"id": 2
}root@07dfee84208e:/tbears# cat stepprice.json
{
"jsonrpc": "2.0",
"id": 3,
"method": "icx_call",
"params": {
"to": "cx0000000000000000000000000000000000000001",
"dataType": "call",
"data": {
"method": "getStepPrice"
}
}
}
}
root@07dfee84208e:/tbears# tbears call -u https://bicon.net.solidwallet.io/api/v3 stepprice.json
response : {
"jsonrpc": "2.0",
"result": "0x2540be400",
"id": 3
}