dapphub / ds-token

A simple and sufficient ERC20 implementation
https://dapp.tools/dappsys/ds-token.html
GNU General Public License v3.0
224 stars 76 forks source link

Can not run `dapp create` with string or bytes32 #32

Closed starit closed 2 years ago

starit commented 2 years ago

I compiled with solc:0.5.12 successfully and failed to run dapp create with nor string or bytes32

it shows the error:

hevm: could not parse abi argument: 0x494f550000000000000000000000000000000000000000000000000000000000 : string
gbalabasquer commented 2 years ago

dapp create DSToken '"SYMBOL"' should work

tfalencar commented 2 years ago

As soon as the string has spaces in it, it appears the syntax suggested above no longer works, as hevm parser treats it as a separate argument. Ideas how to solve for such case?

d-xo commented 2 years ago

@tfalencar can you escape the space with a \ ?

tfalencar commented 2 years ago

Unfortunately I've tried that too and it didn't work:

dapp create MyContract '"DAI"' '"This\ ticket\ is\ not\ valid\ as\ an\ invoice."' -- --gas '' --rpc-url https://....

hevm: wrong number of arguments:9: ["\"DAI\"","\"This\","ticket\","is\","not\","valid\","as\","an\","invoice.\""] CallStack (from HasCallStack): error, called at hevm-cli/hevm-cli.hs:984:11 in main:Main

gbalabasquer commented 2 years ago

Why do you have two params for the constructor? The contract expects just one, the symbol. And still works for me if I do:

dapp create DSToken '"My Token"'
tfalencar commented 2 years ago

Thanks for the help @gbalabasquer : you made me realise it was a mistake elsewhere in my bash script, where string arguments got expanded to multiple items when passed to a function.

Why do you have two params for the constructor?

MyContract is different and takes two string parameters.