(
ctx: z.RefinementCtx,
contractName: string,
proxyAdmin: Address,
operators: ReadonlyArray<{ key: string; value: Address }>,
)
| 154 | * Emit a zod issue for any operator that collides with the contract's proxy admin. |
| 155 | */ |
| 156 | export const enforceOperatorsNotProxyAdmin = ( |
| 157 | ctx: z.RefinementCtx, |
| 158 | contractName: string, |
| 159 | proxyAdmin: Address, |
| 160 | operators: ReadonlyArray<{ key: string; value: Address }>, |
| 161 | ) => { |
| 162 | for (const { key, value } of operators) { |
| 163 | if (value === proxyAdmin) { |
| 164 | ctx.addIssue({ |
| 165 | code: z.ZodIssueCode.custom, |
| 166 | message: `Operator ${key} cannot be the same as the proxy admin of ${contractName}`, |
| 167 | }) |
| 168 | } |
| 169 | } |
| 170 | } |
| 171 | |
| 172 | /** |
| 173 | * bigintReplacer encode bigint to string. |
no outgoing calls
no test coverage detected