Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
13 changes: 5 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,10 @@

## Usage

1. Start [ganache](https://trufflesuite.com/ganache/) instance by running `npm start` in [ganache](./packages/ganache) folder
2. Deploy [TestERC20.sol](./packages/client/src/contract/TestERC20.sol), [PaymentGatewayContract.sol](./packages/client/src/contract/PaymentGatewayContract.sol) by using [Remix IDE](https://remix-project.org/)
3. Mint some tokens in `TestERC20` by calling `mint` method. The UI is using `18 digits` representation of token decimals, so you should pass an argument like `200000000000000000000`.
4. Allow withdrawal in `TestERC20` by calling `approve` method (with `PaymentGatewayContract` **deployer address**). Pass **the same amount from the step 3**
5. Update `PaymentGatewayContract` address in [params.ts](./packages/client/src/config/params.ts)
6. Run this DApp by running `npm start` in [client](./packages/client) folder. Send some tokens
7. Check admin menu by typing secret cheat-code `133337`
1. Run `start:ganache` in separated terminal
2. Run `deploy:contracts` to deploy contracts to ganache
3. Run this DApp by running `npm start` in [client](./packages/client) folder. Send some tokens
4. Check admin menu by typing secret cheat-code `133337`

## Contract source code

Expand All @@ -20,7 +17,7 @@
contract PaymentGatewayContract {

IERC20 private erc20;
address owner;
address public owner;

uint256 public deployBlock;

Expand Down
17 changes: 9 additions & 8 deletions packages/ganache/package-lock.json → package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "erc20-payment-gateway",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start:ganache": "node ./scripts/run-ganache.js",
"deploy:contracts": "cd ./packages/truffle && npm start"
},
"repository": {
"type": "git",
"url": "git+https://github.com/react-declarative/erc20-payment-gateway.git"
},
"keywords": [],
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/react-declarative/erc20-payment-gateway/issues"
},
"homepage": "https://github.com/react-declarative/erc20-payment-gateway#readme",
"dependencies": {
"ganache-cli": "6.12.2",
"glob": "8.0.3",
"rimraf": "3.0.2"
}
}
Loading