I’m having trouble calling /encode-calldata endpoint on my local sophia-compiler. I use [email protected] which boots up aesophia_http:v2.1.0 docker image when starting local Ae nodes.
The error I get is 403 Forbidden with following description:
Type errors\nUnbound variable ak_FHZrEbRmanKUe9ECPXVNTLLpRP2SeQCLCT6Vnvs9JuVu78J7V at line 53, column 36\n
The address in this error message is actually the one I’m trying to encode (wallet variable in example code above). coopSource is the full source code of contract containing add_wallet() function.
Contract compiles successfully (tried with forgae compile). Also no problems with deployment.
Here’s the function:
public stateful function add_wallet(wallet: address) =
only_owner()
put(state{ activeWallets[wallet] = true })
Thanks, I’ve updated compiler version but now my deployment script fails
I have two contracts A and B. B is deployed with address of deployed A as init parameter. This init parameter is not of type address, but AInterface which is my interface over the deployed A contract. I used to provide this parameter in form of address and it worked well. With new compiler, when encode data is called for this init function I get the error:
“Type errors\nCannot unify AInterface\n and bytes(32)”
I understand error message, init function asks for AInterface type and I’m providing address type but I thought these two are interchangeable?
How should I change my code or deploy script for this to work?
From the error message it sounds as if you are providing something of type bytes(32), i.e. #1a2b3c4d... rather than something of type AInterface, i.e. a contract ct_...