Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jdevcs committed Oct 11, 2023
1 parent 3fc5f0b commit 2a468b1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/web3-eth-contract/src/contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -607,17 +607,17 @@ export class Contract<Abi extends ContractAbi>
} as AbiConstructorFragment;
}

const _input = (deployOptions?.input ?? this.options.input)? format(
const _input = (deployOptions?.input ?? this.options.input)!== undefined ? format(
{ format: 'bytes' },
deployOptions?.input ?? this.options.input,
DEFAULT_RETURN_FORMAT,
): '0x';
): undefined;

const _data = (deployOptions?.data ?? this.options.data)? format(
const _data = (deployOptions?.data ?? this.options.data)!== undefined ? format(
{ format: 'bytes' },
deployOptions?.data ?? this.options.data,
DEFAULT_RETURN_FORMAT,
): '0x';
): undefined;

if ((!_input || _input.trim() === '0x') && (!_data || _data.trim() === '0x')) {
throw new Web3ContractError('contract creation without any data provided.');
Expand Down

0 comments on commit 2a468b1

Please sign in to comment.