INNER CODE UNIT · Rust
maximum_fee
renegade-fi/renegade · crates/circuits/circuit-types/src/lib.rs:148
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 {
let max_amount = (1u128 << AMOUNT_BITS) - 1;
amount <= max_amount
}
/// Verify that a price is within the correct bitlength
pub fn validate_price_bitlength(price: FixedPoint) -> bool {
let max_repr = (1u128 << PRICE_BITS) - 1;
price.repr <= Scalar::from(max_repr)
}
/// Converts an element of the arkworks `ScalarField` to an `ark-mpc` type
/// `Scalar`