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
  • Abstract
  • Functionality
  • Security measures

Was this helpful?

  1. ONTOLOGY ELEMENTS

Smart Contracts

Units of logic and functionality

PreviousE-ShopsNextTypes of smart contracts

Last updated 3 years ago

Was this helpful?

Abstract

Smart contracts are by no means a new concept, and certainly not directly linked to blockchain, traditionally speaking. The term was coined in the 1990's long before blockchain was conceived of.

However, because of the way smart contracts have been used to implement general computational logic and mechanism on different blockchains, especially Ethereum, any computer program that implements a certain logic can be regarded as a smart contract in the context of blockchains and distributed ledgers.

Functionality

Smart contract, or simply digital contract was conceived in their original form to mimic real world contracts, but with the inception of distributed ledgers and blockchain coming into picture, it is safe to say that smart contracts can be used to execute various form of complex logic and functionality in different industries, almost certainly going beyond finance.

A few ways in which smart contracts can be used in tandem with either completely, or partially decentralized blockchain technology:

  • Intellectual Property (IP) protection

  • Supply chain management

  • Research and development

  • Legal Industry

  • Government sectors

Smart contracts carry out functions by releasing assets on single, or multiple chains based on the business logic and architecture, when certain pre-determined contractual clauses are fulfilled or fail to fulfill. The important thing to note here would be that these clauses and all the steps of this process are publicly visible. This brings a whole new level of transparency to systems that are notoriously untraceable and hence face issues in terms of communication, co-ordination, responsibility and role management, etc. As the competition grows and blockchain technology develops further, smart contracts will play bigger and more important roles.

Ontology Smart Contracts support dynamic features including high scalability, high performance, multilingual contracts, cross-chain, cross-virtual-machines, etc., all integrated into one system. The programming languages supported currently include Python, C#, and Rust. While Java, C++, Go, and JavaScript will be supported in the future.

Ontology also supports EVM contracts written in Solidity.

Security measures

Smart contracts have a lot of strong points such as transparency, precision, cost-effectiveness and practicality.

Smart contract can be used as safeguards, to ensure that certain assets are released only when the fixed contractual clauses are satisfied. But there is a security vulnerability that arises due to the transparency of smart contracts. Not only are the clauses on public display, so are any issues and vulnerabilities.

Considering the fact that smart contracts cannot be altered after being deployed, it is important to look into the smart contract logic and perform rigorous testing by subjecting them to practical scenarios so as to avoid any mishaps such as the popular 2016 DAO attack. There are several smart contract auditing services that have come up since the attack. But here are other tips that one can follow to write good smart contracts:

  • Follow general programming best practices to avoid any limitations brought about by the programming language being used.

  • Write blockchain specific code with the level of decentralization in mind instead of writing general logic.

  • Testing, testing, and more meticulous testing. Ensure that the contract works as intended under various different calculated circumstances.

  • Limit functionality to only the essentials. This might seems a little counter-intuitive, but more functionality generally equates to more loopholes that can be exploited, generally speaking.

For more information on how to develop smart contracts using Ontology, please follow link.

this
Smart Contract Development