Transaction signed by contract failing with code 500
See original GitHub issueDescribe the bug
Hello, I’m trying to use a contract to generate signature for a transaction and trying to send it to Gnosis Safe transaction service. It is working when EOA signs the transaction, but it fails with error code 500 when the same thing is done using contract. The contract is implementing EIP 1271 isValidSignature
for signature verification.
To Reproduce Steps to reproduce the behavior:
- Do POST on ‘https://safe-transaction.rinkeby.gnosis.io/api/v1/safes/0x2E46E481d57477A0663a7Ec61E7eDc65F4cb7F5C/transactions/’
- Data:-
{
"safe": "0x2E46E481d57477A0663a7Ec61E7eDc65F4cb7F5C",
"to": "0xc68285210a663D10Ea66EAd1564cf6Ae83C8b3c3",
"value": 0,
"data": "0xbab29e0c",
"operation": 0,
"safeTxGas": 136123,
"baseGas": 0,
"gasPrice": 0,
"nonce": 1,
"contractTransactionHash": "0x74ce4479d935d3cc117e4aacbe756ebd06da34136ef3950d4a9a7e0e9f7013a6",
"sender": "0xd5aa96b0E4649694308E98c4613b1822Ff7a0eC8",
"signature": "0x000000000000000000000000d5aa96b0E4649694308E98c4613b1822Ff7a0eC800000000000000000000000000000000000000000000000000000000000000410000000000000000000000000000000000000000000000000000000000000000202290dc5085e3ccb19eebc96131752065a4d77f397887335181aae9fab8fdea78"
}
- The contract is deployed on rinkeby at address -
0xd5aa96b0E4649694308E98c4613b1822Ff7a0eC8
- The contract can be found here - https://gist.github.com/codebuster22/8dfa8c32804a598192cb7aa5fa93642d
Expected behavior Expected behavior was code 201, that is success and I should see the transaction created on the Gnosis Safe App.
Additional context I have been trying to create a contract signature for a week now, so it would be great to know if the error is with the signature and if it is what should be improved. Also, I won’t be doing any transaction from the safe so the nonce doesn’t change until it is diagnosed. Thank You in Advance.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
I’m new to this contract signatures, can I get some feedback on the signature I created. Maybe if I can know what I did wrong. The way I have structured is :-
0x{32-bytes padded address that implements EIP-1271}{32-bytes data-position, position of signature length}{1-byte signature type}{32-bytes length of signature}{bytes signature}
EIP1271 has updated its value to
0x1626ba7e
, I will update that