├── foam_data.xls ├── foam_trade_to_mint_winners.xls ├── package.json ├── LICENSE ├── .gitignore ├── index.mjs ├── README.md └── ftd.json /foam_data.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoilLabs/Solana-Foam/HEAD/foam_data.xls -------------------------------------------------------------------------------- /foam_trade_to_mint_winners.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SoilLabs/Solana-Foam/HEAD/foam_trade_to_mint_winners.xls -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "solana-foam", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "@coral-xyz/anchor": "^0.29.0" 13 | }, 14 | "devDependencies": { 15 | "@types/bn.js": "^5.1.0", 16 | "@types/chai": "^4.3.0", 17 | "typescript": "^4.3.5" 18 | } 19 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to 25 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | .pnpm-debug.log* 9 | 10 | # Diagnostic reports (https://nodejs.org/api/report.html) 11 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 12 | 13 | # Runtime data 14 | pids 15 | *.pid 16 | *.seed 17 | *.pid.lock 18 | 19 | # Directory for instrumented libs generated by jscoverage/JSCover 20 | lib-cov 21 | 22 | # Coverage directory used by tools like istanbul 23 | coverage 24 | *.lcov 25 | 26 | # nyc test coverage 27 | .nyc_output 28 | 29 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 30 | .grunt 31 | 32 | # Bower dependency directory (https://bower.io/) 33 | bower_components 34 | 35 | # node-waf configuration 36 | .lock-wscript 37 | 38 | # Compiled binary addons (https://nodejs.org/api/addons.html) 39 | build/Release 40 | 41 | # Dependency directories 42 | node_modules/ 43 | jspm_packages/ 44 | 45 | # Snowpack dependency directory (https://snowpack.dev/) 46 | web_modules/ 47 | 48 | # TypeScript cache 49 | *.tsbuildinfo 50 | 51 | # Optional npm cache directory 52 | .npm 53 | 54 | # Optional eslint cache 55 | .eslintcache 56 | 57 | # Optional stylelint cache 58 | .stylelintcache 59 | 60 | # Microbundle cache 61 | .rpt2_cache/ 62 | .rts2_cache_cjs/ 63 | .rts2_cache_es/ 64 | .rts2_cache_umd/ 65 | 66 | # Optional REPL history 67 | .node_repl_history 68 | 69 | # Output of 'npm pack' 70 | *.tgz 71 | 72 | # Yarn Integrity file 73 | .yarn-integrity 74 | 75 | # dotenv environment variable files 76 | .env 77 | .env.development.local 78 | .env.test.local 79 | .env.production.local 80 | .env.local 81 | 82 | # parcel-bundler cache (https://parceljs.org/) 83 | .cache 84 | .parcel-cache 85 | 86 | # Next.js build output 87 | .next 88 | out 89 | 90 | # Nuxt.js build / generate output 91 | .nuxt 92 | dist 93 | 94 | # Gatsby files 95 | .cache/ 96 | # Comment in the public line in if your project uses Gatsby and not Next.js 97 | # https://nextjs.org/blog/next-9-1#public-directory-support 98 | # public 99 | 100 | # vuepress build output 101 | .vuepress/dist 102 | 103 | # vuepress v2.x temp and cache directory 104 | .temp 105 | .cache 106 | 107 | # Docusaurus cache and generated files 108 | .docusaurus 109 | 110 | # Serverless directories 111 | .serverless/ 112 | 113 | # FuseBox cache 114 | .fusebox/ 115 | 116 | # DynamoDB Local files 117 | .dynamodb/ 118 | 119 | # TernJS port file 120 | .tern-port 121 | 122 | # Stores VSCode versions used for testing VSCode extensions 123 | .vscode-test 124 | 125 | # yarn v2 126 | .yarn/cache 127 | .yarn/unplugged 128 | .yarn/build-state.yml 129 | .yarn/install-state.gz 130 | .pnp.* 131 | -------------------------------------------------------------------------------- /index.mjs: -------------------------------------------------------------------------------- 1 | import { SYSVAR_SLOT_HASHES_PUBKEY, SYSVAR_INSTRUCTIONS_PUBKEY } from '@solana/web3.js'; 2 | import * as anchor from "@coral-xyz/anchor"; 3 | import { BN } from "bn.js" 4 | import Ftd from "./ftd.json" assert { type: "json" }; 5 | //---------------------------------------------------- 6 | //input your solana private key 7 | const privateKey = ''; 8 | //the times you want to mint 9 | let times = 10000; 10 | //interval second 11 | const sleepSecond = 2; 12 | 13 | //input your inviter's solana address 14 | //if not, keep the default 15 | const inviterAddress = '11111111111111111111111111111112'; 16 | 17 | //Solana endpoint 18 | const endpoint = 'https://api.mainnet-beta.solana.com'; 19 | //---------------------------------------------------- 20 | const slotsPerEpoch = 500; 21 | 22 | const getProvider = () => { 23 | const connection = new anchor.web3.Connection(endpoint, 'processed'); 24 | const keypair = anchor.web3.Keypair.fromSecretKey(anchor.utils.bytes.bs58.decode(privateKey)) 25 | const wallet = new anchor.Wallet(keypair); 26 | console.log('your address: ', wallet.publicKey.toString()) 27 | const provider = new anchor.AnchorProvider(connection, wallet, { commitment: 'processed', preflightCommitment: 'processed' }); 28 | return provider; 29 | }; 30 | 31 | const sleep = () => { 32 | return new Promise((resolve) => setTimeout(resolve, sleepSecond * 1000)); 33 | } 34 | 35 | const program = new anchor.Program(Ftd, Ftd.metadata.address, getProvider()); 36 | 37 | const sysInfoAddr = (anchor.web3.PublicKey.findProgramAddressSync([anchor.utils.bytes.utf8.encode("SysInfo"),], program.programId))[0] 38 | const userSummaryAddr = (anchor.web3.PublicKey.findProgramAddressSync([anchor.utils.bytes.utf8.encode("UserSummary"), program.provider.wallet.publicKey.toBuffer()], program.programId))[0] 39 | const dividendDataAddr = (anchor.web3.PublicKey.findProgramAddressSync([anchor.utils.bytes.utf8.encode("DividendData"),], program.programId))[0] 40 | 41 | let inviterInfoAddr = (anchor.web3.PublicKey.findProgramAddressSync([anchor.utils.bytes.utf8.encode("InviterInfo"), new anchor.web3.PublicKey(inviterAddress).toBuffer()], program.programId))[0] 42 | 43 | let userSummary = await program.account.userSummary.getAccountInfo(userSummaryAddr); 44 | let inviterInfo = await program.account.inviterInfo.getAccountInfo(inviterInfoAddr); 45 | 46 | if (userSummary != null) { 47 | const invitedFrom = program.coder.accounts.decode('UserSummary', userSummary.data).invitedFrom; 48 | inviterInfoAddr = (anchor.web3.PublicKey.findProgramAddressSync([anchor.utils.bytes.utf8.encode("InviterInfo"), new anchor.web3.PublicKey(invitedFrom).toBuffer()], program.programId))[0] 49 | } else if (inviterInfo == null) { 50 | inviterInfoAddr = (anchor.web3.PublicKey.findProgramAddressSync([anchor.utils.bytes.utf8.encode("InviterInfo"), new anchor.web3.PublicKey('11111111111111111111111111111111').toBuffer()], program.programId))[0] 51 | } 52 | 53 | const getReward = async () => { 54 | try { 55 | let userSummary = await program.account.userSummary.getAccountInfo(userSummaryAddr); 56 | if (userSummary == null) return; 57 | const dst_epoch = program.coder.accounts.decode('UserSummary', userSummary.data).unclaimedEpochs[0]; 58 | const epochInfoAddr = (anchor.web3.PublicKey.findProgramAddressSync([anchor.utils.bytes.utf8.encode("EpochInfo"), anchor.utils.bytes.utf8.encode(new BN(dst_epoch).toString())], program.programId))[0] 59 | const userEpochInfoAddr = (anchor.web3.PublicKey.findProgramAddressSync([anchor.utils.bytes.utf8.encode("UserEpochInfo"), anchor.utils.bytes.utf8.encode(new BN(dst_epoch).toString()), program.provider.wallet.publicKey.toBuffer()], program.programId))[0] 60 | const tx = await program.methods.claim().accounts({ 61 | sysInfo: sysInfoAddr, 62 | epochInfo: epochInfoAddr, 63 | userEpochInfo: userEpochInfoAddr, 64 | userSummary: userSummaryAddr, 65 | dividendData: dividendDataAddr, 66 | inviterInfo: inviterInfoAddr 67 | }).preInstructions([anchor.web3.ComputeBudgetProgram.setComputeUnitLimit({ units: 1400000, })]).rpc() 68 | console.log('getReward tx: ', tx) 69 | } catch (e) { 70 | console.log('No reward or waiting for the next epoch claim.') 71 | } 72 | } 73 | 74 | await getReward() 75 | while (times-- > 0) { 76 | try { 77 | if (times % 5 == 0) await getReward() 78 | const slot = await program.provider.connection.getSlot(); 79 | const epochInfoAddr = (anchor.web3.PublicKey.findProgramAddressSync([anchor.utils.bytes.utf8.encode("EpochInfo"), anchor.utils.bytes.utf8.encode(new BN(slot).div(new BN(slotsPerEpoch)).toString())], program.programId))[0] 80 | const userEpochInfoAddr = (anchor.web3.PublicKey.findProgramAddressSync([anchor.utils.bytes.utf8.encode("UserEpochInfo"), anchor.utils.bytes.utf8.encode(new BN(slot).div(new BN(slotsPerEpoch)).toString()), program.provider.wallet.publicKey.toBuffer()], program.programId))[0] 81 | console.log('current slot', slot) 82 | var tx = program.methods.mintftd().accounts({ 83 | sysInfo: sysInfoAddr, 84 | userSummary: userSummaryAddr, 85 | epochInfo: epochInfoAddr, 86 | userEpochInfo: userEpochInfoAddr, 87 | recentSlothashes: SYSVAR_SLOT_HASHES_PUBKEY, 88 | instructions: SYSVAR_INSTRUCTIONS_PUBKEY, 89 | inviterInfo: inviterInfoAddr 90 | }).preInstructions([anchor.web3.ComputeBudgetProgram.setComputeUnitLimit({ units: 1400000, })]).rpc() 91 | console.log('mintftd tx: ', await tx) 92 | } catch (e) { 93 | console.log('mintftd error: ', e.message) 94 | } 95 | await sleep() 96 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Solana-Foam 2 | Foam mint and claim script 3 | 4 | ## 1-99980 winners data 5 | https://github.com/SoilLabs/Solana-Foam/blob/main/foam_data.xls 6 | 7 | ## Rage Mode Data 8 | Winning numbers (arithmetic sequence mechanism): 9 | 10 | 1809 2469 3129 3789 4449 5109 5769 6429 7089 7749 8409 9069 9729 10389 11049 11709 12369 13029 13689 14349 11 | 12 | Num tx_signer 13 | 1809 FWE8qytqwu5HsU3qdzRhZ86tMjfwM56GdJzcD5SGpipS 14 | https://solscan.io/tx/23dCsNcFqWi6CHn7yN92685eW2Z1nKqV9pJhmWwd2g5PVnTp9SHJNFfkkGYM8k1xhZBs8Qt4d4BHQ8rdyxpzoQkt 15 | 16 | 2469 QKypUcnD5Cw6BhVGqP1sjqzoS6Rr3W3rjVwbmicVEAD 17 | https://solscan.io/tx/42xxy5AcB4Kp8UNWPPfyUR3rWust187rUQjgaKuUHAWVfViFBAGPi8zejzCmx2DK5emwEed66pqdu5iTXEV6A7td 18 | 19 | 3129 7ikGSgNT5YDr49oScMjVP1pdLQM8ZRB1yBYVXMZiHTn1 20 | https://solscan.io/tx/bHEKgzFx8NnZKtqZaGbyWUbbhgsPVrjbwkWzbqK61rAr8mfdDP3hrjMXjEbLhXwh18q7dJbLiXkz7DBjWPNxubQ 21 | 22 | 3789 6pTQEmQYwAHpa9LvJGnQTt8JZkz5ZMahUojUwE76aYW6 23 | https://solscan.io/tx/H2nT9NTGzXaY75hjpsAK28a9BJoyY3i9uViuCudH76XFN2ZXh5ptBrhw4LHAnkweP62nSRCsamK7HCN5ARhPn3P 24 | 25 | 4449 9X9DJc6s8oKsb43oMqZsYr3gj9iDsLgeS9rfs18jArfY 26 | https://solscan.io/tx/ZwGX3JZ4s87YyRwZTbCWjuPcmRA46RYCnsPaUrq229aTkQdUkhUkJbrKKK8Dy8PaodGjDeND7Dr8SgZGxGHtvqR 27 | 28 | 5109 5UZxTGyUnGUqvwY1V4N1sV4hydfyt8FGuKqtveMFVGCH 29 | https://solscan.io/tx/HhXWfKDmuV5wZe49zsZ6G9oMtgc35bGfTmcxQVWnqpd1V1ey6C32tgMqDhYNa9ZFsgyKsRUuZqojm9pFqYBjCTG 30 | 31 | 5769 FrfUoxYwXcrhj5Eo1SFKGy3GBnUj1NH3rtQ6Caodgskp 32 | https://solscan.io/tx/5gSPFnPQq4hsciYuV3KAtXAAc7cWGtSZktm24PEJf9GZ7T4W14iaYC3o47moL5tbUp52sDkPhBbmU3d8DdWBWR2e 33 | 34 | 6429 3DNFuumCLnoc7kAebNnXJk2jP4vmykDa2ZznQDKQ55Pd 35 | https://solscan.io/tx/MC1EADFuQa9zdVXRiSbZHx5bnzJJ6wHyck4sJ7RZEJ7cVQXm6JhxEhmrTr3qk1nMNCt9TVovAMBRTJCG56zoXLf 36 | 37 | 7089 AKg2Re2JaDkACU5uDgusq9A93DXZ3tQA6Rj3mp2p5kfx 38 | https://solscan.io/tx/urj6EUhnrrrRGkvDgZJ46vdnWeCU7oSfC8STeNFaST1Q6MM1gauYuwDQA9rQPgCvkEuj9Sir1MMQ8sX1xhRBTjG 39 | 40 | 7749 92JsdRRPiYRTVZoS5PA5hcRY23o9TQzyBQhx5JMT8RGq 41 | https://solscan.io/tx/3yhfK4UzY3ep5x368F7QcSq65ng8FoZGQyFnzxeBcPEP45a9BAENWrhEqFh7JZRy74By8A5o8WsYWL8fq8XQY829 42 | 43 | 8409 E7KYjNm7EsYTNtNorduAPMSNRfUNSGkc7woRX6T2hFpv 44 | https://solscan.io/tx/4uZSBe6JLRwesEg8TikaJuMfEFeXKrnmVj49hzLGCRrsB8BEHT24s2deTTu7iBHvceTp4ATsCiGXbqb19tR76Nvk 45 | 46 | 9069 AGPz3R1V3nXB8krfSCddgPQxjhCe26TtTzVpAXmeLTak 47 | https://solscan.io/tx/3L174rxZ6eTSKPptZNsfQLhmrgvsVX9gKxykrhyjfknRnHmodEvqLYNTnFU3a74keUtq68TMqdzaHBnmecpyznCm 48 | 49 | 9729 4J1vZerYXSd5PWPuy2QGCSRLaTR1ydio4NcCMSidXCWb 50 | https://solscan.io/tx/5v9xLn4byvPc9H6oSaAs1dX2qGy6trYdDpeZN5YQs8w6ymsN8ZUD674iimp9ECijGihzTYYq1FGs9iWiVFKZcWtf 51 | 52 | 10389 BjgmooEKjPVwHdW6DngSYW9cAB2sr3QiCRuXdqxT75QG 53 | https://solscan.io/tx/3JeQPWkwnjdqmoEmF1HSxkFdeHzHmYJCqApNo1hsTZiQJ8NqaY3yWwV3sj6zYLrKE6hnMCpEYMQpqh8ngwi8oh68 54 | 55 | 11049 BKV32qrDhQRwSasr37WJBnzhBRxEKVegZxhwphUUKbCs 56 | https://solscan.io/tx/4fqjzRzCvQuE93Racsz32NQZpdBobUHyciR9rebnDttsgSQB8p77azrh6dubrZFFvhQVd91ahXk6ob7Gj3od8ST3 57 | 58 | 11709 DNCjoLSRuycbWHK4D4KVi5FoaHza4LKXGbQZDAj2uvC3 59 | https://solscan.io/tx/4UmUSKBGP8onJAobQn98k8jzFSo88FJVHZ7dqiFARLRpeiug4X5pDiTdkKBMCHQPmD6u2oYMmRWQYq3iEUiH57p6 60 | 61 | 12369 E7KYjNm7EsYTNtNorduAPMSNRfUNSGkc7woRX6T2hFpv 62 | https://solscan.io/tx/L1c7AK1xPa7eHhebT5PYZgL6sDDpyHu5emnaPsf8UvN4ypCQ9j34MT5Nmr5c8A7D29yHmPW6qBtXvnLghi9aHP7 63 | 64 | 13029 AfwgFoeu5xkcFxaYqyTiC3QiVpfPWq1grnKEcvRTmNx7 65 | https://solscan.io/tx/4uQtqbZGQLDAMHChNg5DsWqbZxsXUUAQdpPfME98WB9fkRzsmR84B6GAu6np6b4ZupPsoHHKVd8CXPhc2A9C5U6D 66 | 67 | 13689 Ch6zvXMth7CeUFVbn9nPtWE71SJNNkagpJQKgbe1H94m 68 | https://solscan.io/tx/yzVKhBUJkgvdNKmAXXu7fuUrkcD9LLeTrVLdLFFQNj8n3wSGg1rdGi4YcrzyWTW6MLuwJG3owRHhJ4UJ7kkAVAM 69 | 70 | 14349 BEqU5hkqLTas5iopni8NmqtWiP7bdkK8paaf9xCoSfxB 71 | https://solscan.io/tx/Vq8BUZEuk4SYQzKozrodn3qmagPgFYLCxsW5rKubwque3UEPi9wvvvLYFPzUuoiuikNxx3ck8st3Cj69sz8sUNX 72 | 73 | 74 | Dune.com query sql 75 | ``` 76 | select 77 | block_time, 78 | block_slot, 79 | tx_index, 80 | outer_executing_account, 81 | executing_account, 82 | data, 83 | tx_signer, 84 | tx_success, 85 | log_messages, 86 | 0.000005 as fee, 87 | tx_id 88 | from 89 | solana.instruction_calls 90 | where 91 | block_slot >= 238651704 92 | and executing_account = 'BFEtYvLqoWfj15xwapzoN62xHedP4AS718v36RCj9vKe' 93 | and data = 0x5e6670ef835f211d 94 | and tx_success = true 95 | order by block_slot asc ,tx_index asc 96 | ``` 97 | 98 | ## Lottery code 99 | ``` 100 | //step to next block 101 | if sys_info.current_block != Clock::get().unwrap().slot { 102 | //previous block has address join 103 | if sys_info.join_number != 0 { 104 | let recent_slothashes: &UncheckedAccount<'_> = &ctx.accounts.recent_slothashes; 105 | let data: std::cell::Ref<'_, &mut [u8]> = recent_slothashes.data.borrow(); 106 | let most_recent: &[u8; 8] = array_ref![data, 12, 8]; 107 | // seed for the random number is a combination of the slot_hash - timestamp 108 | let seed: u64 = u64::from_le_bytes(*most_recent) 109 | .saturating_sub(Clock::get().unwrap().unix_timestamp as u64); 110 | 111 | let reward_index: usize = (seed % sys_info.join_number) as usize; 112 | let reward_times: usize = epoch_info.reward_times as usize; 113 | epoch_info.reward_block[reward_times] = sys_info.current_block; 114 | epoch_info.reward_pubkey[reward_times] = sys_info.join_pubkey[reward_index]; 115 | epoch_info.reward_times += 1; 116 | sys_info.current_block = Clock::get().unwrap().slot; 117 | sys_info.join_number = 0; 118 | } 119 | } 120 | ``` 121 | 122 | ## How to run the script 123 | 1. install Node.js(v18+): 124 | 125 | download and install nodejs https://nodejs.org/download/release/v18.19.0/ 126 | 127 | 2. download script: 128 | 129 | download script from https://codeload.github.com/SoilLabs/Solana-Foam/zip/refs/heads/main 130 | 131 | 3. unzip script and change directory to the folders: 132 | 133 | cd Solana-Foam-main 134 | 135 | 4. Install the dependencies 136 | 137 | npm install 138 | 139 | 5. Fill in your information in the index.mjs 140 | 141 | edit index.mjs and input your information 142 | 143 | 6. Run the script: 144 | 145 | node index.mjs 146 | -------------------------------------------------------------------------------- /ftd.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.1.0", 3 | "name": "ftd", 4 | "instructions": [ 5 | { 6 | "name": "initialize", 7 | "accounts": [ 8 | { 9 | "name": "sysInfo", 10 | "isMut": true, 11 | "isSigner": false 12 | }, 13 | { 14 | "name": "epochInfo", 15 | "isMut": true, 16 | "isSigner": false 17 | }, 18 | { 19 | "name": "dividendData", 20 | "isMut": true, 21 | "isSigner": false 22 | }, 23 | { 24 | "name": "payer", 25 | "isMut": true, 26 | "isSigner": true 27 | }, 28 | { 29 | "name": "systemProgram", 30 | "isMut": false, 31 | "isSigner": false 32 | }, 33 | { 34 | "name": "rent", 35 | "isMut": false, 36 | "isSigner": false 37 | } 38 | ], 39 | "args": [] 40 | }, 41 | { 42 | "name": "empty", 43 | "accounts": [ 44 | { 45 | "name": "payer", 46 | "isMut": true, 47 | "isSigner": true 48 | } 49 | ], 50 | "args": [] 51 | }, 52 | { 53 | "name": "forTest", 54 | "accounts": [ 55 | { 56 | "name": "sysInfo", 57 | "isMut": true, 58 | "isSigner": false 59 | }, 60 | { 61 | "name": "payer", 62 | "isMut": true, 63 | "isSigner": true 64 | }, 65 | { 66 | "name": "systemProgram", 67 | "isMut": false, 68 | "isSigner": false 69 | }, 70 | { 71 | "name": "rent", 72 | "isMut": false, 73 | "isSigner": false 74 | } 75 | ], 76 | "args": [] 77 | }, 78 | { 79 | "name": "increaseSysInfo", 80 | "accounts": [ 81 | { 82 | "name": "sysInfo", 83 | "isMut": true, 84 | "isSigner": false 85 | }, 86 | { 87 | "name": "payer", 88 | "isMut": true, 89 | "isSigner": true 90 | }, 91 | { 92 | "name": "systemProgram", 93 | "isMut": false, 94 | "isSigner": false 95 | } 96 | ], 97 | "args": [ 98 | { 99 | "name": "len", 100 | "type": "u64" 101 | }, 102 | { 103 | "name": "epochId", 104 | "type": "u64" 105 | } 106 | ] 107 | }, 108 | { 109 | "name": "increaseEpochInfo", 110 | "accounts": [ 111 | { 112 | "name": "epochInfo", 113 | "isMut": true, 114 | "isSigner": false 115 | }, 116 | { 117 | "name": "payer", 118 | "isMut": true, 119 | "isSigner": true 120 | }, 121 | { 122 | "name": "systemProgram", 123 | "isMut": false, 124 | "isSigner": false 125 | } 126 | ], 127 | "args": [ 128 | { 129 | "name": "len", 130 | "type": "u64" 131 | }, 132 | { 133 | "name": "epochId", 134 | "type": "u64" 135 | } 136 | ] 137 | }, 138 | { 139 | "name": "increaseDividendData", 140 | "accounts": [ 141 | { 142 | "name": "dividendData", 143 | "isMut": true, 144 | "isSigner": false 145 | }, 146 | { 147 | "name": "payer", 148 | "isMut": true, 149 | "isSigner": true 150 | }, 151 | { 152 | "name": "systemProgram", 153 | "isMut": false, 154 | "isSigner": false 155 | } 156 | ], 157 | "args": [ 158 | { 159 | "name": "len", 160 | "type": "u64" 161 | } 162 | ] 163 | }, 164 | { 165 | "name": "feedInviterData", 166 | "accounts": [ 167 | { 168 | "name": "inviterInfo", 169 | "isMut": true, 170 | "isSigner": false 171 | }, 172 | { 173 | "name": "payer", 174 | "isMut": true, 175 | "isSigner": true 176 | }, 177 | { 178 | "name": "systemProgram", 179 | "isMut": false, 180 | "isSigner": false 181 | } 182 | ], 183 | "args": [ 184 | { 185 | "name": "invitor", 186 | "type": "publicKey" 187 | } 188 | ] 189 | }, 190 | { 191 | "name": "feedDividendData", 192 | "accounts": [ 193 | { 194 | "name": "dividendData", 195 | "isMut": true, 196 | "isSigner": false 197 | }, 198 | { 199 | "name": "payer", 200 | "isMut": true, 201 | "isSigner": true 202 | }, 203 | { 204 | "name": "systemProgram", 205 | "isMut": false, 206 | "isSigner": false 207 | } 208 | ], 209 | "args": [ 210 | { 211 | "name": "start", 212 | "type": "u64" 213 | }, 214 | { 215 | "name": "end", 216 | "type": "u64" 217 | } 218 | ] 219 | }, 220 | { 221 | "name": "activeNextEpoch", 222 | "accounts": [ 223 | { 224 | "name": "sysInfo", 225 | "isMut": true, 226 | "isSigner": false 227 | }, 228 | { 229 | "name": "epochInfo", 230 | "isMut": true, 231 | "isSigner": false 232 | }, 233 | { 234 | "name": "previousEpochInfo", 235 | "isMut": true, 236 | "isSigner": false 237 | }, 238 | { 239 | "name": "recentSlothashes", 240 | "isMut": false, 241 | "isSigner": false, 242 | "docs": [ 243 | "SlotHashes sysvar cluster data." 244 | ] 245 | }, 246 | { 247 | "name": "payer", 248 | "isMut": true, 249 | "isSigner": true 250 | }, 251 | { 252 | "name": "systemProgram", 253 | "isMut": false, 254 | "isSigner": false 255 | }, 256 | { 257 | "name": "rent", 258 | "isMut": false, 259 | "isSigner": false 260 | } 261 | ], 262 | "args": [] 263 | }, 264 | { 265 | "name": "claim", 266 | "accounts": [ 267 | { 268 | "name": "sysInfo", 269 | "isMut": true, 270 | "isSigner": false 271 | }, 272 | { 273 | "name": "userSummary", 274 | "isMut": true, 275 | "isSigner": false 276 | }, 277 | { 278 | "name": "epochInfo", 279 | "isMut": true, 280 | "isSigner": false 281 | }, 282 | { 283 | "name": "userEpochInfo", 284 | "isMut": true, 285 | "isSigner": false 286 | }, 287 | { 288 | "name": "dividendData", 289 | "isMut": true, 290 | "isSigner": false 291 | }, 292 | { 293 | "name": "inviterInfo", 294 | "isMut": true, 295 | "isSigner": false 296 | }, 297 | { 298 | "name": "payer", 299 | "isMut": true, 300 | "isSigner": true 301 | }, 302 | { 303 | "name": "systemProgram", 304 | "isMut": false, 305 | "isSigner": false 306 | }, 307 | { 308 | "name": "rent", 309 | "isMut": false, 310 | "isSigner": false 311 | } 312 | ], 313 | "args": [] 314 | }, 315 | { 316 | "name": "withdraw", 317 | "accounts": [ 318 | { 319 | "name": "pda", 320 | "isMut": true, 321 | "isSigner": false 322 | }, 323 | { 324 | "name": "payer", 325 | "isMut": true, 326 | "isSigner": true 327 | }, 328 | { 329 | "name": "systemProgram", 330 | "isMut": false, 331 | "isSigner": false 332 | }, 333 | { 334 | "name": "rent", 335 | "isMut": false, 336 | "isSigner": false 337 | } 338 | ], 339 | "args": [ 340 | { 341 | "name": "total", 342 | "type": "u64" 343 | } 344 | ] 345 | }, 346 | { 347 | "name": "mintftd", 348 | "accounts": [ 349 | { 350 | "name": "sysInfo", 351 | "isMut": true, 352 | "isSigner": false 353 | }, 354 | { 355 | "name": "epochInfo", 356 | "isMut": true, 357 | "isSigner": false 358 | }, 359 | { 360 | "name": "userEpochInfo", 361 | "isMut": true, 362 | "isSigner": false 363 | }, 364 | { 365 | "name": "userSummary", 366 | "isMut": true, 367 | "isSigner": false 368 | }, 369 | { 370 | "name": "inviterInfo", 371 | "isMut": true, 372 | "isSigner": false 373 | }, 374 | { 375 | "name": "recentSlothashes", 376 | "isMut": false, 377 | "isSigner": false, 378 | "docs": [ 379 | "SlotHashes sysvar cluster data." 380 | ] 381 | }, 382 | { 383 | "name": "payer", 384 | "isMut": true, 385 | "isSigner": true 386 | }, 387 | { 388 | "name": "systemProgram", 389 | "isMut": false, 390 | "isSigner": false 391 | }, 392 | { 393 | "name": "rent", 394 | "isMut": false, 395 | "isSigner": false 396 | }, 397 | { 398 | "name": "instructions", 399 | "isMut": false, 400 | "isSigner": false 401 | } 402 | ], 403 | "args": [] 404 | } 405 | ], 406 | "accounts": [ 407 | { 408 | "name": "SysInfo", 409 | "type": { 410 | "kind": "struct", 411 | "fields": [ 412 | { 413 | "name": "isExtremeMode", 414 | "type": "u64" 415 | }, 416 | { 417 | "name": "extremeModeStartTime", 418 | "type": "u64" 419 | }, 420 | { 421 | "name": "extremeModeEndTime", 422 | "type": "u64" 423 | }, 424 | { 425 | "name": "extremeModeEnterSlot", 426 | "type": "u64" 427 | }, 428 | { 429 | "name": "sysStartSlot", 430 | "type": "u64" 431 | }, 432 | { 433 | "name": "totalJoinNumber", 434 | "type": "u64" 435 | }, 436 | { 437 | "name": "totalDividendNumber", 438 | "type": "u64" 439 | }, 440 | { 441 | "name": "adminAddr", 442 | "type": "publicKey" 443 | }, 444 | { 445 | "name": "liqAmount", 446 | "type": "u64" 447 | }, 448 | { 449 | "name": "prizeAmount", 450 | "type": "u64" 451 | }, 452 | { 453 | "name": "teamAmount", 454 | "type": "u64" 455 | }, 456 | { 457 | "name": "dividendAmount", 458 | "type": "u64" 459 | }, 460 | { 461 | "name": "failureIncome", 462 | "type": "u64" 463 | }, 464 | { 465 | "name": "currentEpoch", 466 | "type": "u64" 467 | }, 468 | { 469 | "name": "currentBlock", 470 | "type": "u64" 471 | }, 472 | { 473 | "name": "joinNumber", 474 | "type": "u64" 475 | }, 476 | { 477 | "name": "joinPubkey", 478 | "type": { 479 | "array": [ 480 | "publicKey", 481 | 3000 482 | ] 483 | } 484 | } 485 | ] 486 | } 487 | }, 488 | { 489 | "name": "EpochInfo", 490 | "type": { 491 | "kind": "struct", 492 | "fields": [ 493 | { 494 | "name": "joinNumber", 495 | "type": "u64" 496 | }, 497 | { 498 | "name": "dividendNumber", 499 | "type": "u64" 500 | }, 501 | { 502 | "name": "epochId", 503 | "type": "u64" 504 | }, 505 | { 506 | "name": "rewardTimes", 507 | "type": "u64" 508 | }, 509 | { 510 | "name": "rewardBlock", 511 | "type": { 512 | "array": [ 513 | "u64", 514 | 500 515 | ] 516 | } 517 | }, 518 | { 519 | "name": "rewardPubkey", 520 | "type": { 521 | "array": [ 522 | "publicKey", 523 | 500 524 | ] 525 | } 526 | } 527 | ] 528 | } 529 | }, 530 | { 531 | "name": "UserEpochInfo", 532 | "type": { 533 | "kind": "struct", 534 | "fields": [ 535 | { 536 | "name": "userAddr", 537 | "type": "publicKey" 538 | }, 539 | { 540 | "name": "leftNft", 541 | "type": "u64" 542 | }, 543 | { 544 | "name": "nftClaimedIndex", 545 | "type": "u64" 546 | }, 547 | { 548 | "name": "hasClaim", 549 | "type": "u64" 550 | }, 551 | { 552 | "name": "epochId", 553 | "type": "u64" 554 | }, 555 | { 556 | "name": "lastBlock", 557 | "type": "u64" 558 | }, 559 | { 560 | "name": "joinTimes", 561 | "type": "u64" 562 | }, 563 | { 564 | "name": "joinBlock", 565 | "type": { 566 | "array": [ 567 | "u64", 568 | 500 569 | ] 570 | } 571 | } 572 | ] 573 | } 574 | }, 575 | { 576 | "name": "UserSummary", 577 | "type": { 578 | "kind": "struct", 579 | "fields": [ 580 | { 581 | "name": "invitedFrom", 582 | "type": "publicKey" 583 | }, 584 | { 585 | "name": "totalDividendTimes", 586 | "type": "u64" 587 | }, 588 | { 589 | "name": "totalDividendAmount", 590 | "type": "u64" 591 | }, 592 | { 593 | "name": "totalRefundAmount", 594 | "type": "u64" 595 | }, 596 | { 597 | "name": "initEpochId", 598 | "type": "u64" 599 | }, 600 | { 601 | "name": "lastJoinEpochId", 602 | "type": "u64" 603 | }, 604 | { 605 | "name": "totalJoinEpochTimes", 606 | "type": "u64" 607 | }, 608 | { 609 | "name": "totalJoinTimes", 610 | "type": "u64" 611 | }, 612 | { 613 | "name": "unclaimedEpochsLen", 614 | "type": "u64" 615 | }, 616 | { 617 | "name": "unclaimedEpochs", 618 | "type": { 619 | "array": [ 620 | "u64", 621 | 10 622 | ] 623 | } 624 | } 625 | ] 626 | } 627 | }, 628 | { 629 | "name": "InviterInfo", 630 | "type": { 631 | "kind": "struct", 632 | "fields": [ 633 | { 634 | "name": "userAddr", 635 | "type": "publicKey" 636 | }, 637 | { 638 | "name": "mintTimes", 639 | "type": "u64" 640 | }, 641 | { 642 | "name": "dividendTimes", 643 | "type": "u64" 644 | } 645 | ] 646 | } 647 | }, 648 | { 649 | "name": "DividendData", 650 | "type": { 651 | "kind": "struct", 652 | "fields": [ 653 | { 654 | "name": "data", 655 | "type": { 656 | "array": [ 657 | { 658 | "array": [ 659 | "u32", 660 | 501 661 | ] 662 | }, 663 | 501 664 | ] 665 | } 666 | } 667 | ] 668 | } 669 | } 670 | ], 671 | "events": [ 672 | { 673 | "name": "ClaimedEvent", 674 | "fields": [ 675 | { 676 | "name": "epochId", 677 | "type": "u64", 678 | "index": false 679 | }, 680 | { 681 | "name": "dividendAmount", 682 | "type": "u64", 683 | "index": false 684 | }, 685 | { 686 | "name": "refundAmount", 687 | "type": "u64", 688 | "index": false 689 | }, 690 | { 691 | "name": "dividendTimes", 692 | "type": "u64", 693 | "index": false 694 | } 695 | ] 696 | } 697 | ], 698 | "errors": [ 699 | { 700 | "code": 6000, 701 | "name": "OnlyOneTimeError", 702 | "msg": "Only One Time" 703 | }, 704 | { 705 | "code": 6001, 706 | "name": "Limit", 707 | "msg": "Access Limit" 708 | }, 709 | { 710 | "code": 6002, 711 | "name": "ClaimEpochIdError", 712 | "msg": "Claim EpochId Error" 713 | }, 714 | { 715 | "code": 6003, 716 | "name": "InviterError", 717 | "msg": "Inviter Error" 718 | }, 719 | { 720 | "code": 6004, 721 | "name": "EndError", 722 | "msg": ">150 slot Error" 723 | } 724 | ], 725 | "metadata": { 726 | "address": "BFEtYvLqoWfj15xwapzoN62xHedP4AS718v36RCj9vKe" 727 | } 728 | } --------------------------------------------------------------------------------