【问题标题】:Getting “Can not sign transactions for account” error出现“无法为帐户签署交易”错误
【发布时间】:2021-07-13 00:41:35
【问题描述】:

当我在这份合同上致电play() 时,我收到了Error: Can not sign transactions for account。导致错误的原因是什么?

这是代码,

https://github.com/Learn-NEAR/sample--lottery/blob/main/src/lottery/assembly/index.ts

play(): void {
    assert(this.active, this.winner + " won " + this.pot.toString() + ". Please reset the game.");
    const signer = Context.sender;

    // if you've played before then you have to pay extra
    if (this.players.has(signer)) {
      const fee = this.fee();
      assert(Context.attachedDeposit >= fee, this.generate_fee_message(fee));
      this.increase_pot();

      // if it's your first time then you may win for the price of gas
    } else {
      this.players.add(signer);
    }

    this.last_played = signer;

    if (this.won()) {
      this.winner = signer;
      this.payout();
    } else {
      this.lose();
    }
  }

【问题讨论】:

    标签: nearprotocol assemblyscript


    【解决方案1】:

    您需要使用您的 NEAR 帐户登录并输入near login

    【讨论】:

      猜你喜欢
      • 2022-07-21
      • 1970-01-01
      • 2023-04-08
      • 2022-11-07
      • 1970-01-01
      • 1970-01-01
      • 2020-06-25
      • 1970-01-01
      • 2018-11-10
      相关资源
      最近更新 更多