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

Add support loadLogic for *.teal program and SCParams #662

Closed
huybuidac opened this issue Apr 25, 2022 · 3 comments · Fixed by #795
Closed

Add support loadLogic for *.teal program and SCParams #662

huybuidac opened this issue Apr 25, 2022 · 3 comments · Fixed by #795
Assignees

Comments

@huybuidac
Copy link

huybuidac commented Apr 25, 2022

Is your feature request related to a problem? Please describe.

I'm writing a *.teal lsig program with SCParams. But algo-builder does not support to loadLogic for *.teal & SCParams

https://github.com/scale-it/algo-builder/blob/master/packages/runtime/src/runtime.ts#L678

  • @param scTmplParams: Smart contract template parameters (used only when compiling PyTEAL to TEAL)

Describe the solution you'd like

  • Can you support this?

Additional context

@huybuidac huybuidac changed the title Add support loadLogic for TEAL and SCParams Add support loadLogic for *.teal program and SCParams Apr 25, 2022
@vuvoth
Copy link
Contributor

vuvoth commented Apr 26, 2022

Thank you for your proposal! I think we shouldn't not support ScParams for teal because it make teal program unportable.

@huybuidac
Copy link
Author

I found a workaround, but it is better if there is official support.

    const pyOp = new PyCompileOp()

    let lsigProg = getProgram('lsigProg.teal')
    const [replaceParams, param] = pyOp.parseScTmplParam({
      TMPL_a: a,
      TMPL_b b,
      TMPL_c: c,
    }, true);
    lsigProg = pyOp.replaceTempValues(lsigProg, replaceParams)

    const lsigAcc = runtime.createLsigAccount(lsigProg, [])

@rmeena840
Copy link
Contributor

@huybuidac This has been taken care of and will be available in the next release. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants