π²YOLO Buy
YOLO Buy Features
How Does It Work?
Last updated
Last updated
let secret_hash = hash(secret).to_bytes();
require!(secret_hash == roll_state.secret_hash, TRollError::BadHash);
let mut outcome_message = [0; 112];
let (secret_bytes, user, user_nonce, roll_count, commit_slot) =
mut_array_refs![&mut outcome_message, 32, 32, 32, 8, 8];
*secret_bytes = *secret;
*user = roll_state.user.to_bytes();
*user_nonce = roll_state.user_nonce;
*roll_count = roll_state.roll_count.to_le_bytes();
*commit_slot = roll_state.commit_slot.to_le_bytes();
let outcome_hash = hash(&outcome_message).to_bytes();
let outcome_u64 = *bytemuck::from_bytes::<u64>(&outcome_hash[0..8]);