• Luke Schoen's avatar
    feat: Send transaction with data field and allow amount to be zero · 6cc59cfd
    Luke Schoen authored
    * Update Send transaction UI so "amount" field can be 0, since some users may want to just send some data (i.e. https://github.com/chainx-org/ChainX/issues/66)
    * Set the default amount value to be 0 and not required
    * Update Send transaction UI to support "data" field in hex (with 0x prefix)
    * Use a hard-coded Gas Limit of 200,000 when user provides hex "data" value
    * Remove logic that doesn't make sense (i.e. `else if (amountBn.isZero()) {`)
    * Update validation messages
    * Add support for Blockscout link when user using Goerli testnet
    * Update internationalisation
    * Use custom `isHexString` function instead of the ethereumjs-util's version. The ethereumjs-util's version is used by MyCrypto and doesn't work properly.
    * Tested on Goerli testnet by creating two accounts, requesting Goerli tokens, running with `--chain goerli` appended to the end (i.e. `"start": "cross-env ELECTRON_START_URL=http://localhost:3000 electron-webpack dev --chain goerli",` in fether/packages/fether-electron/package.json), and sending a transaction with the high gas price, the hex data. For example, for ChainX convert your ChainX Address (UTF8 chars) into Hex code (i.e. copy/paste it at https://www.browserling.com/tools/utf8-to-hex, for example "helloworld" becomes => `\x68\x65\x6c\x6c\x6f\x20\x77\x6f\x72\x6c\x64`, and remove the `\x`, => `68656c6c6f20776f726c64` => then prepend 0x => `0x68656c6c6f20776f726c64` and add that to the "data" field), then send the transaction, and
    when the transaction is successful go to the Blockscout link and you'll see under "Raw Input" ("Input Data" on Etherscan) that you can switch between viewing it in UTF8 or Hex, i.e. https://blockscout.com/eth/goerli/tx/0x7eaec61ce7753fd4c80aec4509c49942b53986585e4864e18134806bffb25f10/internal_transactions)
    * TODO - update Parity Signer to show "data" field value if it doesn't already