This project(RedPacket
smart contract) is a Dapplet based on the Mask browser extension. Inspired by Red Packet. It enables you to put cryptocurrency tokens(ETH or ERC-20) into red packets and send them to your friends and family.
Besides, Mask Network developed a new red packet for ERC721/NFT token.
This is a hardhat project. To install required node.js modules
npm ci
To compile the solidity source code
npm run compile
To run ERC20 RedPacket unit test
npm run test:normal
To run ERC721/NFT RedPacket unit test
npm run test:erc721
To deploy the smart contract on Ethereum ropsten testnet
NOTE:
Before run deploy scripts, please configure the
.env
file according to.env.example
file.
- For
verify
: if setfalse
, the contract won't be verified during deployment, and vice versa.- For
upgrade
: if setfalse
, the script will deploy a new contract on the specified chain. Otherwise, the script will upgrade the contract.If you don't configure the
.env
file properly, the script will deploy a new contract and won't verify contract by default;
npm run deploy ropsten
Unit test and performance(gas consumption) results, please see test report and gas consumption test report.
Change, please see Change log for changes.
Any contribution is welcomed to make it better.
If you have any questions, please create an issue.
If you have any security issue, please send to security@mask.io.