Skip to content

Non payable message in Ask! ? #249

Open

Description

@shunsukew

In Ask! message is payable even if there's no modifiers.
For example,

@message({ mutates: true })
  flip(): void {
    this.data.flag = !this.data.flag;
    let event = new FlipEvent(this.data.flag);
    // @ts-ignore
    env().emitEvent(event);
  }

This will generate metadata.json payable true, and it is actually payable.

"messages": [
        {
          "mutates": true,
          "payable": true,
          "args": [],
          "docs": [],
          "label": "flip",
          "selector": "0x633aa551"
        }
]

Is there a way to specify message to be non-payable?

Activity

  1. changed the title [-]Non payable function in Ask! ?[/-] [+]Non payable message in Ask! ?[/+] on Feb 6, 2023
  2. yjhmelody commented on Feb 6, 2023

    @yjhmelody
    Contributor

    Some things need to be considered first when support non-payable.

    The logic of checking non-payable need to make sure Balance type first in decorator.
    So we need to make sure the abstract level of Balance type.

    BTW, the ability of payable is super class of non-payble in actually.

  3. shunsukew commented on Feb 6, 2023

    @shunsukew
    ContributorAuthor

    I see,
    I raised the PR #250, but there were some considerations and this line is intentional to
    stop users from using payable: false?

  4. shunsukew commented on Feb 7, 2023

    @shunsukew
    ContributorAuthor

    I missed TODO comment in the source code for some reason, I recognize it intentional and non-payable hasn't not supported yet.

  5. added
    enhancement
    good first issue
    on Feb 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementgood first issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions