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

你可能感兴趣的文章
phpmailer发送邮件,可以带附件
查看>>
phpmailer的用法
查看>>
phpMQTT
查看>>
phpmyadmin 安装
查看>>
phpmyadmin导出数据库出现Fatal error: Cannot 'break' 2 levels in D:\phpstudy\WWW\phpMyAdmin
查看>>
phpmyadmin数据库建表及插入
查看>>
phpnow配置
查看>>
phprpc简单使用
查看>>
phpspider中当爬虫获取数据时如何去掉广告
查看>>
phpstorm 2016.3.3 激活
查看>>
phpstorm中Xdebug的使用
查看>>
phpstorm中使用svn版本控制器
查看>>
PHPStorm使用git
查看>>
PHPstorm最常用的快捷键,提高开发效率
查看>>
Redis五种数据结构
查看>>
phpstorm配置php脚本执行
查看>>
PhpStorm配置远程xdebug
查看>>
phpstudy+iis搭建php项目
查看>>
phpStudy安装教程
查看>>
phpstudy搭建网站,通过快解析端口映射外网访问
查看>>