Skip to content

Instantly share code, notes, and snippets.

@1Firsts
Created February 2, 2022 02:57
Show Gist options
  • Save 1Firsts/8cb91feeee74d67670be35da8e6571b3 to your computer and use it in GitHub Desktop.
Save 1Firsts/8cb91feeee74d67670be35da8e6571b3 to your computer and use it in GitHub Desktop.
Defining The Instruction
let (instruction_byte, all_other_bytes) = data.split_first().unwrap();
if *i nstruction_byte == 0{
// create campaign
}
else if *instruction_byte == 1{
// fund a campaign
}
else if *instruction_byte == 2{
// get how much funds are left to reach the requested amount
}
else if *instruction_byte == 3{
// withdraw all collected funds and close campaign
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment