message: Better error message on contract errors
diff: @@ -24,11 +24,23 @@ const PROPOSAL_STATES = [
  "Executed",
  ];
  +const has = <K extends string>(
  + key: K,
  + x: object,
  +): x is { [key in K]: unknown } => (
  + key in x
  +);
  +
  /*
  * helper functions
  */
  export function getErrorMessage(error: unknown) {
  - if (error instanceof Error) return error.message
  + if (error instanceof Error) {
  + if (has('code', error) && has('reason', error) && error.code === "UNPREDICTABLE_GAS_LIMIT" && error.reason) {
  + return error.reason as string
  + }
  + return error.message
  + }
  return String(error)
  }
  function catchError(error: unknown) {
  