Skip to content

Commit 127fc25

Browse files
authored
Update example deployment cost (#1065)
With protocol version 53 (release 1.26) the deployment gas cost per byte increases from 6_812_999 to 64_572_944. This updates the example gas calculation.
1 parent 4e2f5f4 commit 127fc25

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/concepts/gas.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,21 +84,21 @@ The numbers above should give you the sense that transactions on NEAR are cheap!
8484
The basic action costs include two different values for deploying contracts. Simplified, these are:
8585

8686
deploy_contract_cost: 184765750000,
87-
deploy_contract_cost_per_byte: 6812999,
87+
deploy_contract_cost_per_byte: 64572944,
8888

8989
Again, these values can be queried by using the [`protocol_config`](/docs/api/rpc#protocol-config) RPC endpoint.
9090

9191
The first is a baseline cost, no matter the contract size. Keeping in mind that each need to be multiplied by two, for both `send` and `execute` costs, and will also require sending & executing a receipt (see blue box above), the gas units comes to:
9292

9393
2 * 184765750000 +
94-
2 * contract_size_in_bytes * 6812999 +
94+
2 * contract_size_in_bytes * 64572944 +
9595
2 * 108059500000
9696

9797
(Divide the resulting number by 10¹² to get to TGas!)
9898

9999
Note that this covers the cost of uploading and writing bytes to storage, but does _not_ cover the cost of holding these bytes in storage. Long-term storage is compensated via [storage staking], a recoverable cost-per-byte amount that will also be deducted from your account during contract deployment.
100100

101-
The AssemblyScript contract in [this example Fungible Token](https://github.com/near-examples/FT/pull/42) compiles to just over 16kb (the Rust contract is much larger, but this [will be optimized](https://github.com/near/near-sdk-rs/issues/167)). Using the calculation above, we find that it requires **0.81 TGas** (and thus 0.081mN at minimum gas price) for the transaction fee to deploy the contract, while 1.5N will be locked up for storage staking.
101+
The AssemblyScript contract in [this example Fungible Token](https://github.com/near-examples/FT/pull/42) compiles to just over 16kb (the Rust contract is much larger, but this [will be optimized](https://github.com/near/near-sdk-rs/issues/167)). Using the calculation above, we find that it requires **2.65 TGas** (and thus 0.265mN at minimum gas price) for the transaction fee to deploy the contract, while 1.5N will be locked up for storage staking.
102102

103103
### Function calls {#function-calls}
104104

0 commit comments

Comments
 (0)