Skip to content

CryptoCash smart contracts - Ethereum contracts for generating and redeeming secret codes to acquire tokens.

License

Notifications You must be signed in to change notification settings

ignromanov/crypto-cash-contracts

Repository files navigation

CryptoCash Logo

Solidity Hardhat Ethereum Polygon

CryptoCash Smart Contracts

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

CryptoCash Presentation by Ignat Romanov - Watch Video


Web Application Repository

Demo Application


Contracts

  1. 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.

  2. 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.

Features

  • 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.

Contract Addresses

Polygon Mumbai Testnet

Development

Prerequisites

  • Node.js v16.x.x or later
  • Npm package manager
  • Hardhat development environment

Installation

  1. Clone the repository:
git clone https://github.com/ignromanov/crypto-cash-contracts.git
  1. Change to the repository's directory:
cd crypto-cash-contracts
  1. Install dependencies:
npm install

Compile

To compile the smart contracts, run:

npx hardhat compile

Test

To run the tests, execute:

npx hardhat test

Deployment

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

Support Me

Buy Me A Coffee

License

This project is licensed under the MIT License.

About

CryptoCash smart contracts - Ethereum contracts for generating and redeeming secret codes to acquire tokens.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published