Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update 10-savinggasview.md #595

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion zh/3/10-savinggasview.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ material:

稍后我们将介绍如何在自己的节点上设置 web3.js。但现在,你关键是要记住,在所能只读的函数上标记上表示“只读”的“`external view` 声明,就能为你的玩家减少在 DApp 中 gas 用量。

>注意:如果一个 `view` 函数在另一个函数的内部被调用,而调用函数与 `view` 函数的不属于同一个合约,也会产生调用成本。这是因为如果主调函数在以太坊创建了一个事务,它仍然需要逐个节点去验证。所以标记为 `view` 的函数只有在外部调用时才是免费的。
>注意:如果一个 `view` 函数被另一个相同合约的函数调用,调用者函数不是一个 `view` 函数,被调用函数也会产生调用成本。这是因为如果调用者函数在以太坊创建了一个事务,它仍然需要逐个节点去验证。所以标记为 `view` 的函数只有在外部调用时才是免费的。


## 实战演习
Expand Down