Cannot read properties of undefined (reading 'abi')
carlomigueldy opened this issue · comments
Description
I am trying to propose a custom transaction supplied encoded function data in batch to my Safe programmatically in backend, I have followed everything from the docs, yet it's throwing an exception when I call init from protocol-kit package.
Environment
- Safe Core SDK version:
^4.0.0
- Safe contract version: not sure
- Environment:
- browser
- non-browser
Steps to reproduce
If applicable, please provide a screenshot or small video reproducing the bug.
Provide as much information as necessary to reproduce the bug.
Check the gist here.
Expected result
Should get something like this.
Additional context
Add any other context about the problem here.
Could you please share which chain you are trying to use?
I also see you are having a custom @app/contracts
which you are not setting in the Safe.init, may be related if you are using something custom.
I am using Base Sepolia chain 84532
@dasanra
@dasanra I use @app/constants
import in here (not @app/contracts
btw), to get the safe address from my constants
Could you share which specific versions you are using from
@safe-global/api-kit
@safe-global/protocol-kit
@safe-global/safe-core-sdk-types
I'm not able to get the same error locally.
The gist you shared seems fine, as long as the Safe is already deployed.
Here ya go man @dasanra
{
...
"@safe-global/api-kit": "^2.4.0",
"@safe-global/protocol-kit": "^4.0.0",
"@safe-global/safe-core-sdk-types": "^4.0.2",
...
}
Could you please push @safe-global/safe-core-sdk-types
to the latest v5?
That should solve the issue
Alright, sec will give it a try
It worked @dasanra, however now getting a different exception. It's an out of scope of this issue, but maybe you have some ideas?
EDIT: Created a separate issue instead on #829
[App] - 5/27/2024, 11:16:29 PM VERBOSE [SafeAppService.proposeTransaction]: Initializing protocol kit +0ms
[App] - 5/27/2024, 11:16:31 PM VERBOSE [SafeAppService.proposeTransaction]: Creating safe transaction +2s
[App] - 5/27/2024, 11:16:31 PM VERBOSE [SafeAppService.proposeTransaction]: Getting safe transaction hash +578ms
[App] - 5/27/2024, 11:16:32 PM VERBOSE [SafeAppService.proposeTransaction]: Signing the transaction hash +206ms
[App] - 5/27/2024, 11:16:32 PM VERBOSE [SafeAppService.proposeTransaction]: Proposing the transaction to safe +5ms
[App] - 5/27/2024, 11:16:32 PM ERROR [SafeAppService.proposeTransaction]: Error while proposing transaction request to https://safe-transaction-base-sepolia.safe.global/api/v1/safes/0x3DbE5B38d41394A756246997407408b421937c7B/multisig-transactions/ failed, reason: write EPROTO 4078382E9E7F0000:error:0A00010B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:354:
- {
type: 'system',
errno: 'EPROTO',
code: 'EPROTO',
stack: 'FetchError: request to https://safe-transaction-base-sepolia.safe.global/api/v1/safes/0x3DbE5B38d41394A756246997407408b421937c7B/multisig-transactions/ failed, reason: write EPROTO 4078382E9E7F0000:error:0A00010B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:354:\n' +
'\n' +
' at ClientRequest.<anonymous> (/home/carlomigueldy/dev/limitless-labs-group/limitless-exchange-api/node_modules/.pnpm/node-fetch@2.7.0/node_modules/node-fetch/lib/index.js:1501:11)\n' +
' at ClientRequest.emit (node:events:519:28)\n' +
' at TLSSocket.socketErrorListener (node:_http_client:500:9)\n' +
' at TLSSocket.emit (node:events:519:28)\n' +
' at emitErrorNT (node:internal/streams/destroy:169:8)\n' +
' at emitErrorCloseNT (node:internal/streams/destroy:128:3)\n' +
' at processTicksAndRejections (node:internal/process/task_queues:82:21)'
} +497ms
Let's close this one and continue the discussion in the new one that you created