-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
29 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
# Dune Details | ||
DUNE_API_KEY= | ||
PAYMENT_QUERY=3630322 | ||
FEE_QUERY=3605385 | ||
|
||
# Node Details | ||
## Testnet | ||
RPC_URL=https://rpc.ankr.com/eth_sepolia | ||
BILLING_CONTRACT_ADDRESS=0xF1436859a0F04A827b79F8c92736F6331ebB64A1 | ||
|
||
# sepolia | ||
RPC_URL= | ||
BILLING_CONTRACT_ADDRESS=0x2ad5fcddf209ca9e01509ecfa77115d3a9f999fa | ||
BILLER_PRIVATE_KEY= | ||
|
||
# Mainnet | ||
# RPC_URL= | ||
## Mainnet | ||
# RPC_URL=https://rpc.ankr.com/eth | ||
# BILLING_CONTRACT_ADDRESS=0x08Cd77fEB3fB28CC1606A91E0Ea2f5e3EABa1A9a | ||
# BILLER_PRIVATE_KEY= | ||
|
||
# Secrets | ||
DUNE_API_KEY= | ||
BILLER_PRIVATE_KEY= |
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 |
---|---|---|
@@ -1,44 +1,49 @@ | ||
# Automated Builder Billing for MEV Blocker | ||
|
||
On April 10, 2024, MEV Blocker Private RPC started charging a fee paid by the builders. | ||
The accounting processes are seeded through the [MEVBlockerFeeTill](https://github.com/cowprotocol/mev-blocker-till) contract deployed on Ethereum mainnet at [0x08Cd77fEB3fB28CC1606A91E0Ea2f5e3EABa1A9a](https://etherscan.io/address/0x08Cd77fEB3fB28CC1606A91E0Ea2f5e3EABa1A9a). | ||
The accounting processes are seeded through the [MEVBlockerFeeTill](https://github.com/cowprotocol/mev-blocker-till) contract deployed on Ethereum Mainnet at [0x08Cd77fEB3fB28CC1606A91E0Ea2f5e3EABa1A9a](https://etherscan.io/address/0x08Cd77fEB3fB28CC1606A91E0Ea2f5e3EABa1A9a). | ||
|
||
The billing process is achieved through calling the `bill` method on this contract (restricted to `onlyBiller`). | ||
The data supplied to the billing method is aggregated by the following [Dune](https://dune.com) queries: | ||
The data supplied to the billing method is aggregated by the following: | ||
|
||
1. [MEV Blocker - Fee per block](https://dune.com/queries/3605385) | ||
2. [MEV Blocker - Payment Due](https://dune.com/queries/3630322) | ||
### [Dune](https://dune.com) Queries: | ||
|
||
## Verified Contracts | ||
- **Fee per block:** https://dune.com/queries/3605385 | ||
- **Payment Due:** https://dune.com/queries/3630322 | ||
|
||
```sh | ||
https://etherscan.io/address/0x08Cd77fEB3fB28CC1606A91E0Ea2f5e3EABa1A9a#writeContract | ||
``` | ||
## Verified Contracts | ||
|
||
``` | ||
https://sepolia.etherscan.io/address/0xF1436859a0F04A827b79F8c92736F6331ebB64A1#writeContract | ||
``` | ||
- **Mainnet:** https://etherscan.io/address/0x08Cd77fEB3fB28CC1606A91E0Ea2f5e3EABa1A9a | ||
- **Testnet:** https://sepolia.etherscan.io/address/0xF1436859a0F04A827b79F8c92736F6331ebB64A1 | ||
|
||
## Local Development: Install, Set ENV & Run | ||
|
||
```sh | ||
# Install | ||
yarn | ||
# Copy and fill env vars | ||
# Copy and fill environment variables | ||
cp .env.sample .env | ||
``` | ||
|
||
Some values are filled, but others require secrets. | ||
Some values are filled, but others require secrets (`DUNE_API_KEY` & `BILLER_PRIVATE_KEY`). | ||
|
||
Run the Script | ||
Run the Script: | ||
|
||
```sh | ||
yarn run main | ||
``` | ||
|
||
## Docker | ||
|
||
**Local build and run** | ||
|
||
```sh | ||
docker build -t mb-billing . | ||
docker run --env-file .env mb-billing | ||
docker run --rm --env-file .env mb-billing | ||
``` | ||
|
||
**Published image** | ||
|
||
```sh | ||
docker run --rm --env-file .env ghcr.io/cowanator/mb-billing:main | ||
``` |