@@ -100,7 +100,9 @@ export async function getEpv1SendUlnConfig(
100100 const ulnConfig : Uln302UlnConfig = {
101101 confirmations : ulnConfigRaw . confirmations . toNumber ( ) ,
102102 requiredDVNs : ulnConfigRaw . requiredDVNs ,
103+ requiredDVNCount : ulnConfigRaw . requiredDVNCount ,
103104 optionalDVNs : ulnConfigRaw . optionalDVNs ,
105+ optionalDVNCount : ulnConfigRaw . optionalDVNCount ,
104106 optionalDVNThreshold : ulnConfigRaw . optionalDVNThreshold ,
105107 }
106108
@@ -141,7 +143,9 @@ export async function getEpv1ReceiveUlnConfig(
141143 const ulnConfig : Uln302UlnConfig = {
142144 confirmations : ulnConfigRaw . confirmations . toNumber ( ) ,
143145 requiredDVNs : ulnConfigRaw . requiredDVNs ,
146+ requiredDVNCount : ulnConfigRaw . requiredDVNCount ,
144147 optionalDVNs : ulnConfigRaw . optionalDVNs ,
148+ optionalDVNCount : ulnConfigRaw . optionalDVNCount ,
145149 optionalDVNThreshold : ulnConfigRaw . optionalDVNThreshold ,
146150 }
147151
@@ -330,7 +334,9 @@ export async function getEpv1DefaultSendConfig(
330334 const emptyUlnConfig : Uln302UlnConfig = {
331335 confirmations : BigInt ( 0 ) ,
332336 requiredDVNs : [ zeroAddress ] ,
337+ requiredDVNCount : 0 ,
333338 optionalDVNs : [ ] ,
339+ optionalDVNCount : 0 ,
334340 optionalDVNThreshold : 0 ,
335341 }
336342
@@ -348,7 +354,9 @@ export async function getEpv1DefaultSendConfig(
348354 const ulnConfig : Uln302UlnConfig = {
349355 confirmations : ulnConfigRaw . confirmations . toNumber ( ) ,
350356 requiredDVNs : ulnConfigRaw . requiredDVNs ,
357+ requiredDVNCount : ulnConfigRaw . requiredDVNCount ,
351358 optionalDVNs : ulnConfigRaw . optionalDVNs ,
359+ optionalDVNCount : ulnConfigRaw . optionalDVNCount ,
352360 optionalDVNThreshold : ulnConfigRaw . optionalDVNThreshold ,
353361 }
354362
@@ -386,7 +394,9 @@ export async function getEpv1DefaultReceiveConfig(
386394 const emptyUlnConfig : Uln302UlnConfig = {
387395 confirmations : BigInt ( 0 ) ,
388396 requiredDVNs : [ zeroAddress ] ,
397+ requiredDVNCount : 0 ,
389398 optionalDVNs : [ ] ,
399+ optionalDVNCount : 0 ,
390400 optionalDVNThreshold : 0 ,
391401 }
392402
@@ -404,7 +414,9 @@ export async function getEpv1DefaultReceiveConfig(
404414 const ulnConfig : Uln302UlnConfig = {
405415 confirmations : ulnConfigRaw . confirmations . toNumber ( ) ,
406416 requiredDVNs : ulnConfigRaw . requiredDVNs ,
417+ requiredDVNCount : ulnConfigRaw . requiredDVNCount ,
407418 optionalDVNs : ulnConfigRaw . optionalDVNs ,
419+ optionalDVNCount : ulnConfigRaw . optionalDVNCount ,
408420 optionalDVNThreshold : ulnConfigRaw . optionalDVNThreshold ,
409421 }
410422
@@ -471,7 +483,15 @@ function encodeExecutorConfig(config: Uln302ExecutorConfig): string {
471483
472484/**
473485 * Encodes the UlnConfig into ABI-encoded bytes.
474- * @param config Uln302UlnConfig object
486+ *
487+ * The DVN counts are derived from the array lengths rather than read from the config's
488+ * `requiredDVNCount`/`optionalDVNCount`. That is only valid because the callers here feed
489+ * RESOLVED configs (read via `getConfig` -> `getUlnConfig`, which collapses any stored NIL
490+ * sentinel to 0 before returning). Uln301 inherits `UlnBase`, so its stored config CAN hold a
491+ * NIL sentinel — if this were ever pointed at a raw/stored config (`getAppUlnConfig`), the
492+ * length derivation would silently drop that sentinel. Keep it on the resolved-config path.
493+ *
494+ * @param config Uln302UlnConfig object (resolved, not raw/stored)
475495 * @returns ABI-encoded string
476496 */
477497function encodeUlnConfig ( config : Uln302UlnConfig ) : string {
@@ -481,10 +501,10 @@ function encodeUlnConfig(config: Uln302UlnConfig): string {
481501 ] ,
482502 [
483503 [
484- config . confirmations ,
485- config . requiredDVNs . length ,
486- config . optionalDVNs . length ,
487- config . optionalDVNThreshold ,
504+ config . confirmations ?? 0 ,
505+ ( config . requiredDVNs || [ ] ) . length ,
506+ ( config . optionalDVNs || [ ] ) . length ,
507+ config . optionalDVNThreshold ?? 0 ,
488508 config . requiredDVNs || [ ] ,
489509 config . optionalDVNs || [ ] ,
490510 ] ,
0 commit comments