Skip to content

Commit

Permalink
update instructions, add dotenv config
Browse files Browse the repository at this point in the history
  • Loading branch information
kristofgazso committed Jul 12, 2023
1 parent 61377ef commit 9c554ae
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

This repository contains the full code for [Pimlico tutorials](https://docs.pimlico.io/tutorial) in the Pimlico documentation.

To set up the repository, clone it, copy the .env.example file to .env and fill in your Pimlico API key (use the [quick start guide](https://docs.pimlico.io/how-to/quick-start) to generate one), install the dependencies, and run `npm tutorial-1` (or whichever tutorial you're looking to run)!
To set up the repository, clone it, copy the .env.example file to .env and fill in your Pimlico API key (use the [quick start guide](https://docs.pimlico.io/how-to/quick-start) to generate one), install the dependencies, and run `npm run tutorial-1` (or whichever tutorial you're looking to run)!

```bash
npm install
cp .env.example .env
# fill in your Pimlico API key in .env
npm tutorial-1
npm run tutorial-1
```

If everything works correctly, you should deploy a User Operation as per the flow of the tutorial.
Expand Down
16 changes: 14 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"dependencies": {
"@account-abstraction/contracts": "^0.6.0",
"@pimlico/erc20-paymaster": "^0.0.12",
"dotenv": "^16.3.1",
"ethers": "^5.7.2",
"ts-node": "^10.9.1",
"typescript": "^5.1.6"
Expand Down
2 changes: 2 additions & 0 deletions tutorial-1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import { Provider, StaticJsonRpcProvider } from "@ethersproject/providers"
import { BigNumber, Wallet, constants, utils } from "ethers"
import { ERC20, ERC20__factory } from "@pimlico/erc20-paymaster/contracts"
import { getERC20Paymaster } from "@pimlico/erc20-paymaster"
import dotenv from 'dotenv'
dotenv.config()

// GENERATE THE INITCODE
const SIMPLE_ACCOUNT_FACTORY_ADDRESS = "0x9406Cc6185a346906296840746125a0E44976454"
Expand Down

0 comments on commit 9c554ae

Please sign in to comment.