CryptoCash is a blockchain-based payment solution designed for developing markets, where the majority of transactions are cash-based due to high card transaction fees and low bank card usage. CryptoCash aims to streamline transactions by leveraging mobile phones and existing offline prepayment infrastructure, making payments faster, cheaper, and more convenient for users. This repository contains the smart contracts for the project. The system enables users to generate and redeem secret codes for acquiring tokens, utilizing the Polygon Mumbai blockchain for fast and affordable transactions.
CryptoCash Presentation by Ignat Romanov - Watch Video
-
CSHToken.sol
: The CryptoCash Token (CSH) contract is an ERC20 token with minting functionality. This token is specifically designed to work with the CodesFactory contract, and only the CodesFactory contract can mint new tokens. The contract makes use of OpenZeppelin's upgradeable contracts to ensure safe and efficient upgrades. -
CodesFactory.sol
: The main smart contract for generating and redeeming token-based codes. The contract makes use of a Merkle tree to validate the redemption of secret codes by users. Users can reveal secret codes and redeem the associated tokens if they have valid Merkle proofs.
- ERC20 token implementation with restricted minting functionality.
- Secure generation and redemption of token-based codes using Merkle trees.
- User commitments and code redemption tracking.
- Redeemed code verification.
- Upgradeable contracts for safe and efficient upgrades.
- CSHToken: 0xA729D60d8E59aA53d59A752F15cc47e5462BA1a5
- CodesFactory: 0x931Ea08151960d4d6110386ff22Dd78B583a7105
- Node.js v16.x.x or later
- Npm package manager
- Hardhat development environment
- Clone the repository:
git clone https://github.com/ignromanov/crypto-cash-contracts.git
- Change to the repository's directory:
cd crypto-cash-contracts
- Install dependencies:
npm install
To compile the smart contracts, run:
npx hardhat compile
To run the tests, execute:
npx hardhat test
To deploy the smart contracts, you'll need to configure the deployment script (scripts/deploy.js
) with your desired network and update the .env
file with your private key and Infura project ID.
Then, run the following command to deploy:
npx hardhat run --network <network> scripts/deploy.js
This project is licensed under the MIT License.