status-im/nim-web3

Handling inputs to a smart contract constructor

oskarth opened this issue · 5 comments

Duplicate of waku-org/nwaku#323

Problem

The problem is about how to deploy a smart contract with its constructor's inputs using nim-web3.

Some thoughts:
The EthSend has a data field which embodies the compiled code of the contract, probably the constructor's parameters should be passed/encoded as part of the data field, like <smartcontract code><parameters of constructor> but couldn't find the encoding procedure in this library.

Original issue by @staheri14. This is also an issue for SWAP accounting that also requires a constructor: waku-org/nwaku#323

@zah or someone else do you have any ideas for how to do this within nim-web3 library? Would be very useful. Also see previous discussion in Nimbus discord.

A solution for this issue is implemented in this PR waku-org/nwaku#359 (in nim-waku repo), please see https://github.com/status-im/nim-waku/blob/master/tests/v2/test_utils.nim