Skip to content

Instantly share code, notes, and snippets.

@staccDOTsol
Created May 30, 2022 15:41
Show Gist options
  • Save staccDOTsol/4b5e25ec411ee875311f4e3256b5118d to your computer and use it in GitHub Desktop.
Save staccDOTsol/4b5e25ec411ee875311f4e3256b5118d to your computer and use it in GitHub Desktop.
#today we simp @redacted_j and @only_raindrops #next we mix some sprinkles over other solana genius - this gonna be way cooler wen we fuck with the nashisms ingame and metagame :) # #fuckwiththenashofit
# assumes solana-cli (eh but an old enuff version for raindrops to work, I actually replaced raindrops occurrences of _recentBlockhash with getLastBlockHash iirc)
# you have cloned https://github.com/raindrops-protocol/raindrops
# you are in raindrops/js
# gl; hf; mb
solana-keygen new -o bla --force -s --no-bip39-passphrase
export blarg=$(solana address -k bla)
solana-keygen new -o p1 --force -s --no-bip39-passphrase
export p1=$(solana address -k p1)
solana-keygen new -o p2 --force -s --no-bip39-passphrase
export p2=$(solana address -k p2)
solana-keygen new -o p0 --force -s --no-bip39-passphrase
export p0=$(solana address -k p0)
solana airdrop 1 $p1
solana airdrop 1 $p2
solana airdrop 1 $p0
spl-token wrap 0.2 p2
spl-token wrap 0.2 p1
rm -rf createMatch.js
echo '''{
"winOracle": null,
"matchState": { "initialized": true },
"winOracleCooldown": 10,
"space": 300,
"minimumAllowedEntryTime": null,
"tokenEntryValidation": null,
"authority": "'''$p0'''",
"leaveAllowed": true,
"joinAllowedDuringStart": true,
"oracleState": {
"seed": "'''$blarg'''",
"authority": "'''$p0'''",
"finalized": false,
"tokenTransferRoot": null,
"tokenTransfers": [
]
},
"tokensToJoin": [
{
"mint": "So11111111111111111111111111111111111111112",
"amount": 100000000,
"sourceType": 1,
"index": 1,
"validationProgram": "nameAxQRRBnd4kLfsVoZBBXfrByZdZTkh8mULLxLyqV"
}
]
}''' >> createMatch.js
yarn ts-node src/cli/matches.ts create_or_update_oracle -e devnet -k p0 -cp createMatch.js
yarn ts-node src/cli/matches.ts create_match -e devnet -k p0 -cp createMatch.js
yarn ts-node src/cli/matches.ts join_match -e devnet -k p1 -cp createMatch.js
yarn ts-node src/cli/matches.ts join_match -e devnet -k p2 -cp createMatch.js
rm -rf createMatch.js
echo '''{
"winOracle": null,
"matchState": { "started": true },
"winOracleCooldown": 10,
"space": 300,
"minimumAllowedEntryTime": null,
"tokenEntryValidation": null,
"authority": "'''$p0'''",
"leaveAllowed": true,
"joinAllowedDuringStart": true,
"oracleState": {
"seed": "'''$blarg'''",
"authority": "'''$p0'''",
"finalized": false,
"tokenTransferRoot": null,
"tokenTransfers": [
]
},
"tokensToJoin": [
{
"mint": "So11111111111111111111111111111111111111112",
"amount": 100000000,
"sourceType": 1,
"index": 1,
"validationProgram": "nameAxQRRBnd4kLfsVoZBBXfrByZdZTkh8mULLxLyqV"
}
]
}''' >> createMatch.js
yarn ts-node src/cli/matches.ts update_match -e devnet -k p0 -cp createMatch.js
rm -rf createMatch.js
echo '''{
"winOracle": null,
"matchState": { "started": true },
"winOracleCooldown": 10,
"space": 300,
"minimumAllowedEntryTime": null,
"tokenEntryValidation": null,
"authority": "'''$p0'''",
"leaveAllowed": true,
"joinAllowedDuringStart": true,
"oracleState": {
"seed": "'''$blarg'''",
"authority": "'''$p0'''",
"finalized": true,
"tokenTransferRoot": null,
"tokenTransfers": [
{
"from": "'''$p0'''",
"to": "'''$p2'''",
"tokenTransferType": { "normal": true },
"mint": "So11111111111111111111111111111111111111112",
"amount": 200000000
}
]
},
"tokensToJoin": [
{
"mint": "So11111111111111111111111111111111111111112",
"amount": 100000000,
"sourceType": 1,
"index": 1,
"validationProgram": "nameAxQRRBnd4kLfsVoZBBXfrByZdZTkh8mULLxLyqV"
}
]
}''' >> createMatch.js
yarn ts-node src/cli/matches.ts create_or_update_oracle -e devnet -k p0 -cp createMatch.js
yarn ts-node src/cli/matches.ts update_match_from_oracle -e devnet -k p0 -cp createMatch.js
# this will fail lol. get the ata for wsol for p2. lol then put it in the above config
# I'm actually getting sleepy. find whatever ata you send 0.1 wsol to twice, too, that's from in above json <3
#this is one of my wips currently dunno what is muckled from here down lol, https://twitter.com/STACCart/status/1531294664149590018
yarn ts-node src/cli/matches.ts disburse_tokens_by_oracle -e devnet -k p0 -cp createMatch.js
yarn ts-node src/cli/matches.ts drain_match -e devnet -k p0 -cp createMatch.js
yarn ts-node src/cli/matches.ts drain_oracle -e devnet -k p0 -cp createMatch.js
echo $p2
echo "should? be up. go look"
#today we simp @redacted_j and @only_raindrops
#next we mix some sprinkles over other solana genius - this gonna be way cooler wen we fuck with the nashisms ingame and metagame :)
# #fuckwiththenashofit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment