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

你可能感兴趣的文章
PyQt 正确使用 emit() 和 pyqtSignal()
查看>>
PyQT-将文件复制到剪贴板
查看>>
PYQT.如何在QTableView中插入小部件
查看>>
PyQt4 代码在 PyQt5 (QHeaderView) 上不起作用
查看>>
PyQt4 到 PyQt5 ->mainFrame() 已弃用,需要修复才能加载网页
查看>>
PyQt4, class:mouseButtons用法
查看>>
PyQt4参考文档
查看>>
PyTorch Lightning:通过分布式训练扩展深度学习工作流
查看>>
PyQt5 - QThread:在线程仍在运行时被销毁
查看>>
PyQt5 - 如何从工作线程发出信号以通过 GUI 线程调用事件
查看>>
PyQt5 Designer 不工作:此应用程序无法启动,因为无法初始化 Qt 平台插件
查看>>
PyQt5 QLCNumber 没有更新
查看>>
PyQt5 TabWidget选项卡BarClicked TypeError:本机Qt信号不可调用
查看>>
PyQt5 从 PyQt4 转换信号代码
查看>>
PyQt5 和 asyncio:从永不完成的收益
查看>>
PyQt5 和 Django:如何使用 HTTP 请求(Multipart-form)上传图像?
查看>>
PyQt5 按钮运行功能和更新 LCD
查看>>
pyqt5 获取Qlabel中的图片并对其进行处理(包括Qimage转换为Mat)
查看>>
pyqt5 设置控件在最上层或者在下层
查看>>
pyqt5 设置网格布局的间距
查看>>