ink! is a programming language for smart contracts; blockchains built with the Substrate framework can choose from a
number of smart contract languages which one(s) they want to support. ink! is one of them. It is an opinionated
language that we have built by extending the popular Rust programming language with functionality needed to make
it smart contract compatible.
# Do a gas estimation of the messagegas_predit_result=contract.read(keypair,'flip')print('Result of dry-run: ',gas_predit_result.value)print('Gas estimate: ',gas_predit_result.gas_required)# Do the actual callprint('Executing contract call...')contract_receipt=contract.exec(keypair,'flip',args={},gas_limit=gas_predit_result.gas_required)ifcontract_receipt.is_success:print(f'Events triggered in contract: {contract_receipt.contract_events}')else:print(f'Error message: {contract_receipt.error_message}')