i’m currently trying to deploy a contract
include "Library.aes" contract SophiaTypes = ...
with an include to a custom library.
namespace Library = type number = int function inc(x : number) : number = x + 1
Using the http-endpoint of the sophia-compiler to generate the bytecode works when i add the custom library in the file_system (see [Solved] Compilation of contract with include)
The next step is to create a ContractCreateTransaction to deploy the contract. Therefore i need the callData for the “init” Function, which is obtained using the “encode-calldata” function of the http-endpoint of the sophia compiler.
When i call this, i get an “500 internal server error”.
I guess, thus one of the parameters of the call is the sourcecode of the contract, that the include somehow has also to be passed.
Anyone faced a similar problem? @hanssv.chain - maybe you can enlighten us?
Thanks and regards,
Of course, you got two options:
- either you provide just a contract stub (without the include etc.) that just contains a function prototype for the function you are creating calldata for, or
- you provide the full contract, including the include files. The HTTP-compiler takes exactly the same
optionargument for encode calldata as it takes for compilation…
thanks again - seems that you revealed an issue within our Java SDK, the parameter is currently just missing and couldn’t be set