The writeContract method from genlayer-js throws a TypeError when passing float values in the args array. This issue specifically impacts Adaptive AMM contracts that require float parameters for configuration.
Current Behavior
When calling writeContract with float values in the arguments array, the following error is thrown:
Error: invalid calldata input '0.5'
at AMMAdaptiveSimulated.resolve (AMMAdaptativeSimulat…1731913010393:56:38)
at resolveOrders (AMMAdaptativeSimulatedScreen.vue:111:38)
Expected Behavior
The library should handle and serialize float values properly, allowing them to be passed as arguments without errors.
Steps to Reproduce
Create a client instance using genlayer-js
Attempt to call a contract function with float parameters
The TypeError occurs when executing the transaction
This issue affects the functionality of Adaptive AMM contracts that require float parameters for their configuration. There is no current workaround available.
I suspect this issue might be related to how floats are encoded when passed to the writeContract function. It could require additional serialization or handling within the library.
Description
The
writeContract
method fromgenlayer-js
throws aTypeError
when passing float values in theargs
array. This issue specifically impacts Adaptive AMM contracts that require float parameters for configuration.Current Behavior
When calling
writeContract
with float values in the arguments array, the following error is thrown:Expected Behavior
The library should handle and serialize float values properly, allowing them to be passed as arguments without errors.
Steps to Reproduce
genlayer-js
TypeError
occurs when executing the transactionMinimal Reproduction Code
Environment
Additional Context
This issue affects the functionality of Adaptive AMM contracts that require float parameters for their configuration. There is no current workaround available.