DEV Community

Cover image for Building Together: A Personal Invitation to Create with Crowdfunding DApps
Soroban Dapps Challenge
Soroban Dapps Challenge

Posted on

Building Together: A Personal Invitation to Create with Crowdfunding DApps

⁤In our fast-paced world, the art of bringing dreams to life has been beautifully transformed by crowdfunding. ⁤⁤It's a space where innovative projects, heartfelt social causes, and artistic ventures find wings, thanks to the support of a worldwide community. ⁤⁤But what if you could do more than just support? ⁤⁤What if you could build the very platform that makes all this possible?

⁤⁤Picture this: your own Crowdfunding Decentralized Application (DApp), built by you, for a community you care about. ⁤

⁤The World of Crowdfunding Today

⁤We're all part of this incredible digital era where traditional ways of fundraising are evolving into something more open and dynamic. ⁤⁤Platforms like Kickstarter and Indiegogo have shown us the power of collective support, making the once distant dream of funding accessible to everyone, everywhere. ⁤

⁤But, what if we could push those boundaries even further? ⁤⁤Imagine a place where crowdfunding isn't just about giving but about creating a transparent, secure, and direct line between dreamers and supporters. ⁤⁤That's the vision behind Crowdfunding DApps. ⁤

⁤Why Create Your Own Crowdfunding DApp?

  • Empowerment at Its Core: This journey is about more than funding; it's about building a community where everyone has a voice in what gets brought to life. ⁤ ⁤
  • Transforming How We Fund: Picture a world without middlemen, where blockchain's smart contracts ensure every penny goes exactly where it's meant to, building a foundation of trust. ⁤

  • A Canvas for Creativity: Your DApp can be the stage for anything from groundbreaking tech to art that moves the soul, making the realm of possibilities endless. ⁤

  • Support Without Borders: Geography and finances no longer dictate who can contribute. ⁤⁤Your DApp can be a global melting pot of support for creators and a treasure chest of innovative projects for backers. ⁤

Your Challenge: Bring Your DApp to Life with Stellar and Soroban

⁤Ready to roll up your sleeves? ⁤⁤We're inviting you to dive into the world of DApp creation, using Stellar's Soroban to build and launch your very own Crowdfunding DApp. ⁤⁤This is more than just a learning experience; it's your chance to test the waters of DApp development, from deploying smart contracts to interacting with your app in a real-world setting. ⁤

Here’s a headstart on completing the crowdfund challenge:

Checkpoint 0: 📦 Install 📚​

Start by installing the required dependencies. You'll also want to be sure you have the most updated version of Rust installed.

Required:

First, clone the Soroban Dapps Challenge repo and check out the crowdfund branch, which contains the code for the crowdfund smart contract that powers this dapp:

git clone https://github.com/stellar/soroban-dapps-challenge.git
cd soroban-dapps-challenge
git checkout crowdfund
Enter fullscreen mode Exit fullscreen mode

Then, install soroban-cli alias by running the following command:

cargo install_soroban
Enter fullscreen mode Exit fullscreen mode

Soroban CLI is the command line interface to Soroban. It allows you to build, deploy, and interact with smart contracts, configure identities, generate key pairs, manage networks, and more. The soroban-cli (alias) that is used in this challenge is a pinned version of the soroban-cli that is used in the Soroban Dapps Challenge. This ensures that the challenge is reproducible and that all participants are using the same version of Soroban.

Checkpoint 1: 🎬 Deploy Smart Contracts​

Now that you have the Crowdfund branch checked out, it's time to deploy the smart contracts to a Sandbox environment. Deploying a smart contract in a production setting involves submitting the contract code to the blockchain's main network ( Mainnet ), where it becomes part of the chain's immutable ledger. Deploying smart contracts to a Sandbox environment simulates that process without actually affecting Mainnet. When you deploy the smart contracts, you'll instead deploy to Futurenet, a test network with more cutting-edge features that have not yet been implemented in the Mainnet.

In your terminal, load the contracts and initialize them in the Sandbox environment by running the following commands:

npm run setup
Enter fullscreen mode Exit fullscreen mode

If the command runs successfully, your terminal will return a series of messages notifying you about the successful initialization of the contracts and the post-installation sequence.
Contract deployed successfully with ID:

CBXHU5BWWTOCZRYX3DMSSKCFG7B3K2YG2I5F75ALPQ6GCY6ZES2XKLTI
Deploy the crowdfund contract
Contract deployed successfully with ID: CBKY7UN5VGD4LIQFOBOTSUSQWK67BZZTA23NIEVWSWRR5SAT26JQN2BN
Initialize the abundance token contract

Initialize the crowdfund contract

Done

> soroban-example-dapp@0.1.0 build-contracts
...
Enter fullscreen mode Exit fullscreen mode

The contract ID is a unique identifier for a smart contract deployed on a blockchain. This contract ID is used to interact with and reference the smart contract, allowing users to invoke functions from the smart contract, send transactions, or otherwise interact with the smart contract's functionalities and data stored on the blockchain.

TIP
Please, save your deployed contract ID. You will need it to complete the challenge.

Connect your wallet to track your progress and submit your ContractId here: Checkpoint 1

Checkpoint 2: 🤝 Connect the Frontend to the Backend​

Now that you have deployed the smart contract, it's time to check out the frontend of your dapp. The frontend is the browser interface where contributors to your crowdfund campaign will connect their digital wallets and pledge assets to the campaign's cause.

First, start the development server:

npm run dev
Enter fullscreen mode Exit fullscreen mode

Now open your browser and visit http://localhost:3000/. You should be able to see the frontend of your dapp.

Note: Follow the instructions below and ensure that you have funded your wallet address that you intend to use from the browser, otherwise the dapp display will be blank and a 'Account not found' will be printed on the browser's console only. If you are using Freighter, be sure that you have properly configured the Freighter Wallet by following the instructions here.

Now that you have the frontend running, it's time to connect it with the backend, your smart contract, that defines the rules and logic of the crowdfund campaign, including the function for accepting contributions. If you want to dig into the specifics of the contract, take a look at the video walkthrough of the contract code here.

You will need to add some Futurenet network lumens to your wallet to interact with the dapp. Visit https://laboratory.stellar.org/#account-creator?network=futurenet, and follow the instructions to create and or fund an account on Futurenet. Remember, these are test lumens for use on Futurenet and cannot be used on Mainnet.

Checkpoint 3: 🌟 Powering the Campaign​

Fuel the vision! In this step, you will learn how to mint tokens and fund the crowdfunding campaign. Minting tokens in a crowdfund dapp, while not always required, serves as a bootstrapping mechanism for the campaign, allowing the campaign to be funded with the minted tokens.

Step 1: 🏦 Mint Tokens

Mint Tokens

Ready to deploy your Crowdfund dapp? Continue the Challenge here: https://soroban.stellar.org/dapps/dapp-challenges/challenge-0-crowdfund

Curious to learn more and be part of the conversation? Connect with Us on LinkedIn & Join the Soroban Dapps Challenge!

Top comments (0)