Member "transfer" not found or not visible after argument-dependent lookup in address. _needer.neede

关于solidity 0.5.0中的transfer的修改:

官方中原话:

  • The address type was split into address and address payable, where only address payable provides the transfer function. An address payable can be directly converted to an address, but the other way around is not allowed. Converting address to address payable is possible via conversion through uint160. If c is a contract, address(c) results in address payable only if c has a payable fallback function. If you use the withdraw pattern, you most likely do not have to change your code because transfer is only used on msg.sender instead of stored addresses and msg.sender is an address payable.

意思就是 address分成了两个部分,一个是address 一个是address payable ,如果你用address 在交易方面的话,你要定义address 变量,需要在address后加payable。例如:address payable neederAddress;

 

不知道解释的明白不,下面是官方api 不懂的话你们自己看下。我也一个刚学区块链的小白。请大家多多指教。

https://solidity.readthedocs.io/en/v0.5.3/050-breaking-changes.html?highlight=address%20payable

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值