Skip to content

Commit

Permalink
ci: prettier lint check (#118)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbejarano820 authored Oct 2, 2023
1 parent a758011 commit 5c6dee9
Show file tree
Hide file tree
Showing 4 changed files with 108 additions and 94 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/linters.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Task - Linters

on:
pull_request:
types: [opened, synchronize, reopened]

jobs:
prettier:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run prettier
run: |-
npx prettier --check .
4 changes: 2 additions & 2 deletions .github/workflows/security.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Security

on:
on:
pull_request:
types: [opened, synchronize, reopened]

Expand Down Expand Up @@ -49,4 +49,4 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: caracal-cairo
path: caracal-output.txt
path: caracal-output.txt
10 changes: 5 additions & 5 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Tests
on:
merge_group:
push:
branches: [ main ]
pull_request:
branches: [ '*' ]
merge_group:
push:
branches: [main]
pull_request:
branches: ["*"]
jobs:
check:
runs-on: ubuntu-latest
Expand Down
174 changes: 87 additions & 87 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
YAS is Yet Another Swap on Starknet 😝. It's an AMM based on Uniswap v3 that
will add some new features to the Starknet ecosystem.

- Provide a more capital efficient liquidity layer
- Based on a robust and battle-tested protocol. LPs from Uniswap v3 will feel
right at home.
- Provide the best prices for aggregators and traders.
- Provide a more capital efficient liquidity layer
- Based on a robust and battle-tested protocol. LPs from Uniswap v3 will feel
right at home.
- Provide the best prices for aggregators and traders.

At YAS we believe product quality should always be a priority so we are commited
to provide the best experience for users that want to put Starknet to the limit.
Expand Down Expand Up @@ -44,9 +44,9 @@ make deps

This will end up installing:

- [Scarb](https://docs.swmansion.com/scarb) (Cairo/Starknet packet manager) -
Includes a specific version of the Cairo compiler.
- [Starkli](https://github.com/xJonathanLEI/starkli) (Starknet CLI)
- [Scarb](https://docs.swmansion.com/scarb) (Cairo/Starknet packet manager) -
Includes a specific version of the Cairo compiler.
- [Starkli](https://github.com/xJonathanLEI/starkli) (Starknet CLI)

## Build Project

Expand Down Expand Up @@ -76,75 +76,75 @@ Follow the steps below to set up a testnet smart wallet using `starkli`:
Provider. For our project we will be using Alchemy's free tier in Goerli
Testnet.

1. Go to [Alchemy website](https://www.alchemy.com/) and create an account.
2. It will ask which network you want to develop on and choose Starknet.
3. Select the Free version of the service (we will only need access to send
some transactions to deploy the contracts)
4. Once the account creation process is done, go to _My apps_ and create a
new Application. Choose Starknet as a Chain and Goerli Starknet as a
Network.
5. Click on _View key_ on the new Starknet Application and copy the HTTPS
url.
6. On your terminal run:

```bash
export STARKNET_RPC="<ALCHEMY_API_HTTPS_URL>"
```
1. Go to [Alchemy website](https://www.alchemy.com/) and create an account.
2. It will ask which network you want to develop on and choose Starknet.
3. Select the Free version of the service (we will only need access to send
some transactions to deploy the contracts)
4. Once the account creation process is done, go to _My apps_ and create a
new Application. Choose Starknet as a Chain and Goerli Starknet as a
Network.
5. Click on _View key_ on the new Starknet Application and copy the HTTPS
url.
6. On your terminal run:

```bash
export STARKNET_RPC="<ALCHEMY_API_HTTPS_URL>"
```

2. **Create a Keystore**: A Keystore is a encrypted `json` file that stores the
private keys.

1. **Create a hidden folder**: Use the following command:
1. **Create a hidden folder**: Use the following command:

```bash
mkdir -p ~/.starkli-wallets
```
```bash
mkdir -p ~/.starkli-wallets
```

2. **Generate a new Keystore file**: Run the following command to create a
new private key stored in the file. It will **ask for a password** to
encrypt the file:
2. **Generate a new Keystore file**: Run the following command to create a
new private key stored in the file. It will **ask for a password** to
encrypt the file:

```bash
starkli signer keystore new ~/.starkli-wallets/keystore.json
```
```bash
starkli signer keystore new ~/.starkli-wallets/keystore.json
```

The command will return the Public Key of your account, copy it to your
clipboard to fund the account.
The command will return the Public Key of your account, copy it to your
clipboard to fund the account.

3. **Set STARKNET_ACCOUNT**: To set the environment variable just run:
3. **Set STARKNET_ACCOUNT**: To set the environment variable just run:

```bash
export STARKNET_KEYSTORE="~/.starkli-wallets/keystore.json"
```
```bash
export STARKNET_KEYSTORE="~/.starkli-wallets/keystore.json"
```

3. **Account Creation**: In Starknet every account is a smart contract, so to
create one it will need to be deployed.

1. **Initiate the account with the Open Zeppelin Account contract**:
1. **Initiate the account with the Open Zeppelin Account contract**:

```bash
starkli account oz init --keystore ~/.starkli-wallets/keystore.json ~/.starkli-wallets/account.json
```
```bash
starkli account oz init --keystore ~/.starkli-wallets/keystore.json ~/.starkli-wallets/account.json
```

2. **Deploy the account by running**:
2. **Deploy the account by running**:

```bash
starkli account deploy --keystore ~/.starkli-wallets/keystore.json ~/.starkli-wallets/account.json
```
```bash
starkli account deploy --keystore ~/.starkli-wallets/keystore.json ~/.starkli-wallets/account.json
```

For the deployment `starkli` will ask you to fund an account. To do so
you will need to fund the address given by `starkli` with the
[Goerli Starknet Faucet](https://faucet.goerli.starknet.io)
For the deployment `starkli` will ask you to fund an account. To do so
you will need to fund the address given by `starkli` with the
[Goerli Starknet Faucet](https://faucet.goerli.starknet.io)

4. **Setting Up Environment Variables**: There are two primary environment
variables vital for effective usage of Starkli’s CLI. These are the location
of the keystore file for the Signer, and the location of the Account
Descriptor file:

```bash
export STARKNET_ACCOUNT=~/.starkli-wallets/account.json
export STARKNET_KEYSTORE=~/.starkli-wallets/keystore.json
```
```bash
export STARKNET_ACCOUNT=~/.starkli-wallets/account.json
export STARKNET_KEYSTORE=~/.starkli-wallets/keystore.json
```

## Declare and Deploy Contracts

Expand All @@ -155,36 +155,36 @@ Now we have to deploy the simple YASFactory and YASPool contract to the Testnet.

On Starknet, the deployment process is in two steps:

- Declaring the class of your contract, or sending your contract’s code to the
network
- Deploying a contract or creating an instance of the previously declared code
with the necessary parameters
- Declaring the class of your contract, or sending your contract’s code to the
network
- Deploying a contract or creating an instance of the previously declared code
with the necessary parameters

1. Build the project:

```bash
make build
```
```bash
make build
```

2. Start Local Testnet
```bash
make start-katana
```
```bash
make start-katana
```
3. Declare and Deploy: Using [deploy.rs](./scripts/deploy.rs) script, we
sequentially declare and deploy the contracts. Local deployment needs
`katana` running. The account used for deployment is a pre-funded one.

- When running in development for the first time
- When running in development for the first time

```bash
./scripts/make_with_env.sh deploy
```
```bash
./scripts/make_with_env.sh deploy
```

- After the [.env](./.env) file is created, you may edit the values and run
- After the [.env](./.env) file is created, you may edit the values and run

```bash
make deploy
```
```bash
make deploy
```

## Override `.env` file

Expand All @@ -201,29 +201,29 @@ make deploy

## Version Specifications

- Cairo 2.2.0
- Scarb v0.7.0
- Starkli 0.1.9
- Orion `main` branch (library from Giza)
- Cairo 2.2.0
- Scarb v0.7.0
- Starkli 0.1.9
- Orion `main` branch (library from Giza)

## Tooling

- [Starkli](https://book.starkli.rs/)
- [Scarb](https://book.starknet.io/chapter_2/scarb.html)
- [Cairo 1.0 VSCode Extension](https://marketplace.visualstudio.com/items?itemName=starkware.cairo1)
- [Starknet Foundry](https://foundry-rs.github.io/starknet-foundry/) **In the
near future once it's more mature**
- [Starkli](https://book.starkli.rs/)
- [Scarb](https://book.starknet.io/chapter_2/scarb.html)
- [Cairo 1.0 VSCode Extension](https://marketplace.visualstudio.com/items?itemName=starkware.cairo1)
- [Starknet Foundry](https://foundry-rs.github.io/starknet-foundry/) **In the
near future once it's more mature**
## Useful resources
- [Cairo Book](https://book.cairo-lang.org/)
- [Cairo by example](https://cairo-by-example.com/)
- [Starknet Book](https://book.starknet.io/index.html)
- [Uniswap Protocol](https://docs.uniswap.org/concepts/uniswap-protocol)
- [Uniswap V3 Development Book](https://uniswapv3book.com/docs/introduction/uniswap-v3/)
- [Liquidity Math in Uniswap V3](https://atiselsts.github.io/pdfs/uniswap-v3-liquidity-math.pdf)
- [UNISWAP V3 - New Era Of AMMs? Architecture Explained](https://www.youtube.com/watch?v=Ehm-OYBmlPM)
- [ZK Podcast: Exploring Uniswap V3 and a Multi-L2 Future with Noah and Moody](https://zeroknowledge.fm/185-2/)
- [Cairo Book](https://book.cairo-lang.org/)
- [Cairo by example](https://cairo-by-example.com/)
- [Starknet Book](https://book.starknet.io/index.html)
- [Uniswap Protocol](https://docs.uniswap.org/concepts/uniswap-protocol)
- [Uniswap V3 Development Book](https://uniswapv3book.com/docs/introduction/uniswap-v3/)
- [Liquidity Math in Uniswap V3](https://atiselsts.github.io/pdfs/uniswap-v3-liquidity-math.pdf)
- [UNISWAP V3 - New Era Of AMMs? Architecture Explained](https://www.youtube.com/watch?v=Ehm-OYBmlPM)
- [ZK Podcast: Exploring Uniswap V3 and a Multi-L2 Future with Noah and Moody](https://zeroknowledge.fm/185-2/)
## License
Expand Down

0 comments on commit 5c6dee9

Please sign in to comment.