Deploying a standard smart contract, binded contract or term contract

Kujua has three types of smart contracts namely a standard contract (sx), binded contract (bx) and term contract (tx). Generate a contract 'sx', 'bx' or 'tx' wallet address key pair using function generate_address(). Add the wallet address to the value in class 'Cluster' 'standard_contract_address', 'binded_contract_address' or 'term_address', also add a 'description' and the code to 'executable' in format hexlify("""your code""".encode("utf-8")).decode("utf-8") within the triple quotations ("""e.g"""), (The upcoming release of Kujua will only support code that is converted to byte code but still have a way to verify the contents of the contract). Make sure you send your contract address enough Juana to cover the fees for the next step. Then finally to deploy, you will need to send 0.0001 using the address and private key of the contract address and send the amount to the same contract address itself (send to oneself).


# Create a standard contract
# send a standard amount of 0.0001 to broadcast
fees = functions.calculate_fees(0.0001,
                                inputs.node.node_url,
                                inputs.dummy.recipient_address)

broadcast = functions.broadcast(inputs.wallet.wallet_address,
                                inputs.wallet.private_key_encrypted,  # only use a dummy address's private key until we make kujuaOffChainRelay public
                                inputs.wallet.passphrase,
                                0.0001,
                                fees['content']['full_fee'],
                                inputs.node.node_url,
                                str(),
                                inputs.dummy.recipient_address,
                                str(),
                                0,
                                0,
                                str(),
                                'create_contract',
                                (None,),
                                inputs.wallet.standard_contract,
                                True,
                                inputs.node.gt_node_url,
                                False)
print(broadcast)

# Create a binded contract
# send a standard amount of 0.0001 to broadcast
fees = functions.calculate_fees(0.0001,
                                inputs.node.node_url,
                                inputs.dummy.recipient_address)

broadcast = functions.broadcast(inputs.wallet.wallet_address,
                                inputs.wallet.private_key_encrypted,  # only use a dummy address's private key until we make kujuaOffChainRelay public
                                inputs.wallet.passphrase,
                                0.0001,
                                fees['content']['full_fee'],
                                inputs.node.node_url,
                                str(),
                                inputs.dummy.recipient_address,
                                str(),
                                0,
                                0,
                                str(),
                                'create_binded_contract',
                                (None,),
                                inputs.wallet.binded_contract,
                                True,
                                inputs.node.gt_node_url,
                                False)
print(broadcast)

# Create a term
# send a standard amount of 0.0001 to broadcast
fees = functions.calculate_fees(0.0001,
                                inputs.node.node_url,
                                inputs.dummy.recipient_address)

broadcast = functions.broadcast(inputs.wallet.wallet_address,
                                inputs.wallet.private_key_encrypted,  # only use a dummy address's private key until we make kujuaOffChainRelay public
                                inputs.wallet.passphrase,
                                0.0001,
                                fees['content']['full_fee'],
                                inputs.node.node_url,
                                str(),
                                inputs.dummy.recipient_address,
                                str(),
                                0,
                                0,
                                str(),
                                'create_term',
                                (None,),
                                inputs.wallet.term,
                                True,
                                inputs.node.gt_node_url,
                                False)
print(broadcast)
data points: contract_address, binded_contract_address, term_address, description, executable