Skip to content

Other Components

Fee Policy

Controls initial fee suggestion and replacement fee bumping.

Config KeyMeaning
fees.base_multiplierMultiplier applied to base fee suggestion
fees.priority_tipInitial maxPriorityFeePerGas value
tx.max_replacementsLimit of fee bump attempts

Implement custom policy by binding a new class to FeePolicy.

php
$this->app->singleton(FeePolicy::class, fn() => new MyAdaptivePolicy());

Nonce Management

Local nonce memory prevents collision during sequential sends. Ensure only one worker per signing address. For horizontal scaling add a distributed (Redis/DB) manager.

Signer

Encapsulates private key usage; current driver: private_key. Future extensions could allow hardware wallets or vault integration.

Health Snapshot

Quick connectivity check:

php
$status = \Farbcode\LaravelEvm\Facades\EvmRpc::health();

Gives chain id & latest block number.

Encoding Helpers

Use Encoding::stringToBytes32('text') for static bytes32 arguments.

Security Considerations

ConcernRecommendation
Private key exposureKeep in env, never log
Nonce raceSingle worker per address
RPC reliabilityConfigure multiple endpoints
Fee underpricingMonitor TxReplaced frequency

Released under the MIT License.