Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

💵 Purchase Article #7

Open
wants to merge 50 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
ae8da88
feat: notifications in test version
efe-onchain Oct 17, 2023
4524566
feat: delete articles
efe-onchain Oct 18, 2023
32ee2f0
fix: remappings placements
efe-onchain Oct 18, 2023
20fbe37
fix: reset openzeppelin dependencies
efe-onchain Oct 18, 2023
da3424c
forge install: openzeppelin-contracts
efe-onchain Oct 18, 2023
f216d34
fix: dependencies fixed
efe-onchain Oct 18, 2023
05c28ea
Initial placeholder dashboard page
juansjimenez Oct 21, 2023
1f6d844
Fix articles from journalist hook without file termination
juansjimenez Oct 21, 2023
6736320
Merge branch 'journalist-dashboard'
juansjimenez Oct 21, 2023
991a17b
fix: merge conflicts
efe-onchain Oct 21, 2023
8b2e05c
fix: notifications branch on par with main
efe-onchain Oct 21, 2023
501b684
fix: merge conflict
efe-onchain Oct 21, 2023
32557a9
fix: final bugfix involving merge
efe-onchain Oct 21, 2023
9ede782
fix: subgraph
efe-onchain Oct 21, 2023
0b25753
✨ Update subpgraph integration
Gaonuk Oct 21, 2023
5fd9e29
Merge pull request #2 from Gaonuk/feat/update-subpgrah-integration
Gaonuk Oct 21, 2023
e2a0379
Add dashboard working with real information
juansjimenez Oct 21, 2023
89c4f06
Add get subgraph journalist hook
juansjimenez Oct 21, 2023
b6dd2cf
merge main
juansjimenez Oct 21, 2023
2679d75
Merge branch 'main' into notifications
efe-onchain Oct 21, 2023
517ec83
Move helpers to lib folder
juansjimenez Oct 21, 2023
2a8d801
Merge pull request #3 from Gaonuk/feat/dashboard
Gaonuk Oct 21, 2023
f22e1fc
feat: notifications
efe-onchain Oct 22, 2023
4df4d7b
Merge branch 'main' into notifications
efe-onchain Oct 22, 2023
44933eb
✨ Add article page
Gaonuk Oct 22, 2023
3cf6f78
fix: diff between branch
efe-onchain Oct 22, 2023
9dcf2a5
✨ Remove reads to prioritise using the graph
Gaonuk Oct 22, 2023
29d722c
fix: delete notifications
efe-onchain Oct 22, 2023
9e576fe
fix: remove payper-app
efe-onchain Oct 22, 2023
c57b9bf
✨ Fix build
Gaonuk Oct 22, 2023
3ee246e
notifications final
efe-onchain Oct 22, 2023
b8998e1
Merge pull request #4 from Gaonuk/feat/add-article-page
juansjimenez Oct 22, 2023
9ab2d44
fix: correct payper-app
efe-onchain Oct 22, 2023
da806d1
Merge branch 'main' into notifications
efe-onchain Oct 22, 2023
d8d81e9
Delete pnpm-lock.yaml
efe-onchain Oct 22, 2023
564a9e8
add pnpm lock
efe-onchain Oct 22, 2023
14ef209
fix: remove article tsx
efe-onchain Oct 22, 2023
a6b2722
Add search articles functionality
juansjimenez Oct 22, 2023
b7bb9c2
Fix dashboard total revenue value
juansjimenez Oct 22, 2023
cb5df35
Merge pull request #1 from Gaonuk/notifications
efe-onchain Oct 22, 2023
5ea2ebd
Fix build
juansjimenez Oct 22, 2023
f841248
Merge pull request #5 from Gaonuk/feat/article-search
juansjimenez Oct 22, 2023
958d29a
subgraph hook
efe-onchain Oct 22, 2023
fcb61e2
incorrect file type
efe-onchain Oct 22, 2023
fb154c6
Add purchase read and purchase contract write to Article page
juansjimenez Oct 22, 2023
f13ce2c
Remove console logs
juansjimenez Oct 22, 2023
557f00f
raing
efe-onchain Oct 22, 2023
e800c51
Merge branch 'read-purchase' of https://github.com/Gaonuk/PayPer into…
efe-onchain Oct 22, 2023
e10ba61
fix: merge conflict
efe-onchain Oct 22, 2023
8339a70
price fix
efe-onchain Oct 22, 2023
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
9 changes: 8 additions & 1 deletion contracts/src/PayPer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ contract PayPer {
event JounralistTipped(address journalist, uint256 tipAmount, string message);

event JournalistRated(address journalist, uint256 rating, uint256 totalRating, uint256 amountOfRatings);

event ArticleDeleted(uint256 articleId);

mapping(uint256 => Article) public articles;
mapping(address => Journalist) public journalists;
mapping(uint256 => Edition) public editions;
Expand Down Expand Up @@ -105,6 +106,12 @@ contract PayPer {
emit PostedArticle(article.id, article.name, article.journalist, article.freeContent, article.encryptedUrl, article.imageUrl, article.videoUrl, article.price, article.date, uint256(article.newsType));
}

function deleteArticle(uint256 articleId) external {
delete articles[articleId];

emit ArticleDeleted(articleId);
}

function createJournalist(string memory name, string memory description, address journalistAddress)
external
{
Expand Down
2 changes: 1 addition & 1 deletion payper-app/components.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "default",
"style": "new-york",
"rsc": false,
"tsx": true,
"tailwind": {
Expand Down
36 changes: 23 additions & 13 deletions payper-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,50 +10,60 @@
},
"dependencies": {
"@apollo/client": "^3.8.6",
"@editorjs/editorjs": "^2.28.2",
"@graphprotocol/graph-cli": "^0.60.0",
"@graphprotocol/graph-ts": "^0.31.0",
"@radix-ui/react-avatar": "^1.0.4",
"@radix-ui/react-icons": "^1.3.0",
"@radix-ui/react-slot": "^1.0.2",
"@radix-ui/react-tabs": "^1.0.4",
"@safe-global/api-kit": "^1.3.1",
"@safe-global/auth-kit": "^1.2.1",
"@safe-global/protocol-kit": "^1.3.0",
"@safe-global/safe-react-components": "^2.0.6",
"@wagmi/core": "^1.4.3",
"@walletconnect/types": "^2.10.2",
"@web3auth/base": "^7.0.4",
"@web3auth/modal": "^7.0.5",
"@web3auth/openlogin-adapter": "^7.0.4",
"@web3auth/web3auth-wagmi-connector": "^5.0.1",
"bignumber.js": "^9.1.2",
"class-variance-authority": "^0.7.0",
"classnames": "^2.3.2",
"clsx": "^2.0.0",
"connectkit": "^1.5.3",
"contentlayer": "^0.3.4",
"date-fns": "^2.30.0",
"graphql": "^16.8.1",
"lucide-react": "^0.288.0",
"next": "13.5.4",
"react": "^18",
"react-dom": "^18",
"next-contentlayer": "^0.3.4",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-pdf": "^7.5.1",
"sonner": "^1.0.3",
"tailwind-merge": "^1.14.0",
"tailwindcss-animate": "^1.0.7",
"viem": "^1.16.5",
"wagmi": "^1.4.3"
"wagmi": "^1.4.3",
"web3": "^4.2.0"
},
"devDependencies": {
"@graphprotocol/client-cli": "^3.0.0",
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"@typescript-eslint/eslint-plugin": "^6.4.0",
"autoprefixer": "^10",
"@types/node": "^20.8.6",
"@types/react": "^18.2.28",
"@types/react-dom": "^18.2.13",
"@typescript-eslint/eslint-plugin": "^6.7.5",
"autoprefixer": "^10.4.16",
"eslint": "^8.51.0",
"eslint-config-next": "13.5.4",
"eslint-config-standard-with-typescript": "^39.1.1",
"eslint-plugin-import": "^2.25.2",
"eslint-plugin-n": "^15.0.0 || ^16.0.0 ",
"eslint-plugin-promise": "^6.0.0",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-n": "^16.2.0",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-react": "^7.33.2",
"postcss": "^8",
"tailwindcss": "^3",
"postcss": "^8.4.31",
"tailwindcss": "^3.3.3",
"typescript": "^5.2.2"
}
}
Loading