Closed guidanoli closed 3 months ago
For optional fields, we can use the omitempty
JSON option.
Source: https://pkg.go.dev/encoding/json
I'll go with the easiest route, which is to accept only ERC-20 tokens, and not support native ETH anymore. ETH can be wrapped in ERC-20 tokens and 1-to-1 equivalence can be enforced by contract logic.
We could either:
The difficulty part there is encoding value in the application state. We could add an optional
token
field to theAppBounty
struct. If not provided, it's assumed the bounty only accepts sponsorships in ETH. Otherwise, it only accepts sponsorships in the provided ERC-20 token. The type of currency would be determined by whoever creates the bounty.In the back-end, we'd have to:
token
field of "Create app bounty" inputsIn the web front-end, we'd have to tweak:
It would also be good to test these new cases in Lua.