solang
solang copied to clipboard
create contract requires a new account
Trying to deploy new contract from Solang to Solana with code like:
contract adult { function test() public { hatchling h = new hatchling("luna"); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ } }
But got from deployer:
'Program log: create contract requires a new account', ... 'Program GFfuNq2g55YDtWFZeaQ7Pgrrk4nKNsbNuDVCjPVhVkbQ failed: Failed to serialize or deserialize account data: Unknown'
How can it be solved from Solang? Or I have to deploy this contract separately from new account, anyway?
A new account is needed to make this work. There is an example here:
https://github.com/hyperledger/solang/blob/main/integration/solana/create_contract.spec.ts