diff --git a/multisig/michelson/generic.tz b/multisig/michelson/generic.tz index e521a84..60f5ea9 100644 --- a/multisig/michelson/generic.tz +++ b/multisig/michelson/generic.tz @@ -85,6 +85,18 @@ code } { # Change set of signatures + + # Sanity check threshold/key pair + DUP; + DIP { + UNPAIR; + + # Check threshold is not zero + DUP; INT; ASSERT_NEQ; + + # Check threshold less then or equal to number of keys + DIP { SIZE } ; ASSERT_CMPLE; }; + DIP { CAR } ; SWAP ; PAIR ; NIL operation }; PAIR } diff --git a/multisig/michelson/multisig.tz b/multisig/michelson/multisig.tz index f3ee2a6..e8be2be 100644 --- a/multisig/michelson/multisig.tz +++ b/multisig/michelson/multisig.tz @@ -80,5 +80,17 @@ code SET_DELEGATE ; CONS } { # Change set of signatures + + # Sanity check threshold/key pair + DUP; + DIP { + UNPAIR; + + # Check threshold is not zero + DUP; INT; ASSERT_NEQ; + + # Check threshold less then or equal to number of keys + DIP { SIZE } ; ASSERT_CMPLE; }; + DIP { SWAP ; CAR } ; SWAP ; PAIR ; SWAP }} ; PAIR } \ No newline at end of file