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

Viem migration spike #2

Draft
wants to merge 19 commits into
base: main
Choose a base branch
from
Draft
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
72 changes: 72 additions & 0 deletions .github/workflows/contract-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Foundry Unit Tests

on:
pull_request:
branches: [main]
paths:
- "packages/contracts/**"

jobs:
# build-signer:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - uses: actions/setup-node@v3
# with:
# node-version: 16
# cache: "yarn"
# cache-dependency-path: |
# yarn.lock
# signer/yarn.lock
# contracts/yarn.lock
# # - uses: ./.github/workflows/signer-build.yml
# - name: Cache Signer
# id: cache-signer
# uses: actions/cache@v3
# with:
# path: signer/dist
# key: ${{ runner.os }}-signer
# - name: Build Signer
# run: cd ./signer && yarn install && yarn build && cd .. && yarn install
test:
# needs: [build-signer]
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

- name: Installing dependencies
working-directory: ./packages/contracts
run: yarn install --frozen-lockfile

- name: Linting
working-directory: ./packages/contracts
run: yarn lint

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

- name: Running tests
working-directory: ./packages/contracts
run: forge test
45 changes: 45 additions & 0 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Hardhat SDK -> Contract Integration Tests

on:
pull_request:
branches: [main]
paths:
- "packages/contracts/**"

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

- name: Building signer
working-directory: ./packages/signer
run: yarn install --frozen-lockfile && yarn build

- name: Installing dependencies
working-directory: ./packages/contracts
run: yarn install --frozen-lockfile

- name: Running tests
working-directory: ./packages/contracts
run: yarn test
45 changes: 45 additions & 0 deletions .github/workflows/ownership-rpc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Ownership Oracle

on:
pull_request:
branches: [ main ]
paths:
- 'packages/**'
defaults:
run:
working-directory: packages/ownership-oracle

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1

- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 18.0.0

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

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

- name: Linting
run: yarn lint

- name: Running tests
run: yarn jest
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"yaml.schemas": {
"https://json.schemastore.org/github-workflow.json": "file:///Users/samuelsbauch/Code/xessential/.github/workflows/contract-tests.yml"
}
}
51 changes: 39 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,53 @@
# @xessential
# 0xEssential Tooling

0xEssential's tooling helps developers build decentralized applications in the Ethereum ecosystem with great user experience.
0xEssential's tooling helps developers build apps in the Ethereum ecosystem with great user experience.

Our full-stack solution supports apps with:
The core offering is **NFT Global Entry**, a full stack solution for building L2 contracts that depend on NFT ownership from other EVM chains. Instead of bridging NFTs to use them in games or other low-value transactions, Global Entry allows for _crosschain token gating_ - the token stays on the chain it belongs, and use a cheaper, faster chain as an execution layer for game, governance or other logic.

- Account Delegation
- MultiChain Connections (coming soon)
- Gasless Transactions (coming soon)
- NFT Global Entry (coming soon)
- Burner Wallets (coming soon)
Our full-stack solution also supports:

You can mix and match these capabilities based on your needs. Every component is free, permissionless and open-source, leveraging the tools you already use.
- **MultiChain Connections** - build dapps that seamlessly use multiple chains
- **Gasless Transactions** - pay gas fees for your user's transactions
- **Burner Wallets** - skip wallet popups to keep users in flow when submitting gasless transactions
- **Account Delegation** - keep users in vault context when connected to a hot or burner wallet

You can mix and match these capabilities based on your needs, with or without Global Entry. Every component is free, permissionless, EIP-standards based and open-source. Our SDKs are built on top of the tools you already use for easy adoption and no vendor lock-in. You can use our deployed contracts and APIs, our deploy your own.

Visit our docs for a deeper introduction to NFT Global Entry and our other capabilities.

## Supported Chains

The `EssentialForwarder` contract is deployed on the following EVM chains at `0x000000000066b3aED7Ae8263588dA67fF381FfCa`.

### mainnets

- [Optimism](https://optimistic.etherscan.io/address/0x000000000066b3aED7Ae8263588dA67fF381FfCa)
- [Arbitrum One](https://arbiscan.io/address/0x000000000066b3aED7Ae8263588dA67fF381FfCa)
- [Arbitrum Nova](https://nova.arbiscan.io/address/0x000000000066b3aED7Ae8263588dA67fF381FfCa)
- [Avalanche C-Chain](https://snowtrace.io/address/0x000000000066b3aED7Ae8263588dA67fF381FfCa)
- [Polygon](https://polygonscan.com/address/0x000000000066b3aED7Ae8263588dA67fF381FfCa)

### testnets

- Ethereum goerli
- Optimism goerli
- Polygon Mumbai

### deploy yourself

The contracts package includes the source code and Foundry deployment scripts for deploying `EssentialForwarder` to additional EVM chains at the same address. You can also use the source code to deploy your own version at a new address and custom name - be sure to provide the address and name to the client SDK.

## Contract Integration

Depending on which features you plan to use, your contracts require certain capabilities. In some cases 0xEssential's tooling will work with contracts that are already deployed.

Our Solidity SDK for MultiChain Connections, Gasless Transactions and NFT Global Entry will be released soon.
For NFT Global Entry, you must inherit `EssentialContext` in your Layer 2 contract. Global Entry supports any spec-compliant ERC-721 NFT from any EVM chain - NFT contracts do not require any changes.

Contract requirements for Gasless Transactions, Account Delegation and Burner Wallets depend on your specific use-case.

Contract requirements for Account Delegation and Burner Wallets depend on your specific use-case.
Frontend apps can also use the `react` package for functionality like reading blockchain or indexer state from a Delegated Account without any contract changes.

Dapps can also use the `react` package for functionality like reading blockchain or indexer state from a Delegated Account without any contract changes.
[View contracts Readme](./packages/contracts/README.md)

## Client Packages

Expand Down
Loading