Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

invalid deploy-method of generated class when init-function has params #16

Closed
2 tasks done
marc0olo opened this issue Nov 23, 2019 · 0 comments
Closed
2 tasks done
Assignees
Labels
bug Something isn't working
Projects

Comments

@marc0olo
Copy link
Member

marc0olo commented Nov 23, 2019

we have 2 problems to solve here:

  • provide params in deploy-method
  • provide and fix the params in this.getCalldataForFunction

FungibleToken

init-function (sophia)

entrypoint init(name: string, decimals : int, symbol : string) =
    // If the `name` lenght is less than 1 symbol abort the execution
    require(String.length(name) >= 1, "STRING_TOO_SHORT_NAME")
    // If the `symbol` length is less than 1 symbol abort the execution
    require(String.length(symbol) >= 1, "STRING_TOO_SHORT_SYMBOL")
    // If the provided value for `decimals` is negative abort the execution
    require_non_negative_value(decimals)
    { owner        = Call.caller,
      total_supply = 0,
      balances     = {},
      meta_info    = { name = name, symbol = symbol, decimals = decimals } }

deploy-method (generated java class)

public String deploy() {
    String calldata = this.getCalldataForFunction("init",,name,decimals,symbol);
    return this.deployContract(calldata);
  }
@marc0olo marc0olo added the bug Something isn't working label Nov 23, 2019
@mitch-lbw mitch-lbw added this to Open in v.1.0.0 via automation Nov 29, 2019
@mitch-lbw mitch-lbw moved this from Open to In Progress in v.1.0.0 Nov 29, 2019
@mitch-lbw mitch-lbw moved this from In Progress to Done in v.1.0.0 Nov 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
No open projects
v.1.0.0
  
Done
Development

No branches or pull requests

2 participants