Ontology Developer Center
DISCOVERCOMMUNITYSUPPORT
  • Introduction
  • Discover Ontology
  • Getting Started
  • Glossary
  • Decentralized Identity and Data
    • ONT ID
      • Decentralized Identifiers
        • Method Specification for Ontology
        • Method Specification for Ethereum
        • Method Specification for BSC
      • Verifiable Credentials
        • Anonymous Credentials
      • ONT Login
        • Scenarios
        • Protocol Specification
        • Front-end JavaScript SDK
          • Integration and Usage
          • API Reference
        • Front-end UI SDK
          • Integration and Usage
          • API Reference
        • Back-end Go SDK
          • Integration and Usage
          • API Reference
        • Back-end Java SDK
          • Integration and Usage
          • API Reference
      • ONT TAG
        • Workflow
        • API Reference
      • Mercury
      • OScore
    • DDXF
      • Components and Interfaces
      • GREP
      • Overall Scheme
      • Solutions
        • Marketplace
          • Deployment
          • Scenarios
          • SaaS Tenant
          • Java SDK
        • Data Storage
          • Deployment
          • Java SDK
        • Resource Auditor
        • Offline Judge
      • Use Cases
        • E-Shops
  • ONTOLOGY ELEMENTS
    • Smart Contracts
      • Types of smart contracts
    • Token Protocols
    • Consensus Mechanism
    • Ontology Oracle
      • Oracle Process Flow
  • GUIDES & TUTORIALS
    • Development Guides
      • dApp Development
        • Using the dAPI
        • Data Synchronization
      • Smart Contract Development
        • EVM Contract
          • Development Environment and Tools
          • Wallet Setup
          • Contract Development
          • How to Deploy a Smart Contract with GetBlock
        • NeoVM Contract
          • Development tools and environment
          • Launching the IDE
          • Writing and editing program logic
          • Deploying and testing on private net
        • WASM Contract
          • Development Environment
          • Project Initiation - Hello World
          • Creating your own project
          • Development using SmartX
          • Runtime API
          • Contract Fundamentals
          • Inter-contract Interaction
          • Developing Contracts in C++
        • Publish Contract Source Code
    • Integration Guides
      • dApp Integration
        • dAPI Integration
          • Chrome Plugin
          • Mobile wallet dApp
          • QR code mechanism
          • Wake call mechanism
        • Cocos 2D-x
        • Unity 3D applications
      • Mobile Wallet Integration
        • SDK integration
        • dAPI Integration
          • In-wallet applications
          • QR code mechanism
          • Wake call mechanism
        • Stake
      • Using ONT ID
      • Exchange Integration
        • Exchange Docking Guide
        • Exchange API
      • Ontology for dApp Stores
    • EVM & Token Decimals Upgrade
  • ONTOLOGY NODE
    • Abstract
    • Node Deployment
      • Standard Node
      • Rosetta Node
    • Interacting with a Public Node
  • DEVELOPER TOOLS
    • dApp Development Framework
      • Punica CLI
      • Punica boxes
      • Solo Chain
    • IDE
    • APIs
      • HTTP API
        • Restful
        • WebSocket
        • Remote Procedure Call (RPC)
      • Explorer v2 API
        • Block
        • Address
        • Contract
        • Token
        • Transactions
        • ONT ID
        • Summary
        • Node
      • Native Token API
        • ONT Contract API
        • ONG Contract API
      • ONT ID Contract API
      • Web3 API
      • OScore Open API
      • Rosetta Node API
        • Data API
        • Construction API
      • DToken Contract API
      • DDXF
        • Marketplace Contract API
        • Storage API
      • Governance API
    • Digital Wallet
      • Chrome Plugin provider
      • Chrome Plugin dAPI
      • Mobile version provider
      • Mobile version dAPI
    • SDKs
    • Signing Server
      • Installation
      • API reference
  • COMMUNITY
    • Ecosystem Programs
    • Community Libraries
    • Community Events
    • Community Channels
    • Core Contributors
  • SUPPORT
    • FAQ
      • Basic blockchain concepts
      • Ontology Nodes
      • Ontology token protocols
      • Smart contracts
      • SDKs and APIs
    • Contact Us
Powered by GitBook
On this page

Was this helpful?

  1. ONTOLOGY ELEMENTS
  2. Smart Contracts

Types of smart contracts

Different types of Ontology smart contracts

PreviousSmart ContractsNextToken Protocols

Last updated 3 years ago

Was this helpful?

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.

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.

Smart Contract Development