|
| 1 | +source ./create_components.sh |
| 2 | + |
| 3 | +# |
| 4 | +resim set-default-account $AIRDROP_REGISTER_ADDRESS_CYOVER $AIRDROP_REGISTER_PVKEY_CYOVER |
| 5 | +#tweeter account cyover registring to the airdrop |
| 6 | +echo "CALL_METHOD ComponentAddress(\"$AIRDROP_WITH_TWEETER_ORACLE_COMPONENT\") \"register\" \"cyover\" ;" > tx.rtm |
| 7 | +echo "CALL_METHOD_WITH_ALL_RESOURCES ComponentAddress(\"$AIRDROP_REGISTER_ADDRESS_CYOVER\") \"deposit_batch\";" >> tx.rtm |
| 8 | +resim run tx.rtm |
| 9 | + |
| 10 | +# tweeter account cyrolsi registring to the airdrop |
| 11 | +resim set-default-account $AIRDROP_REGISTER_ADDRESS_CYROLSI $AIRDROP_REGISTER_PVKEY_CYROLSI |
| 12 | +echo "CALL_METHOD ComponentAddress(\"$AIRDROP_WITH_TWEETER_ORACLE_COMPONENT\") \"register\" \"cyrolsi\" ;" > tx.rtm |
| 13 | +echo "CALL_METHOD_WITH_ALL_RESOURCES ComponentAddress(\"$AIRDROP_REGISTER_ADDRESS_CYROLSI\") \"deposit_batch\";" >> tx.rtm |
| 14 | +resim run tx.rtm |
| 15 | + |
| 16 | + |
| 17 | +#cyover has completed alls tasks need by the airdrop (like radixdlt, like and reweet tweet1) in contrast to cyrolsi |
| 18 | +resim set-default-account $TWEETER_ORACLE_ADMIN_ADDRESS $TWEETER_ORACLE_ADMIN_PVKEY |
| 19 | +#inserting datas by TWEETER_ORACLE_ADMIN_ADDRESS |
| 20 | +echo "CALL_METHOD ComponentAddress(\"$TWEETER_ORACLE_ADMIN_ADDRESS\") \"create_proof_by_amount\" Decimal(\"1\") ResourceAddress(\"$TWEETER_ORACLE_ADMIN_BADGE\");" > tx.rtm |
| 21 | +echo "CALL_METHOD ComponentAddress(\"$TWEETER_ORACLE_COMPONENT\") \"insert_account_followers\" \"radixdlt\" HashSet<String>(\"cyover\",\"ade\");" >> tx.rtm |
| 22 | +echo "CALL_METHOD ComponentAddress(\"$TWEETER_ORACLE_COMPONENT\") \"insert_tweets_likers\" \"tweet1\" HashSet<String>(\"cyover\",\"cyrolsi\",\"vivi\");" >> tx.rtm |
| 23 | +echo "CALL_METHOD ComponentAddress(\"$TWEETER_ORACLE_COMPONENT\") \"insert_tweets_retweeters\" \"tweet1\" HashSet<String>(\"cyover\",\"cyrolsi\");" >> tx.rtm |
| 24 | +resim run tx.rtm |
| 25 | + |
| 26 | + |
| 27 | +#AIRDROP_ADMIN_ADDRESS find and store airdrop recipeints and finalize it |
| 28 | +resim set-default-account $AIRDROP_ADMIN_ADDRESS $AIRDROP_ADMIN_PVKEY |
| 29 | +echo "CALL_METHOD ComponentAddress(\"$AIRDROP_ADMIN_ADDRESS\") \"create_proof_by_amount\" Decimal(\"1\") ResourceAddress(\"$AIRDROP_WITH_TWEETER_ORACLE_ADMIN_BADGE\");" > tx.rtm |
| 30 | +echo "CALL_METHOD ComponentAddress(\"$AIRDROP_WITH_TWEETER_ORACLE_COMPONENT\") \"find_and_store_airdrop_recipients\" ;" >> tx.rtm |
| 31 | +resim run tx.rtm |
| 32 | + |
| 33 | +echo "CALL_METHOD ComponentAddress(\"$AIRDROP_ADMIN_ADDRESS\") \"create_proof_by_amount\" Decimal(\"1\") ResourceAddress(\"$AIRDROP_WITH_TWEETER_ORACLE_ADMIN_BADGE\");" > tx.rtm |
| 34 | +echo "CALL_METHOD ComponentAddress(\"$AIRDROP_ADMIN_ADDRESS\") \"withdraw\" ResourceAddress(\"$XRD\");" >> tx.rtm |
| 35 | +echo "TAKE_FROM_WORKTOP_BY_AMOUNT Decimal(\"100\") ResourceAddress(\"$XRD\") Bucket(\"xrd_bucket\");" >> tx.rtm |
| 36 | +echo "CALL_METHOD ComponentAddress(\"$AIRDROP_WITH_TWEETER_ORACLE_COMPONENT\") \"finalize_airdrop\" Bucket(\"xrd_bucket\") ;" >> tx.rtm |
| 37 | +echo "CALL_METHOD_WITH_ALL_RESOURCES ComponentAddress(\"$AIRDROP_ADMIN_ADDRESS\") \"deposit_batch\";" >> tx.rtm |
| 38 | +resim run tx.rtm |
| 39 | +rm tx.rtm |
| 40 | + |
| 41 | + |
| 42 | +#withdraw |
| 43 | + |
| 44 | +#cyover withdraw is success |
| 45 | +resim show $AIRDROP_REGISTER_ADDRESS_CYOVER |
| 46 | +resim set-default-account $AIRDROP_REGISTER_ADDRESS_CYOVER $AIRDROP_REGISTER_PVKEY_CYOVER |
| 47 | +resim call-method $AIRDROP_WITH_TWEETER_ORACLE_COMPONENT "withdraw" 1,$AIRDROP_WITH_TWEETER_ORACLE_PARTICIPANT_BADGE |
| 48 | +resim show $AIRDROP_REGISTER_ADDRESS_CYOVER |
| 49 | + |
| 50 | + |
| 51 | +#cyrolsi try to withdraw and get error because he is not a recipient |
| 52 | +resim show $AIRDROP_REGISTER_ADDRESS_CYROLSI |
| 53 | +resim set-default-account $AIRDROP_REGISTER_ADDRESS_CYROLSI $AIRDROP_REGISTER_PVKEY_CYROLSI |
| 54 | +resim call-method $AIRDROP_WITH_TWEETER_ORACLE_COMPONENT "withdraw" 1,$AIRDROP_WITH_TWEETER_ORACLE_PARTICIPANT_BADGE |
| 55 | +resim show $AIRDROP_REGISTER_ADDRESS_CYROLSI |
0 commit comments