如何将资金从智能合约转移到msg.sender以外的其他帐户?

问题描述 投票:0回答:1

我正在尝试将存储在智能合约中的部分资金转移到一个调用该函数(msg.sender)的帐户以外的帐户。我的功能非常像这样:

function getFunds(address addr, uint amount) public {
    require (address.this(balance)>= amount);
    addr.transfer(amount);
}

当我在松露中编译时得到的是:

在地址中依赖于参数的查找之后,找不到或看不到成员“传输”。>

好像在结构中寻找成员。

感谢您的帮助。

我正在尝试将存储在智能合约中的部分资金转移到一个调用该函数(msg.sender)的帐户以外的帐户。我的函数非常像这样:function getFunds(address ...

solidity transfer smartcontracts truffle
1个回答
1
投票

由于坚固性0.5地址应该是payable才能将eth传送给它们

© www.soinside.com 2019 - 2024. All rights reserved.