博客
关于我
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/

你可能感兴趣的文章
PHP语言最优雅的支付SDK扩展包
查看>>
PHP请求https域名发生segment fault段错误
查看>>
PHP读写XML文件
查看>>
PHP读写XML文件
查看>>
R&Python Data Science 系列:数据处理(3)
查看>>
php读取xml 数据库字段超长处理
查看>>
php课程 12-40 抽象类的作用是什么
查看>>
php课程 4-16 数组自定义函数(php数组->桶)
查看>>
PHP调用接口用post方法传送json数据
查看>>
php转化IP为整形
查看>>
php输出数据到csv文件
查看>>
php输出语句
查看>>
php运行原理详细说明
查看>>
php运行环境出现Undefined index 或variable时解决方法
查看>>
php进程通信
查看>>
R&Python Data Science 系列:数据处理(2)
查看>>
php递归算法总结
查看>>
PHP递归遍历文件夹
查看>>
R&Python Data Science 系列:数据处理(1)
查看>>
php错误日志文件
查看>>