def get_unsigned_contract_create(owner, contract, external_api): contract_create_data_obj = ContractCreateData( owner=owner, code=contract["code"], vm_version=contract["vm_version"], deposit=contract["deposit"], amount=contract["amount"], gas=contract["gas"], gas_price=contract["gas_price"], fee=contract["fee"], call_data=contract["call_data"]) tx_obj = external_api.post_contract_create(contract_create_data_obj) return (tx_obj.tx, tx_obj.contract_address)
def get_unsigned_contract_create(owner, contract, external_api): bytecode = read_id_contract(external_api) call_input = ContractCallInput("sophia", bytecode, contract["function"], contract["argument"]) print("Call input:", call_input) result = external_api.encode_calldata(call_input) call_data = result.calldata contract_create_data_obj = ContractCreateData( owner=owner, code=bytecode, vm_version=contract["vm_version"], deposit=contract["deposit"], amount=contract["amount"], gas=contract["gas"], gas_price=contract["gas_price"], fee=contract["fee"], ttl=100, call_data=call_data) tx_obj = external_api.post_contract_create(contract_create_data_obj) return (tx_obj.tx, tx_obj.contract_address)