Skip to content

Commit 813a7bc

Browse files
committed
updated reference and added erc-20 guide
1 parent 9fa1640 commit 813a7bc

File tree

8 files changed

+490
-91
lines changed

8 files changed

+490
-91
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
2+
3+
# ERC-20 Paymaster
4+
5+
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/)
6+
7+
### Get Started
8+
9+
10+
1. Install Connect SDK
11+
12+
npm install thirdweb
13+
14+
2. Configure the Paymaster In your SDK code, specify the ERC-20 token you wish to use for gas fees.
15+
16+
Currently you may use Lisk LSK, Base USDC or Celo CUSD.
17+
18+
```
19+
import { base, lisk, celo } from "thirdweb/chains";
20+
import { TokenPaymaster, smartWallet } from "thirdweb/wallets";
21+
22+
// Have users pay for gas in Base USDC
23+
const usdcWallet = smartWallet({
24+
chain: base,
25+
sponsorGas: true,
26+
overrides: {
27+
tokenPaymaster: TokenPaymaster.BASE_USDC,
28+
},
29+
});
30+
31+
// Have users pay for gas in Lisk LSK
32+
const lskWallet = smartWallet({
33+
chain: lisk,
34+
sponsorGas: true,
35+
overrides: {
36+
tokenPaymaster: TokenPaymaster.LISK_LSK,
37+
},
38+
});
39+
40+
// Have users pay for gas in Celo CUSD
41+
const cusdWallet = smartWallet({
42+
chain: celo,
43+
sponsorGas: true,
44+
overrides: {
45+
tokenPaymaster: TokenPaymaster.CELO_CUSD,
46+
},
47+
});
48+
```

apps/portal/src/app/connect/sidebar.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,10 @@ export const sidebar: SideBar = {
172172
},
173173
],
174174
},
175+
{
176+
name: "ERC-20 Paymaster",
177+
href: `${aAslug}/erc-20-paymaster`,
178+
},
175179
{
176180
name: "Account Factories",
177181
href: `${aAslug}/factories`,

apps/portal/src/app/layout.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ export default function RootLayout({
6666
<StickyTopContainer>
6767
{/* 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 */}
6868
<Banner
69-
id="modular-contracts"
70-
text="Modular Contracts Beta: Secure, Customizable, and Easy to Integrate contracts"
71-
href="https://thirdweb.com/explore/modular-contracts"
69+
id="nebula-alpha"
70+
text="Introducing Nebula - the most powerful AI to interact with the blockchain. Join the waitlist."
71+
href="https://thirdweb.com/nebula"
7272
/>
7373
<Header />
7474
</StickyTopContainer>

0 commit comments

Comments
 (0)