OpCode Costs Tables
The following tables outline the cost, in motes, for a given operation on Casper's Mainnet. If you are building for a private network or other instance of Casper, you will need to verify these costs in the associated chainspec.toml.
Storage Costs
| Attribute | Description | Cost | 
|---|---|---|
| gas_per_byte | Gas charged per byte stored in global state. | 630,000 | 
OpCode Costs
| Attribute | Description | Cost | 
|---|---|---|
| bit | Bit operations multiplier. | 300 | 
| add | Arithmetic add operations multiplier. | 210 | 
| mul | Mul operations multiplier. | 240 | 
| div | Div operations multiplier. | 320 | 
| load | Memory load operation multiplier. | 2_500 | 
| store | Memory store operation multiplier. | 4,700 | 
| const | Const store operation multiplier. | 110 | 
| local | Local operations multiplier. | 390 | 
| global | Global operations multiplier. | 390 | 
| integer_comparison | Integer operations multiplier. | 250 | 
| conversion | Conversion operations multiplier. | 420 | 
| unreachable | Unreachable operation multiplier. | 270 | 
| nop | Nop operation multiplier. | 200 | 
| current_memory | Get the current memory operation multiplier. | 290 | 
| grow_memory | Grow memory cost per page (64 kB). | 240,000 | 
Control Flow Operation Costs
| Attribute | Description | Cost | 
|---|---|---|
| block | Cost for blockopcode. | 440 | 
| loop | Cost for loopopcode. | 440 | 
| if | Cost for ifopcode. | 440 | 
| else | Cost for elseopcode. | 440 | 
| end | Cost for endopcode. | 440 | 
| br | Cost for bropcode. | 35_000 | 
| br_if | Cost for br_ifopcode. | 35,000 | 
| return | Cost for returnopcode. | 440 | 
| select | Cost for selectopcode. | 440 | 
| call | Cost for callopcode. | 68_000 | 
| call_indirect | Cost for call_indirectopcode. | 68,000 | 
| drop | Cost for dropopcode. | 440 | 
Br_Table OpCode Costs
| Attribute | Description | Cost | 
|---|---|---|
| cost | Fixed cost per br_tableopcode. | 35,000 | 
| size_multiplier | Size of target labels in the br_tableopcode will be multiplied bysize_multiplier. | 100 | 
External Function Costs
The following costs are for low-level bindings for host-side ("external") functions. More information on the Casper external FFI can be found here.
| Host-Side Function | Cost | Arguments | 
|---|---|---|
| add | 5,800 | [0, 0, 0, 0] | 
| add_associated_key | 9,000 | [0, 0, 0] | 
| add_contract_version | 200 | [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] | 
| blake2b | 200 | [0, 0, 0, 0] | 
| call_contract | 4,500 | [0, 0, 0, 0, 0, 420, 0] | 
| call_versioned_contract | 4,500 | [0, 0, 0, 0, 0, 0, 0, 420, 0] | 
| create_contract_package_at_hash | 200 | [0, 0] | 
| create_contract_user_group | 200 | [0, 0, 0, 0, 0, 0, 0, 0] | 
| create_purse | 2,500,000,000 | [0, 0] | 
| disable_contract_version | 200 | [0, 0, 0, 0] | 
| get_balance | 3,800 | [0, 0, 0] | 
| get_blocktime | 330 | [0] | 
| get_caller | 380 | [0] | 
| get_key | 2,000 | [0, 440, 0, 0, 0] | 
| get_main_purse | 1,300 | [0] | 
| get_named_arg | 200 | [0, 0, 0, 0] | 
| get_named_arg_size | 200 | [0, 0, 0] | 
| get_phase | 710 | [0] | 
| get_system_contract | 1,100 | [0, 0, 0] | 
| has_key | 1,500 | [0, 840] | 
| is_valid_uref | 760 | [0, 0] | 
| load_named_keys | 42,000 | [0, 0] | 
| new_uref | 17,000 | [0, 0, 590] | 
| random_bytes | 200 | [0, 0] | 
| 20,000 | [0, 4,600] | |
| provision_contract_user_group_uref | 200 | [0, 0, 0, 0, 0] | 
| put_key | 38,000 | [0, 1,100, 0, 0] | 
| read_host_buffer | 3,500 | [0, 310, 0] | 
| read_value | 6,000 | [0, 0, 0] | 
| read_value_local | 5,500 | [0, 590, 0] | 
| remove_associated_key | 4,200 | [0, 0] | 
| remove_contract_user_group | 200 | [0, 0, 0, 0] | 
| remove_contract_user_group_urefs | 200 | [0, 0, 0, 0, 0, 0] | 
| remove_key | 61,000 | [0, 3,200] | 
| ret | 23,000 | [0, 420,000] | 
| revert | 500 | [0] | 
| set_action_threshold | 74,000 | [0, 0] | 
| transfer_from_purse_to_account | 2,500,000,000 | [0, 0, 0, 0, 0, 0, 0, 0, 0] | 
| transfer_from_purse_to_purse | 82,000 | [0, 0, 0, 0, 0, 0, 0, 0] | 
| transfer_to_account | 2,500,000,000 | [0, 0, 0, 0, 0, 0, 0] | 
| update_associated_key | 4,200 | [0, 0, 0] | 
| write | 14,000 | [0, 0, 0, 980] | 
| write_local | 9,500 | [0, 1,800, 0, 520] | 
Protocol Operating Costs
| Attribute | Description | Cost | 
|---|---|---|
| wasmless_transfer_cost | Default gas cost for a wasmless transfer. | 100,000,000 | 
Auction System Contract Costs
These are the costs of calling auction system contract entrypoints.
| Entrypoint | Description | Cost | 
|---|---|---|
| get_era_validators | Cost of calling the get_era_validatorsentrypoint. | 10,000 | 
| read_seigniorage_recipients | Cost of calling the read_seigniorage_recipientsentrypoint. | 10,000 | 
| add_bid | Cost of calling the add_bidentrypoint. | 2,500,000,000 | 
| withdraw_bid | Cost of calling the withdraw_bidentrypoint. | 2,500,000,000 | 
| delegate | Cost of calling the delegateentrypoint. | 2,500,000,000 | 
| undelegate | Cost of calling the undelegateentrypoint. | 2,500,000,000 | 
| run_auction | Cost of calling the run_auctionentrypoint. | 10,000 | 
| slash | Cost of calling the slashentrypoint. | 10,000 | 
| distribute | Cost of calling the distributeentrypoint. | 10,000 | 
| withdraw_delegator_reward | Cost of calling the withdraw_delegator_rewardentrypoint. | 10,000 | 
| withdraw_validator_reward | Cost of calling the withdraw_validator_rewardentrypoint. | 10,000 | 
| read_era_id | Cost of calling the read_era_identrypoint. | 10,000 | 
| activate_bid | Cost of calling the activate_bidentrypoint. | 10,000 | 
| redelegate | Cost of calling the redelegateentrypoint. | 2,500,000,000 | 
Mint System Contract Costs
These are the costs of calling mint system contract entrypoints.
| Entrypoint | Description | Cost | 
|---|---|---|
| mint | Cost of calling the mintentrypoint. | 2,500,000,000 | 
| reduce_total_supply | Cost of calling the reduce_total_supplyentrypoint. | 10,000 | 
| create | Cost of calling the createentrypoint. | 2,500,000,000 | 
| balance | Cost of calling the balanceentrypoint. | 10,000 | 
| transfer | Cost of calling the transferentrypoint. | 10,000 | 
| read_base_round_reward | Cost of calling the read_base_round_rewardentrypoint. | 10,000 | 
| mint_into_existing_purse | Cost of calling the mint_into_existing_purseentrypoint. | 2,500,000,000 | 
Handle_Payment System Contract Costs
These are the costs of calling entrypoints on the handle_payment system contract.
| Entrypoint | Description | Cost | 
|---|---|---|
| get_payment_purse | Cost of calling the get_payment_purseentrypoint. | 10,000 | 
| set_refund_purse | Cost of calling the set_refund_purseentrypoint. | 10,000 | 
| get_refund_purse | Cost of calling the get_refund_purseentrypoint. | 10,000 | 
| finalize_payment | Cost of calling the finalize_paymententrypoint. | 10,000 | 
Standard_Payment System Contract Costs
These settings manage the costs of calling entrypoints on the standard_payment system contract.
| Entrypoint | Description | Cost | 
|---|---|---|
| pay | Cost of calling the payentrypoint and sending an amount to a payment purse. | 10,000 |