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

initial nebula docs #5720

Merged
merged 12 commits into from
Dec 16, 2024
4 changes: 4 additions & 0 deletions apps/portal/src/app/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ const links = [
name: "Insight",
href: "/insight",
},
{
name: "Nebula",
href: "/nebula",
},
];

const toolLinks = [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@


# ERC-20 Paymaster

In traditional Ethereum transactions, users pay gas fees in the native cryptocurrency of the network, such as ETH. This requirement can create friction, especially for applications where users interact with smart contracts without holding native tokens. ERC-20 Paymaster enables users pay gas fees using ERC-20 tokens. [Learn more about ERC-20 Paymasters.](https://blog.thirdweb.com/account-abstraction-paymaster-pay-evm-gas-fees-with-usdt-usdc-or-any-other-erc-20-token/)

### Get Started


1. Install Connect SDK

```bash
npm install thirdweb
```

2. Configure the Paymaster In your SDK code, specify the ERC-20 token you wish to use for gas fees.

Currently you may use Lisk LSK, Base USDC or Celo CUSD.


```tsx
import { base, lisk, celo } from "thirdweb/chains";
import { TokenPaymaster, smartWallet } from "thirdweb/wallets";

// Have users pay for gas in Base USDC
const usdcWallet = smartWallet({
chain: base,
sponsorGas: true,
overrides: {
tokenPaymaster: TokenPaymaster.BASE_USDC,
},
});

// Have users pay for gas in Lisk LSK
const lskWallet = smartWallet({
chain: lisk,
sponsorGas: true,
overrides: {
tokenPaymaster: TokenPaymaster.LISK_LSK,
},
});

// Have users pay for gas in Celo CUSD
const cusdWallet = smartWallet({
chain: celo,
sponsorGas: true,
overrides: {
tokenPaymaster: TokenPaymaster.CELO_CUSD,
},
});
```
4 changes: 4 additions & 0 deletions apps/portal/src/app/connect/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,10 @@ export const sidebar: SideBar = {
},
],
},
{
name: "ERC-20 Paymaster",
href: `${aAslug}/erc-20-paymaster`,
},
{
name: "Account Factories",
href: `${aAslug}/factories`,
Expand Down
6 changes: 3 additions & 3 deletions apps/portal/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ export default function RootLayout({
<StickyTopContainer>
{/* Note: Please change id as well when changing text or href so that new banner is shown to user even if user dismissed the older one */}
<Banner
id="modular-contracts"
text="Modular Contracts Beta: Secure, Customizable, and Easy to Integrate contracts"
href="https://thirdweb.com/explore/modular-contracts"
id="nebula-alpha"
text="Introducing Nebula - the most powerful AI to interact with the blockchain. Join the waitlist."
href="https://thirdweb.com/nebula"
/>
<Header />
</StickyTopContainer>
Expand Down
Loading
Loading