GaslessSponsor
Allow FunWallets to transact without paying for gas
Overview
GaslessSponsor allows FunWallets to transact without paying for gas. This works by having an external funder account (EOA, FunWallet or other) stake the native gas token (e.g. ETH, MATIC, AVAX, etc) in a smart contract called a Paymaster.
This stake is then drained to cover the gas requirements for authorized FunWallets as they execute Transactions.
The GaslessSponsor class allows Paymaster external funders to configure their Paymaster, with the following capabilities:
Toggle between address whitelist & blacklist mode
Add & remove users from whitelists & blacklists
Constructor
const gaslessSponsor = new GaslessSponsor()
Methods
addWalletToWhitelist
Add a FunWallet to a GaslessSponsor whitelistconst actionFunc = gaslessSponsor.addWalletToWhitelist(walletAddress)
Parameters
Returns
removeWalletFromWhitelist
Remove a FunWallet from a GaslessSponsor whitelistconst actionFunc = gaslessSponsor.removeWalletFromWhitelist(walletAddress)
Parameters
Returns
addWalletToBlacklist
Add a FunWallet to a GaslessSponsor blacklistconst actionFunc = gaslessSponsor.addWalletToBlacklist(walletAddress)
Parameters
Returns
removeWalletFromBlacklist
Remove a FunWallet from a GaslessSponsor blacklistconst actionFunc = gaslessSponsor.removeWalletFromBlacklist(walletAddress)
Parameters
Returns
setWhitelistMode
Set a GaslessSponsor to whitelist modeconst actionFunc = gaslessSponsor.setWhitelistMode()
Returns
setBlacklistMode
Set a GaslessSponsor to blacklist modeconst actionFunc = gaslessSponsor.setBlacklistMode()
Returns
stake
Stake some native gas tokens in the GaslessSponsorconst actionFunc = gaslessSponsor.stake(walletAddress, amount)
Parameters
Returns
unstake
Unstake some native gas tokens from the GaslessSponsorconst actionFunc = gaslessSponsor.unstake(walletAddress, amount)