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

update #105

Open
wants to merge 65 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
37191f3
Update README.md
FOWGit Sep 23, 2022
a208c31
Create main_page.tsx
FOWGit Oct 8, 2022
bbeb870
Create rescue_detls.tsx
FOWGit Oct 8, 2022
a9a1169
Create validation_page.txs
FOWGit Oct 8, 2022
ad13c01
Rename validation_page.txs to validation_page.tsx
FOWGit Oct 8, 2022
85e341c
Create donate_dets.tsx
FOWGit Oct 8, 2022
d31326a
Create rescue_tracker.tsx
FOWGit Oct 8, 2022
a70a8ea
Create donation_tracker.tsx
FOWGit Oct 8, 2022
73a43e9
Rename PROJECT_NAME/donate_dets.tsx to FOW FR/donate_dets.tsx
FOWGit Oct 8, 2022
44ba65b
Rename PROJECT_NAME/donation_tracker.tsx to FOW FR/donation_tracker.tsx
FOWGit Oct 8, 2022
49d8cfd
Rename PROJECT_NAME/main_page.tsx to FOW FR/main_page.tsx
FOWGit Oct 8, 2022
e62386a
Rename PROJECT_NAME/rescue_detls.tsx to FOW FR/rescue_detls.tsx
FOWGit Oct 8, 2022
b29499b
Rename PROJECT_NAME/rescue_tracker.tsx to FOW FR/rescue_tracker.tsx
FOWGit Oct 8, 2022
aa9840f
Rename PROJECT_NAME/validation_page.tsx to FOW FR/validation_page.tsx
FOWGit Oct 8, 2022
d640238
Delete PROJECT_NAME directory
FOWGit Oct 8, 2022
96fd4ce
Gr, Spell Corrections
AmaanSayyad Oct 8, 2022
f819616
Add files via upload
AmaanSayyad Oct 21, 2022
728b806
update
Ankush263 Oct 24, 2022
3a091ae
no need
Ankush263 Oct 24, 2022
9cec562
update
Ankush263 Oct 24, 2022
789c4a8
update
Ankush263 Oct 24, 2022
a0fc86c
.
Ankush263 Oct 24, 2022
31c49c6
update
Ankush263 Nov 1, 2022
200000f
All images
Ankush263 Nov 2, 2022
58c6591
update
Ankush263 Nov 2, 2022
f010722
update
Ankush263 Nov 2, 2022
5dfc456
update
Ankush263 Nov 2, 2022
d0dfcd3
update
Ankush263 Nov 2, 2022
0ae90b0
update
Ankush263 Nov 2, 2022
68ceb8c
update
Ankush263 Nov 2, 2022
5b4b4bd
update
Ankush263 Nov 2, 2022
5b6a114
update
Ankush263 Nov 2, 2022
1c7941a
update
Ankush263 Nov 2, 2022
9a40a29
update
Ankush263 Nov 2, 2022
c03bd88
update
Ankush263 Nov 2, 2022
8428cb8
update
Ankush263 Nov 2, 2022
ee19dc4
update
Ankush263 Nov 2, 2022
ea77a79
update
Ankush263 Nov 2, 2022
404782c
update
Ankush263 Nov 2, 2022
4684f7b
update
Ankush263 Nov 2, 2022
80c5082
update
Ankush263 Nov 2, 2022
dbb94f3
update
Ankush263 Nov 2, 2022
9f69d94
update
Ankush263 Nov 2, 2022
b787081
update
Ankush263 Nov 2, 2022
72431c0
update
Ankush263 Nov 2, 2022
58d6ed6
update
Ankush263 Nov 2, 2022
4b2d28a
update
Ankush263 Nov 2, 2022
2185a59
update
Ankush263 Nov 2, 2022
be9d075
update
Ankush263 Nov 2, 2022
b798aa8
update
Ankush263 Nov 2, 2022
ed3e200
update
Ankush263 Nov 2, 2022
30c792d
update
Ankush263 Nov 2, 2022
1931cf0
update
Ankush263 Nov 2, 2022
8d17b3a
update
Ankush263 Nov 2, 2022
1fcbb91
update
Ankush263 Nov 2, 2022
d69b933
update
Ankush263 Nov 2, 2022
08c0fd3
update the css
Ankush263 Nov 6, 2022
08d63d7
Update pinata
Ankush263 Nov 6, 2022
62b29f9
update first page
Ankush263 Nov 6, 2022
6bee159
update
Ankush263 Nov 6, 2022
23c8cb8
update
Ankush263 Nov 6, 2022
a8cb25a
update
Ankush263 Nov 9, 2022
3fd79df
update
Ankush263 Nov 9, 2022
fcd12e5
implement new chain
Ankush263 Mar 4, 2023
d7a0e0e
Add walletconnect
Ankush263 Jun 1, 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
11 changes: 11 additions & 0 deletions FOW FR/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
node_modules
.env
coverage
coverage.json
typechain
typechain-types

#Hardhat files
cache
artifacts

13 changes: 13 additions & 0 deletions FOW FR/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Sample Hardhat Project

This project demonstrates a basic Hardhat use case. It comes with a sample contract, a test for that contract, and a script that deploys that contract.

Try running some of the following tasks:

```shell
npx hardhat help
npx hardhat test
REPORT_GAS=true npx hardhat test
npx hardhat node
npx hardhat run scripts/deploy.ts
```
244 changes: 244 additions & 0 deletions FOW FR/contracts/CELO_HACK.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,244 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;

contract CELO_HACK {

struct RescueDetails {
uint rescueId;
address owner;
string rescueInfo;
address rescuerAddress;
bool rescuePickup;
bool rescueRecieved;
bool rescueClosed;
}

struct DonationDetails {
uint donationId;
address owner;
string donationInfo;
address donarAddress;
bool donationPickup;
bool NFTreceived;
bool donationReceived;
bool donationClosed;
}

struct NFT {
uint NFTId;
address owner;
string NFTinfo;
}

uint rescueCount = 0;
uint donationCount = 0;
uint count = 0;

RescueDetails[] public AllRescueDetails;
DonationDetails[] public AllDonationDetails;
NFT[] public AllNFTs;

address payable public owner;



constructor() {
owner = payable(msg.sender);
}

function transferOwnership(address _newOwner) public {
require(msg.sender == owner);
owner = payable(_newOwner);
}

// -------------------------All Rescue Functions---------------------------------------------

function SendRescueRequest
(
string memory _rescueInfo

) public {

RescueDetails memory tempRescueDetails;

tempRescueDetails.rescueId = rescueCount;
tempRescueDetails.owner = owner;
tempRescueDetails.rescuerAddress = msg.sender;
tempRescueDetails.rescueInfo = _rescueInfo;

AllRescueDetails.push(tempRescueDetails);
rescueCount++;
}

function getAllRescueRequest() public view returns(RescueDetails[] memory) {
return AllRescueDetails;
}

function getRescuePickup(uint _rescueId) public {
require(owner == msg.sender, "Only owner can call this function"); // Here Id starts from (0 -> infinity)
require(AllRescueDetails[_rescueId].rescueRecieved == false);
require(AllRescueDetails[_rescueId].rescuePickup == false);
require(AllRescueDetails[_rescueId].rescueClosed == false);

AllRescueDetails[_rescueId].rescuePickup = true;
}

function getRescueRecieved(uint _rescueId) public {
require(owner == msg.sender, "Only owner can call this function");
require(AllRescueDetails[_rescueId].rescuePickup == true);
require(AllRescueDetails[_rescueId].rescueClosed == false);
require(AllRescueDetails[_rescueId].rescueRecieved == false);

AllRescueDetails[_rescueId].rescueRecieved = true;
}

function getRescueClosed(uint _rescueId) public {
require(owner == msg.sender, "Only owner can call this function");
require(AllRescueDetails[_rescueId].rescuePickup == true);
require(AllRescueDetails[_rescueId].rescueRecieved == true);
require(AllRescueDetails[_rescueId].rescueClosed == false);

AllRescueDetails[_rescueId].rescueClosed = true;
}

function getAllMyRescueDetails() public view returns(RescueDetails[] memory) {
uint totalRescueCount = rescueCount;
uint rescue = 0;
uint currentIndex = 0;

for(uint i = 0; i < totalRescueCount; i++) {
if(AllRescueDetails[i].rescuerAddress == msg.sender) {
rescue++;
}
}

RescueDetails[] memory myRescue = new RescueDetails[](rescue);
for(uint i = 0; i < totalRescueCount; i++) {
if(AllRescueDetails[i].rescuerAddress == msg.sender) {
myRescue[currentIndex] = AllRescueDetails[i];
currentIndex++;
}
}

return myRescue;

}

// -------------------------All Donation Functions---------------------------------------------

function SendDonationRequest
(
string memory _donationInfo

)public {

DonationDetails memory tempDonationDetails;

tempDonationDetails.donationId = donationCount;
tempDonationDetails.owner = owner;
tempDonationDetails.donarAddress = msg.sender;
tempDonationDetails.donationInfo = _donationInfo;

AllDonationDetails.push(tempDonationDetails);
donationCount++;
}

function getAllDonationRequest() public view returns(DonationDetails[] memory) {
return AllDonationDetails;
}

function getDonationPickup(uint _donationId) public {
require(owner == msg.sender, "Only owner can call this function");
require(AllDonationDetails[_donationId].donationReceived == false);
require(AllDonationDetails[_donationId].donationClosed == false);
require(AllDonationDetails[_donationId].donationPickup == false);

AllDonationDetails[_donationId].donationPickup = true;
}


function createNFT
(
uint _donationId,
string memory _NFTinfo

) public {
require(owner == msg.sender);
NFT memory tempNFTs;

tempNFTs.NFTId = count;
tempNFTs.owner = AllDonationDetails[_donationId].donarAddress;
tempNFTs.NFTinfo = _NFTinfo;

AllNFTs.push(tempNFTs);
AllDonationDetails[_donationId].NFTreceived = true;
count++;
}

function getAllMyNFT() public view returns(NFT[] memory) {
uint totalNFT = count;
uint nft = 0;
uint currentIndex = 0;

for(uint i = 0; i < totalNFT; i++) {
if(AllNFTs[i].owner == msg.sender) {
nft++;
}
}

NFT[] memory nftOwner = new NFT[](nft);
for(uint i = 0; i < totalNFT; i++) {
if(AllNFTs[i].owner == msg.sender) {
nftOwner[currentIndex] = AllNFTs[i];
currentIndex++;
}
}

return nftOwner;
}


function getDonationReceived(uint _donationId) public {
require(owner == msg.sender, "Only owner can call this function");
require(AllDonationDetails[_donationId].donationPickup == true);
require(AllDonationDetails[_donationId].NFTreceived == true);
require(AllDonationDetails[_donationId].donationReceived == false);
require(AllDonationDetails[_donationId].donationClosed == false);

AllDonationDetails[_donationId].donationReceived = true;
}

function getDonationClosed(uint _donationId) public {
require(owner == msg.sender, "Only owner can call this function");
require(AllDonationDetails[_donationId].donationPickup == true);
require(AllDonationDetails[_donationId].NFTreceived == true);
require(AllDonationDetails[_donationId].donationReceived == true);
require(AllDonationDetails[_donationId].donationClosed == false);

AllDonationDetails[_donationId].donationClosed = true;
}

function getAllMyDonationDetails() public view returns(DonationDetails[] memory) {
uint totalDonationCount = donationCount;
uint donation = 0;
uint currentIndex = 0;

for(uint i = 0; i < totalDonationCount; i++) {
if(AllDonationDetails[i].donarAddress == msg.sender) {
donation++;
}
}

DonationDetails[] memory myDonar = new DonationDetails[](donation);
for(uint i = 0; i < totalDonationCount; i++) {
if(AllDonationDetails[i].donarAddress == msg.sender) {
myDonar[currentIndex] = AllDonationDetails[i];
currentIndex++;
}
}

return myDonar;
}


}
34 changes: 34 additions & 0 deletions FOW FR/contracts/Lock.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.9;

// Uncomment this line to use console.log
// import "hardhat/console.sol";

contract Lock {
uint public unlockTime;
address payable public owner;

event Withdrawal(uint amount, uint when);

constructor(uint _unlockTime) payable {
require(
block.timestamp < _unlockTime,
"Unlock time should be in the future"
);

unlockTime = _unlockTime;
owner = payable(msg.sender);
}

function withdraw() public {
// Uncomment this line, and the import of "hardhat/console.sol", to print a log in your terminal
// console.log("Unlock time is %o and block timestamp is %o", unlockTime, block.timestamp);

require(block.timestamp >= unlockTime, "You can't withdraw yet");
require(msg.sender == owner, "You aren't the owner");

emit Withdrawal(address(this).balance, block.timestamp);

owner.transfer(address(this).balance);
}
}
3 changes: 3 additions & 0 deletions FOW FR/fow_client/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "next/core-web-vitals"
}
36 changes: 36 additions & 0 deletions FOW FR/fow_client/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
34 changes: 34 additions & 0 deletions FOW FR/fow_client/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).

## Getting Started

First, run the development server:

```bash
npm run dev
# or
yarn dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file.

[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`.

The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.

## Learn More

To learn more about Next.js, take a look at the following resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!

## Deploy on Vercel

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.

Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
7 changes: 7 additions & 0 deletions FOW FR/fow_client/next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
swcMinify: true,
}

module.exports = nextConfig
Loading