Skip to content

Sauhard74/doiTON-Smart-Contract--hack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

doiTON

Overview doiTON is an Android app integrated with TON blockchain smart contracts, designed to allow users to complete tasks and receive TON rewards upon task validation. The app connects with a TON wallet and enables users to interact with the blockchain seamlessly. The smart contract is responsible for managing task status and transferring rewards.

The project includes:

Smart Contracts for task management and reward distribution. Android App for users to interact with the smart contract via a WebView for wallet connection.

WebView for Wallet Connect: https://github.com/Jenish-1235/ton-connect-webpage

Android Repository: https://github.com/Jenish-1235/doiTON

Features Task Management: Users can add tasks, validate them, and receive rewards when completed. Reward Transfer: The smart contract sends TON rewards to the task completer's wallet. TON Wallet Connect: Seamless connection to a TON wallet via a WebView. Project Structure

  1. Smart Contract: TaskCompletion The TaskCompletion contract tracks tasks, validates completion, and sends rewards. It is deployed on the TON blockchain.

Task Struct: Stores task information (receiver, reward, validation status). Functions: addTask: Adds a new task with the receiver's address and reward amount. validateTask: Marks the task as completed and eligible for reward. transferReward: Transfers the reward (TON) to the task completer's wallet. 2. Android App The Android app provides a UI to interact with the smart contract.

WebView: Used to connect to the TON wallet using the WebView from the ton-connect-webpage repo. UI: Simple interface to display tasks, task validation, and reward transfer. Networking: Custom functions to interact with the TON node and send transactions. How It Works User Interacts with the App:

The user sees a list of tasks and their current status. When a task is completed, the user can validate it, which triggers the reward transfer. Connecting Wallet:

The WebView provides a seamless connection to the user's TON wallet for interaction with the blockchain. Smart Contract Interaction:

The app sends a transaction to the deployed TaskCompletion contract to update task status and transfer the reward. The contract checks the validation status and sends the reward to the user’s wallet. Requirements TON Node: Either use a public TON node or deploy your own to interact with the blockchain. Android Studio: To build and run the Android app. TON Wallet: A compatible wallet for the TON network. Installation

  1. Clone the Repositories Clone the Android app repository:

bash Copy code git clone https://github.com/Jenish-1235/doiTON.git Clone the WebView repository:

bash Copy code git clone https://github.com/Jenish-1235/ton-connect-webpage.git 2. Set Up the Android App Open doiTON in Android Studio. Sync the project with Gradle. Ensure that you have the necessary permissions and dependencies for network requests and WebView. 3. Deploy the Smart Contract Compile and deploy the TaskCompletion smart contract on the TON blockchain using your preferred method. Update the smart contract address in the Android app to match the deployed contract. 4. Run the Application Connect your Android device or use an emulator to run the app. The WebView will prompt you to connect your TON wallet. Start interacting with the tasks and receiving rewards! UI Screenshots

image image

image image

image image

License This project is licensed under the MIT License - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published