Skip to content

Commit

Permalink
Add 'sdks/permit2-sdk/' from commit 'cb84da1accf9f475d11e96fff7e5b255…
Browse files Browse the repository at this point in the history
…d55dcc14'

git-subtree-dir: sdks/permit2-sdk
git-subtree-mainline: 2ba7498
git-subtree-split: cb84da1
  • Loading branch information
adjkant committed Dec 7, 2023
2 parents 446022d + 664d8b9 commit ce8e75d
Show file tree
Hide file tree
Showing 33 changed files with 8,812 additions and 0 deletions.
1 change: 1 addition & 0 deletions sdks/permit2-sdk/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.sol linguist-language=Solidity
39 changes: 39 additions & 0 deletions sdks/permit2-sdk/.github/workflows/forge-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Forge Tests

on:
push:
pull_request:

jobs:
tests:
name: Unit tests
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive

- name: Set up node
uses: actions/setup-node@v2
with:
node-version: 16
registry-url: https://registry.npmjs.org

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Build
run: yarn build

- name: Write interop
run: yarn interop

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Run tests
run: forge test
28 changes: 28 additions & 0 deletions sdks/permit2-sdk/.github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Lint

on:
push:
pull_request:

jobs:
run-linters:
name: Run linters
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive

- name: Set up node
uses: actions/setup-node@v2
with:
node-version: 16
registry-url: https://registry.npmjs.org

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Run linters
run: yarn prettier --check src/
28 changes: 28 additions & 0 deletions sdks/permit2-sdk/.github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Unit Tests

on:
push:
pull_request:

jobs:
tests:
name: Unit tests
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive

- name: Set up node
uses: actions/setup-node@v2
with:
node-version: 16
registry-url: https://registry.npmjs.org

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Run tests
run: yarn test
7 changes: 7 additions & 0 deletions sdks/permit2-sdk/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#build
dist
out
cache

#dependencies
node_modules
9 changes: 9 additions & 0 deletions sdks/permit2-sdk/.gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[submodule "permit2"]
path = permit2
url = https://github.com/Uniswap/permit2
[submodule "lib/forge-std"]
path = lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "lib/solmate"]
path = lib/solmate
url = https://github.com/transmissions11/solmate
7 changes: 7 additions & 0 deletions sdks/permit2-sdk/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"solidity.packageDefaultDependenciesContractsDirectory": "src",
"solidity.packageDefaultDependenciesDirectory": "lib",
"solidity.compileUsingRemoteVersion": "v0.8.17",
"solidity.formatter": "forge",
"editor.formatOnSave": true
}
21 changes: 21 additions & 0 deletions sdks/permit2-sdk/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 Uniswap Labs

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
18 changes: 18 additions & 0 deletions sdks/permit2-sdk/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# permit2-sdk

## Local Development

### Checkout the repo
- `git clone --recurse-submodules https://github.com/Uniswap/permit2-sdk.git`

### Install dependencies
- `yarn`

### Run Unit Tests
- `yarn test`

### Run Forge tests
- `yarn build`
- `yarn interop`
- `(cd permit2 && forge build)`
- `forge test`
Loading

0 comments on commit ce8e75d

Please sign in to comment.