-
Notifications
You must be signed in to change notification settings - Fork 400
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
12 changed files
with
837 additions
and
17 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
51 changes: 51 additions & 0 deletions
51
apps/portal/src/app/connect/account-abstraction/erc-20-paymaster/page.mdx
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,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, | ||
}, | ||
}); | ||
``` |
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
Oops, something went wrong.