Don't send an empty "to" address when estimating gas for the constructor

Sending a empty "to" address when estimating the gas usage of the contract constructor returns the following error (from geth at least):

> invalid argument 0: hex string has length 0, want 40 for common.Address in
This commit is contained in:
Andrei Mateescu 2018-08-23 08:31:18 +03:00 committed by GitHub
parent 1fb7762eb7
commit 908d841bce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -544,7 +544,6 @@ class Contract
if (count($arguments) > 0) {
$transaction = $arguments[0];
}
$transaction['to'] = '';
$transaction['data'] = '0x' . $this->bytecode . Utils::stripZero($data);
} else {
$method = array_splice($arguments, 0, 1)[0];