Flex Docs (Work-In-Progress | Last Updated: 12/07)
  • Current Landscape
  • Welcome to Flex
  • Overview
    • Infrastructure for the New Web
    • The Values of the Flex Ecosystem
  • Protocol
    • Flex Validator Nodes
      • Data and Validation Layer
      • Rewards Layer
      • Audit Layer
      • Sentinel Layer
      • Prediction Layer
      • Getting Started
        • Propagation into the Validation Layer
        • Transaction Pool Generation
        • Transaction Weight Assignment
        • Epoch Score Calculation
        • Reward Distribution
        • Reward Claiming
        • Epoch Reward Pool Mechanics
    • Proof-of-Collaboration (PoCol)
      • PoCol Governance using FLEXE
      • Actors in the Flex Ecosystem
    • Flex Commons
      • Code Tokenization
      • Code Registry and Indexing
      • Code Versioning and Forking
      • Code Licensing and Royalties
      • Code Marketplaces and Auctions
      • Code Search and Discovery
      • Flex Commons Governance using FLEXE
    • Ecosystem Tokens' Multi-Staking
    • Technical Roadmap for the Flex Ecosystem
      • Flex Virtual Machine (FVM)
      • Flex SDCK
      • re:Flex Smart Contract Language
    • Flex Improvement Proposal (FIP)
    • Flex Portal: Your Gateway to Web3
  • Contribute to the Ecosystem
    • Strategists: Roles and Contributions
    • Developers and Projects
  • Governance and Utility
    • Introducing the FLEXE Token (coming soon)
    • Flexonomics (coming soon)
    • How to get FLEXE tokens (coming soon)
      • Use the faucet (coming soon)
      • Run a node (coming soon)
  • Quicklinks
    • Supported Social Media
    • Official Website
  • Legal
    • Terms of Service
    • Privacy Policy
    • Digital Asset Disclosure (coming soon)
Powered by GitBook
On this page
  1. Protocol
  2. Technical Roadmap for the Flex Ecosystem

re:Flex Smart Contract Language

Flex is a community-owned platform that rapidly boosts dApp user growth, ensuring the value generated directly benefits the Flex community.

To enable the development of expressive, composable smart contracts that can be seamlessly integrated into dApps, Flex introduces re:Flex, a novel smart contract language designed from the ground up for the FVM. re:Flex is a statically-typed, functional programming language that combines the familiarity and ecosystem compatibility of Solidity with the safety and expressiveness of modern language features.

Properties of re:Flex include:

  1. Type system: A strong, static type system that catches common programming errors at compile-time and provides a solid foundation for building secure and reliable contracts.

  2. Functional programming: Embraces functional programming principles to promote code reuse, modularity, and testability.

  3. Contract composition: First-class support for contract composition, allowing developers to create modular, reusable building blocks that can be easily combined to form complex dApps. Contracts in re:Flex can inherit from one or more base contracts, inheriting their state variables, functions, and modifiers. This enables the creation of contract hierarchies and the reuse of common functionality across multiple contracts.

  4. Safe arithmetic: Integer overflows and underflows are a common source of vulnerabilities in smart contracts. To prevent these issues, Reflex provides safe arithmetic operators that automatically check for overflows and throw an exception if an operation results in an out-of-bounds value.

  5. Access control: Includes built-in primitives for implementing access control and authorization in smart contracts. Contracts can define roles, which represent a set of permissions or capabilities that an address can possess. Roles can be granted, revoked, and checked using dedicated language constructs, such as the `auth` and `has` keywords.

  6. Error handling: Provides a robust error-handling mechanism based on exceptions. Contracts can define custom exception types and throw them using the `throw` keyword.

  7. Metaprogramming: Powerful metaprogramming capabilities that enable developers to write code that generates or manipulates other code at compile-time.

PreviousFlex SDCKNextFlex Improvement Proposal (FIP)

Last updated 10 months ago