
    (i1                        d dl Z d dlmZmZ dZ e j
                  e      Z e j                  d       Z e j                  d      Z	de
de
fdZd	e
dee
e
f   fd
Zd	e
dee
e
f   fdZd	e
de
dee j                  e j                  f   fdZd	e
de
dee j                  e j                  f   fdZde
dee j                  ge j                  f   fdZy)    N)CallableTuplei  )prec
   xreturnc                 ,    | dz  dk(  r| S | dz   | dz  z
  S )N    r    )r   s    F/var/www/br/venv/lib/python3.12/site-packages/eth_abi/utils/numeric.pyceil32r      s$    B!12R1r6!22    num_bitsc                     dd| z  dz
  fS )Nr         r   r   s    r   compute_unsigned_integer_boundsr      s    		8a r   c                 .    dd| dz
  z  z  d| dz
  z  dz
  fS )Nr   r   r   r   s    r   compute_signed_integer_boundsr      s.    
Q8a<  	hla r   frac_placesc                     t        |       d   }t        j                  t              5  t        j                  |      t
        | z  z  }d d d        t        |fS # 1 sw Y   t        fS xY w)Nr   )r   decimallocalcontextabi_decimal_contextDecimalTENZERO)r   r   	int_upperuppers       r   compute_unsigned_fixed_boundsr"   !   sd     09!<I			1	2 ?	*S;,->>? ;? ;s   !AA)c                     t        |       \  }}t        j                  t              5  t        | z  }t        j
                  |      |z  }t        j
                  |      |z  }d d d        ||fS # 1 sw Y   fS xY wN)r   r   r   r   r   r   )r   r   	int_lowerr    explowerr!   s          r   compute_signed_fixed_boundsr(   -   s|     9BIy			1	2 1K<	*S0	*S01
 %<1
 %<s   ;A//A;placesc                 `   t        | t              st        d|  dt        |        d      t	        j
                  t              5  t        |  z  ddd       dt        j                  dt        j                  ffd}| dkD  rd	|  nd
|   }d| }||_	        ||_
        |S # 1 sw Y   TxY w)zs
    Returns a function that shifts the decimal point of decimal values to the
    right by ``places`` places.
    z*Argument `places` must be int.  Got value z	 of type .Nr   r   c                 l    t        j                  t              5  | z  cd d d        S # 1 sw Y   y xY wr$   )r   r   r   )r   scaling_factors    r   fzscale_places.<locals>.fI   s/    !!"56 	&~%	& 	& 	&s   *3r   EnegEpos	scale_by_)
isinstanceint
ValueErrortyper   r   r   r   r   __name____qualname__)r)   r.   places_repr	func_namer-   s       @r   scale_placesr:   ;   s    
 fc"8 AF|nA'
 	

 
		1	2 &vg&&W__ & & &,aZD/tVG95EKK=)IAJANH& &s   B$$B-)r   typingr   r   ABI_DECIMAL_PRECContextr   r   r   r   r3   r   r   r   r"   r(   r:   r   r   r   <module>r>      s   
  %goo+;< wqgoob3c 3c 3c eCHo C E#s(O 			 7??GOO+,	 7??GOO+, 7??*;W__*L!M r   