博客
关于我
solidity中的transfer、send、call(delegatecall)的区别和用法总结
阅读量:674 次
发布时间:2019-03-15

本文共 1097 字,大约阅读时间需要 3 分钟。

Regarding Solidity, a popular programming language used for smart contracts on blockchain platforms, understanding the differences between transfer, send, and call methods is crucial for developers. These methods are often conflated, but they serve distinct purposes in contract programming.

・The transfer and send methods are designed for transferring tokens between addresses and invoking external contract functions respectively. While transfer is deterministic and gas-efficient, send is more flexible but less predictable.

・Importantly, when using transfer or send in Solidity, a fallback function must be implemented in the recipient contract to handle the transaction's Ether. This is because Solidity's EVM requires that any transaction must have a receiver to process it.

・The call.value method is another powerful tool for interacting with contracts. It allows the immediate use of Ether and requires that the method being called is marked as payable. Unlike transfer and send, there is no gas limit restriction for call.value.

译者:何派文

关键词:Solidity, 转账方法, contract, fallback函数, call.value

转载地址:http://jsmmz.baihongyu.com/

你可能感兴趣的文章
PageHelper分页查询遇到的小问题
查看>>
PageHelper实现分页详细版、整合SSM应用
查看>>
SpringBoot中配置为开发模式,代码修改后不用重新运行
查看>>
springboot中pom.xml、application.yml、application.properties
查看>>
PageHelper:上手教程(最详细)
查看>>
PageOffice如何实现从零开始动态生成图文并茂的Word文档
查看>>
PageRank算法
查看>>
Paint类(画笔)
查看>>
paip. 调试技术打印堆栈 uapi print stack java php python 总结.
查看>>
paip.android 手机输入法制造大法
查看>>
paip.spring3 mvc servlet的配置以及使用最佳实践
查看>>
Palindrome Number leetcode java
查看>>
Palo Alto Networks Expedition 未授权SQL注入漏洞复现(CVE-2024-9465)
查看>>
Palo Alto Networks Expedition 远程命令执行漏洞(CVE-2024-9463)
查看>>
Palo Alto Networks PAN-OS身份认证绕过导致RCE漏洞复现(CVE-2024-0012)
查看>>
Panalog 日志审计系统 libres_syn_delete.php 前台RCE漏洞复现
查看>>
Springboot中@SuppressWarnings注解详细解析
查看>>
Panalog 日志审计系统 sprog_deletevent.php SQL 注入漏洞复现
查看>>
Panalog 日志审计系统 sprog_upstatus.php SQL 注入漏洞复现(XVE-2024-5232)
查看>>
Panalog 日志审计系统 前台RCE漏洞复现
查看>>