neo-node icon indicating copy to clipboard operation
neo-node copied to clipboard

Can't send all gas to an address in neo-cli

Open chenzhitong opened this issue 4 years ago • 7 comments

image

Description I want to transfer all my GAS to another address, and I can't do that in neo-cli.

Expected Automatically deduct the fee and transfer the balance to this address.

Suggestion: Can it automatically deduct the fee from the transfer amount when sending all?

chenzhitong avatar Jan 15 '21 08:01 chenzhitong

A nice feature 🆒.

ProDog avatar Jan 15 '21 09:01 ProDog

It can be done changing the type to string and parsing the string inside the method

shargon avatar Jan 15 '21 09:01 shargon

It can be done changing the type to string and parsing the string inside the method

Since we're still calculating NetFee per byte not per KB, how can we calculate that accurately if the tx is just over 1KB after signature is added.

superboyiii avatar Jan 15 '21 10:01 superboyiii

Since we're still calculating NetFee per byte not per KB, how can we calculate that accurately if the tx is just over 1KB after signature is added.

With zero padding for the big integer amount. The size will be the same for 1 and for 10000000. You will need to compute only twice the transaction, one for get the fee with 0000000000000001, substract the fee from the amount and sign.

image

shargon avatar Jan 15 '21 11:01 shargon

But it would be nice to have this https://github.com/neo-project/neo/pull/2008 otherwise, you will earn gas :)

shargon avatar Jan 15 '21 11:01 shargon

Since we're still calculating NetFee per byte not per KB, how can we calculate that accurately if the tx is just over 1KB after signature is added.

With zero padding for the big integer amount. The size will be the same for 1 and for 10000000. You will need to compute only twice the transaction, one for get the fee with 0000000000000001, substract the fee from the amount and sign.

image

Yeah, size will be the same for 1 and 10000000. But we could have multi addresses in wallet especially the exchange. They often have few gas in many wallet. If one signature is added, the size is bigger then netfee will be increased, if the second address has not enough gas then CLI has to ask the third address for more fee and more recalculate. So the issue is we don't know how many times we have to calculate or CLI will return fault after tried twice.

superboyiii avatar Jan 15 '21 11:01 superboyiii

We can try it 10 times?

shargon avatar Jan 15 '21 12:01 shargon

Old, if remains, please re-open

shargon avatar Dec 05 '23 13:12 shargon