简体   繁体   中英

If i deploy a todolist smartcontract on the ethereum blockchain , will i have to pay ether / gas price for adding a task or marking a task completed?

To explain it a bit more in detail, let us say I have deployed a smart contract on the Ethereum blockchain which is capable of acting like a to-do list app, you can add tasks to it and mark them done once u finish them. My question is every time I perform such activities do I have to pay ether/gas price aka real money for it as it adds a block to the Ethereum blockchain?

My question is every time I perform such activities do I have to pay ether/gas price aka real money for it as it adds a block to the Ethereum blockchain?

Yes. You pay gas fees for every transaction you send (in this case to the contract address). A transaction allows you to change state, eg update storage variable containing the task details. Read-only calls are free.

Yes definitely as marking tasks or creating a new task changes the state of the blockchain. So whenever the blockchain state changes it costs some gas fee. You can try that by creating a todolist smartcontract and deploy it on the testnet like rinkeby. You will see that every time you call a function (that can change the state of the blockchain) metamask will popup

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM