This project demonstrates how to interact with the Ethena blockchain using the USDe token. It utilizes the ZeroDev SDK and other libraries to create and manage accounts, send transactions, and more.
-
ZeroDev Dashboard:
- Create an account on the ZeroDev Dashboard.
- Deploy a self-funded paymaster and fund it.
- Set a conversion rate for USDe.
-
Environment Setup:
- Ensure you have Node.js and Yarn installed on your machine.
-
Clone the repository:
git clone https://github.com/zerodevapp/usde-sponsorship-example cd usde-sponsorship-example
-
Install the dependencies:
yarn
-
Copy the
.env.example
file to.env
and fill in the required values:cp .env.example .env
Ensure you set the following environment variables in your
.env
file:BUNDLER_RPC
PAYMASTER_RPC
PRIVATE_KEY
-
Get Account Address:
Run the following command to get the address of the account:
yarn getAddress
-
Fund the Account:
Send USDe to the account address obtained in the previous step. This will allow the account to pay for transactions using the USDe token.
-
Send a Transaction:
Once the account is funded, you can send a transaction using the following command:
yarn sendTransaction
The main logic for interacting with the Ethena blockchain is located in the src
directory. You can find the relevant code in the following file:
src/example.ts
This project is licensed under the MIT License.