From 908d841bce5c183eeb5ae326bf2fe91ba0284edd Mon Sep 17 00:00:00 2001 From: Andrei Mateescu Date: Thu, 23 Aug 2018 08:31:18 +0300 Subject: [PATCH] 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 --- src/Contract.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Contract.php b/src/Contract.php index 476db71..7e1ddcc 100644 --- a/src/Contract.php +++ b/src/Contract.php @@ -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];