Skip to content

Commit

Permalink
fix: attached gas is units, not yN
Browse files Browse the repository at this point in the history
  • Loading branch information
chadoh committed Aug 5, 2020
1 parent 9995290 commit d5bd230
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/concepts/gas.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ If you're coming from Ethereum, you may be used to the idea of paying a higher g

For basic operations like "transfer funds," you can't specify an amount to attach. The gas needed is easy to calculate ahead of time, so it's automatically attached for you. (Check it: [`near-cli`](https://github.com/near/near-cli) has a `send` command, which accepts no `gas` parameter; [`near-api-js`](https://github.com/near/near-api-js) has a [`sendTokens`](https://near.github.io/near-api-js/classes/_near_.near.html#sendtokens) function which accepts no `gas` argument.) As shown in the tables above, these operations are cheap, so you probably won't even notice the slight reduction in your account's balance.

Function calls are more complex, and you can attach an explicit amount of gas to these transactions, up to a [maximum value](https://github.com/nearprotocol/nearcore/blob/c162dc3ffc8ccb871324994e58bf50fe084b980d/neard/res/mainnet_genesis.json#L193) of 3⨉10¹⁴ yN. Here's how you would override the default attached gas with [`near-cli`](https://github.com/near/near-cli):
Function calls are more complex, and you can attach an explicit amount of gas to these transactions, up to a [maximum value](https://github.com/nearprotocol/nearcore/blob/c162dc3ffc8ccb871324994e58bf50fe084b980d/neard/res/mainnet_genesis.json#L193) of 3⨉10¹⁴ gas units. As a reminder, these will be multiplied by the gas price, making this maximum attached gas correspond to a final gas fee of `3⨉10¹⁴ ⨉ 10⁸ = 3⨉10²²` or 0.03Ⓝ at minimum gas price. Here's how you would override the default attached gas with [`near-cli`](https://github.com/near/near-cli):

near call myContract.testnet myFunction "{ \"arg1\": \"val1\" }" --gas=300000000000000

Expand Down

0 comments on commit d5bd230

Please sign in to comment.