You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: contracts/README.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,12 @@
2
2
3
3
Smart contracts for EV-Reth, including the FeeVault for bridging collected fees to Celestia.
4
4
5
+
## AdminProxy
6
+
7
+
The AdminProxy contract solves the bootstrap problem for admin addresses at genesis. It acts as an intermediary owner/admin for other contracts and precompiles (like the Mint Precompile) when the final admin (e.g., a multisig) is not known at genesis time.
8
+
9
+
See [AdminProxy documentation](../docs/contracts/admin_proxy.md) for detailed setup and usage instructions.
10
+
5
11
## FeeVault
6
12
7
13
The FeeVault contract collects base fees and bridges them to Celestia via Hyperlane. It supports:
Copy file name to clipboardExpand all lines: crates/ev-precompiles/README.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,10 +58,12 @@ Calls from any other address will be rejected with an "unauthorized caller" erro
58
58
Mints new native tokens to a specified address.
59
59
60
60
**Parameters:**
61
+
61
62
-`to` (address): Recipient address
62
63
-`amount` (uint256): Amount to mint in wei
63
64
64
65
**Behavior:**
66
+
65
67
1. Verifies caller is the authorized mint admin
66
68
2. Creates the recipient account if it doesn't exist
67
69
3. Increases the recipient's balance by the specified amount
@@ -70,6 +72,7 @@ Mints new native tokens to a specified address.
70
72
**Gas:** Returns unused gas (precompile consumes minimal gas)
71
73
72
74
**Errors:**
75
+
73
76
-`unauthorized caller`: Caller is not the mint admin
74
77
-`balance overflow`: Adding the amount would overflow uint256
75
78
@@ -78,10 +81,12 @@ Mints new native tokens to a specified address.
78
81
Burns native tokens from a specified address.
79
82
80
83
**Parameters:**
84
+
81
85
-`from` (address): Address to burn tokens from
82
86
-`amount` (uint256): Amount to burn in wei
83
87
84
88
**Behavior:**
89
+
85
90
1. Verifies caller is the authorized mint admin
86
91
2. Ensures the target account exists
87
92
3. Decreases the target's balance by the specified amount
@@ -90,6 +95,7 @@ Burns native tokens from a specified address.
90
95
**Gas:** Returns unused gas (precompile consumes minimal gas)
91
96
92
97
**Errors:**
98
+
93
99
-`unauthorized caller`: Caller is not the mint admin
94
100
-`insufficient balance`: Account doesn't have enough balance to burn
95
101
@@ -99,18 +105,22 @@ The typical usage pattern involves deploying a proxy contract at the mint admin
99
105
100
106
This pattern allows the mint admin to be a smart contract with custom authorization logic (multisig, governance, etc.) rather than a simple EOA.
101
107
108
+
See the [AdminProxy documentation](../../docs/contracts/admin_proxy.md) for a ready-to-use proxy contract that can be deployed at genesis and later upgraded to a multisig.
109
+
102
110
## Implementation Details
103
111
104
112
### Account Creation
105
113
106
114
The precompile automatically creates accounts that don't exist when minting to them. This ensures that:
115
+
107
116
- Tokens can be minted to any address, including those not yet active on-chain
108
117
- The account is properly marked as created in the EVM state
109
118
- The account is touched for accurate state tracking
110
119
111
120
### Balance Manipulation
112
121
113
122
The precompile directly modifies account balances in the EVM state using the `EvmInternals` API. This provides:
123
+
114
124
-**Direct state access**: No need for complex transfer mechanisms
115
125
-**Overflow protection**: All arithmetic is checked
116
126
-**State consistency**: Accounts are properly touched for journaling
**Note:** The owner EOA must also be funded with gas at genesis to execute transactions. In the example above, `0x56bc75e2d63100000` equals 100 ETH in wei.
181
+
177
182
**Example with concrete addresses:**
178
183
179
184
If your owner EOA is `0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266`:
@@ -195,11 +200,11 @@ After creating your genesis file, you can verify the AdminProxy is correctly con
0 commit comments