Skip to content

Commit

Permalink
finalising running instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
zorixid committed May 30, 2021
1 parent 59adf26 commit 0501423
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 21 deletions.
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@



###### Blockchain Token Staking dApp built with React, Solidity, on ethereum Ganache testnet <h6>
###### Blockchain Token Staking dApp built with React, Solidity, on Ethereum Ganache, Ropsten, Rinkeby testnet networks <h6>


![Preview](src/assets/screenshot.png)
Expand All @@ -20,8 +20,8 @@
- [x] Implemented testing
- [x] Added redistribution script
*
- [x] Injected web3 and metamask
- [x] Ability to detect if metamask installed, logged, locked
- [x] Injected web3 and Metamask
- [x] Ability to detect if Metamask installed, logged, locked
- [x] Added skeletons for totalStaked, myStake,
- [x] Added skeletons for Tester to Redistribute rewards and claim test tokens
*
Expand All @@ -31,8 +31,8 @@
- [x] Stake, Unstake is now working
- [x] Redistribute rewards for (Admin only) is now working
*
- [x] Implemented totalstaked
- [x] Implemented ability to claim test token(Tst) (FOR TESTIN PURPOSE ONLY)
- [x] Implemented totalStaked
- [x] Implemented ability to claim test token(Tst) (FOR TESTING PURPOSE ONLY)
- [x] Added amount type validity check
- [x] Add ability for user to stake max
*
Expand All @@ -52,14 +52,14 @@
- [x] Added UI Elements
- [x] Loaders fixed
*
- [x] Added checks and restrictions for when metamask is not connected
- [x] Added checks and restrictions for when Metamask is not connected
- [x] UI Optimised for mobiles
- [x] Production build uploaded to https://ibnz-staking.netlify.app/ for preview and test run
*
- [ ] Add clear running description

```diff
- Warning
- # Token Staking dApp <h1>
```
Front end functions to `Claim for 1000 Tst` token and `Redistribute rewards or Custom redistribution` are only for testing purpose and showcase of application. Do not include or use them in your final project.
![Preview](src/assets/screenshot4.png)
Expand All @@ -73,11 +73,11 @@ Front end functions to `Claim for 1000 Tst` token and `Redistribute rewards or C
* To run tests from /test/TokenStaking (truffle test)

## For Admin Use
* There are prewritten scripts for Admin use either manually or on daily, weekly basic, idealy with predefined cronjob from server.
* There are prewritten scripts for Admin use either manually or on daily, weekly basic, ideally with predefined cronjob from the server.
* All scripts are located in `/scripts` folder
* To change APY % run: ```truffle exec scripts/changeAPY.js 0.137``` this script takes 1 argument (daily apy), in this provided example, admin sets `0.137` daily APY
* To change APY % run: ```truffle exec scripts/changeAPY.js 0.137``` this script takes 1 argument (daily APY), in this provided example, admin sets `0.137` daily APY
![Preview](src/assets/screenshot2.png)
* To redistribute rewards from console, run: ```truffle exec scripts/redistribute.js``` or provide argument `custom` if you want to redistribute custom rewards
* To redistribute rewards from the console, run: ```truffle exec scripts/redistribute.js``` or provide argument `custom` if you want to redistribute custom rewards
![Preview](src/assets/screenshot3.png)


Expand All @@ -93,7 +93,7 @@ mocha testing output
TokenStaking stakeTokens function
✓ users balance is correct before staking (126ms)
✓ checking total staked before any stakes (126ms)
aproving tokens, staking tokens, checking balance (1259ms)
approving tokens, staking tokens, checking balance (1259ms)
✓ checking contract balance after staking (156ms)
✓ checking user balance inside contract (131ms)
✓ checking total staked (136ms)
Expand All @@ -108,8 +108,8 @@ mocha testing output
✓ checking total staked (132ms)
TokenStaking [custom] staking/unstaking functions
✓ checking total custom staked before any stakes (132ms)
✓ checking usrs balance before staking (165ms)
aproving tokens, staking tokens, checking balance (1131ms)
✓ checking users balance before staking (165ms)
approving tokens, staking tokens, checking balance (1131ms)
✓ checking custom total staked (125ms)
✓ testing if user is staking at custom staking at the moment (147ms)
✓ testing if user has staked at custom staking (107ms)
Expand All @@ -126,7 +126,7 @@ mocha testing output
```


For private ethereum test network make sure Ganache is running on HTTP://127.0.0.1:7545
For private Ethereum test network make sure Ganache is running on HTTP://127.0.0.1:7545


TokenStaking Smart Contract Address on Test Net
Expand Down
10 changes: 5 additions & 5 deletions test/TokenStaking.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ contract('TokenStaking', ([creator, user]) => {
});

// 3.3 Testing stakeTokens function
it('aproving tokens, staking tokens, checking balance', async () => {
// first aprove tokens to be staked
it('approving tokens, staking tokens, checking balance', async () => {
// first approve tokens to be staked
await testToken.approve(tokenStaking.address, tokenCorvert('1000'), {
from: user,
});
Expand Down Expand Up @@ -222,7 +222,7 @@ contract('TokenStaking', ([creator, user]) => {
});

// 6.2 checking Users Balance before staking
it('checking usrs balance before staking', async () => {
it('checking users balance before staking', async () => {
result = await testToken.balanceOf(user);
assert.equal(
result.toString(),
Expand All @@ -232,8 +232,8 @@ contract('TokenStaking', ([creator, user]) => {
});

// 6.3 testing if user able to stake in custom staking
it('aproving tokens, staking tokens, checking balance', async () => {
// first aprove tokens to be staked
it('approving tokens, staking tokens, checking balance', async () => {
// first approve tokens to be staked
await testToken.approve(tokenStaking.address, tokenCorvert('1234'), {
from: user,
});
Expand Down
5 changes: 3 additions & 2 deletions truffle-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ module.exports = {

// call console - truffle console
// get contract - await TestToken.deployed()
// to compile - truffle compile
// to deploy - truffle migrate --reset

// to compile - truffle compile
// to deploy - truffle migrate --reset
// to deploy - truffle migrate --network rinkeby --reset
// to verify - truffle run verify Contract --network rinkeby

0 comments on commit 0501423

Please sign in to comment.