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

feat(frontend): list sponsorships #25

Merged
merged 9 commits into from
Jun 30, 2024
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
4 changes: 2 additions & 2 deletions backend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ node_modules
ignition/deployments/chain-31337

# Base Sepolia
ignition/deployments/chain-84532/artifacts
#ignition/deployments/chain-84532/artifacts
ignition/deployments/chain-84532/build-info

# Base Mainnet
ignition/deployments/chain-8453/artifacts
#ignition/deployments/chain-8453/artifacts
ignition/deployments/chain-8453/build-info
18 changes: 11 additions & 7 deletions backend/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
# Sample Hardhat Project
# Backend

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

Try running some of the following tasks:
```shell
npm install
npx hardhat clean
npx hardhat compile
```

Testing:

```shell
npx hardhat help
npx hardhat test
REPORT_GAS=true npx hardhat test
npx hardhat node
npx hardhat ignition deploy ./ignition/modules/Lock.ts
npx hardhat coverage
npx istanbul check-coverage --lines 80
```

Deployment:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"_format": "hh-sol-dbg-1",
"buildInfo": "..\\build-info\\ffb38c599a198bfb369f04890d4c17de.json"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
{
"_format": "hh-sol-artifact-1",
"contractName": "SponsorshipQueue",
"sourceName": "contracts/SponsorshipQueue.sol",
"abi": [
{
"inputs": [
{
"internalType": "uint256",
"name": "_estimatedCost",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [],
"name": "OnlyOwner",
"type": "error"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "estimatedCost",
"type": "uint256"
}
],
"name": "EstimatedCostUpdated",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "owner",
"type": "address"
}
],
"name": "OwnerUpdated",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"components": [
{
"internalType": "uint256",
"name": "estimatedCost",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "timestamp",
"type": "uint256"
},
{
"internalType": "address",
"name": "sponsor",
"type": "address"
}
],
"indexed": false,
"internalType": "struct Sponsorship",
"name": "sponsorship",
"type": "tuple"
}
],
"name": "SponsorshipAdded",
"type": "event"
},
{
"inputs": [],
"name": "addSponsorship",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [],
"name": "estimatedCost",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getQueueCount",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"name": "queue",
"outputs": [
{
"internalType": "uint256",
"name": "estimatedCost",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "timestamp",
"type": "uint256"
},
{
"internalType": "address",
"name": "sponsor",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_estimatedCost",
"type": "uint256"
}
],
"name": "updateEstimatedCost",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_owner",
"type": "address"
}
],
"name": "updateOwner",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
],
"bytecode": "0x608060405234801561001057600080fd5b5060405161083a38038061083a833981810160405281019061003291906100ba565b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600181905550506100e7565b600080fd5b6000819050919050565b61009781610084565b81146100a257600080fd5b50565b6000815190506100b48161008e565b92915050565b6000602082840312156100d0576100cf61007f565b5b60006100de848285016100a5565b91505092915050565b610744806100f66000396000f3fe6080604052600436106100705760003560e01c8063880cdc311161004e578063880cdc31146100d35780638da5cb5b146100fc578063d6ed2f0614610127578063ddf0b0091461015257610070565b80633471b337146100755780636e28e29c146100a057806370b62b49146100aa575b600080fd5b34801561008157600080fd5b5061008a610191565b604051610097919061052e565b60405180910390f35b6100a861019e565b005b3480156100b657600080fd5b506100d160048036038101906100cc919061057a565b6102cc565b005b3480156100df57600080fd5b506100fa60048036038101906100f59190610605565b610392565b005b34801561010857600080fd5b50610111610491565b60405161011e9190610641565b60405180910390f35b34801561013357600080fd5b5061013c6104b5565b604051610149919061052e565b60405180910390f35b34801561015e57600080fd5b506101796004803603810190610174919061057a565b6104bb565b6040516101889392919061065c565b60405180910390f35b6000600280549050905090565b3073ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f1935050505050600060405180606001604052803481526020014281526020013373ffffffffffffffffffffffffffffffffffffffff1681525090506002819080600181540180825580915050600190039060005260206000209060030201600090919091909150600082015181600001556020820151816001015560408201518160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050507f9036e83c8988af3d265365c7dde9b7defca043b13814829c5deb742021a5c4f8816040516102c191906106f3565b60405180910390a150565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610351576040517f5fc483c500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b806001819055507f33c78a8bf87e9543dd141ff0b40c84fcd144e6d54cadbce6b444da858110887081604051610387919061052e565b60405180910390a150565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610417576040517f5fc483c500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f4ffd725fc4a22075e9ec71c59edf9c38cdeb588a91b24fc5b61388c5be41282b816040516104869190610641565b60405180910390a150565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60015481565b600281815481106104cb57600080fd5b90600052602060002090600302016000915090508060000154908060010154908060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905083565b6000819050919050565b61052881610515565b82525050565b6000602082019050610543600083018461051f565b92915050565b600080fd5b61055781610515565b811461056257600080fd5b50565b6000813590506105748161054e565b92915050565b6000602082840312156105905761058f610549565b5b600061059e84828501610565565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006105d2826105a7565b9050919050565b6105e2816105c7565b81146105ed57600080fd5b50565b6000813590506105ff816105d9565b92915050565b60006020828403121561061b5761061a610549565b5b6000610629848285016105f0565b91505092915050565b61063b816105c7565b82525050565b60006020820190506106566000830184610632565b92915050565b6000606082019050610671600083018661051f565b61067e602083018561051f565b61068b6040830184610632565b949350505050565b61069c81610515565b82525050565b6106ab816105c7565b82525050565b6060820160008201516106c76000850182610693565b5060208201516106da6020850182610693565b5060408201516106ed60408501826106a2565b50505050565b600060608201905061070860008301846106b1565b9291505056fea2646970667358221220d9836b835cafe1204579cb0ffcd640e262a15b4612db47f778f3ebf5e2a5d2a864736f6c63430008180033",
"deployedBytecode": "0x6080604052600436106100705760003560e01c8063880cdc311161004e578063880cdc31146100d35780638da5cb5b146100fc578063d6ed2f0614610127578063ddf0b0091461015257610070565b80633471b337146100755780636e28e29c146100a057806370b62b49146100aa575b600080fd5b34801561008157600080fd5b5061008a610191565b604051610097919061052e565b60405180910390f35b6100a861019e565b005b3480156100b657600080fd5b506100d160048036038101906100cc919061057a565b6102cc565b005b3480156100df57600080fd5b506100fa60048036038101906100f59190610605565b610392565b005b34801561010857600080fd5b50610111610491565b60405161011e9190610641565b60405180910390f35b34801561013357600080fd5b5061013c6104b5565b604051610149919061052e565b60405180910390f35b34801561015e57600080fd5b506101796004803603810190610174919061057a565b6104bb565b6040516101889392919061065c565b60405180910390f35b6000600280549050905090565b3073ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f1935050505050600060405180606001604052803481526020014281526020013373ffffffffffffffffffffffffffffffffffffffff1681525090506002819080600181540180825580915050600190039060005260206000209060030201600090919091909150600082015181600001556020820151816001015560408201518160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050507f9036e83c8988af3d265365c7dde9b7defca043b13814829c5deb742021a5c4f8816040516102c191906106f3565b60405180910390a150565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610351576040517f5fc483c500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b806001819055507f33c78a8bf87e9543dd141ff0b40c84fcd144e6d54cadbce6b444da858110887081604051610387919061052e565b60405180910390a150565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610417576040517f5fc483c500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f4ffd725fc4a22075e9ec71c59edf9c38cdeb588a91b24fc5b61388c5be41282b816040516104869190610641565b60405180910390a150565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60015481565b600281815481106104cb57600080fd5b90600052602060002090600302016000915090508060000154908060010154908060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905083565b6000819050919050565b61052881610515565b82525050565b6000602082019050610543600083018461051f565b92915050565b600080fd5b61055781610515565b811461056257600080fd5b50565b6000813590506105748161054e565b92915050565b6000602082840312156105905761058f610549565b5b600061059e84828501610565565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006105d2826105a7565b9050919050565b6105e2816105c7565b81146105ed57600080fd5b50565b6000813590506105ff816105d9565b92915050565b60006020828403121561061b5761061a610549565b5b6000610629848285016105f0565b91505092915050565b61063b816105c7565b82525050565b60006020820190506106566000830184610632565b92915050565b6000606082019050610671600083018661051f565b61067e602083018561051f565b61068b6040830184610632565b949350505050565b61069c81610515565b82525050565b6106ab816105c7565b82525050565b6060820160008201516106c76000850182610693565b5060208201516106da6020850182610693565b5060408201516106ed60408501826106a2565b50505050565b600060608201905061070860008301846106b1565b9291505056fea2646970667358221220d9836b835cafe1204579cb0ffcd640e262a15b4612db47f778f3ebf5e2a5d2a864736f6c63430008180033",
"linkReferences": {},
"deployedLinkReferences": {}
}
43 changes: 11 additions & 32 deletions frontend/README.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,19 @@
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).
# Frontend

## Getting Started

First, run the development server:
Compiling:

```bash
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
```
npm install
npm run lint
npm run build
```
Comment on lines +8 to +10
Copy link

@coderabbitai coderabbitai bot Jun 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specify language for code blocks.

To improve readability and enable syntax highlighting, specify the language for code blocks. This aligns with best practices and addresses the Markdownlint warning.

- ```bash
+ ```bash
  npm install
  npm run lint
  npm run build
- ```
+ ```

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the code change here?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jo-elimu The suggested code change is to specify the language for the code blocks in the frontend/README.md file. By adding bash after the triple backticks, it enables syntax highlighting, which improves readability. This change also addresses the Markdownlint warning related to unspecified language for code blocks. Here is the specific change:

- ```
+ ```bash
  npm install
  npm run lint
  npm run build
- ```
+ ```bash

This small adjustment helps make the code snippets clearer for readers and aligns with best practices for Markdown documentation.


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.

This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.

## 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
Run the development server:

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.
```bash
npm run dev
```

Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
Then open http://localhost:3000 with your browser.
Loading
Loading