-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #350 from 0xsend/deploy-main
Deploy main
- Loading branch information
Showing
42 changed files
with
1,434 additions
and
1,377 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
!.yarn/releases | ||
!.yarn/sdks | ||
!.yarn/versions | ||
bun.lockb | ||
|
||
# expo | ||
**/.expo/* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Account Abstraction Bundler | ||
|
||
The account abstraction bundler is responsible for writing user operations onchain via the Entrypoint contract. | ||
|
||
## Usage | ||
|
||
```shell | ||
docker run --rm \ | ||
--name aa-bundler \ | ||
--add-host=host.docker.internal:host-gateway \ | ||
-p 127.0.0.1:3030:3030 \ | ||
-v ./keys/0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266:/app/keys/0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 \ | ||
-v ./etc/aabundler:/app/etc/aabundler \ | ||
-e "DEBUG=aa.rpc" \ | ||
-e "DEBUG_COLORS=true" \ | ||
accountabstraction/bundler:0.7.0 \ | ||
--port 3030 \ | ||
--config /app/etc/aabundler/aabundler.config.json \ | ||
--mnemonic /app/keys/0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 \ | ||
--network http://host.docker.internal:8546 \ | ||
--entryPoint 0x0000000071727De22E5E9d8BAf0edAc6f37da032 \ | ||
--beneficiary 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 \ | ||
``` | ||
|
||
## Configuration | ||
|
||
The bundler is configured via a JSON file or command line arguments. Below is an example configuration file. | ||
|
||
```json | ||
{ | ||
"gasFactor": "1", | ||
"minBalance": "50000000000000", | ||
"maxBundleGas": 5e6, | ||
"minStake": "50000000000000", | ||
"minUnstakeDelay": 86400, | ||
"autoBundleInterval": 2, | ||
"autoBundleMempoolSize": 10, | ||
"mnemonic": "/app/keys/0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", | ||
"network": "http://host.docker.internal:8546", | ||
"entryPoint": "0x0000000071727De22E5E9d8BAf0edAc6f37da032", | ||
"beneficiary": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" | ||
} | ||
``` |
2 changes: 1 addition & 1 deletion
2
etc/aa-bundler/aa-bundler.config.json → apps/aabundler/etc/aabundler.config.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"gasFactor": "1", | ||
"gasFactor": "1.1", | ||
"minBalance": "1", | ||
"maxBundleGas": 5e6, | ||
"minStake": "1", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Testing the Send Flow | ||
|
||
Send app is p2p future cash app. It allows users to send ERC-20 tokens, a kind of cryptocurrency, to each other. | ||
|
||
We will be convering how to test the send flow in localnet, a forked version of the [Base](https://base.org/) chain. | ||
|
||
## Setup | ||
|
||
Let's start by setting up the localnet. | ||
|
||
- Reset your database and project | ||
- `tilt down` | ||
|
||
- Start your project | ||
- `tilt up` | ||
- Wait until the [NextJS server](http://localhost:10350/r/next%3Aweb/overview) is running. | ||
|
||
- Seed your database with some data | ||
- `yarn snaplet:seed` or by clicking the `snaplet seed` button in the Tilt UI. | ||
|
||
- Again, ensure there are no errors in the tilt UI. If not, try again. | ||
|
||
## Send App | ||
|
||
Send app is a [React Native](https://reactnative.dev/) app built using a UI library called [Tamagui](https://tamagui.dev). It is built on top [React Native Web](https://necolas.github.io/react-native-web/) and [Expo](https://docs.expo.dev/) to allow for cross platform development. | ||
|
||
For this guide, we will only focus on the React Native part of the app and it's interaction with localnet. | ||
|
||
### Sending Tokens | ||
|
||
Let's start by sending tokens to another user. | ||
|
||
- Open the [Send app](http://localhost:3000/) | ||
- Commplete the onboarding flow | ||
1. Enter your phone number (123456 is fine for localnet.) | ||
2. Enter one-time password (OTP). The code is `123456` for localnet. | ||
|
||
At this point, you have created a supabase user, not a Send account. The app should redirect you to onboarding to open your Send account. | ||
|
||
3. Create your passkey. | ||
|
||
**What's happening:** This opens your Send account which is a smart contract wallet that holds your tokens onchain. It pre-approves a USDC paymaster allowing for transacting onchain without actually holding any ether. Initially, the smart account has only one approved signer, the passkey. | ||
|
||
4. Grab some tokens from the secret shop. | ||
|
||
**Note:** On testnet, we operate a faucet that gives you tokens for free. On [Base mainnet](https://basescan.org/), you must follow the deposit flow to fund your Send account. | ||
- Visit a profile of another user | ||
1. Open the [Send app](http://localhost:3000/activity) | ||
2. Search for another user | ||
3. Click on their profile | ||
- Click on the `Send` button | ||
- Enter the amount of tokens you want to send | ||
- Click on the `Send` button | ||
|
||
At this point, there should have been a transaction on the localnet blockchain. You can inspect it in our local block explorer [Otterscan](http://localhost:5101/) by pasting the transaction hash in the search bar. Or by clicking, `View on Otterscan` in the button. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.