From 9c9d0ec848c44ccef3069902915c173e0ac84b3c Mon Sep 17 00:00:00 2001 From: morfeusz2844 Date: Wed, 1 Mar 2023 16:11:52 +0100 Subject: [PATCH 1/3] Resolve problem with mb_substr(): Argument #3 ($length) must be of type ?int, float given --- src/Contracts/SolidityType.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Contracts/SolidityType.php b/src/Contracts/SolidityType.php index 5adf5729..99cf9287 100644 --- a/src/Contracts/SolidityType.php +++ b/src/Contracts/SolidityType.php @@ -262,7 +262,7 @@ public function decode($value, $offset, $name) $dynamicOffset = (int) Utils::toBn('0x' . mb_substr($value, $offset * 2, 64))->toString(); $length = (int) Utils::toBn('0x' . mb_substr($value, $dynamicOffset * 2, 64))->toString(); $roundedLength = floor(($length + 31) / 32); - $param = mb_substr($value, $dynamicOffset * 2, ( 1 + $roundedLength) * 64); + $param = mb_substr($value, $dynamicOffset * 2, (int)(( 1 + $roundedLength) * 64)); return $this->outputFormat($param, $name); } $length = $this->staticPartLength($name); From 7184b329b4177714cfebe6b65f4589d701753c93 Mon Sep 17 00:00:00 2001 From: morfeusz2844 Date: Wed, 1 Mar 2023 16:33:06 +0100 Subject: [PATCH 2/3] change in composer --- composer.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index e03dcef0..6ab253f9 100644 --- a/composer.json +++ b/composer.json @@ -1,12 +1,11 @@ { - "name": "web3p/web3.php", + "name": "ca-morfeusz2844/web3.php", "description": "Ethereum web3 interface.", "type": "library", "license": "MIT", "authors": [ { - "name": "sc0Vu", - "email": "alk03073135@gmail.com" + "name": "ca-morfeusz2844" } ], "require": { From 394b4af94f68955858e30054f18ebc1946a136bb Mon Sep 17 00:00:00 2001 From: morfeusz2844 Date: Wed, 1 Mar 2023 16:45:36 +0100 Subject: [PATCH 3/3] Revert "change in composer" This reverts commit 7184b329b4177714cfebe6b65f4589d701753c93. --- composer.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 6ab253f9..e03dcef0 100644 --- a/composer.json +++ b/composer.json @@ -1,11 +1,12 @@ { - "name": "ca-morfeusz2844/web3.php", + "name": "web3p/web3.php", "description": "Ethereum web3 interface.", "type": "library", "license": "MIT", "authors": [ { - "name": "ca-morfeusz2844" + "name": "sc0Vu", + "email": "alk03073135@gmail.com" } ], "require": {