0

Should it be like the example below(2,2 as two different parametres) Ex: const stackId = drizzle.contracts.SimpleStorage.methods.set.cacheSend(2,2, {from: '0x3f...'})

0

That is the correct way of doing multiple parameters. See here where somebody asked a similar question.

| improve this answer | |
0

The easier way is sending them as parameters to cacheSend:

cacheSend(
      drizzleState.clientAccount,
      toHex(parseAmountToToken(amountToSend, tokenDecimals))
    );

Here, we are sending two parameters for the transfer function: transfer(address, uint256)....

If you are using hooks you can use the send function passing the parameters you need:

const { useCacheSend } = drizzleReactHooks.useDrizzle()
const { send, TXObjects } = useCacheSend('MyToken', 'transfer')

---

        onSubmit={
          // Use memoization to avoid unnecessary rerenders.
          useCallback(({ to=drizzleState.clientAccount, value=toHex(parseAmountToToken(amountToSend, tokenDecimals)) }) => send(to, value), [amountToSend])
        }

That's all.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.