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

你可能感兴趣的文章
Oracle数据库ORA-01555解决含clob和blob字段表报错快照过旧问题
查看>>
ubuntu24 finalshell 无法连接ubuntu服务器, 客户端无法连接ubuntu, 无法远程连接ubuntu。
查看>>
Oracle数据库入门——初级系列教程
查看>>
oracle数据库包package小例子
查看>>
UBUNTU 添加删除用户
查看>>
Oracle数据库备份与还原
查看>>
Ubuntu Seata开机自启动服务
查看>>
uart 驱动架构
查看>>
Oracle数据库学习(三)
查看>>
Oracle数据库安装成功后,忘记解锁账户和设置密码
查看>>
TypeError: create_purple() 接受 0 个位置参数,但给出了 2 个
查看>>
Oracle数据库异常--- oracle_10g_登录em后,提示java.lang.Exception_Exception_in_sending_Request__null或Connection
查看>>
Oracle数据库异常---OracleDBConsoleorcl无法启动
查看>>
oracle数据库异常---SP2-1503: 无法初始化 Oracle 调用界面 SP2-1503: 无法初始化 Oracle 问题的解决办法
查看>>
Oracle数据库性能调优
查看>>