【问题标题】:Transfer the gas value of contract to my own address将合约的gas值转入我自己的地址
【发布时间】:2017-09-29 17:07:13
【问题描述】:

会发生什么?

    msg.sender.transfer(msg.value);

remix.eth 只是告诉我

错误:无法读取未定义的属性“op”

【问题讨论】:

  • 您的问题不正确。您可能是指将资金从智能合约转移到您的钱包?因为gasConsumed * gasPrice = whatYouPayForMiner,这个不能转移。
  • 是的,我的问题是关于这个的,非常感谢!

标签: ethereum solidity smartcontracts


【解决方案1】:

对我来说很好用:

pragma solidity ^0.4.0;

contract Test {

    function () payable {
        msg.sender.transfer(msg.value);
    }

}

如果我没有指定支付功能,我会得到无效的操作码。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-11-23
    • 2013-05-28
    • 1970-01-01
    • 2021-09-07
    • 2020-10-25
    • 1970-01-01
    • 2021-07-18
    • 1970-01-01
    相关资源
    最近更新 更多