Added contract_create/3,8

This commit is contained in:
Craig Everett
2022-11-09 19:24:41 +09:00
parent 446cf1b58c
commit f803e66ed3
+13 -1
View File
@@ -921,13 +921,25 @@ contract_create2(CreatorID, Nonce,
contract_create3(CreatorID, Nonce, contract_create3(CreatorID, Nonce,
Amount, Gas, GasPrice, Fee, Amount, Gas, GasPrice, Fee,
Compiled, CallData) -> Compiled, CallData) ->
try
{account_pubkey, OwnerID} = aeser_api_encoder:decode(CreatorID),
contract_create4(OwnerID, Nonce,
Amount, Gas, GasPrice, Fee,
Compiled, CallData)
catch
Error:Reason -> {Error, Reason}
end.
contract_create4(OwnerID, Nonce,
Amount, Gas, GasPrice, Fee,
Compiled, CallData) ->
Code = aeser_contract_code:serialize(Compiled), Code = aeser_contract_code:serialize(Compiled),
CTVersion = 2, CTVersion = 2,
ContractCreateVersion = 1, ContractCreateVersion = 1,
TTL = 0, TTL = 0,
Type = contract_create_tx, Type = contract_create_tx,
Fields = Fields =
[{owner_id, aeser_id:create(account, CreatorID)}, [{owner_id, aeser_id:create(account, OwnerID)},
{nonce, Nonce}, {nonce, Nonce},
{code, Code}, {code, Code},
{ct_version, CTVersion}, {ct_version, CTVersion},