Closed navigatrum closed 2 years ago
My fault.
Problem was that the contract isn't a sort-of EIP1271 returning bool
. But it's exaclty a EIP1271 returning bytes4
.
And while web3.js (and ethers.js) decoding implementation 'trasforms' the resulting transaction string
to true
(maybe casting it to bool
), web3.php transforms it to false
(for some reasons depending on how Ethabi::decodeParameters
is implemented).
I'm calling
isValidSignature
method from wallet contract implementingEIP1271
(sort of, returningbool
, for Argent [and Loopring] wallets, taken from spruceid/siwe/test/eip1271.json).Problem is that the
web3.php
call is returningfalse
; while theweb3.js
call is returningtrue
as expected.All the params are taken from the same json file, so they are exactly the same for both the implementations.
Here a test repo.
Code
In
php
I'm doing this (in a class extendingPHPUnit\Framework\TestCase
):resulting in:
This is the (working) js:
This is the json: