This project implements a basic token wallet for the Internet Computer Protocol (ICP) blockchain using Rust. The wallet supports sending and receiving IRCRC2 tokens and displaying token balances.
-
Install Rust and Cargo (the Rust package manager):
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
-
Install the DFINITY Canister SDK:
sh -ci "$(curl -fsSL https://smartcontracts.org/install.sh)"
-
Clone this repository:
git clone https://github.com/your-username/icp-token-wallet.git cd icp-token-wallet
-
Build the project:
cargo build
-
Deploy to a local ICP test network:
dfx start --background dfx deploy
-
Run the unit tests:
cargo test
-
For manual testing, you can use the
dfx
command-line tool to interact with the deployed canister:-
To send tokens:
dfx canister call token_wallet send_tokens '(principal "receiver-principal-id", 100)'
-
To check balance:
dfx canister call token_wallet get_balance '(principal "account-principal-id")'
-