https://github.com/vectorized/gasback
RIP-7767
https://github.com/vectorized/gasback
Last synced: 7 months ago
JSON representation
RIP-7767
- Host: GitHub
- URL: https://github.com/vectorized/gasback
- Owner: Vectorized
- Created: 2025-05-08T17:09:38.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-05-20T19:05:15.000Z (8 months ago)
- Last Synced: 2025-06-23T01:08:03.566Z (7 months ago)
- Language: Solidity
- Size: 24.4 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Gasback
A barebones implementation of a gasback contract that implements [RIP-7767](https://github.com/ethereum/RIPs/blob/master/RIPS/rip-7767.md).
## Suggested deployment for OP stack chains
1. Deploy the `gasback` contract which will be used as an implementation via EIP-7702.
2. Use EIP-7702 to make the EOA `RECIPIENT` of the `baseFeeVault` delegated to the `gasback` implementation.
After delegating, use the EOA to call functions on itself to initialize the parameters:
- `setGasbackRatioNumerator(uint256)`
`900000000000000000`
- `setGasbackMaxBaseFee(uint256)`
`115792089237316195423570985008687907853269984665640564039457584007913129639935`
- `setBaseFeeVault(address)`
`0x4200000000000000000000000000000000000019`
4. Put or leave some ETH into the EOA `RECIPIENT`, which will be the actual `gasback` contract.
The ETH will act as a buffer that will be temporarily dished out to contracts calling the EOA `RECIPIENT` in the span of a single block.
The base fees collected in a block will only be accrued into the `baseFeeVault` at the end of a block.
Try not to empty ETH from the `RECIPIENT` when you are actually taking out ETH from it.
5. For better discoverabiity (for the devX), deploy the `gasbackBeacon` and use the system address to set the EOA `RECIPIENT`.
The exact CREATE2 instructions are in [`./deployments.md`](./deployments.md).