Skip to content

Commit 032e461

Browse files
shekhirinklkvr
authored andcommitted
fix: pow u256 to u256
1 parent 4553a2c commit 032e461

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/rpc/relay.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2462,7 +2462,7 @@ impl Relay {
24622462
/// - Result: 1_000_000_000_000_000_000 (represents 1 USDC with 18 decimals)
24632463
fn adjust_balance_for_decimals(balance: U256, from_decimals: u8, to_decimals: u8) -> U256 {
24642464
let diff = (from_decimals as i32) - (to_decimals as i32);
2465-
let factor = U256::from(10u128.pow(diff.unsigned_abs()));
2465+
let factor = U256::from(10).pow(U256::from(diff.unsigned_abs()));
24662466

24672467
if diff > 0 { balance / factor } else { balance * factor }
24682468
}

0 commit comments

Comments
 (0)