> ## Documentation Index
> Fetch the complete documentation index at: https://build.onswig.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Set Up the EVM Examples

> Choose a language, connect to a compatible deployment, and prepare your signing key.

## Set up the examples

For the individual examples, you need an RPC endpoint and a compatible Swig
deployment. Obtain the factory address and deployment details from your operator
or [contact Swig](/links-and-contact). The public SDK source does not deploy the
contracts for you.

The EVM packages are available from source. These guides use the tested examples
in [swig-protocol-sdk](https://github.com/anagrambuild/swig-protocol-sdk/tree/5eec58c3eca4b79c483d245df2f2885313fd03dc/evm),
rather than a published package release.

```bash theme={null}
git clone https://github.com/anagrambuild/swig-protocol-sdk.git
cd swig-protocol-sdk
git checkout 5eec58c3eca4b79c483d245df2f2885313fd03dc
```

Choose a language and keep its working directory for the commands in these guides.

<CodeGroup>
  ```bash TypeScript theme={null}
  cd evm/typescript
  bun install --frozen-lockfile
  ```

  ```bash Rust theme={null}
  cd evm
  cargo build --locked -p swig-evm --examples
  ```

  ```bash Python theme={null}
  cd evm/python
  uv sync --locked
  ```
</CodeGroup>

Set `RPC_URL` to the chain you are using. For writes, load `SIGNER_PRIVATE_KEY`
into your environment from your application's key storage. Keep private keys
outside source files and logs. The examples use secp256k1 authorities.

For your own deployment, obtain a factory matching the SDK's
[pinned contract revision](https://github.com/anagrambuild/swig-protocol-sdk/blob/5eec58c3eca4b79c483d245df2f2885313fd03dc/evm/abi/source.json).
The guides do not assume a public-chain deployment address. A direct transaction
requires gas in the signing key's EOA.

## Understand the two addresses

* **Account address:** the Swig config contract. It stores roles and permissions
  and receives the wallet's execution requests. Use this as `ACCOUNT_ADDRESS`.
* **Vault address:** the contract that holds the wallet's assets. Transfers spend
  from this balance. Funding the vault does not fund the signer's gas balance.

## Run your first scenario

[Create a wallet](/evm/create-wallet), then add a role and send a transfer.
Each scenario uses the language directory you selected above.

## Try every scenario locally

This optional contributor workflow requires access to Swig's private contracts
repository, `swig-dev-portal`, and all three language toolchains. It is separate
from running one language's examples against an existing deployment.

The disposable test runner builds and deploys the pinned contracts, creates test
wallets, and runs all 16 examples. It owns Anvil and Rundler through Docker
Compose and removes them when the run finishes. It uses public development keys.

Install Bun, Node.js/npm, Foundry, Docker with Compose, Rust through rustup, and uv.
Check out `swig-dev-portal` using your authorized repository access so the runner
can read the pinned contract commit. From the `swig-protocol-sdk` root:

```bash theme={null}
cd evm/typescript
bun install --frozen-lockfile
cd ../..
evm/scripts/test-4337.sh /path/to/swig-dev-portal
```

The run checks deployed addresses, authority identities, transfers, remaining
allowances, and sponsored-operation receipts. This verifies the local SDK and
bundler configuration; a hosted provider needs its own compatibility check.
