diff --git a/packages/abi/src.ts/interface.ts b/packages/abi/src.ts/interface.ts index af80974aee..ce1fbd2063 100644 --- a/packages/abi/src.ts/interface.ts +++ b/packages/abi/src.ts/interface.ts @@ -462,6 +462,14 @@ export class Interface { return keccak256(hexlify(value)); } + if (param.type === "bool" && typeof(value) === "boolean") { + value = (value ? "0x01": "0x00"); + } + + if (param.type.match(/^u?int/)) { + value = BigNumber.from(value).toHexString(); + } + // Check addresses are valid if (param.type === "address") { this._abiCoder.encode( [ "address" ], [ value ]); } return hexZeroPad(hexlify(value), 32);