KingSwap is a platform that enables users without native tokens to use an ERC20Permit compatible token for paying swap transaction fees towards a native token. It utilizes the EIP-2612 standard, allowing users to sign a message that authorizes a spender to use their tokens on their behalf. By integrating with PancakeSwapV4 hooks, KingSwap efficiently refunds transaction fees to the relayer on the user's behalf.
- Description: The central contract that users interact with for token swapping and for the relayer to receive refunds on transaction fees.
- Main Functions:
- Token swapping
- Refunding the relayer for transaction fees
- Description: This contract monitors the gas expended by the relayer to cover transaction fees for the user.
- Key Operations:
- Receives tokens from the PancakeSwap Vault
- Splits tokens between the relayer and the user
forge install
forge compile
forge test
- KingSwap.sol: View on BaseScan
- KingSwapHook.sol: View on BaseScan
- KingSwap.sol: View on Arbiscan
- KingSwapHook.sol: View on Arbiscan