Skip to content

Instantly share code, notes, and snippets.

@ptisserand
Created February 12, 2025 14:58
Show Gist options
  • Save ptisserand/673e61ccbe03a319b11cad18ded6d7a8 to your computer and use it in GitHub Desktop.
Save ptisserand/673e61ccbe03a319b11cad18ded6d7a8 to your computer and use it in GitHub Desktop.
fn main() {
hack();
}
fn hack() {
let scale: felt252 = 1000000000000000000000000000;
let deposit: felt252 = 0x38790ce2af72fa75;
let withdraw: felt252 = 0x54b59354072c77ad;
let accumulator: felt252 = 0xb6793fc03db6bc15d492b1956ce62920000000;
let scale: u256 = scale.into();
let deposit: u256 = deposit.into();
let withdraw: u256 = withdraw.into();
let accumulator: u256 = accumulator.into();
let scaled_down_deposit = deposit * scale / accumulator;
let scaled_down_withdraw = withdraw * scale / accumulator;
println!("Deposit: {} -> {}", deposit, scaled_down_deposit);
println!("Withdraw: {} -> {}", scaled_down_withdraw, withdraw);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment