将Ether发送给另一款合同时,它将其发送给合同?

发布于 2025-01-21 17:05:17 字数 485 浏览 0 评论 0原文

我尝试将以太从一个地址发送到另一个地址。但是在交易中,接收器似乎是合同地址。 我的目标是从地址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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

千纸鹤 2025-01-28 17:05:18

当您调用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.

夜血缘 2025-01-28 17:05:18

我遇到了同样的问题。但是它实际上正常,以太发送了。我的错误是我没有改变以太的派别,而是将其设置为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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文