Skip to content

Commit

Permalink
Include contract constructor args when estimating intrinsic gas (q9f#111
Browse files Browse the repository at this point in the history
)
  • Loading branch information
dansimpson authored and mculp committed Jul 28, 2022
1 parent 55aea1a commit 9f3d34e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/eth/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,11 @@ def deploy_and_wait(contract, *args, **kwargs)
def deploy(contract, *args, **kwargs)
raise ArgumentError, "Cannot deploy contract without source or binary!" if contract.bin.nil?
raise ArgumentError, "Missing contract constructor params!" if contract.constructor_inputs.length != args.length
gas_limit = Tx.estimate_intrinsic_gas(contract.bin) + Tx::CREATE_GAS
data = contract.bin
unless args.empty?
data += encode_constructor_params(contract, args)
end
gas_limit = Tx.estimate_intrinsic_gas(data) + Tx::CREATE_GAS
params = {
value: 0,
gas_limit: gas_limit,
Expand Down

0 comments on commit 9f3d34e

Please sign in to comment.