将Ether发送给另一款合同时,它将其发送给合同?
我尝试将以太从一个地址发送到另一个地址。但是在交易中,接收器似乎是合同地址。 我的目标是从地址1发送到地址2:
地址1:0xDB7C83D499787E6B7660C961F8A9999EE3C395ADE address2:0x9199D9323b25BA171De6b9189201Bb322Ba12274
contract-address:0xa82bcf321f584fe81e2e3cfb04eae97b422a4c4f
But the receiver in the transaction appears to be the contract:
;
pordebode
ubloder-prodepter-ubloder-podebore porde-ublayer-internalterions = (0x9199D9323B25BA171DE6B9189201BB322BA12274)
卖方。转移(msg.value); }
I try to send ether from one address to another. But in the transaction the receiver seems to be the contract address.
My goal is to send from address 1 to address 2:
address1:0xDb7c83d499787E6b7660C961F8a9999E3C395AdE
address2:0x9199D9323b25BA171De6b9189201Bb322Ba12274
contract-address:0xa82bcf321f584fe81e2e3cfb04eae97b422a4c4f
But the receiver in the transaction appears to be the contract: https://blockscout.mantis.hexapod.network/tx/0x9bc22ad45dbf60881151c3b94b3d3daa98bc84b1906f1ed131ee2ca9a89484eb/internal-transactions
Function:
function sendMoney() public payable {
address payable seller = payable(0x9199D9323b25BA171De6b9189201Bb322Ba12274);
seller.transfer(msg.value);
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
当您调用
sendmoney()
函数时,您将向实现此功能的合同发送交易。seller.transfer(msg.value);
是内部交易 - 主要交易的一部分。When you're invoking the
sendMoney()
function, you're sending a transaction to the contract that implements this function.The
seller.transfer(msg.value);
is an internal transaction - a part of the main transaction.我遇到了同样的问题。但是它实际上正常,以太发送了。我的错误是我没有改变以太的派别,而是将其设置为Wei。因此,我试图发送1个WEI而不是1醚。交易完成了,但是我看不到变化,因为数量很小。
I had the same problem. But it is actually working fine, the ether is sent. My mistake was that I didn't change the denomination of ether, it was set to wei. So, I was trying to send 1 wei instead of 1 ether. The transaction goes through but I couldn't see the change as the quantity was so small.