Skip to content

Commit 9d4ca9a

Browse files
committed
Cleaning up code
1 parent 1087208 commit 9d4ca9a

8 files changed

Lines changed: 60 additions & 127 deletions

File tree

.github/workflows/lint.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ jobs:
3030
- name: Install dependencies
3131
run: yarn install --immutable
3232

33-
- name: Run hardhat node, deploy contracts (& generate contracts typescript output)
34-
run: yarn chain & yarn deploy
33+
# - name: Run hardhat node, deploy contracts (& generate contracts typescript output)
34+
# run: yarn chain & yarn deploy
3535

3636
# - name: Run nextjs lint
3737
# run: yarn next:lint --max-warnings=0
3838

3939
# - name: Check typings on nextjs
4040
# run: yarn next:check-types
4141

42-
- name: Run hardhat lint
43-
run: yarn hardhat:lint --max-warnings=0
42+
# - name: Run hardhat lint
43+
# run: yarn hardhat:lint --max-warnings=0

CONTRIBUTING.md

Lines changed: 40 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,86 +1,61 @@
1-
# Welcome to Scaffold-ETH 2 Contributing Guide
1+
# Contributing Guidelines
22

3-
Thank you for investing your time in contributing to Scaffold-ETH 2!
3+
Thank you for considering contributing to the Lightning EVM Bridge project! Before you start, please take a moment to review the following guidelines to help streamline the contribution process and ensure a positive collaborative experience.
44

5-
This guide aims to provide an overview of the contribution workflow to help us make the contribution process effective for everyone involved.
5+
## How Can I Contribute?
66

7-
## About the Project
7+
Contributions to the Lightning EVM Bridge project can come in various forms, including but not limited to:
88

9-
Scaffold-ETH 2 is a minimal and forkable repo providing builders with a starter kit to build decentralized applications on Ethereum.
9+
- Reporting bugs
10+
- Suggesting enhancements
11+
- Fixing issues by opening pull requests
12+
- Writing tests
13+
- Improving documentation
14+
- Providing feedback on discussions
1015

11-
Read the [README](README.md) to get an overview of the project.
16+
## Getting Started
1217

13-
### Vision
18+
To contribute to the project, follow these steps:
1419

15-
The goal of Scaffold-ETH 2 is to provide the primary building blocks for a decentralized application.
20+
1. Fork the repository and create your branch from `main`.
21+
2. Clone your forked repository to your local machine.
22+
3. Make your changes and ensure that they adhere to the coding standards and guidelines.
23+
4. Test your changes thoroughly.
24+
5. Commit your changes with clear and concise commit messages.
25+
6. Push your changes to your forked repository.
26+
7. Open a pull request to the `main` branch of the original repository.
1627

17-
The repo can be forked to include integrations and more features, but we want to keep the master branch simple and minimal.
28+
## Code Quality and Standards
1829

19-
### Project Status
30+
- Follow the existing code style and conventions.
31+
- Write clear and concise code and comments.
32+
- Ensure that your changes do not introduce linting errors or warnings.
33+
- Write comprehensive tests for new features or changes.
2034

21-
The project is under active development.
35+
## Issue Reporting
2236

23-
You can view the open Issues, follow the development process and contribute to the project.
37+
If you encounter any bugs, issues, or have suggestions for enhancements, please search the existing issues before opening a new one to avoid duplicates. When opening an issue, provide detailed information, including steps to reproduce the problem or context for the enhancement.
2438

25-
## Getting started
39+
## Pull Request Guidelines
2640

27-
You can contribute to this repo in many ways:
41+
When submitting a pull request, please:
2842

29-
- Solve open issues
30-
- Report bugs or feature requests
31-
- Improve the documentation
43+
- Provide a clear and descriptive title for your pull request.
44+
- Reference any related issues in the pull request description using GitHub issue linking syntax (`#issue_number`).
45+
- Include a brief summary of your changes and their purpose.
46+
- Ensure that all tests pass successfully.
47+
- Rebase your branch on top of the latest `main` branch before opening a pull request to simplify the merge process.
3248

33-
Contributions are made via Issues and Pull Requests (PRs). A few general guidelines for contributions:
49+
## Review Process
3450

35-
- Search for existing Issues and PRs before creating your own.
36-
- Contributions should only fix/add the functionality in the issue OR address style issues, not both.
37-
- If you're running into an error, please give context. Explain what you're trying to do and how to reproduce the error.
38-
- Please use the same formatting in the code repository. You can configure your IDE to do it by using the prettier / linting config files included in each package.
39-
- If applicable, please edit the README.md file to reflect the changes.
51+
Pull requests will undergo a review process by project maintainers. Reviews may include feedback, suggestions, or requests for changes. Contributors are expected to address any review comments promptly and professionally.
4052

41-
### Issues
53+
## Maintainers
4254

43-
Issues should be used to report problems, request a new feature, or discuss potential changes before a PR is created.
55+
The following individuals are maintainers of the Lightning EVM Bridge project:
4456

45-
#### Solve an issue
57+
- [Diyahir](mailto:me@diyahir.com)
4658

47-
Scan through our [existing issues](https://github.com/scaffold-eth/scaffold-eth-2/issues) to find one that interests you.
59+
Feel free to reach out to them directly for any project-related inquiries or assistance.
4860

49-
If a contributor is working on the issue, they will be assigned to the individual. If you find an issue to work on, you are welcome to assign it to yourself and open a PR with a fix for it.
50-
51-
#### Create a new issue
52-
53-
If a related issue doesn't exist, you can open a new issue.
54-
55-
Some tips to follow when you are creating an issue:
56-
57-
- Provide as much context as possible. Over-communicate to give the most details to the reader.
58-
- Include the steps to reproduce the issue or the reason for adding the feature.
59-
- Screenshots, videos etc., are highly appreciated.
60-
61-
### Pull Requests
62-
63-
#### Pull Request Process
64-
65-
We follow the ["fork-and-pull" Git workflow](https://github.com/susam/gitpr)
66-
67-
1. Fork the repo
68-
2. Clone the project
69-
3. Create a new branch with a descriptive name
70-
4. Commit your changes to the new branch
71-
5. Push changes to your fork
72-
6. Open a PR in our repository and tag one of the maintainers to review your PR
73-
74-
Here are some tips for a high-quality pull request:
75-
76-
- Create a title for the PR that accurately defines the work done.
77-
- Structure the description neatly to make it easy to consume by the readers. For example, you can include bullet points and screenshots instead of having one large paragraph.
78-
- Add the link to the issue if applicable.
79-
- Have a good commit message that summarises the work done.
80-
81-
Once you submit your PR:
82-
83-
- We may ask questions, request additional information or ask for changes to be made before a PR can be merged. Please note that these are to make the PR clear for everyone involved and aims to create a frictionless interaction process.
84-
- As you update your PR and apply changes, mark each conversation resolved.
85-
86-
Once the PR is approved, we'll "squash-and-merge" to keep the git commit history clean.
61+
Thank you for contributing to the Lightning EVM Bridge project! 🎉

README.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ There are three main parts to this project:
2121

2222
<!-- Make a table with links to each folder -->
2323

24-
| Folder | Description |
25-
| ------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
26-
| [Contracts](./packages/foundry) | This is where the smart contracts live. |
27-
| [Frontend](./packages/nextjs) | This is the frontend of the app. |
28-
| [Lightning server](./packages/server) | This is the lightning service provider who is paying the invoices, this connects to your lightning node (is not one itself) |
24+
| Folder | Description |
25+
| ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
26+
| [Contracts](./packages/foundry) | This is where the smart contracts live |
27+
| [Frontend](./packages/nextjs) | This is the frontend of the app built using Scaffold-Eth 2 |
28+
| [Lightning server](./packages/server) | This is the lightning service provider websocket who is paying the invoices, this connects to your lightning node (is not one itself) |
2929

3030
## Payment Flow
3131

@@ -113,7 +113,13 @@ yarn start
113113

114114
This command starts a local Ethereum network using Hardhat. The network runs on your local machine and can be used for testing and development. You can customize the network configuration in `hardhat.config.ts`.
115115

116-
## Deploying your Smart Contracts to a Live Network
116+
## Deploying Smart Contracts
117+
118+
To test the smart contracts
119+
120+
```bash
121+
yarn foundry:test
122+
```
117123

118124
Once you are ready to deploy your smart contracts, there are a few things you need to adjust.
119125

@@ -190,8 +196,6 @@ docker-compose up -d --build
190196
### Future Work
191197

192198
- [ ] Server funds rebalancing (cycle funds from the evm chain to the lightning network channel)
193-
- [ ] ERC20 support for tBTC on other chains (Base, Arbitrum, etc.)
194-
- [ ] Make server multi-chain
195199
- [ ] Add support to receive payments from the lightning network to the evm chain
196200
- [ ] Create proper database for the server
197201
- [ ] Add ability to change LSP

packages/nextjs/app/page.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { useState } from "react";
55
import "../styles/bg.css";
66
import "../styles/glowButton.css";
77
import { useAccount } from "wagmi";
8-
// Import your custom components and hooks
98
import { HistoryTable } from "~~/components/HistoryTable";
109
import SendModalPopup from "~~/components/SendModalPopup";
1110
import { useLightningApp } from "~~/hooks/LightningProvider";
@@ -35,10 +34,7 @@ const Home = () => {
3534

3635
return (
3736
<>
38-
<div className="bg-oval-gradient justify-center absolute bg-gradient-to-r from-yellow-400 to-violet-800 opacity-25">
39-
{/* Your content here */}
40-
</div>
41-
37+
<div className="bg-oval-gradient justify-center absolute bg-gradient-to-r from-yellow-400 to-violet-800 opacity-25" />
4238
<div className="font-plex container mx-auto flex h-[95%] items-center justify-center">
4339
<div className="card w-[500px] ">
4440
<div className="card-header text-white p-4">

packages/nextjs/components/Footer.tsx

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -36,41 +36,8 @@ export const Footer = () => {
3636
</>
3737
)}
3838
</div>
39-
{/* <SwitchTheme className={`pointer-events-auto ${isLocalNetwork ? "self-end md:self-auto" : ""}`} /> */}
4039
</div>
4140
</div>
42-
{/* <div className="w-full">
43-
<ul className="menu menu-horizontal w-full">
44-
<div className="flex justify-center items-center gap-2 text-sm w-full">
45-
<div className="text-center">
46-
<a href="https://github.com/scaffold-eth/se-2" target="_blank" rel="noreferrer" className="link">
47-
Fork me
48-
</a>
49-
</div>
50-
<span>·</span>
51-
<div className="flex justify-center items-center gap-2">
52-
<p className="m-0 text-center">
53-
Built with <HeartIcon className="inline-block h-4 w-4" /> at
54-
</p>
55-
<a
56-
className="flex justify-center items-center gap-1"
57-
href="https://buidlguidl.com/"
58-
target="_blank"
59-
rel="noreferrer"
60-
>
61-
<BuidlGuidlLogo className="w-3 h-5 pb-1" />
62-
<span className="link">BuidlGuidl</span>
63-
</a>
64-
</div>
65-
<span>·</span>
66-
<div className="text-center">
67-
<a href="https://t.me/joinchat/KByvmRe5wkR-8F_zz6AjpA" target="_blank" rel="noreferrer" className="link">
68-
Support
69-
</a>
70-
</div>
71-
</div>
72-
</ul>
73-
</div> */}
7441
</div>
7542
);
7643
};

packages/nextjs/components/Header.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"use client";
22

33
import React from "react";
4+
import Image from "next/image";
45
import Link from "next/link";
56
import { usePathname } from "next/navigation";
67
import { FaucetButton, RainbowKitCustomConnectButton } from "~~/components/scaffold-eth";
@@ -59,12 +60,11 @@ export const Header = () => {
5960
<div className="sticky font-plex lg:static top-0 navbar bg-base-100 min-h-0 flex-shrink-0 justify-between z-20 px-0 sm:px-2">
6061
<div className="navbar-start w-auto lg:w-1/2">
6162
<Link color={"white"} href="/" passHref className="hidden lg:flex items-center gap-2 ml-4 mr-6 shrink-0">
62-
<img src="/logo.svg" alt="Botanix Logo" width={"24px"} height={"24px"} />
63+
<Image src="/logo.svg" alt="Botanix Logo" width={"24"} height={"24"} />
6364
<div className="flex flex-col font-plex font-bold text-white">Botanix {"<>"} Lightning </div>
6465
</Link>
6566
</div>
6667
<div className="navbar-end flex-grow mr-4">
67-
{/* a div that shows if the client is connected to the server */}
6868
<button
6969
className="btn btn-ghost btn-sm text-white font-plex"
7070
onClick={() => {

packages/nextjs/components/PaymentInvoice.tsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ import React from "react";
22
import { useLightningApp } from "~~/hooks/LightningProvider";
33
import { LnPaymentInvoice } from "~~/types/utils";
44

5-
/**
6-
* Site footer
7-
*/
85
type PaymentInvoiceProps = {
96
invoice: LnPaymentInvoice;
107
contractId: string | null;
@@ -54,14 +51,9 @@ export const PaymentInvoice = ({ invoice, submitPayment, cancelPayment, step }:
5451
</table>
5552

5653
{/* Stepper Component */}
57-
{/* You'll need to adapt or implement your own stepper logic with Tailwind CSS */}
5854
<ul className="steps steps-vertical">
5955
{steps.map((stepInfo, index) => (
60-
<li
61-
// data-content={index === step ? "" : index + 1}
62-
key={index}
63-
className={`${index < step ? "step step-primary" : "step"} text-gray-400`}
64-
>
56+
<li key={index} className={`${index < step ? "step step-primary" : "step"} text-gray-400`}>
6557
<div className="flex flex-col text-start">
6658
{stepInfo.title}
6759
&nbsp;

packages/nextjs/hooks/LightningProvider.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { useNativeCurrencyPrice, useScaffoldEventSubscriber } from "./scaffold-e
33
import { useWebSocket } from "./useWebSocket";
44
import { ToastContainer, toast } from "react-toastify";
55
import "react-toastify/dist/ReactToastify.css";
6-
// import { useWalletClient } from "wagmi";
76
import { InvoiceRequest, InvoiceResponse } from "~~/types/utils";
87

98
// Define the types for your historical transactions and context

0 commit comments

Comments
 (0)