estimateDeployGas static method
Future<BigInt>
estimateDeployGas({
- required String bytecode,
- required PublicClient publicClient,
- required String from,
- List constructorArgs = const [],
- BigInt? value,
Estimates gas for contract deployment.
Implementation
static Future<BigInt> estimateDeployGas({
required String bytecode,
required PublicClient publicClient,
required String from,
List<dynamic> constructorArgs = const [],
BigInt? value,
}) async {
// For now, we'll keep deployment simple without constructor args
if (constructorArgs.isNotEmpty) {
throw UnimplementedError('Constructor arguments not yet supported');
}
final deployData = HexUtils.decode(bytecode);
final request = CallRequest(
from: from,
data: deployData,
value: value,
);
return publicClient.estimateGas(request);
}