@@ -145,13 +145,15 @@ export async function deepDiff({
145145 bitMapToIndexes ( BigInt ( before . collateralBitmap || 0 ) ) ,
146146 )
147147 ) . toString ( ) ;
148+ before . collateralBitmap = toBinaryString ( BigInt ( before . collateralBitmap || 0 ) ) ;
148149 after . collateralBitmap_decoded = (
149150 await assetIndexesToAsset (
150151 client ,
151152 address ,
152153 bitMapToIndexes ( BigInt ( after . collateralBitmap || 0 ) ) ,
153154 )
154155 ) . toString ( ) ;
156+ after . collateralBitmap = toBinaryString ( BigInt ( after . collateralBitmap || 0 ) ) ;
155157 }
156158 if ( before . borrowableBitmap !== undefined ) {
157159 before . borrowableBitmap_decoded = (
@@ -161,13 +163,15 @@ export async function deepDiff({
161163 bitMapToIndexes ( BigInt ( before . borrowableBitmap || 0 ) ) ,
162164 )
163165 ) . toString ( ) ;
166+ before . borrowableBitmap = toBinaryString ( BigInt ( before . borrowableBitmap || 0 ) ) ;
164167 after . borrowableBitmap_decoded = (
165168 await assetIndexesToAsset (
166169 client ,
167170 address ,
168171 bitMapToIndexes ( BigInt ( after . borrowableBitmap || 0 ) ) ,
169172 )
170173 ) . toString ( ) ;
174+ after . borrowableBitmap = toBinaryString ( BigInt ( after . borrowableBitmap || 0 ) ) ;
171175 }
172176 }
173177
@@ -262,7 +266,7 @@ async function enhanceValue({
262266 if ( key && [ '_reserves' , '_eModeCategories' ] . includes ( type ) ) {
263267 if ( [ 'liquidityIndex' , 'variableBorrowIndex' ] . includes ( key ) )
264268 return prettifyNumber ( { decimals : 27 , value, showDecimals : true } ) ;
265- if ( [ 'liquidationThreshold' , 'reserveFactor' , 'liquidationProtocolFee' ] . includes ( key ) )
269+ if ( [ 'liquidationThreshold' , 'reserveFactor' , 'liquidationProtocolFee' , 'ltv' ] . includes ( key ) )
266270 return prettifyNumber ( { decimals : 2 , value, suffix : '%' , showDecimals : true } ) ;
267271 if (
268272 [ 'currentLiquidityRate' , 'currentVariableBorrowRate' , 'currentStableBorrowRate' ] . includes (
@@ -276,7 +280,7 @@ async function enhanceValue({
276280 value,
277281 suffix : '%' ,
278282 showDecimals : true ,
279- patchedValue : BigInt ( value ) - BigInt ( 1e4 ) ,
283+ patchedValue : BigInt ( value ) == 0n ? 0n : BigInt ( value ) - BigInt ( 1e4 ) ,
280284 } ) ;
281285 }
282286 }
@@ -324,3 +328,7 @@ export const checkStateChanges: ProposalCheck<any> = {
324328 return { info, warnings, errors} ;
325329 } ,
326330} ;
331+
332+ function toBinaryString ( value : bigint ) {
333+ return `0b` + value . toString ( 2 ) ;
334+ }
0 commit comments