Skip to content

Commit

Permalink
Cleaning up code
Browse files Browse the repository at this point in the history
  • Loading branch information
diyahir committed Mar 15, 2024
1 parent 1087208 commit 9d4ca9a
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 127 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ jobs:
- name: Install dependencies
run: yarn install --immutable

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

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

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

- name: Run hardhat lint
run: yarn hardhat:lint --max-warnings=0
# - name: Run hardhat lint
# run: yarn hardhat:lint --max-warnings=0
105 changes: 40 additions & 65 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,86 +1,61 @@
# Welcome to Scaffold-ETH 2 Contributing Guide
# Contributing Guidelines

Thank you for investing your time in contributing to Scaffold-ETH 2!
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.

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

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

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

Read the [README](README.md) to get an overview of the project.
## Getting Started

### Vision
To contribute to the project, follow these steps:

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

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

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

The project is under active development.
## Issue Reporting

You can view the open Issues, follow the development process and contribute to the project.
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.

## Getting started
## Pull Request Guidelines

You can contribute to this repo in many ways:
When submitting a pull request, please:

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

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

- Search for existing Issues and PRs before creating your own.
- Contributions should only fix/add the functionality in the issue OR address style issues, not both.
- If you're running into an error, please give context. Explain what you're trying to do and how to reproduce the error.
- 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.
- If applicable, please edit the README.md file to reflect the changes.
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.

### Issues
## Maintainers

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

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

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

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.

#### Create a new issue

If a related issue doesn't exist, you can open a new issue.

Some tips to follow when you are creating an issue:

- Provide as much context as possible. Over-communicate to give the most details to the reader.
- Include the steps to reproduce the issue or the reason for adding the feature.
- Screenshots, videos etc., are highly appreciated.

### Pull Requests

#### Pull Request Process

We follow the ["fork-and-pull" Git workflow](https://github.com/susam/gitpr)

1. Fork the repo
2. Clone the project
3. Create a new branch with a descriptive name
4. Commit your changes to the new branch
5. Push changes to your fork
6. Open a PR in our repository and tag one of the maintainers to review your PR

Here are some tips for a high-quality pull request:

- Create a title for the PR that accurately defines the work done.
- 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.
- Add the link to the issue if applicable.
- Have a good commit message that summarises the work done.

Once you submit your PR:

- 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.
- As you update your PR and apply changes, mark each conversation resolved.

Once the PR is approved, we'll "squash-and-merge" to keep the git commit history clean.
Thank you for contributing to the Lightning EVM Bridge project! 🎉
20 changes: 12 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ There are three main parts to this project:

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

| Folder | Description |
| ------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| [Contracts](./packages/foundry) | This is where the smart contracts live. |
| [Frontend](./packages/nextjs) | This is the frontend of the app. |
| [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) |
| Folder | Description |
| ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| [Contracts](./packages/foundry) | This is where the smart contracts live |
| [Frontend](./packages/nextjs) | This is the frontend of the app built using Scaffold-Eth 2 |
| [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) |

## Payment Flow

Expand Down Expand Up @@ -113,7 +113,13 @@ yarn start

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`.

## Deploying your Smart Contracts to a Live Network
## Deploying Smart Contracts

To test the smart contracts

```bash
yarn foundry:test
```

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

Expand Down Expand Up @@ -190,8 +196,6 @@ docker-compose up -d --build
### Future Work

- [ ] Server funds rebalancing (cycle funds from the evm chain to the lightning network channel)
- [ ] ERC20 support for tBTC on other chains (Base, Arbitrum, etc.)
- [ ] Make server multi-chain
- [ ] Add support to receive payments from the lightning network to the evm chain
- [ ] Create proper database for the server
- [ ] Add ability to change LSP
Expand Down
6 changes: 1 addition & 5 deletions packages/nextjs/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { useState } from "react";
import "../styles/bg.css";
import "../styles/glowButton.css";
import { useAccount } from "wagmi";
// Import your custom components and hooks
import { HistoryTable } from "~~/components/HistoryTable";
import SendModalPopup from "~~/components/SendModalPopup";
import { useLightningApp } from "~~/hooks/LightningProvider";
Expand Down Expand Up @@ -35,10 +34,7 @@ const Home = () => {

return (
<>
<div className="bg-oval-gradient justify-center absolute bg-gradient-to-r from-yellow-400 to-violet-800 opacity-25">
{/* Your content here */}
</div>

<div className="bg-oval-gradient justify-center absolute bg-gradient-to-r from-yellow-400 to-violet-800 opacity-25" />
<div className="font-plex container mx-auto flex h-[95%] items-center justify-center">
<div className="card w-[500px] ">
<div className="card-header text-white p-4">
Expand Down
33 changes: 0 additions & 33 deletions packages/nextjs/components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,41 +36,8 @@ export const Footer = () => {
</>
)}
</div>
{/* <SwitchTheme className={`pointer-events-auto ${isLocalNetwork ? "self-end md:self-auto" : ""}`} /> */}
</div>
</div>
{/* <div className="w-full">
<ul className="menu menu-horizontal w-full">
<div className="flex justify-center items-center gap-2 text-sm w-full">
<div className="text-center">
<a href="https://github.com/scaffold-eth/se-2" target="_blank" rel="noreferrer" className="link">
Fork me
</a>
</div>
<span>·</span>
<div className="flex justify-center items-center gap-2">
<p className="m-0 text-center">
Built with <HeartIcon className="inline-block h-4 w-4" /> at
</p>
<a
className="flex justify-center items-center gap-1"
href="https://buidlguidl.com/"
target="_blank"
rel="noreferrer"
>
<BuidlGuidlLogo className="w-3 h-5 pb-1" />
<span className="link">BuidlGuidl</span>
</a>
</div>
<span>·</span>
<div className="text-center">
<a href="https://t.me/joinchat/KByvmRe5wkR-8F_zz6AjpA" target="_blank" rel="noreferrer" className="link">
Support
</a>
</div>
</div>
</ul>
</div> */}
</div>
);
};
4 changes: 2 additions & 2 deletions packages/nextjs/components/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"use client";

import React from "react";
import Image from "next/image";
import Link from "next/link";
import { usePathname } from "next/navigation";
import { FaucetButton, RainbowKitCustomConnectButton } from "~~/components/scaffold-eth";
Expand Down Expand Up @@ -59,12 +60,11 @@ export const Header = () => {
<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">
<div className="navbar-start w-auto lg:w-1/2">
<Link color={"white"} href="/" passHref className="hidden lg:flex items-center gap-2 ml-4 mr-6 shrink-0">
<img src="/logo.svg" alt="Botanix Logo" width={"24px"} height={"24px"} />
<Image src="/logo.svg" alt="Botanix Logo" width={"24"} height={"24"} />
<div className="flex flex-col font-plex font-bold text-white">Botanix {"<>"} Lightning </div>
</Link>
</div>
<div className="navbar-end flex-grow mr-4">
{/* a div that shows if the client is connected to the server */}
<button
className="btn btn-ghost btn-sm text-white font-plex"
onClick={() => {
Expand Down
10 changes: 1 addition & 9 deletions packages/nextjs/components/PaymentInvoice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ import React from "react";
import { useLightningApp } from "~~/hooks/LightningProvider";
import { LnPaymentInvoice } from "~~/types/utils";

/**
* Site footer
*/
type PaymentInvoiceProps = {
invoice: LnPaymentInvoice;
contractId: string | null;
Expand Down Expand Up @@ -54,14 +51,9 @@ export const PaymentInvoice = ({ invoice, submitPayment, cancelPayment, step }:
</table>

{/* Stepper Component */}
{/* You'll need to adapt or implement your own stepper logic with Tailwind CSS */}
<ul className="steps steps-vertical">
{steps.map((stepInfo, index) => (
<li
// data-content={index === step ? "" : index + 1}
key={index}
className={`${index < step ? "step step-primary" : "step"} text-gray-400`}
>
<li key={index} className={`${index < step ? "step step-primary" : "step"} text-gray-400`}>
<div className="flex flex-col text-start">
{stepInfo.title}
&nbsp;
Expand Down
1 change: 0 additions & 1 deletion packages/nextjs/hooks/LightningProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { useNativeCurrencyPrice, useScaffoldEventSubscriber } from "./scaffold-e
import { useWebSocket } from "./useWebSocket";
import { ToastContainer, toast } from "react-toastify";
import "react-toastify/dist/ReactToastify.css";
// import { useWalletClient } from "wagmi";
import { InvoiceRequest, InvoiceResponse } from "~~/types/utils";

// Define the types for your historical transactions and context
Expand Down

0 comments on commit 9d4ca9a

Please sign in to comment.