- Is it possible for one contract to deploy another contract, and if possible what is the Sophia syntax?
- Is it possible to pass arguments to the contract init function, and what would be the JS SDK syntax?
Not possible yet - here is the task to do it…
Yes this is certainly possible - just like passing arguments to a function in a contract call. Exactly how it is done in JS SDK I am afraid I don’t know, I’ll leave that part to the JS SDK experts!
const contractObject = await sdkInstance.getContractInstance(contractSource) // Init function: `entrypoint init (n: int, s: string): state => n` await contractObject.deploy([1, 'Hello']) // Array of init arguments // or await contractObject.methods.init(1, 'Hello') // Here the arguments order is the same as in sophia spurce