LogoLogo
  • Introduction
  • Foundation Initiatives and Grants
    • Users
    • Ambassadors
    • Developers
    • Validators
  • Bug Bounty Program
  • The Unique Value of CrossFi Grants
  • FAQ Public Testnet
  • XFI PAD
  • How to do tasks
    • Test XFI Console
    • Faucets
      • Telagram faucet
      • Discord faucet
    • How to verify the task
    • Unique tasks
      • Social media
      • Delegate MPX to validator
    • Daily tasks
      • Send MPX
      • Send MPX to different addresses in the same transaction
      • Claim XFI reward
      • Send Cosmos XFI
      • Send EVM XFI
      • Send XFI to different addresses in the same transaction
      • Send XFI and MPX to different addresses in the same transaction
  • Additional MPX
  • CrossFi Evolution Hackathons
    • Hackaton # 1 - Boost XFI utility
      • Workshops Roadmap & Timeline
        • CrossFi Workshop #1
        • CrossFi Workshop #2
        • Partner Workshop: DEX Guru
          • Block Explorer & Data Warehouse Walkthrough
          • Quick Start Guide for Developers at XFI Hackathon
          • Data Warehouse
            • Query, Dashboard, API
          • Block Explorer
          • XFI Swap
          • Data Warehouse API
        • Partner Workshop: Bware Labs
          • Roadmap
          • Introduction
          • A Guide to Blast
          • Breaking DeFi Barriers with Blast
            • Using CrossFi with Blast
          • Public CrossFi Gateway
            • Public API
          • CrossFi RPC
            • CrossFi RPC Method Calls
          • Blast Intoduction
            • API Docs
            • Things to Know
            • Tutorials & Guides
            • Blast SDK
            • Blast Protocol
        • Partner Workshop: Covalent
          • A Guide to GoldRush
        • Partner Workshop: DIA
        • Workshop FAQs
      • Hackathon Judges
        • Interested in Becoming a Judge?
      • Hackathon FAQs
Powered by GitBook
On this page
  • CrossFi Workshop #1
  • Introduction (5 minutes)
  • Installing Foundry and Setting Up Project (5 minutes)
  • Creating and Reviewing the Smart Contract (20 minutes)
  • Testing the Contract (10 minutes)
  • Deploying the Contract (10 minutes)
  • Interacting with the Contract (5 minutes)
  • Conclusion (5 minutes)
  1. CrossFi Evolution Hackathons
  2. Hackaton # 1 - Boost XFI utility
  3. Workshops Roadmap & Timeline

CrossFi Workshop #1

CrossFi Workshop #1

Smart Contracts on CrossFi Chain

Introduction (5 minutes)

  • Welcome participants to the workshop and introduce the objective: to guide them through deploying a smart contract on the CrossFi Chain.

  • Emphasize that this guide provides a foundational understanding of smart contract deployment, which participants can apply to more complex projects in the future.

  • Highlight the requirements for the workshop: Node.js, basic Solidity understanding, and access to Testnet XFI coins (faucet coming soon).

  • Provide an overview of the tools and technologies used, including Foundry for testing and deployment.

Installing Foundry and Setting Up Project (5 minutes)

  • Explain the importance of Foundry in the deployment process and its role in providing a seamless development experience.

  • Guide participants through creating a project directory and initializing npm using the provided commands.

  • Demonstrate the installation of Foundry using the curl command and running foundryup to set up the environment.

  • Address potential MacOS-specific issues related to library loading and provide a resolution using Homebrew.

Creating and Reviewing the Smart Contract (20 minutes)

  • Instruct participants to create a contract file using the forge init command and open it in their code editor.

  • Review the Counter.sol smart contract, highlighting its components such as the number variable, setNumber and increment functions.

  • Explain the importance of compiling the contract to verify its logic and introduce the forge build command for this purpose.

Testing the Contract (10 minutes)

  • Provide an overview of the provided test file Counter.t.sol and its purpose in ensuring the functionality of the smart contract.

  • Guide participants through executing the test code using the forge test command and interpreting the test results.

  • Emphasize the significance of testing in smart contract development and ensuring the contract behaves as expected.

Deploying the Contract (10 minutes)

  • Explain the deployment process using forge create command, requiring a private key connected to a wallet with Testnet XFI tokens.

  • Provide the necessary parameters including the RPC URL and private key, demonstrating how to deploy the contract.

  • Show participants how to verify the deployment by checking the contract address in the terminal and using the CrossFi Testnet Block Explorer.

Interacting with the Contract (5 minutes)

  • Conclude the workshop by demonstrating contract interaction using Foundry commands.

  • Guide participants through setting the number, reading the current value, and incrementing the number using cast send and cast call commands.

  • Reinforce the completion of the deployment process and encourage participants to explore further contract functionalities independently.

Conclusion (5 minutes)

  • Summarize the key steps covered in the workshop, including project setup, contract creation, testing, deployment, and interaction.

  • Reiterate the applicability of these steps to future CrossFi projects and the importance of understanding smart contract deployment fundamentals.

  • Thank participants for their participation and encourage them to reach out with any questions or feedback.

  • Provide resources for further learning and exploration, such as documentation and community channels.

PreviousPartner Workshop: DIANextCrossFi Workshop #2

PreviousWorkshops Roadmap & TimelineNextCrossFi Workshop #2