AI prompts
base on Foam mint and claim script # Solana-Foam
Foam mint and claim script
## 1-99980 winners data
https://github.com/SoilLabs/Solana-Foam/blob/main/foam_data.xls
## Rage Mode Data
Winning numbers (arithmetic sequence mechanism):
1809 2469 3129 3789 4449 5109 5769 6429 7089 7749 8409 9069 9729 10389 11049 11709 12369 13029 13689 14349
Num tx_signer
1809 FWE8qytqwu5HsU3qdzRhZ86tMjfwM56GdJzcD5SGpipS
https://solscan.io/tx/23dCsNcFqWi6CHn7yN92685eW2Z1nKqV9pJhmWwd2g5PVnTp9SHJNFfkkGYM8k1xhZBs8Qt4d4BHQ8rdyxpzoQkt
2469 QKypUcnD5Cw6BhVGqP1sjqzoS6Rr3W3rjVwbmicVEAD
https://solscan.io/tx/42xxy5AcB4Kp8UNWPPfyUR3rWust187rUQjgaKuUHAWVfViFBAGPi8zejzCmx2DK5emwEed66pqdu5iTXEV6A7td
3129 7ikGSgNT5YDr49oScMjVP1pdLQM8ZRB1yBYVXMZiHTn1
https://solscan.io/tx/bHEKgzFx8NnZKtqZaGbyWUbbhgsPVrjbwkWzbqK61rAr8mfdDP3hrjMXjEbLhXwh18q7dJbLiXkz7DBjWPNxubQ
3789 6pTQEmQYwAHpa9LvJGnQTt8JZkz5ZMahUojUwE76aYW6
https://solscan.io/tx/H2nT9NTGzXaY75hjpsAK28a9BJoyY3i9uViuCudH76XFN2ZXh5ptBrhw4LHAnkweP62nSRCsamK7HCN5ARhPn3P
4449 9X9DJc6s8oKsb43oMqZsYr3gj9iDsLgeS9rfs18jArfY
https://solscan.io/tx/ZwGX3JZ4s87YyRwZTbCWjuPcmRA46RYCnsPaUrq229aTkQdUkhUkJbrKKK8Dy8PaodGjDeND7Dr8SgZGxGHtvqR
5109 5UZxTGyUnGUqvwY1V4N1sV4hydfyt8FGuKqtveMFVGCH
https://solscan.io/tx/HhXWfKDmuV5wZe49zsZ6G9oMtgc35bGfTmcxQVWnqpd1V1ey6C32tgMqDhYNa9ZFsgyKsRUuZqojm9pFqYBjCTG
5769 FrfUoxYwXcrhj5Eo1SFKGy3GBnUj1NH3rtQ6Caodgskp
https://solscan.io/tx/5gSPFnPQq4hsciYuV3KAtXAAc7cWGtSZktm24PEJf9GZ7T4W14iaYC3o47moL5tbUp52sDkPhBbmU3d8DdWBWR2e
6429 3DNFuumCLnoc7kAebNnXJk2jP4vmykDa2ZznQDKQ55Pd
https://solscan.io/tx/MC1EADFuQa9zdVXRiSbZHx5bnzJJ6wHyck4sJ7RZEJ7cVQXm6JhxEhmrTr3qk1nMNCt9TVovAMBRTJCG56zoXLf
7089 AKg2Re2JaDkACU5uDgusq9A93DXZ3tQA6Rj3mp2p5kfx
https://solscan.io/tx/urj6EUhnrrrRGkvDgZJ46vdnWeCU7oSfC8STeNFaST1Q6MM1gauYuwDQA9rQPgCvkEuj9Sir1MMQ8sX1xhRBTjG
7749 92JsdRRPiYRTVZoS5PA5hcRY23o9TQzyBQhx5JMT8RGq
https://solscan.io/tx/3yhfK4UzY3ep5x368F7QcSq65ng8FoZGQyFnzxeBcPEP45a9BAENWrhEqFh7JZRy74By8A5o8WsYWL8fq8XQY829
8409 E7KYjNm7EsYTNtNorduAPMSNRfUNSGkc7woRX6T2hFpv
https://solscan.io/tx/4uZSBe6JLRwesEg8TikaJuMfEFeXKrnmVj49hzLGCRrsB8BEHT24s2deTTu7iBHvceTp4ATsCiGXbqb19tR76Nvk
9069 AGPz3R1V3nXB8krfSCddgPQxjhCe26TtTzVpAXmeLTak
https://solscan.io/tx/3L174rxZ6eTSKPptZNsfQLhmrgvsVX9gKxykrhyjfknRnHmodEvqLYNTnFU3a74keUtq68TMqdzaHBnmecpyznCm
9729 4J1vZerYXSd5PWPuy2QGCSRLaTR1ydio4NcCMSidXCWb
https://solscan.io/tx/5v9xLn4byvPc9H6oSaAs1dX2qGy6trYdDpeZN5YQs8w6ymsN8ZUD674iimp9ECijGihzTYYq1FGs9iWiVFKZcWtf
10389 BjgmooEKjPVwHdW6DngSYW9cAB2sr3QiCRuXdqxT75QG
https://solscan.io/tx/3JeQPWkwnjdqmoEmF1HSxkFdeHzHmYJCqApNo1hsTZiQJ8NqaY3yWwV3sj6zYLrKE6hnMCpEYMQpqh8ngwi8oh68
11049 BKV32qrDhQRwSasr37WJBnzhBRxEKVegZxhwphUUKbCs
https://solscan.io/tx/4fqjzRzCvQuE93Racsz32NQZpdBobUHyciR9rebnDttsgSQB8p77azrh6dubrZFFvhQVd91ahXk6ob7Gj3od8ST3
11709 DNCjoLSRuycbWHK4D4KVi5FoaHza4LKXGbQZDAj2uvC3
https://solscan.io/tx/4UmUSKBGP8onJAobQn98k8jzFSo88FJVHZ7dqiFARLRpeiug4X5pDiTdkKBMCHQPmD6u2oYMmRWQYq3iEUiH57p6
12369 E7KYjNm7EsYTNtNorduAPMSNRfUNSGkc7woRX6T2hFpv
https://solscan.io/tx/L1c7AK1xPa7eHhebT5PYZgL6sDDpyHu5emnaPsf8UvN4ypCQ9j34MT5Nmr5c8A7D29yHmPW6qBtXvnLghi9aHP7
13029 AfwgFoeu5xkcFxaYqyTiC3QiVpfPWq1grnKEcvRTmNx7
https://solscan.io/tx/4uQtqbZGQLDAMHChNg5DsWqbZxsXUUAQdpPfME98WB9fkRzsmR84B6GAu6np6b4ZupPsoHHKVd8CXPhc2A9C5U6D
13689 Ch6zvXMth7CeUFVbn9nPtWE71SJNNkagpJQKgbe1H94m
https://solscan.io/tx/yzVKhBUJkgvdNKmAXXu7fuUrkcD9LLeTrVLdLFFQNj8n3wSGg1rdGi4YcrzyWTW6MLuwJG3owRHhJ4UJ7kkAVAM
14349 BEqU5hkqLTas5iopni8NmqtWiP7bdkK8paaf9xCoSfxB
https://solscan.io/tx/Vq8BUZEuk4SYQzKozrodn3qmagPgFYLCxsW5rKubwque3UEPi9wvvvLYFPzUuoiuikNxx3ck8st3Cj69sz8sUNX
Dune.com query sql
```
select
block_time,
block_slot,
tx_index,
outer_executing_account,
executing_account,
data,
tx_signer,
tx_success,
log_messages,
0.000005 as fee,
tx_id
from
solana.instruction_calls
where
block_slot >= 238651704
and executing_account = 'BFEtYvLqoWfj15xwapzoN62xHedP4AS718v36RCj9vKe'
and data = 0x5e6670ef835f211d
and tx_success = true
order by block_slot asc ,tx_index asc
```
## Lottery code
```
//step to next block
if sys_info.current_block != Clock::get().unwrap().slot {
//previous block has address join
if sys_info.join_number != 0 {
let recent_slothashes: &UncheckedAccount<'_> = &ctx.accounts.recent_slothashes;
let data: std::cell::Ref<'_, &mut [u8]> = recent_slothashes.data.borrow();
let most_recent: &[u8; 8] = array_ref![data, 12, 8];
// seed for the random number is a combination of the slot_hash - timestamp
let seed: u64 = u64::from_le_bytes(*most_recent)
.saturating_sub(Clock::get().unwrap().unix_timestamp as u64);
let reward_index: usize = (seed % sys_info.join_number) as usize;
let reward_times: usize = epoch_info.reward_times as usize;
epoch_info.reward_block[reward_times] = sys_info.current_block;
epoch_info.reward_pubkey[reward_times] = sys_info.join_pubkey[reward_index];
epoch_info.reward_times += 1;
sys_info.current_block = Clock::get().unwrap().slot;
sys_info.join_number = 0;
}
}
```
## How to run the script
1. install Node.js(v18+):
download and install nodejs https://nodejs.org/download/release/v18.19.0/
2. download script:
download script from https://codeload.github.com/SoilLabs/Solana-Foam/zip/refs/heads/main
3. unzip script and change directory to the folders:
cd Solana-Foam-main
4. Install the dependencies
npm install
5. Fill in your information in the index.mjs
edit index.mjs and input your information
6. Run the script:
node index.mjs
", Assign "at most 3 tags" to the expected json: {"id":"6408","tags":[]} "only from the tags list I provide: [{"id":77,"name":"3d"},{"id":89,"name":"agent"},{"id":17,"name":"ai"},{"id":54,"name":"algorithm"},{"id":24,"name":"api"},{"id":44,"name":"authentication"},{"id":3,"name":"aws"},{"id":27,"name":"backend"},{"id":60,"name":"benchmark"},{"id":72,"name":"best-practices"},{"id":39,"name":"bitcoin"},{"id":37,"name":"blockchain"},{"id":1,"name":"blog"},{"id":45,"name":"bundler"},{"id":58,"name":"cache"},{"id":21,"name":"chat"},{"id":49,"name":"cicd"},{"id":4,"name":"cli"},{"id":64,"name":"cloud-native"},{"id":48,"name":"cms"},{"id":61,"name":"compiler"},{"id":68,"name":"containerization"},{"id":92,"name":"crm"},{"id":34,"name":"data"},{"id":47,"name":"database"},{"id":8,"name":"declarative-gui "},{"id":9,"name":"deploy-tool"},{"id":53,"name":"desktop-app"},{"id":6,"name":"dev-exp-lib"},{"id":59,"name":"dev-tool"},{"id":13,"name":"ecommerce"},{"id":26,"name":"editor"},{"id":66,"name":"emulator"},{"id":62,"name":"filesystem"},{"id":80,"name":"finance"},{"id":15,"name":"firmware"},{"id":73,"name":"for-fun"},{"id":2,"name":"framework"},{"id":11,"name":"frontend"},{"id":22,"name":"game"},{"id":81,"name":"game-engine "},{"id":23,"name":"graphql"},{"id":84,"name":"gui"},{"id":91,"name":"http"},{"id":5,"name":"http-client"},{"id":51,"name":"iac"},{"id":30,"name":"ide"},{"id":78,"name":"iot"},{"id":40,"name":"json"},{"id":83,"name":"julian"},{"id":38,"name":"k8s"},{"id":31,"name":"language"},{"id":10,"name":"learning-resource"},{"id":33,"name":"lib"},{"id":41,"name":"linter"},{"id":28,"name":"lms"},{"id":16,"name":"logging"},{"id":76,"name":"low-code"},{"id":90,"name":"message-queue"},{"id":42,"name":"mobile-app"},{"id":18,"name":"monitoring"},{"id":36,"name":"networking"},{"id":7,"name":"node-version"},{"id":55,"name":"nosql"},{"id":57,"name":"observability"},{"id":46,"name":"orm"},{"id":52,"name":"os"},{"id":14,"name":"parser"},{"id":74,"name":"react"},{"id":82,"name":"real-time"},{"id":56,"name":"robot"},{"id":65,"name":"runtime"},{"id":32,"name":"sdk"},{"id":71,"name":"search"},{"id":63,"name":"secrets"},{"id":25,"name":"security"},{"id":85,"name":"server"},{"id":86,"name":"serverless"},{"id":70,"name":"storage"},{"id":75,"name":"system-design"},{"id":79,"name":"terminal"},{"id":29,"name":"testing"},{"id":12,"name":"ui"},{"id":50,"name":"ux"},{"id":88,"name":"video"},{"id":20,"name":"web-app"},{"id":35,"name":"web-server"},{"id":43,"name":"webassembly"},{"id":69,"name":"workflow"},{"id":87,"name":"yaml"}]" returns me the "expected json"