This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use solana_program::{ | |
account_info::{next_account_info, AccountInfo}, | |
entrypoint, | |
entrypoint::ProgramResult, | |
msg, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let mut campaign_account_data = CampaignAccount::try_from_slice(&campaign_account.data.borrow())?; | |
msg!("{}",campaign_account_data.campaign_amount - campaign_account_data.campaign_fulfilled); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let mut campaign_account_data= CampaignAccount::try_from_slice(&campaign_account.data.borrow())?; | |
campaign_account_data.campaign_amount = amount; | |
campaign_account_data.campaign_description = description; | |
campaign_account_data.campaign_fulfilled = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let amount = rest_of_data | |
.get(..8) | |
.and_then(|slice| slice.try_into().ok()) | |
.map(u64::from_le_bytes) | |
.unwrap(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let (instruction_byte, all_other_bytes) = data.split_first().unwrap(); | |
if *i nstruction_byte == 0{ | |
// create campaign | |
} | |
else if *instruction_byte == 1{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub fun process_instruction ( | |
program_id : &Pubkey, | |
accounts : &[AccountInfo], | |
data :&[u8], | |
) -> ProgramResult |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub struct CampaignAccount { | |
pub campaign_owner: PubKey, | |
pub campaign_amounts: u64, | |
pub campaign_descriptions: String, | |
pub campaign_fulfilled: u64, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Sunmation (Capital Sigma) --> | |
<?= | |
sum = 0; | |
for(n=0; n<=4; n++){ | |
sum += 3*n; | |
} | |
?> | |
<!-- Product (Capital Pi) --> | |
<?= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title> CSS Selector</title> | |
</head> | |
<body> | |
<style> | |
body{ | |
background-color: #f1faee; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<input type="range" min="1" max="100" value="75"> |
NewerOlder