A barebones implementation of a gasback contract that implements RIP-7767.
- The
baseFeeVaultis deployed at0x4200000000000000000000000000000000000019. - The
WITHDRAWAL_NETWORKof thebaseFeeVaultis set to1. - The
baseFeeVaultrecipient is set toShapePaymentSplitter. Gasbackreceives only its configured share fromShapePaymentSplitter.
See script/DeployGasback.s.sol and script/DeployShapePaymentSplitter.s.sol for deployment scripts.
These scripts require you to have PRIVATE_KEY in your environment.
For more information on how to run a foundry script, see https://getfoundry.sh/guides/scripting-with-solidity.
-
Deploy the
Gasbackcontract. -
Deploy
ShapePaymentSplitterwithGasbackas one of the payees. -
Set the
baseFeeVaultrecipient to the deployedShapePaymentSplitter. -
Configure
Gasbackvia authorized calls:setBaseFeeVault(address)
0x4200000000000000000000000000000000000019setBaseFeeVaultShareNumerator(uint256)
600000000000000000(0.6 ether) and ensure it matches the splitter allocation forGasback.setGasbackRatioNumerator(uint256)
Must be less than or equal tosetBaseFeeVaultShareNumerator.setGasbackMaxBaseFee(uint256)
115792089237316195423570985008687907853269984665640564039457584007913129639935
-
Put or leave some ETH in
Gasback. The ETH acts as a buffer that is temporarily dished out to contracts callingGasbackin the span of a single block. The base fees collected in a block will only be accrued into thebaseFeeVaultat the end of a block. Try not to empty ETH fromGasbackwhile actively serving gasback payouts.