weiroll / weiroll.js

A high-level javascript transpiler for weiroll
https://weiroll.github.io/weiroll.js/
MIT License
53 stars 10 forks source link

Functions in wrapped Contract class are not strict enough with arguments #11

Closed mattdf closed 3 years ago

mattdf commented 3 years ago

If you feed the wrong type of argument to a function wrapped by Planner, it won't error, it will just silently build the wrong state.

e.g. if you call:

planner.addCommand(math.add([1, 2]))

Instead of using math.add(1, 2) the output state is mangled, and generates this for whatever reason:

0x0000000000000000000000000000000000000000000000000000000000000102

Probably should catch that the arguments fed match the function interface, in type and in number.