Skip to content

A secure token wallet for the Internet Computer Protocol (ICP) blockchain, built with Rust. This project includes smart contracts for managing IRCRC2 tokens and a web frontend for token transactions and balance display.

Notifications You must be signed in to change notification settings

jhunuak47/My_wallet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

my_wallet

Welcome to the my_wallet project! This project is a secure token wallet developed for the Internet Computer Protocol (ICP) blockchain. It supports basic functionalities such as sending and receiving IRCRC2 tokens and displays token balances.

Table of Contents

Project Overview

The my_wallet project includes:

  • Smart Contracts: Developed in Rust for managing token transactions.
  • Frontend: A web interface for interacting with the wallet.

The project uses the ICP blockchain and adheres to the IRCRC2 token standard.

Features

  • Create Tokens: Initialize tokens with an owner and balance.
  • Transfer Tokens: Send tokens to other addresses.
  • Fetch Balance: Display the current balance of a wallet.

Setup Instructions

Prerequisites

  1. Install dfx and ensure Rust is installed.
  2. Ensure Node.js and npm are installed for the frontend.

Building and Deploying

  1. Clone the Repository

    git clone https://github.com/jhunuak47/My_wallet.git
    cd my_wallet
  2. Build and Deploy Backend

    Navigate to the backend directory and build the smart contract:

    cd my_wallet_backend
    cargo build

    Deploy the contract to the local ICP testnet:

    dfx start --background
    dfx deploy
  3. Setup Frontend

    Navigate to the frontend directory, install dependencies, and start the application:

    cd my_wallet_frontend
    npm install
    npm start

    The frontend application will be available at http://localhost:8080, and it proxies API requests to the backend running at port 4943.

Note on Frontend Environment Variables

If you are hosting the frontend code elsewhere, ensure you adjust environment variables as follows:

  • Set DFX_NETWORK to ic if you are using Webpack.
  • Replace process.env.DFX_NETWORK in autogenerated declarations if needed.
  • Configure dfx.json to replace process.env.DFX_NETWORK with a string in the autogenerated declarations.
  • Write your own createActor constructor if necessary.

Running the Project Locally

To test your project locally, use the following commands:

# Start the replica, running in the background
dfx start --background

# Deploy canisters to the replica and generate candid interface
dfx deploy

Once deployed, your application will be accessible at http://localhost:4943?canisterId={your_canister_id}.

Testing

Write unit tests for your smart contract in my_wallet_backend/tests. You can run tests with:

cargo test

Contributing

Contributions are welcome! If you want to contribute to the my_wallet project, please follow these steps:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature/YourFeature).
  3. Commit your changes (git commit -am 'Add new feature').
  4. Push to the branch (git push origin feature/YourFeature).
  5. Create a new Pull Request.

Documentation

For more information, check out these resources:

License

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


Feel free to adjust any details as needed!

About

A secure token wallet for the Internet Computer Protocol (ICP) blockchain, built with Rust. This project includes smart contracts for managing IRCRC2 tokens and a web frontend for token transactions and balance display.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published