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

Error: RUNTIME_ERR1500: Invalid ASA definition: Total must be a positive number and smaller than 2^64-1 #768

Closed
MetaB0y opened this issue Aug 18, 2022 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@MetaB0y
Copy link

MetaB0y commented Aug 18, 2022

Describe the bug

I am running Pact's CPMM smart contract in AlgoBuilder runtime. It fails on line 1033.

1033: int 18446744073709551615
1034: itxn_field ConfigAssetTotal

with the following stack trace

     Error: RUNTIME_ERR1500: Invalid ASA definition: 'undefined'.
    Reason:           [total]: Total must be a positive number and smaller than 2^64-1

      at ITxnSubmit.execute (node_modules/.store/@algo-builder-runtime-npm-5.0.1-79534551d4/package/src/interpreter/opcode-list.ts:4308:4)
      at Interpreter.executeWithResult (node_modules/.store/@algo-builder-runtime-npm-5.0.1-79534551d4/package/src/interpreter/interpreter.ts:547:40)
      at Interpreter.execute (node_modules/.store/@algo-builder-runtime-npm-5.0.1-79534551d4/package/src/interpreter/interpreter.ts:486:23)
      at Runtime.run (node_modules/.store/@algo-builder-runtime-npm-5.0.1-79534551d4/package/src/runtime.ts:990:15)
      at /Users/qumeric/github/cometa-laas/node_modules/.store/@algo-builder-runtime-npm-5.0.1-79534551d4/package/src/ctx.ts:820:23
      at Array.forEach (<anonymous>)
      at Ctx.processTransactions (node_modules/.store/@algo-builder-runtime-npm-5.0.1-79534551d4/package/src/ctx.ts:774:12)
      at Runtime.executeTx (node_modules/.store/@algo-builder-runtime-npm-5.0.1-79534551d4/package/src/runtime.ts:954:31)
      at new PactContext (test/pact-context.ts:57:22)
      at setUpCtx (test/pact-happy-path copy.ts:17:15)

I tried to make the number smaller and got the following weird behaviour:

  • 18446744073709550615 (2^64 - 1 - 1000) still fails
  • 18446744073709541615 (2^64 - 1 - 10000) passes.

I am not sure which exact number starts to cause trouble.

Also, a related small issue: error says the number should be smaller than 2^64-1 while actually, it should be smaller than 2^64.

Environment

  • OS: macOS
  • Node.js version: 18 fresh
  • algob version: master
@MetaB0y MetaB0y added the bug Something isn't working label Aug 18, 2022
@robert-zaremba
Copy link
Member

error says the number should be smaller than 2^64-1 while actually, it should be smaller than 2^64.

True - in other words, it should be <= 2^64 - 1

 Error: RUNTIME_ERR1500: Invalid ASA definition: 'undefined'.

the 'undefined' is related to the ASA name - since it is created using an inner transaction we should inherit it from itxn_field ConfigAssetName

@robert-zaremba
Copy link
Member

fixed in #775

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
None yet
Development

No branches or pull requests

3 participants