diff --git a/client/src/App.jsx b/client/src/App.jsx
index fad5d2e..e34f67d 100644
--- a/client/src/App.jsx
+++ b/client/src/App.jsx
@@ -4,6 +4,12 @@ import {
import { useSDK } from '@metamask/sdk-react';
import { Web3 } from 'web3';
import Button from 'react-bootstrap/Button';
+import Tab from 'react-bootstrap/Tab';
+import Tabs from 'react-bootstrap/Tabs';
+import Container from 'react-bootstrap/Container';
+import Row from 'react-bootstrap/Row';
+import Col from 'react-bootstrap/Col';
+import Stack from 'react-bootstrap/Stack';
import DAOArtifact from './assets/DAO.json';
import work1Artifact from './assets/Work1.json';
@@ -391,173 +397,193 @@ function App() {
{connected && (
<>
-
- {!contracts[chainId] && (
-
- Please switch MetaMask to Sepolia testnet!
-
- )}
-
- {chainId && `Chain ID: ${chainId}`}
-
-
- {`Account: ${account}`}
-
-
- {`Balance: ${balanceEther} ETH`}
-
-
- {`Your REP: ${reputation}`}
-
-
- {`Total REP: ${totalReputation}`}
-
-
-
-
- {`Posts count: ${posts.length}`}
-
-
-
-
-
- ID |
- Author |
- Sender |
- Actions |
-
-
-
- {posts.filter((x) => !!x).map((post) => (
-
- {post.id.toString()} |
- {post.author} |
- {post.sender} |
-
- Initiate Validation Pool
- {' '}
-
- {' '}
-
- {' '}
-
- |
-
- ))}
-
-
-
-
-
-
-
- {`Validation Pool Count: ${validationPools.length}`}
-
-
-
-
-
- ID |
- Post ID |
- Fee |
- Duration |
- End Time |
-
- Stake
-
- Count
- |
- Status |
- Actions |
-
-
-
- {validationPools.filter((x) => !!x).map((pool) => (
-
- {pool.id.toString()} |
- {pool.postIndex.toString()} |
- {pool.fee.toString()} |
- {pool.duration.toString()} |
- {new Date(Number(pool.endTime) * 1000).toLocaleString()} |
- {pool.stakeCount.toString()} |
- {pool.status} |
-
- {!pool.resolved && reputation > 0 && pool.timeRemaining > 0 && (
- <>
- |
+
+ ))}
+
+
+
+
+ addPost()}>Add Post
+
+
+ {`Validation Pool Count: ${validationPools.length}`}
+
+
+
+
+
+ ID |
+ Post ID |
+ Fee |
+ Duration |
+ End Time |
+
+ Stake
+
+ Count
+ |
+ Status |
+ Actions |
+
+
+
+ {validationPools.filter((x) => !!x).map((pool) => (
+
+ {pool.id.toString()} |
+ {pool.postIndex.toString()} |
+ {pool.fee.toString()} |
+ {pool.duration.toString()} |
+ {new Date(Number(pool.endTime) * 1000).toLocaleString()} |
+ {pool.stakeCount.toString()} |
+ {pool.status} |
+
+ {!pool.resolved && reputation > 0 && pool.timeRemaining > 0 && (
+ <>
+ stakeAllInFavor(pool.id)}>
+ Stake
+
+ {' '}
+ >
+ )}
+ {!pool.resolved && pool.timeRemaining <= 0 && (
+ evaluateOutcome(pool.id)}>
+ Evaluate Outcome
+
+ )}
+ |
+
+ ))}
+
+
+
+
+
Work Contract 1
+
+ {`Price: ${work1Price} ETH`}
+
+
+ Stake Availability:
{' '}
- stakeAvailability(7200)}>2 Hr.
- >
- )}
-
-
- Availability Stake Count:
- {' '}
- {availabilityStakes.length}
-
-
-
-
-
- ID |
- Worker |
- Amount |
- End Time |
- Assigned |
- Reclaimed |
- Actions |
-
-
-
- {availabilityStakes.filter((x) => !!x).map((s) => (
-
- {s.id.toString()} |
- {s.worker.toString()} |
- {s.amount.toString()} |
- {new Date(Number(s.endTime) * 1000).toLocaleString()} |
- {s.assigned.toString()} |
- {s.reclaimed.toString()} |
-
- {s.currentUserIsWorker() && (
- extendAvailabilityStake(s.id, 3600)}>
- Extend 1 Hr.
-
- )}
- {s.currentUserIsWorker() && s.timeRemaining <= 0
+ {!reputation && <>No reputation available to stake>}
+ {reputation > 0 && (
+ <>
+ stakeAvailability(300)}>5 Min.
+ {' '}
+ stakeAvailability(7200)}>2 Hr.
+ >
+ )}
+
+
+ Availability Stake Count:
+ {' '}
+ {availabilityStakes.length}
+
+
+
+
+
+ ID |
+ Worker |
+ Amount |
+ End Time |
+ Assigned |
+ Reclaimed |
+ Actions |
+
+
+
+ {availabilityStakes.filter((x) => !!x).map((s) => (
+
+ {s.id.toString()} |
+ {s.worker.toString()} |
+ {s.amount.toString()} |
+ {new Date(Number(s.endTime) * 1000).toLocaleString()} |
+ {s.assigned.toString()} |
+ {s.reclaimed.toString()} |
+
+ {s.currentUserIsWorker() && (
+ extendAvailabilityStake(s.id, 3600)}>
+ Extend 1 Hr.
+
+ )}
+ {s.currentUserIsWorker() && s.timeRemaining <= 0
&& !s.assigned && !s.reclaimed && (
<>
{' '}
@@ -565,58 +591,58 @@ function App() {
Reclaim
>
- )}
- |
-
- ))}
-
-
-
-
- requestWork()}>Request Work
-
-
- Work Request Count:
- {' '}
- {workRequests.length}
-
-
-
-
-
- ID |
- Customer |
- Fee |
- Status |
- Stake ID |
- Approval |
- Pool ID |
- Actions |
-
-
-
- {workRequests.filter((x) => !!x).map((request) => (
-
- {request.id.toString()} |
- {request.customer.toString()} |
-
- {request.feeEther}
- {' '}
- ETH
- |
- {request.statusString} |
- {request.stakeIndex.toString()} |
- {request.approval.toString()} |
- {request.poolIndex.toString()} |
-
- {availabilityStakes.length > 0
+ )}
+ |
+
+ ))}
+
+
+
+
+ requestWork()}>Request Work
+
+
+ Work Request Count:
+ {' '}
+ {workRequests.length}
+
+
+
+
+
+ ID |
+ Customer |
+ Fee |
+ Status |
+ Stake ID |
+ Approval |
+ Pool ID |
+ Actions |
+
+
+
+ {workRequests.filter((x) => !!x).map((request) => (
+
+ {request.id.toString()} |
+ {request.customer.toString()} |
+
+ {request.feeEther}
+ {' '}
+ ETH
+ |
+ {request.statusString} |
+ {request.stakeIndex.toString()} |
+ {request.approval.toString()} |
+ {request.poolIndex.toString()} |
+
+ {availabilityStakes.length > 0
&& availabilityStakes[Number(request.stakeIndex)]?.currentUserIsWorker()
&& Number(request.status) === 0 && (
submitWorkEvidence(request.id)}>
Submit Work Evidence
- )}
- {request.currentUserIsCustomer()
+ )}
+ {request.currentUserIsCustomer()
&& Number(request.status) === 1 && (
<>
submitWorkApproval(request.id)}>
@@ -626,14 +652,22 @@ function App() {
Submit Dispproval
>
- )}
- |
-
- ))}
-
-
-
-
+ )}
+ |
+
+ ))}
+
+
+
+
+
+
+ TBD
+
+
+ TBD
+
+
>
)}
>