# Types of smart contracts

There are three types of smart contracts with different execution engines that are invoked via a dispatch center:

1. **Native contracts:** Ontology's ONT and ONG contracts that govern all the OEP token protocols and their corresponding functioning.
2. **NeoVM contracts:** Smart contracts that are compiled to **AVM** bytecode, which is then run on the **NeoVM** engine. Currently supported in **Python** and **C#**.
3. **WebAssembly (WASM) VM contracts:** Smart contracts that are compiled to a portable binary code format that can be read and executed by the WebAssembly engine. Currently supported in **Rust** and **C++.**

Let us take a closer look at the flow of control for a smart contract execution cycle.

![](/files/-LwScRKDr2SKk4EI-ZiU)

#### Smart contract invocation mechanism

Once a smart contract has been compiled to **AVM bytecode** and the stack `opcode` is obtained, the contract is transmitted to the chain along with some relevant information regarding the contract. This is involves a transaction that consumes a certain amount of gas, and this is the state where a contract is considered to be deployed on the chain.

Next, when a smart contract is **invoked**, the **layer dispatch** center determines the nature of the contract. The three types of contracts all run on **different engines** and so the flow of control is transferred to the respective contract layer.

For every subsequent invocation from app calls the same procedure is followed.

## EVM Contracts

Solidity smart contracts that run in an **Ethereum Virtual Machine (EVM)** environment in the Ethereum  network can be also deployed on Ontology. All the same development and testing tools, such as the MetaMask wallet, the web3.js library, Truffle and Hardhat development frameworks, etc. can be used for writing, testing, deploying, and running EVM contracts on the Ontology testnet and mainnet.

Solidity contracts are compiled to bytecode and executed in the form of EVM opcodes.

You are now familiar with what smart contracts are, what they can be used to achieve, and how they are executed on the **Ontology** platform. Follow the link below to refer to our smart contract development guides.

{% content-ref url="/pages/-LwHH-VgkPwtRNw6rc4n" %}
[Smart Contract Development](/guides-and-tutorials/development-guides/smart-contract-dev.md)
{% endcontent-ref %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ont.io/ontology-elements/smart-contracts/types.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
