INNER CODE UNIT · Rust

max_price

renegade-fi/renegade · crates/circuits/circuit-types/src/lib.rs:136

pub fn max_price() -> FixedPoint {
    let repr_bigint = (BigUint::from(1u8) << PRICE_BITS) - 1u8;
    let repr = biguint_to_scalar(&repr_bigint);
    FixedPoint::from_repr(repr)
}

/// Get the maximum representable amount
pub fn max_amount() -> Amount {
    (1u128 << AMOUNT_BITS) - 1
}

/// The maximum fee rate allowed by the protocol
pub fn maximum_fee() -> FixedPoint {
    FixedPoint::from_f64_round_down(MAX_RELAYER_FEE_RATE)
}

/// Verify that an amount is within the correct bitlength
pub fn validate_amount_bitlength(amount: Amount) -> bool {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…