diff --git a/contracts/eosio.ftoken/token.abi b/contracts/eosio.ftoken/token.abi new file mode 100644 index 0000000..024b53f --- /dev/null +++ b/contracts/eosio.ftoken/token.abi @@ -0,0 +1,186 @@ +{ + "version": "eosio::abi/1.1", + "types": [], + "structs": [ + { + "name": "Account", + "base": "", + "fields": [ + { + "name": "balance", + "type": "asset" + } + ] + }, + { + "name": "CurrencyStats", + "base": "", + "fields": [ + { + "name": "supply", + "type": "asset" + }, + { + "name": "max_supply", + "type": "asset" + }, + { + "name": "issuer", + "type": "name" + } + ] + }, + { + "name": "close", + "base": "", + "fields": [ + { + "name": "owner", + "type": "name" + }, + { + "name": "symbol", + "type": "symbol" + } + ] + }, + { + "name": "create", + "base": "", + "fields": [ + { + "name": "issuer", + "type": "name" + }, + { + "name": "maximum_supply", + "type": "asset" + } + ] + }, + { + "name": "issue", + "base": "", + "fields": [ + { + "name": "to", + "type": "name" + }, + { + "name": "quantity", + "type": "asset" + }, + { + "name": "memo", + "type": "string" + } + ] + }, + { + "name": "open", + "base": "", + "fields": [ + { + "name": "owner", + "type": "name" + }, + { + "name": "symbol", + "type": "symbol" + }, + { + "name": "ram_payer", + "type": "name" + } + ] + }, + { + "name": "retire", + "base": "", + "fields": [ + { + "name": "quantity", + "type": "asset" + }, + { + "name": "memo", + "type": "string" + } + ] + }, + { + "name": "transfer", + "base": "", + "fields": [ + { + "name": "from", + "type": "name" + }, + { + "name": "to", + "type": "name" + }, + { + "name": "quantity", + "type": "asset" + }, + { + "name": "memo", + "type": "string" + } + ] + } + ], + "actions": [ + { + "name": "close", + "type": "close", + "ricardian_contract": "" + }, + { + "name": "create", + "type": "create", + "ricardian_contract": "" + }, + { + "name": "issue", + "type": "issue", + "ricardian_contract": "" + }, + { + "name": "open", + "type": "open", + "ricardian_contract": "" + }, + { + "name": "retire", + "type": "retire", + "ricardian_contract": "" + }, + { + "name": "transfer", + "type": "transfer", + "ricardian_contract": "" + } + ], + "tables": [ + { + "name": "accounts", + "type": "Account", + "index_type": "i64", + "key_names": [], + "key_types": [] + }, + { + "name": "stat", + "type": "CurrencyStats", + "index_type": "i64", + "key_names": [], + "key_types": [] + } + ], + "variants": [], + "abi_extensions": [], + "error_messages": [], + "ricardian_clauses": [] +} \ No newline at end of file diff --git a/contracts/eosio.ftoken/token.wasm b/contracts/eosio.ftoken/token.wasm new file mode 100644 index 0000000..3efe6e3 Binary files /dev/null and b/contracts/eosio.ftoken/token.wasm differ diff --git a/contracts/eosio.plonky/plonky2_battleship_contract.abi b/contracts/eosio.plonky/plonky2_battleship_contract.abi new file mode 100644 index 0000000..144604a --- /dev/null +++ b/contracts/eosio.plonky/plonky2_battleship_contract.abi @@ -0,0 +1,221 @@ +{ + "version": "eosio::abi/1.1", + "types": [], + "structs": [ + { + "name": "GameStateTable", + "base": "", + "fields": [ + { + "name": "id", + "type": "name" + }, + { + "name": "next_turn", + "type": "uint32" + }, + { + "name": "p1", + "type": "PlayerState" + }, + { + "name": "p2", + "type": "PlayerState" + }, + { + "name": "last_hit", + "type": "uint8" + }, + { + "name": "sunk_what", + "type": "uint8" + } + ] + }, + { + "name": "PlayerState", + "base": "", + "fields": [ + { + "name": "id", + "type": "name" + }, + { + "name": "board", + "type": "bytes" + }, + { + "name": "shot_x", + "type": "uint8" + }, + { + "name": "shot_y", + "type": "uint8" + } + ] + }, + { + "name": "Proof", + "base": "", + "fields": [ + { + "name": "proof_id", + "type": "uint64" + }, + { + "name": "proof_digest", + "type": "checksum256" + }, + { + "name": "proof_input", + "type": "uint64[]" + } + ] + }, + { + "name": "clear", + "base": "", + "fields": [ + { + "name": "game", + "type": "name" + } + ] + }, + { + "name": "clearall", + "base": "", + "fields": [ + { + "name": "count", + "type": "uint32" + } + ] + }, + { + "name": "joingame", + "base": "", + "fields": [ + { + "name": "game_name", + "type": "name" + }, + { + "name": "player_two", + "type": "name" + }, + { + "name": "snarktor_receipt_data", + "type": "bytes" + }, + { + "name": "initial_state_data", + "type": "bytes" + }, + { + "name": "shot_x", + "type": "uint8" + }, + { + "name": "shot_y", + "type": "uint8" + } + ] + }, + { + "name": "newgame", + "base": "", + "fields": [ + { + "name": "game_name", + "type": "name" + }, + { + "name": "player_one", + "type": "name" + }, + { + "name": "snarktor_receipt_data", + "type": "bytes" + }, + { + "name": "initial_state_data", + "type": "bytes" + } + ] + }, + { + "name": "turn", + "base": "", + "fields": [ + { + "name": "snarktor_receipt_data", + "type": "bytes" + }, + { + "name": "round_commit_data", + "type": "bytes" + }, + { + "name": "game_name", + "type": "name" + }, + { + "name": "shot_x", + "type": "uint8" + }, + { + "name": "shot_y", + "type": "uint8" + } + ] + } + ], + "actions": [ + { + "name": "clear", + "type": "clear", + "ricardian_contract": "" + }, + { + "name": "clearall", + "type": "clearall", + "ricardian_contract": "" + }, + { + "name": "joingame", + "type": "joingame", + "ricardian_contract": "" + }, + { + "name": "newgame", + "type": "newgame", + "ricardian_contract": "" + }, + { + "name": "turn", + "type": "turn", + "ricardian_contract": "" + } + ], + "tables": [ + { + "name": "games", + "type": "GameStateTable", + "index_type": "i64", + "key_names": [], + "key_types": [] + }, + { + "name": "proofs", + "type": "Proof", + "index_type": "i64", + "key_names": [], + "key_types": [] + } + ], + "variants": [], + "abi_extensions": [], + "error_messages": [], + "ricardian_clauses": [] +} \ No newline at end of file diff --git a/contracts/eosio.plonky/plonky2_battleship_contract.wasm b/contracts/eosio.plonky/plonky2_battleship_contract.wasm new file mode 100644 index 0000000..6277b86 Binary files /dev/null and b/contracts/eosio.plonky/plonky2_battleship_contract.wasm differ diff --git a/contracts/snarktor/snarktor_receiver_contract.abi b/contracts/eosio.snarktor_goldilocks_verifier/snarktor_goldilocks_verifier_contract.abi similarity index 100% rename from contracts/snarktor/snarktor_receiver_contract.abi rename to contracts/eosio.snarktor_goldilocks_verifier/snarktor_goldilocks_verifier_contract.abi diff --git a/contracts/eosio.snarktor_goldilocks_verifier/snarktor_goldilocks_verifier_contract.wasm b/contracts/eosio.snarktor_goldilocks_verifier/snarktor_goldilocks_verifier_contract.wasm new file mode 100644 index 0000000..f5ea0ac Binary files /dev/null and b/contracts/eosio.snarktor_goldilocks_verifier/snarktor_goldilocks_verifier_contract.wasm differ diff --git a/contracts/eosio.snarktor_receiver/snarktor_receiver_contract.abi b/contracts/eosio.snarktor_receiver/snarktor_receiver_contract.abi new file mode 100644 index 0000000..6281217 --- /dev/null +++ b/contracts/eosio.snarktor_receiver/snarktor_receiver_contract.abi @@ -0,0 +1,108 @@ +{ + "version": "eosio::abi/1.1", + "types": [], + "structs": [ + { + "name": "User", + "base": "", + "fields": [ + { + "name": "user", + "type": "name" + }, + { + "name": "balance", + "type": "asset" + } + ] + }, + { + "name": "aggregator", + "base": "", + "fields": [ + { + "name": "from", + "type": "name" + }, + { + "name": "quantity", + "type": "asset" + }, + { + "name": "memo", + "type": "string" + } + ] + }, + { + "name": "transfer", + "base": "", + "fields": [ + { + "name": "from", + "type": "name" + }, + { + "name": "to", + "type": "name" + }, + { + "name": "quantity", + "type": "asset" + }, + { + "name": "_memo", + "type": "string" + } + ] + }, + { + "name": "withdraw", + "base": "", + "fields": [ + { + "name": "from", + "type": "name" + }, + { + "name": "quantity", + "type": "asset" + }, + { + "name": "memo", + "type": "string" + } + ] + } + ], + "actions": [ + { + "name": "aggregator", + "type": "aggregator", + "ricardian_contract": "" + }, + { + "name": "transfer", + "type": "transfer", + "ricardian_contract": "" + }, + { + "name": "withdraw", + "type": "withdraw", + "ricardian_contract": "" + } + ], + "tables": [ + { + "name": "users", + "type": "User", + "index_type": "i64", + "key_names": [], + "key_types": [] + } + ], + "variants": [], + "abi_extensions": [], + "error_messages": [], + "ricardian_clauses": [] +} \ No newline at end of file diff --git a/contracts/eosio.snarktor_receiver/snarktor_receiver_contract.wasm b/contracts/eosio.snarktor_receiver/snarktor_receiver_contract.wasm new file mode 100644 index 0000000..a517a08 Binary files /dev/null and b/contracts/eosio.snarktor_receiver/snarktor_receiver_contract.wasm differ diff --git a/contracts/snarktor/snarktor_receiver_contract.wasm b/contracts/snarktor/snarktor_receiver_contract.wasm deleted file mode 100644 index 3ab626b..0000000 Binary files a/contracts/snarktor/snarktor_receiver_contract.wasm and /dev/null differ diff --git a/setup_network.sh b/setup_network.sh index 17e14d0..0c02178 100644 --- a/setup_network.sh +++ b/setup_network.sh @@ -25,6 +25,10 @@ cleos create account eosio eosio.rex EOS5uHeBsURAT6bBXNtvwKtWaiDSDJSdSmc96rHVws5 cleos create account eosio eosio.saving EOS5uHeBsURAT6bBXNtvwKtWaiDSDJSdSmc96rHVws5M1qqVCkAm6 EOS5uHeBsURAT6bBXNtvwKtWaiDSDJSdSmc96rHVws5M1qqVCkAm6 cleos create account eosio eosio.stake EOS5uHeBsURAT6bBXNtvwKtWaiDSDJSdSmc96rHVws5M1qqVCkAm6 EOS5uHeBsURAT6bBXNtvwKtWaiDSDJSdSmc96rHVws5M1qqVCkAm6 cleos create account eosio eosio.snark EOS5uHeBsURAT6bBXNtvwKtWaiDSDJSdSmc96rHVws5M1qqVCkAm6 EOS5uHeBsURAT6bBXNtvwKtWaiDSDJSdSmc96rHVws5M1qqVCkAm6 +cleos create account eosio eosio.plonky EOS5uHeBsURAT6bBXNtvwKtWaiDSDJSdSmc96rHVws5M1qqVCkAm6 EOS5uHeBsURAT6bBXNtvwKtWaiDSDJSdSmc96rHVws5M1qqVCkAm6 +cleos create account eosio eosio.goldv EOS5uHeBsURAT6bBXNtvwKtWaiDSDJSdSmc96rHVws5M1qqVCkAm6 EOS5uHeBsURAT6bBXNtvwKtWaiDSDJSdSmc96rHVws5M1qqVCkAm6 +cleos create account eosio eosio.agg EOS5uHeBsURAT6bBXNtvwKtWaiDSDJSdSmc96rHVws5M1qqVCkAm6 EOS5uHeBsURAT6bBXNtvwKtWaiDSDJSdSmc96rHVws5M1qqVCkAm6 +cleos create account eosio eosio.ftoken EOS5uHeBsURAT6bBXNtvwKtWaiDSDJSdSmc96rHVws5M1qqVCkAm6 EOS5uHeBsURAT6bBXNtvwKtWaiDSDJSdSmc96rHVws5M1qqVCkAm6 curl -X POST http://127.0.0.1:8888/v1/producer/schedule_protocol_feature_activations -d '{"protocol_features_to_activate": ["0ec7e080177b2c02b278d5088611686b49d739925a92d9bfcacd7fc6b74053bd"]}' | jq @@ -57,10 +61,38 @@ cd $OG_DIR cleos push action eosio init '[0,"4,TLOS"]' -p eosio@active sleep 6 -cd contracts/snarktor +echo -e "\n\n\nBUILD: Creating Alice account (private key 5KWu5C8FDdNcoCLta3hXuyDKJcxAgaaza3MLkwRJWwEz9C2dn5u)" +cleos system newaccount eosio alice EOS77jzbmLuakAHpm2Q5ew8EL7Y7gGkfSzqJCmCNDDXWEsBP3xnDc EOS77jzbmLuakAHpm2Q5ew8EL7Y7gGkfSzqJCmCNDDXWEsBP3xnDc --stake-net "1000.0000 TLOS" --stake-cpu "1000.0000 TLOS" --buy-ram "5000.0000 TLOS" --transfer +cleos wallet import -n devnet --private-key 5KWu5C8FDdNcoCLta3hXuyDKJcxAgaaza3MLkwRJWwEz9C2dn5u + +echo -e "\n\n\nBUILD: Creating Bob account (private key 5JrTaBsS6q6Nt1GJA8r19H8CGg2eHq2oTneZ9md9AhjCEBpLHNJ)" +cleos system newaccount eosio bob EOS6M6T6yDyzjF2ockZQgW7JHx5pGojRdXUHn4qfsqApJinbQj3pd EOS6M6T6yDyzjF2ockZQgW7JHx5pGojRdXUHn4qfsqApJinbQj3pd --stake-net "1000.0000 TLOS" --stake-cpu "1000.0000 TLOS" --buy-ram "5000.0000 TLOS" --transfer +cleos wallet import -n devnet --private-key 5JrTaBsS6q6Nt1GJA8r19H8CGg2eHq2oTneZ9md9AhjCEBpLHNJ + +cd contracts/eosio.snarktor_receiver +echo -e "\n\n\nBUILD: Deploying SNARKtor receiver contract" cleos set contract eosio.snark . ./snarktor_receiver_contract.wasm ./snarktor_receiver_contract.abi cd $OG_DIR +cd contracts/eosio.snarktor_goldilocks_verifier +echo -e "\n\n\nBUILD: Deploying SNARKtor Goldilocks verifier contract" +cleos set contract eosio.goldv . ./snarktor_goldilocks_verifier_contract.wasm ./snarktor_goldilocks_verifier_contract.abi +cd $OG_DIR + +cd contracts/eosio.plonky +echo -e "\n\n\nBUILD: Deploying SNARKtor Plonky2 Battleship contract" +cleos set contract eosio.plonky . ./plonky2_battleship_contract.wasm ./plonky2_battleship_contract.abi +cd $OG_DIR + +# For more info take a look here: https://github.com/uuosio/rscdk/blob/main/examples/token/lib.rs +cd contracts/eosio.ftoken +echo -e "\n\n\nBUILD: Deploying eosio.ftoken contract" +cleos set contract eosio.ftoken . ./token.wasm ./token.abi +cd $OG_DIR + +# Give permission to snarktor-receiver-contract to make external inline action +cleos set account permission eosio.snark active --add-code + sleep 5 kill $NODEOS_PID