mirror of
https://github.com/datahaven-xyz/datahaven
synced 2026-05-24 09:50:01 +00:00
## Summary This PR adds Moonbeam's Batch precompile to DataHaven, enabling efficient batching of multiple EVM transactions in a single call. This implementation follows Moonbeam's exact architecture and provides significant gas savings for batch operations. ## Key Features ### Batch Precompile Functions - **`batchSome(address[], uint256[], bytes[], uint64[])`**: Execute multiple calls, continuing on failures - **`batchSomeUntilFailure(address[], uint256[], bytes[], uint64[])`**: Execute calls until first failure - **`batchAll(address[], uint256[], bytes[], uint64[])`**: Execute all calls, reverting if any fail ### Technical Implementation - **Address**: `0x0808` (2056 in decimal) - **Access Control**: Restricted nesting with `SubcallWithMaxNesting<2>` - **Self-recursion**: Only the Batch precompile can call itself (`OnlyFrom<AddressU64<2056>>`) - **Gas Management**: Proper gas estimation and refund handling - **Error Handling**: Comprehensive revert reasons and event logging Depends on #137 --------- Co-authored-by: Ahmad Kaouk <ahmadkaouk.93@gmail.com> |
||
|---|---|---|
| .. | ||
| src | ||
| Batch.sol | ||
| Cargo.toml | ||