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

Passing string as parameter throws error #114

Open
somoza opened this issue Jan 19, 2022 · 1 comment
Open

Passing string as parameter throws error #114

somoza opened this issue Jan 19, 2022 · 1 comment

Comments

@somoza
Copy link

somoza commented Jan 19, 2022

I create 2 diff contracts, one with set function receiving integer as parameter, the other receiving string.

First works fine and the second one fails with this message:

{:error,
 %{
   "code" => -32000,
   "data" => %{
     "0xe20bb21666d462cfec33dad694cae424fadd38cdc4820970c8769f2e7690f149" => %{
       "error" => "revert",
       "program_counter" => 5281,
       "return" => "0x"
     },
     "name" => "RuntimeError",
     "stack" => "RuntimeError: VM Exception while processing transaction: revert\n    at Function.RuntimeError.fromResults (/tmp/.mount_ganachjrwblU/resources/static/node/node_modules/ganache-core/lib/utils/runtimeerror.js:94:13)\n    at BlockchainDouble.processBlock (/tmp/.mount_ganachjrwblU/resources/static/node/node_modules/ganache-core/lib/blockchain_double.js:627:24)\n    at runMicrotasks (<anonymous>)\n    at processTicksAndRejections (internal/process/task_queues.js:93:5)"
   },
   "message" => "VM Exception while processing transaction: revert"
 }}

I've tried converting string to hex and didn't work either.

Please add an example on readme on how to format string before passing it to contract function.

@samparmenter
Copy link

Are you passing an ethereum address as the parameter to the contract function or is it just a normal string?

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

No branches or pull requests

2 participants