📑
TOMB
CtrlK
  • 👋Tomb
  • 🎆Quick Start
  • Getting Set up
    • 🛠️Setup
  • Basics
    • 🚩Basics
      • Default types
        • Available macros
      • Variable declaration
      • Call method
      • Library Importing
      • Trigger's
      • Properties
  • Features
    • ✨Features
  • Libraries
    • 📚Libraries
      • Call
      • Runtime
      • Math
      • Token
      • NFT
      • Account
      • Organization
      • Oracle
      • Storage
      • Array
      • Utils
      • Leaderboard
      • Market
      • Crowdsale
      • Stake
      • Governance
      • Relay
      • Mail
      • Time
      • Task
      • UID
      • Map
      • List
      • String
      • Decimal
      • Enum
      • Address
      • Module
      • Format
  • Examples
    • 🖥️Examples
      • Simple Sum
      • Conditions
      • Switch case
      • Simple Counter
      • Counter per Address
      • Strings
      • Decimals
      • Enums
      • Map support
      • Array example
      • Random numbers
      • Tokens
        • Fungible Token
      • Scripts
      • Inline asm
      • Custom Events
      • Triggers Example
        • Trigger OnMint
        • Trigger OnBurn
        • Trigger OnWrite
        • Trigger OnInfuse
        • Trigger OnSeries
        • Trigger OnUpgrade
        • Trigger OnMigrate
        • Trigger OnReceive
        • Trigger OnSend
        • Trigger OnKill
      • Methods variables
      • Type interface in variable declarations
      • Tasks
      • Calls
      • NFTs
      • Multiple returns
  • Tutorials
    • 📹Tutorials
  • Resources
    • 👻Getting Started
    • 👻About Phantasma
    • 🧑‍🤝‍🧑For new Soldiers
    • 👨‍💻For Developers
Powered by GitBook
On this page
  1. Examples
  2. 🖥️Examples

Conditions

Like most programming languages, it is possible to do conditional branching use if statement. Logic operators supported include and, or and xor.

contract test {
	public isEvenAndPositive(n:number):bool
	{
		if (n>0 and n%2==0)
		{
			return true;
		}
		else 
		{
			return false;
		}
	}
}
PreviousSimple SumNextSwitch case

Last updated 2 years ago