Trustless Donations is an innovative application designed to revolutionize the process of charitable donations. It facilitates a transparent flow of donations from donors to charities to suppliers, promoting transparency for all parties involved. By leveraging blockchain technology and smart contracts, Trustless Donations ensures the integrity and accountability of every transaction.
![image](https://private-user-images.githubusercontent.com/24990448/239968185-9b6e3559-1dd1-4446-95d1-ff8003ad5d47.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjIyMDk4MTUsIm5iZiI6MTcyMjIwOTUxNSwicGF0aCI6Ii8yNDk5MDQ0OC8yMzk5NjgxODUtOWI2ZTM1NTktMWRkMS00NDQ2LTk1ZDEtZmY4MDAzYWQ1ZDQ3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MjglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzI4VDIzMzE1NVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWJlZTU0MGQ3YzMyN2Q5NTg3MzMxMTc3NDdmMDMwM2FhZjU0M2EwOWUxYTBmNmI4OGFlOThkZmI5YjBkN2UwNTEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.BP-9p_g4fP-zjVxwq6v1enpX6Mgb-_eyUDVi5KV0uTQ)
Tools used:
-
thirdweb Typescript and React SDKs to interact with our smart contract
-
Solidity, Hardhat, and thirdweb deploy to develop, test, and deploy our smart contract.
Run the Application:
To run the web application, change directories into application
:
cd application
Then, run the development server:
npm install # Install dependencies first
npm run dev
Visit the application at http://localhost:3000/.
This template has two components:
- The smart contract development in the contract folder.
- The web application in the application folder.
To deploy the contracts, change directories into the contract
folder:
cd contract
Use thirdweb deploy to deploy the contract:
npm install # Install dependencies first
npx thirdweb deploy
Complete the deployment flow by clicking the generated link and using the thirdweb dashboard to choose your network and configuration.
Inside the home page of the web application, connect to your smart contract inside the useContract
hook:
// Get the smart contract by it's address
const { contract } = useContract("0x..."); // Your contract address here (from the thirdweb dashboard)
We configure the desired blockchain/network in the _app.js
file; be sure to change this to the network you deployed your contract to.
// This is the chain your dApp will work on.
const activeChain = "mumbai";
To perform a "write" operation (a transaction on the blockchain), we need to have a connected wallet, so we can use their signer to sign the transaction.
To connect a user's wallet, we use one of thirdweb's wallet connection hooks. The SDK automatically detects the connected wallet and uses it to sign transactions. This works because our application is wrapped in the ThirdwebProvider
, as seen in the _app.js
file.
Learn how to use thirdweb's Contract Extensions to create your own NFT Collection smart contract + application in our next template.