From 79e46026b593c2b3d6859788b0558036d4eeb03f Mon Sep 17 00:00:00 2001 From: ncitron Date: Sun, 7 Nov 2021 00:24:08 -0400 Subject: [PATCH 01/20] add gas esimation in seth mktx --- src/seth/libexec/seth/seth-mktx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/seth/libexec/seth/seth-mktx b/src/seth/libexec/seth/seth-mktx index d5790b27e..63ffe75ac 100755 --- a/src/seth/libexec/seth/seth-mktx +++ b/src/seth/libexec/seth/seth-mktx @@ -18,7 +18,7 @@ args=( --nonce "${ETH_NONCE:-$(seth nonce "$ETH_FROM")}" --chain-id "$(seth chain-id)" --gas-price "${ETH_GAS_PRICE:-$(seth gas-price)}" - --gas-limit "${ETH_GAS:-200000}" + --gas-limit "${ETH_GAS:-$(seth estimate $ETH_FROM $data)}" --value "$value" --data "${data:-0x}" ) From a116e13dbe986de7e24b4d743ad2d5ff45dcee75 Mon Sep 17 00:00:00 2001 From: ncitron Date: Sun, 7 Nov 2021 00:25:40 -0400 Subject: [PATCH 02/20] fix data arg --- src/seth/libexec/seth/seth-mktx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/seth/libexec/seth/seth-mktx b/src/seth/libexec/seth/seth-mktx index 63ffe75ac..979afd9dc 100755 --- a/src/seth/libexec/seth/seth-mktx +++ b/src/seth/libexec/seth/seth-mktx @@ -18,7 +18,7 @@ args=( --nonce "${ETH_NONCE:-$(seth nonce "$ETH_FROM")}" --chain-id "$(seth chain-id)" --gas-price "${ETH_GAS_PRICE:-$(seth gas-price)}" - --gas-limit "${ETH_GAS:-$(seth estimate $ETH_FROM $data)}" + --gas-limit "${ETH_GAS:-$(seth estimate $ETH_FROM ${$data:-0x})}" --value "$value" --data "${data:-0x}" ) From e50c75af1dba5e39c16558a7968611596e19075c Mon Sep 17 00:00:00 2001 From: ncitron Date: Sun, 7 Nov 2021 00:27:11 -0400 Subject: [PATCH 03/20] refactor data arg --- src/seth/libexec/seth/seth-mktx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/seth/libexec/seth/seth-mktx b/src/seth/libexec/seth/seth-mktx index 979afd9dc..d7ffffd2b 100755 --- a/src/seth/libexec/seth/seth-mktx +++ b/src/seth/libexec/seth/seth-mktx @@ -13,14 +13,16 @@ if [[ $2 ]]; then data=$(seth calldata "${@:2}") fi +data=${data:-0x} + args=( --from "$(seth --to-address "$ETH_FROM")" --nonce "${ETH_NONCE:-$(seth nonce "$ETH_FROM")}" --chain-id "$(seth chain-id)" --gas-price "${ETH_GAS_PRICE:-$(seth gas-price)}" - --gas-limit "${ETH_GAS:-$(seth estimate $ETH_FROM ${$data:-0x})}" + --gas-limit "${ETH_GAS:-$(seth estimate $ETH_FROM $data)}" --value "$value" - --data "${data:-0x}" + --data "$data" ) if [[ $SETH_CREATE ]]; then From 772259b3025bc992c53cb4856f62611de715de06 Mon Sep 17 00:00:00 2001 From: ncitron Date: Sun, 7 Nov 2021 00:38:28 -0400 Subject: [PATCH 04/20] fix gas estimation when deploying --- src/seth/libexec/seth/seth-mktx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/seth/libexec/seth/seth-mktx b/src/seth/libexec/seth/seth-mktx index d7ffffd2b..fd3cfb499 100755 --- a/src/seth/libexec/seth/seth-mktx +++ b/src/seth/libexec/seth/seth-mktx @@ -15,12 +15,20 @@ fi data=${data:-0x} +if [[ -z "$ETH_GAS" ]]; then + if [[ $SETH_CREATE ]]; then + ETH_GAS=$(seth estimate --create $ETH_FROM $data) + else + ETH_GAS=$(seth estimate $ETH_FROM $data) + fi +fi + args=( --from "$(seth --to-address "$ETH_FROM")" --nonce "${ETH_NONCE:-$(seth nonce "$ETH_FROM")}" --chain-id "$(seth chain-id)" --gas-price "${ETH_GAS_PRICE:-$(seth gas-price)}" - --gas-limit "${ETH_GAS:-$(seth estimate $ETH_FROM $data)}" + --gas-limit "$ETH_GAS" --value "$value" --data "$data" ) From 7183940651d60576ecb78e88fa98ccc4709d161c Mon Sep 17 00:00:00 2001 From: ncitron Date: Sun, 7 Nov 2021 00:58:53 -0400 Subject: [PATCH 05/20] remove from in gas est for create --- src/seth/libexec/seth/seth-mktx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/seth/libexec/seth/seth-mktx b/src/seth/libexec/seth/seth-mktx index fd3cfb499..3c04479c4 100755 --- a/src/seth/libexec/seth/seth-mktx +++ b/src/seth/libexec/seth/seth-mktx @@ -17,7 +17,7 @@ data=${data:-0x} if [[ -z "$ETH_GAS" ]]; then if [[ $SETH_CREATE ]]; then - ETH_GAS=$(seth estimate --create $ETH_FROM $data) + ETH_GAS=$(seth estimate --create $data) else ETH_GAS=$(seth estimate $ETH_FROM $data) fi From f423aae6584e60997e30b9870a0e711a9a5799de Mon Sep 17 00:00:00 2001 From: ncitron Date: Sun, 7 Nov 2021 01:02:12 -0400 Subject: [PATCH 06/20] use raw rpc call for gas estimation --- src/seth/libexec/seth/seth-mktx | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/seth/libexec/seth/seth-mktx b/src/seth/libexec/seth/seth-mktx index 3c04479c4..0d0fc6de3 100755 --- a/src/seth/libexec/seth/seth-mktx +++ b/src/seth/libexec/seth/seth-mktx @@ -16,11 +16,16 @@ fi data=${data:-0x} if [[ -z "$ETH_GAS" ]]; then - if [[ $SETH_CREATE ]]; then - ETH_GAS=$(seth estimate --create $data) - else - ETH_GAS=$(seth estimate $ETH_FROM $data) - fi + jshon+=(-n {}) + [[ $TO ]] && jshon+=(-s "$TO" -i to) + jshon+=(-s "$DATA" -i data) + # shellcheck disable=SC2207 + jshon+=($(SETH_PARAMS_NO_GAS=1 seth --send-params)) + jshon+=(-i append) + [[ $ETH_BLOCK = [0-9]* ]] && ETH_BLOCK=$(seth --to-hex "$ETH_BLOCK") + : "${ETH_BLOCK:=latest}" # geth doesn't like this argument + [[ $ETH_BLOCK = latest ]] || jshon+=(-s "$ETH_BLOCK" -i append) + ETH_GAS=$(seth rpc eth_estimateGas -- "${jshon[@]}") fi args=( From c326a8ac206d5b3329a07ef0838bcda6ddf4ee6e Mon Sep 17 00:00:00 2001 From: ncitron Date: Sun, 7 Nov 2021 01:04:41 -0400 Subject: [PATCH 07/20] proper data var name --- src/seth/libexec/seth/seth-mktx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/seth/libexec/seth/seth-mktx b/src/seth/libexec/seth/seth-mktx index 0d0fc6de3..cd8cf1548 100755 --- a/src/seth/libexec/seth/seth-mktx +++ b/src/seth/libexec/seth/seth-mktx @@ -18,7 +18,7 @@ data=${data:-0x} if [[ -z "$ETH_GAS" ]]; then jshon+=(-n {}) [[ $TO ]] && jshon+=(-s "$TO" -i to) - jshon+=(-s "$DATA" -i data) + jshon+=(-s "$data" -i data) # shellcheck disable=SC2207 jshon+=($(SETH_PARAMS_NO_GAS=1 seth --send-params)) jshon+=(-i append) From 38a8828cc8416e3d7b06b46072d271c06b9d818f Mon Sep 17 00:00:00 2001 From: ncitron Date: Sun, 7 Nov 2021 01:09:36 -0400 Subject: [PATCH 08/20] unused blocknum logic --- src/seth/libexec/seth/seth-mktx | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/seth/libexec/seth/seth-mktx b/src/seth/libexec/seth/seth-mktx index cd8cf1548..36512f199 100755 --- a/src/seth/libexec/seth/seth-mktx +++ b/src/seth/libexec/seth/seth-mktx @@ -22,9 +22,6 @@ if [[ -z "$ETH_GAS" ]]; then # shellcheck disable=SC2207 jshon+=($(SETH_PARAMS_NO_GAS=1 seth --send-params)) jshon+=(-i append) - [[ $ETH_BLOCK = [0-9]* ]] && ETH_BLOCK=$(seth --to-hex "$ETH_BLOCK") - : "${ETH_BLOCK:=latest}" # geth doesn't like this argument - [[ $ETH_BLOCK = latest ]] || jshon+=(-s "$ETH_BLOCK" -i append) ETH_GAS=$(seth rpc eth_estimateGas -- "${jshon[@]}") fi From 6dc76af339441909615b8b46d5f21fda383d8765 Mon Sep 17 00:00:00 2001 From: ncitron Date: Sun, 7 Nov 2021 01:25:04 -0400 Subject: [PATCH 09/20] add TO parameter when estimating gas --- src/seth/libexec/seth/seth-mktx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/seth/libexec/seth/seth-mktx b/src/seth/libexec/seth/seth-mktx index 36512f199..b04c067c1 100755 --- a/src/seth/libexec/seth/seth-mktx +++ b/src/seth/libexec/seth/seth-mktx @@ -15,6 +15,10 @@ fi data=${data:-0x} +if [[ -z "$SETH_CREATE" ]]; then + TO=$(seth --to-address "$1") +fi + if [[ -z "$ETH_GAS" ]]; then jshon+=(-n {}) [[ $TO ]] && jshon+=(-s "$TO" -i to) @@ -38,7 +42,7 @@ args=( if [[ $SETH_CREATE ]]; then args+=(--create) else - args+=(--to "$(seth --to-address "$1")") + args+=(--to "$TO") fi if [[ $ETH_PRIO_FEE ]]; then From 42235fbb20d34334905fa82e22f90224a4c69f55 Mon Sep 17 00:00:00 2001 From: ncitron Date: Sun, 7 Nov 2021 01:34:26 -0400 Subject: [PATCH 10/20] update docs --- src/seth/CHANGELOG.md | 1 + src/seth/README.md | 4 ++-- src/seth/libexec/seth/seth-mktx | 1 - src/seth/libexec/seth/seth-send | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/seth/CHANGELOG.md b/src/seth/CHANGELOG.md index 4b2ea6403..566af725f 100644 --- a/src/seth/CHANGELOG.md +++ b/src/seth/CHANGELOG.md @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `seth index` command returns the slot number for the specified mapping type and input data - `seth --from-fix` command converts fixed point numbers into parsed integers with the specified number of decimals - `seth run-tx` now fetches contract source from etherscan if `ETHERSCAN_API_KEY` is set +- `seth mktx` now estimates gas limit eth `ETH_GAS` is not set ### Fixed diff --git a/src/seth/README.md b/src/seth/README.md index 2e52b1202..eb742c7e0 100644 --- a/src/seth/README.md +++ b/src/seth/README.md @@ -238,7 +238,7 @@ wei—the smallest possible amount of ether—to the [Ethereum Foundation's donation address]: $ seth send --value 1 0xfB6916095ca1df60bB79Ce92cE3Ea74c37c5d359 - seth-send: warning: `ETH_GAS' not set; using default gas amount + seth-send: warning: `ETH_GAS' not set; using estimated gas amount Ethereum account passphrase (not echoed): seth-send: Published transaction with 0 bytes of calldata. seth-send: 0xe428d4bb148ded426777ae892578507e4f394f608ad9d3a9d0229e8348ba72e3 @@ -829,7 +829,7 @@ Sign and publish a transaction to the blockchain. | ------------- | --------------- | ------------ | --------------- | | `--block` | `ETH_BLOCK` | `latest` | block number | | `--from` | `ETH_FROM` | n/a | sender | -| `--gas` | `ETH_GAS` | `200000` | gas quantity | +| `--gas` | `ETH_GAS` | estimated | gas quantity | | `--gas-price` | `ETH_GAS_PRICE` | | gas price | | `--prio-fee` | `ETH_PRIO_FEE` | | EIP-1559 priority fee (miner tip) | | `--value` | `ETH_VALUE` | `0` | ether value | diff --git a/src/seth/libexec/seth/seth-mktx b/src/seth/libexec/seth/seth-mktx index b04c067c1..ac508fba0 100755 --- a/src/seth/libexec/seth/seth-mktx +++ b/src/seth/libexec/seth/seth-mktx @@ -23,7 +23,6 @@ if [[ -z "$ETH_GAS" ]]; then jshon+=(-n {}) [[ $TO ]] && jshon+=(-s "$TO" -i to) jshon+=(-s "$data" -i data) - # shellcheck disable=SC2207 jshon+=($(SETH_PARAMS_NO_GAS=1 seth --send-params)) jshon+=(-i append) ETH_GAS=$(seth rpc eth_estimateGas -- "${jshon[@]}") diff --git a/src/seth/libexec/seth/seth-send b/src/seth/libexec/seth/seth-send index f12300de7..7ce8dadf2 100755 --- a/src/seth/libexec/seth/seth-send +++ b/src/seth/libexec/seth/seth-send @@ -24,7 +24,7 @@ set -e [[ $ETH_FROM ]] || seth --fail "${0##*/}: error: \`ETH_FROM' not set; send from which account?" [[ $ETH_GAS ]] || -echo >&2 "${0##*/}: warning: \`ETH_GAS' not set; using default gas amount" +echo >&2 "${0##*/}: warning: \`ETH_GAS' not set; using estimated gas amount" if [[ $SETH_RESEND ]]; then nonce=$(seth nonce "$ETH_FROM") export ETH_NONCE=$nonce From 9843e2c64e492865ee28b0879b85baf224f78d62 Mon Sep 17 00:00:00 2001 From: ncitron Date: Sun, 7 Nov 2021 01:46:57 -0400 Subject: [PATCH 11/20] add back linter ignore --- src/seth/libexec/seth/seth-mktx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/seth/libexec/seth/seth-mktx b/src/seth/libexec/seth/seth-mktx index ac508fba0..b04c067c1 100755 --- a/src/seth/libexec/seth/seth-mktx +++ b/src/seth/libexec/seth/seth-mktx @@ -23,6 +23,7 @@ if [[ -z "$ETH_GAS" ]]; then jshon+=(-n {}) [[ $TO ]] && jshon+=(-s "$TO" -i to) jshon+=(-s "$data" -i data) + # shellcheck disable=SC2207 jshon+=($(SETH_PARAMS_NO_GAS=1 seth --send-params)) jshon+=(-i append) ETH_GAS=$(seth rpc eth_estimateGas -- "${jshon[@]}") From b8fa44cfd9829bacd6e85fb1b31d68aac9b30fcc Mon Sep 17 00:00:00 2001 From: ncitron Date: Sun, 7 Nov 2021 12:42:45 -0500 Subject: [PATCH 12/20] remove ETH_GAS unset warning in seth send --- src/seth/README.md | 1 - src/seth/libexec/seth/seth-send | 2 -- 2 files changed, 3 deletions(-) diff --git a/src/seth/README.md b/src/seth/README.md index eb742c7e0..b087a6b1d 100644 --- a/src/seth/README.md +++ b/src/seth/README.md @@ -238,7 +238,6 @@ wei—the smallest possible amount of ether—to the [Ethereum Foundation's donation address]: $ seth send --value 1 0xfB6916095ca1df60bB79Ce92cE3Ea74c37c5d359 - seth-send: warning: `ETH_GAS' not set; using estimated gas amount Ethereum account passphrase (not echoed): seth-send: Published transaction with 0 bytes of calldata. seth-send: 0xe428d4bb148ded426777ae892578507e4f394f608ad9d3a9d0229e8348ba72e3 diff --git a/src/seth/libexec/seth/seth-send b/src/seth/libexec/seth/seth-send index 7ce8dadf2..ea1663b0f 100755 --- a/src/seth/libexec/seth/seth-send +++ b/src/seth/libexec/seth/seth-send @@ -23,8 +23,6 @@ set -e [[ $ETH_FROM ]] || seth --fail "${0##*/}: error: \`ETH_FROM' not set; send from which account?" -[[ $ETH_GAS ]] || -echo >&2 "${0##*/}: warning: \`ETH_GAS' not set; using estimated gas amount" if [[ $SETH_RESEND ]]; then nonce=$(seth nonce "$ETH_FROM") export ETH_NONCE=$nonce From e68c6d83a5843b616459aeef0aaab26ee4c8271d Mon Sep 17 00:00:00 2001 From: ncitron Date: Sun, 7 Nov 2021 15:16:49 -0500 Subject: [PATCH 13/20] fix changelog --- src/seth/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/seth/CHANGELOG.md b/src/seth/CHANGELOG.md index 566af725f..89da50228 100644 --- a/src/seth/CHANGELOG.md +++ b/src/seth/CHANGELOG.md @@ -15,7 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `seth index` command returns the slot number for the specified mapping type and input data - `seth --from-fix` command converts fixed point numbers into parsed integers with the specified number of decimals - `seth run-tx` now fetches contract source from etherscan if `ETHERSCAN_API_KEY` is set -- `seth mktx` now estimates gas limit eth `ETH_GAS` is not set +- `seth mktx` now estimates gas limit if `ETH_GAS` is not set ### Fixed From 2ce9250a60f0ad603b29b3f62e7d9acfd2e8714d Mon Sep 17 00:00:00 2001 From: ncitron Date: Sun, 7 Nov 2021 19:21:21 -0500 Subject: [PATCH 14/20] add seth estimate-raw --- src/seth/libexec/seth/seth-estimate-raw | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/seth/libexec/seth/seth-estimate-raw diff --git a/src/seth/libexec/seth/seth-estimate-raw b/src/seth/libexec/seth/seth-estimate-raw new file mode 100644 index 000000000..8f5944616 --- /dev/null +++ b/src/seth/libexec/seth/seth-estimate-raw @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +set -e + +jshon+=(-n {}) +[[ $TO ]] && jshon+=(-s "$TO" -i to) +jshon+=(-s "$data" -i data) +# shellcheck disable=SC2207 +jshon+=($(SETH_PARAMS_NO_GAS=1 seth --send-params)) +jshon+=(-i append) + +seth rpc eth_estimateGas -- "${jshon[@]}" \ No newline at end of file From d06f6baef342255318d598a7967570b855026a1e Mon Sep 17 00:00:00 2001 From: ncitron Date: Sun, 7 Nov 2021 19:30:11 -0500 Subject: [PATCH 15/20] use seth estimate for mktx estimation --- src/seth/libexec/seth/seth-estimate | 3 ++- src/seth/libexec/seth/seth-estimate-raw | 12 ------------ src/seth/libexec/seth/seth-mktx | 12 +++++------- 3 files changed, 7 insertions(+), 20 deletions(-) delete mode 100644 src/seth/libexec/seth/seth-estimate-raw diff --git a/src/seth/libexec/seth/seth-estimate b/src/seth/libexec/seth/seth-estimate index 41864607e..26e03fd5e 100755 --- a/src/seth/libexec/seth/seth-estimate +++ b/src/seth/libexec/seth/seth-estimate @@ -4,6 +4,7 @@ ### or: seth estimate [] ### or: seth estimate [] --create [] ### or: seth estimate [] --create +### or: seth estimate [] --create ### ### Perform a local call to and return the gas usage. ### @@ -15,7 +16,7 @@ ### With `-F ', simulate calling from ### With `-V ', simulate transferring to . set -e -[[ $2 ]] || seth --fail-usage "$0" +[[ $1 ]] || seth --fail-usage "$0" if [[ $SETH_CREATE ]]; then DATA=$(seth --to-hexdata "$1") diff --git a/src/seth/libexec/seth/seth-estimate-raw b/src/seth/libexec/seth/seth-estimate-raw deleted file mode 100644 index 8f5944616..000000000 --- a/src/seth/libexec/seth/seth-estimate-raw +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash - -set -e - -jshon+=(-n {}) -[[ $TO ]] && jshon+=(-s "$TO" -i to) -jshon+=(-s "$data" -i data) -# shellcheck disable=SC2207 -jshon+=($(SETH_PARAMS_NO_GAS=1 seth --send-params)) -jshon+=(-i append) - -seth rpc eth_estimateGas -- "${jshon[@]}" \ No newline at end of file diff --git a/src/seth/libexec/seth/seth-mktx b/src/seth/libexec/seth/seth-mktx index b04c067c1..b9a340fdd 100755 --- a/src/seth/libexec/seth/seth-mktx +++ b/src/seth/libexec/seth/seth-mktx @@ -20,13 +20,11 @@ if [[ -z "$SETH_CREATE" ]]; then fi if [[ -z "$ETH_GAS" ]]; then - jshon+=(-n {}) - [[ $TO ]] && jshon+=(-s "$TO" -i to) - jshon+=(-s "$data" -i data) - # shellcheck disable=SC2207 - jshon+=($(SETH_PARAMS_NO_GAS=1 seth --send-params)) - jshon+=(-i append) - ETH_GAS=$(seth rpc eth_estimateGas -- "${jshon[@]}") + if [[ $SETH_CREATE ]]; then + ETH_GAS=$(seth estimate --create $data) + else + ETH_GAS=$(seth estimate $TO $data) + fi fi args=( From 07483f9235794f16063403d1eb56a776086f96d1 Mon Sep 17 00:00:00 2001 From: ncitron Date: Sun, 7 Nov 2021 19:41:06 -0500 Subject: [PATCH 16/20] add gas estimation for rpc sends --- src/seth/libexec/seth/seth-send | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/seth/libexec/seth/seth-send b/src/seth/libexec/seth/seth-send index ea1663b0f..c677388d3 100755 --- a/src/seth/libexec/seth/seth-send +++ b/src/seth/libexec/seth/seth-send @@ -42,9 +42,18 @@ else fi fi +if [[ -z "$ETH_GAS" ]]; then + if [[ $SETH_CREATE ]]; then + ETH_GAS=$(seth estimate --create $DATA) + else + ETH_GAS=$(seth estimate $TO $DATA) + fi +fi + jshon+=(-n {}) [[ $TO ]] && jshon+=(-s "$TO" -i to) [[ $DATA ]] && jshon+=(-s "$DATA" -i data) +[[ $ETH_GAS ]] && jshon+=(-s "$ETH_GAS" -i gas) # shellcheck disable=SC2207 jshon+=($(seth --send-params)) jshon+=(-i append) From 8d5b6fe5db98c68aa0c2a78fbe95842a3b94d486 Mon Sep 17 00:00:00 2001 From: ncitron Date: Sun, 7 Nov 2021 19:42:51 -0500 Subject: [PATCH 17/20] fix null data --- src/seth/libexec/seth/seth-send | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/seth/libexec/seth/seth-send b/src/seth/libexec/seth/seth-send index c677388d3..19e34f291 100755 --- a/src/seth/libexec/seth/seth-send +++ b/src/seth/libexec/seth/seth-send @@ -44,7 +44,7 @@ fi if [[ -z "$ETH_GAS" ]]; then if [[ $SETH_CREATE ]]; then - ETH_GAS=$(seth estimate --create $DATA) + ETH_GAS=$(seth estimate --create ${$DATA:-0x}) else ETH_GAS=$(seth estimate $TO $DATA) fi From 5a7e024980056bbb4d7fde6e92ed489d17979c4b Mon Sep 17 00:00:00 2001 From: ncitron Date: Sun, 7 Nov 2021 19:46:41 -0500 Subject: [PATCH 18/20] fix null data --- src/seth/libexec/seth/seth-send | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/seth/libexec/seth/seth-send b/src/seth/libexec/seth/seth-send index 19e34f291..95dcf45d3 100755 --- a/src/seth/libexec/seth/seth-send +++ b/src/seth/libexec/seth/seth-send @@ -44,7 +44,7 @@ fi if [[ -z "$ETH_GAS" ]]; then if [[ $SETH_CREATE ]]; then - ETH_GAS=$(seth estimate --create ${$DATA:-0x}) + ETH_GAS=$(seth estimate --create ${DATA:-0x}) else ETH_GAS=$(seth estimate $TO $DATA) fi From 7c8b24ec440e6af35969fc625aefe751e107396f Mon Sep 17 00:00:00 2001 From: ncitron Date: Sun, 7 Nov 2021 19:48:29 -0500 Subject: [PATCH 19/20] fix null data --- src/seth/libexec/seth/seth-send | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/seth/libexec/seth/seth-send b/src/seth/libexec/seth/seth-send index 95dcf45d3..3d72f1b5d 100755 --- a/src/seth/libexec/seth/seth-send +++ b/src/seth/libexec/seth/seth-send @@ -44,9 +44,9 @@ fi if [[ -z "$ETH_GAS" ]]; then if [[ $SETH_CREATE ]]; then - ETH_GAS=$(seth estimate --create ${DATA:-0x}) + ETH_GAS=$(seth estimate --create $DATA) else - ETH_GAS=$(seth estimate $TO $DATA) + ETH_GAS=$(seth estimate $TO ${DATA:-0x}) fi fi From 5568fedf387a35fcf276693ca6f2d608fbc98388 Mon Sep 17 00:00:00 2001 From: ncitron Date: Sun, 7 Nov 2021 20:05:54 -0500 Subject: [PATCH 20/20] update docs --- src/seth/CHANGELOG.md | 1 + src/seth/README.md | 1 + 2 files changed, 2 insertions(+) diff --git a/src/seth/CHANGELOG.md b/src/seth/CHANGELOG.md index 89da50228..24aaa460a 100644 --- a/src/seth/CHANGELOG.md +++ b/src/seth/CHANGELOG.md @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `seth --from-fix` command converts fixed point numbers into parsed integers with the specified number of decimals - `seth run-tx` now fetches contract source from etherscan if `ETHERSCAN_API_KEY` is set - `seth mktx` now estimates gas limit if `ETH_GAS` is not set +- `seth send` now estimates gas limit if `ETH_GAS` is not set ### Fixed diff --git a/src/seth/README.md b/src/seth/README.md index b087a6b1d..0786eae9c 100644 --- a/src/seth/README.md +++ b/src/seth/README.md @@ -659,6 +659,7 @@ node's gas estimation. seth estimate [] [] seth estimate [] --create [] seth estimate [] --create + seth estimate [] --create Options are similar to [`seth send`], but no transaction is published.