diff --git a/abi-tolk/schemas/grambo/grambo_factory.json b/abi-tolk/schemas/grambo/grambo_factory.json new file mode 100644 index 00000000..6fd6441c --- /dev/null +++ b/abi-tolk/schemas/grambo/grambo_factory.json @@ -0,0 +1,237 @@ +{ + "abi_schema_version": "1.0", + "contract_name": "grambo_factory", + "unique_types": [ + { + "kind": "void" + }, + { + "kind": "int" + }, + { + "kind": "slice" + }, + { + "kind": "cell" + }, + { + "kind": "builder" + }, + { + "kind": "bool" + }, + { + "kind": "coins" + }, + { + "kind": "address" + }, + { + "kind": "intN", + "n": 32 + }, + { + "kind": "uintN", + "n": 32 + }, + { + "kind": "intN", + "n": 64 + }, + { + "kind": "uintN", + "n": 64 + }, + { + "kind": "StructRef", + "struct_name": "GramboDeploy" + }, + { + "kind": "StructRef", + "struct_name": "GramboUpdateData" + }, + { + "kind": "StructRef", + "struct_name": "GramboUpdateCode" + }, + { + "kind": "StructRef", + "struct_name": "GramboLaunch" + }, + { + "kind": "AliasRef", + "alias_name": "FactoryIncomingMessage" + }, + { + "kind": "union", + "variants": [ + { + "variant_ty_idx": 12, + "prefix_num": 222467552, + "prefix_len": 32, + "is_prefix_implicit": null, + "stack_type_id": 129, + "stack_width": 4 + }, + { + "variant_ty_idx": 13, + "prefix_num": 548418009, + "prefix_len": 32, + "is_prefix_implicit": null, + "stack_type_id": 130, + "stack_width": 1 + }, + { + "variant_ty_idx": 14, + "prefix_num": 1641125569, + "prefix_len": 32, + "is_prefix_implicit": null, + "stack_type_id": 131, + "stack_width": 1 + } + ], + "stack_width": 5 + }, + { + "kind": "shapedTuple", + "items_ty_idx": [ + 16 + ] + } + ], + "struct_instantiations": [], + "alias_instantiations": [], + "declarations": [ + { + "kind": "struct", + "name": "GramboDeploy", + "ty_idx": 12, + "prefix": { + "prefix_num": 222467552, + "prefix_len": 32 + }, + "fields": [ + { + "name": "query_id", + "ty_idx": 11 + }, + { + "name": "metadata", + "ty_idx": 3 + }, + { + "name": "ton_target", + "ty_idx": 6 + }, + { + "name": "prebuy_amount", + "ty_idx": 6 + } + ] + }, + { + "kind": "struct", + "name": "GramboUpdateData", + "ty_idx": 13, + "prefix": { + "prefix_num": 548418009, + "prefix_len": 32 + }, + "fields": [ + { + "name": "new_data", + "ty_idx": 3 + } + ] + }, + { + "kind": "struct", + "name": "GramboUpdateCode", + "ty_idx": 14, + "prefix": { + "prefix_num": 1641125569, + "prefix_len": 32 + }, + "fields": [ + { + "name": "new_code", + "ty_idx": 3 + } + ] + }, + { + "kind": "alias", + "name": "FactoryIncomingMessage", + "ty_idx": 16, + "target_ty_idx": 17 + }, + { + "kind": "struct", + "name": "GramboLaunch", + "ty_idx": 15, + "prefix": { + "prefix_num": 925833955, + "prefix_len": 32 + }, + "fields": [ + { + "name": "query_id", + "ty_idx": 11 + }, + { + "name": "buyer", + "ty_idx": 7 + }, + { + "name": "virtual_ton_reserve", + "ty_idx": 6 + }, + { + "name": "ton_target", + "ty_idx": 6 + }, + { + "name": "prebuy_amount", + "ty_idx": 6 + } + ] + } + ], + "incoming_messages": [ + { + "body_ty_idx": 12 + }, + { + "body_ty_idx": 13 + }, + { + "body_ty_idx": 14 + } + ], + "incoming_external": [], + "outgoing_messages": [ + { + "body_ty_idx": 15 + } + ], + "emitted_events": [], + "storage": {}, + "get_methods": [], + "thrown_errors": [ + { + "kind": "plain_int", + "err_code": 65299 + }, + { + "kind": "plain_int", + "err_code": 65347 + }, + { + "kind": "plain_int", + "err_code": 65360 + } + ], + "compiler_name": "tolk", + "compiler_version": "1.4.1", + "code_boc64": "te6ccgEBAgEAGwABFP8A9KQT9LzyyAsBABjTMPiR8kCCAP8T8vA=" +} diff --git a/abi-tolk/schemas/grambo/grambo_factory.tolk b/abi-tolk/schemas/grambo/grambo_factory.tolk new file mode 100644 index 00000000..2ce0223f --- /dev/null +++ b/abi-tolk/schemas/grambo/grambo_factory.tolk @@ -0,0 +1,44 @@ +// Grambo Factory (Registry) Contract ABI schema + +import "@stdlib/common" + +struct (0x0d4295e0) GramboDeploy { + query_id: uint64 + metadata: cell + ton_target: coins + prebuy_amount: coins +} + +struct (0x20b031d9) GramboUpdateData { + new_data: cell +} + +struct (0x61d196c1) GramboUpdateCode { + new_code: cell +} + +type FactoryIncomingMessage = + | GramboDeploy + | GramboUpdateData + | GramboUpdateCode + +struct (0x372f1ae3) GramboLaunch { + query_id: uint64 + buyer: address + virtual_ton_reserve: coins + ton_target: coins + prebuy_amount: coins +} + +contract grambo_factory { + incomingMessages: FactoryIncomingMessage + storage: null + outgoingMessages: GramboLaunch + forceAbiExport: [FactoryIncomingMessage] +} + +fun onInternalMessage(in: InMessage) { + throw 65299; // Invalid curve parameters + throw 65347; // Unauthorized + throw 65360; // Insufficient message value +} diff --git a/abi-tolk/schemas/grambo/grambo_jetton_master.json b/abi-tolk/schemas/grambo/grambo_jetton_master.json new file mode 100644 index 00000000..2b2990f5 --- /dev/null +++ b/abi-tolk/schemas/grambo/grambo_jetton_master.json @@ -0,0 +1,921 @@ +{ + "abi_schema_version": "1.0", + "contract_name": "grambo_jetton_master", + "unique_types": [ + { + "kind": "void" + }, + { + "kind": "int" + }, + { + "kind": "slice" + }, + { + "kind": "cell" + }, + { + "kind": "builder" + }, + { + "kind": "bool" + }, + { + "kind": "coins" + }, + { + "kind": "address" + }, + { + "kind": "intN", + "n": 32 + }, + { + "kind": "uintN", + "n": 32 + }, + { + "kind": "intN", + "n": 64 + }, + { + "kind": "uintN", + "n": 64 + }, + { + "kind": "StructRef", + "struct_name": "GramboLaunch" + }, + { + "kind": "StructRef", + "struct_name": "GramboBuy" + }, + { + "kind": "nullable", + "inner_ty_idx": 3 + }, + { + "kind": "StructRef", + "struct_name": "GramboSellNotification" + }, + { + "kind": "StructRef", + "struct_name": "GramboSellParams" + }, + { + "kind": "cellOf", + "inner_ty_idx": 16 + }, + { + "kind": "nullable", + "inner_ty_idx": 17 + }, + { + "kind": "StructRef", + "struct_name": "GramboProvideWalletAddress" + }, + { + "kind": "StructRef", + "struct_name": "GramboUnlockWallet" + }, + { + "kind": "StructRef", + "struct_name": "GramboWithdraw" + }, + { + "kind": "StructRef", + "struct_name": "GramboSwapEvent" + }, + { + "kind": "StructRef", + "struct_name": "GramboTradeFees" + }, + { + "kind": "cellOf", + "inner_ty_idx": 23 + }, + { + "kind": "StructRef", + "struct_name": "GramboGraduateEvent" + }, + { + "kind": "StructRef", + "struct_name": "JettonInternalTransfer" + }, + { + "kind": "StructRef", + "struct_name": "GramboActivateWallet" + }, + { + "kind": "StructRef", + "struct_name": "GramboTakeWalletAddress" + }, + { + "kind": "StructRef", + "struct_name": "JettonExcess" + }, + { + "kind": "StructRef", + "struct_name": "GramboMasterStorage" + }, + { + "kind": "uintN", + "n": 256 + }, + { + "kind": "StructRef", + "struct_name": "GramboCurveState" + }, + { + "kind": "cellOf", + "inner_ty_idx": 32 + }, + { + "kind": "StructRef", + "struct_name": "GramboDexConfig" + }, + { + "kind": "cellOf", + "inner_ty_idx": 34 + }, + { + "kind": "AliasRef", + "alias_name": "MasterIncomingMessage" + }, + { + "kind": "union", + "variants": [ + { + "variant_ty_idx": 12, + "prefix_num": 925833955, + "prefix_len": 32, + "is_prefix_implicit": null, + "stack_type_id": 129, + "stack_width": 5 + }, + { + "variant_ty_idx": 13, + "prefix_num": 794052942, + "prefix_len": 32, + "is_prefix_implicit": null, + "stack_type_id": 130, + "stack_width": 6 + }, + { + "variant_ty_idx": 15, + "prefix_num": 838603382, + "prefix_len": 32, + "is_prefix_implicit": null, + "stack_type_id": 131, + "stack_width": 5 + }, + { + "variant_ty_idx": 19, + "prefix_num": 397738284, + "prefix_len": 32, + "is_prefix_implicit": null, + "stack_type_id": 132, + "stack_width": 3 + }, + { + "variant_ty_idx": 20, + "prefix_num": 2036744463, + "prefix_len": 32, + "is_prefix_implicit": null, + "stack_type_id": 133, + "stack_width": 2 + }, + { + "variant_ty_idx": 21, + "prefix_num": 1139297205, + "prefix_len": 32, + "is_prefix_implicit": null, + "stack_type_id": 134, + "stack_width": 2 + } + ], + "stack_width": 7 + }, + { + "kind": "AliasRef", + "alias_name": "MasterOutgoingMessage" + }, + { + "kind": "union", + "variants": [ + { + "variant_ty_idx": 26, + "prefix_num": 395134233, + "prefix_len": 32, + "is_prefix_implicit": null, + "stack_type_id": 137, + "stack_width": 6 + }, + { + "variant_ty_idx": 27, + "prefix_num": 1802884066, + "prefix_len": 32, + "is_prefix_implicit": null, + "stack_type_id": 138, + "stack_width": 1 + }, + { + "variant_ty_idx": 28, + "prefix_num": 701198948, + "prefix_len": 32, + "is_prefix_implicit": null, + "stack_type_id": 139, + "stack_width": 2 + }, + { + "variant_ty_idx": 29, + "prefix_num": 3576854235, + "prefix_len": 32, + "is_prefix_implicit": null, + "stack_type_id": 140, + "stack_width": 1 + } + ], + "stack_width": 7 + }, + { + "kind": "AliasRef", + "alias_name": "MasterExternalMessage" + }, + { + "kind": "union", + "variants": [ + { + "variant_ty_idx": 22, + "prefix_num": 1344616846, + "prefix_len": 32, + "is_prefix_implicit": null, + "stack_type_id": 135, + "stack_width": 9 + }, + { + "variant_ty_idx": 25, + "prefix_num": 179558236, + "prefix_len": 32, + "is_prefix_implicit": null, + "stack_type_id": 136, + "stack_width": 3 + } + ], + "stack_width": 10 + }, + { + "kind": "shapedTuple", + "items_ty_idx": [ + 36, + 38, + 40 + ] + }, + { + "kind": "StructRef", + "struct_name": "GetCurveStateResult" + }, + { + "kind": "StructRef", + "struct_name": "GetJettonDataResult" + } + ], + "struct_instantiations": [], + "alias_instantiations": [], + "declarations": [ + { + "kind": "struct", + "name": "GramboTradeFees", + "ty_idx": 23, + "fields": [ + { + "name": "referrer_fee", + "ty_idx": 6 + }, + { + "name": "fee_1", + "ty_idx": 6 + }, + { + "name": "fee_2", + "ty_idx": 6 + } + ] + }, + { + "kind": "struct", + "name": "GramboSellParams", + "ty_idx": 16, + "fields": [ + { + "name": "min_ton_out", + "ty_idx": 6 + }, + { + "name": "referrer", + "ty_idx": 7 + }, + { + "name": "custom_payload", + "ty_idx": 14 + } + ] + }, + { + "kind": "struct", + "name": "GramboLaunch", + "ty_idx": 12, + "prefix": { + "prefix_num": 925833955, + "prefix_len": 32 + }, + "fields": [ + { + "name": "query_id", + "ty_idx": 11 + }, + { + "name": "buyer", + "ty_idx": 7 + }, + { + "name": "virtual_ton_reserve", + "ty_idx": 6 + }, + { + "name": "ton_target", + "ty_idx": 6 + }, + { + "name": "prebuy_amount", + "ty_idx": 6 + } + ] + }, + { + "kind": "struct", + "name": "GramboBuy", + "ty_idx": 13, + "prefix": { + "prefix_num": 794052942, + "prefix_len": 32 + }, + "fields": [ + { + "name": "query_id", + "ty_idx": 11 + }, + { + "name": "ton_amount", + "ty_idx": 6 + }, + { + "name": "recipient", + "ty_idx": 7 + }, + { + "name": "min_tokens_out", + "ty_idx": 6 + }, + { + "name": "referrer", + "ty_idx": 7 + }, + { + "name": "custom_payload", + "ty_idx": 14 + } + ] + }, + { + "kind": "struct", + "name": "GramboSellNotification", + "ty_idx": 15, + "prefix": { + "prefix_num": 838603382, + "prefix_len": 32 + }, + "fields": [ + { + "name": "query_id", + "ty_idx": 11 + }, + { + "name": "amount", + "ty_idx": 6 + }, + { + "name": "from", + "ty_idx": 7 + }, + { + "name": "response_destination", + "ty_idx": 7 + }, + { + "name": "sell_params", + "ty_idx": 18 + } + ] + }, + { + "kind": "struct", + "name": "GramboProvideWalletAddress", + "ty_idx": 19, + "prefix": { + "prefix_num": 397738284, + "prefix_len": 32 + }, + "fields": [ + { + "name": "query_id", + "ty_idx": 11 + }, + { + "name": "owner", + "ty_idx": 7 + }, + { + "name": "include_address", + "ty_idx": 5 + } + ] + }, + { + "kind": "struct", + "name": "GramboUnlockWallet", + "ty_idx": 20, + "prefix": { + "prefix_num": 2036744463, + "prefix_len": 32 + }, + "fields": [ + { + "name": "query_id", + "ty_idx": 11 + }, + { + "name": "owner", + "ty_idx": 7 + } + ] + }, + { + "kind": "struct", + "name": "GramboWithdraw", + "ty_idx": 21, + "prefix": { + "prefix_num": 1139297205, + "prefix_len": 32 + }, + "fields": [ + { + "name": "query_id", + "ty_idx": 11 + }, + { + "name": "amount", + "ty_idx": 6 + } + ] + }, + { + "kind": "alias", + "name": "MasterIncomingMessage", + "ty_idx": 36, + "target_ty_idx": 37 + }, + { + "kind": "struct", + "name": "JettonInternalTransfer", + "ty_idx": 26, + "prefix": { + "prefix_num": 395134233, + "prefix_len": 32 + }, + "fields": [ + { + "name": "query_id", + "ty_idx": 11 + }, + { + "name": "amount", + "ty_idx": 6 + }, + { + "name": "from", + "ty_idx": 7 + }, + { + "name": "response_address", + "ty_idx": 7 + }, + { + "name": "forward_ton_amount", + "ty_idx": 6 + }, + { + "name": "forward_payload", + "ty_idx": 3 + } + ] + }, + { + "kind": "struct", + "name": "GramboActivateWallet", + "ty_idx": 27, + "prefix": { + "prefix_num": 1802884066, + "prefix_len": 32 + }, + "fields": [ + { + "name": "query_id", + "ty_idx": 11 + } + ] + }, + { + "kind": "struct", + "name": "GramboTakeWalletAddress", + "ty_idx": 28, + "prefix": { + "prefix_num": 701198948, + "prefix_len": 32 + }, + "fields": [ + { + "name": "query_id", + "ty_idx": 11 + }, + { + "name": "owner_address", + "ty_idx": 14 + } + ] + }, + { + "kind": "struct", + "name": "JettonExcess", + "ty_idx": 29, + "prefix": { + "prefix_num": 3576854235, + "prefix_len": 32 + }, + "fields": [ + { + "name": "query_id", + "ty_idx": 11 + } + ] + }, + { + "kind": "alias", + "name": "MasterOutgoingMessage", + "ty_idx": 38, + "target_ty_idx": 39 + }, + { + "kind": "struct", + "name": "GramboSwapEvent", + "ty_idx": 22, + "prefix": { + "prefix_num": 1344616846, + "prefix_len": 32 + }, + "fields": [ + { + "name": "query_id", + "ty_idx": 11 + }, + { + "name": "recipient", + "ty_idx": 7 + }, + { + "name": "is_buy", + "ty_idx": 5 + }, + { + "name": "new_collected_ton", + "ty_idx": 6 + }, + { + "name": "ton_amount", + "ty_idx": 6 + }, + { + "name": "token_amount", + "ty_idx": 6 + }, + { + "name": "referrer", + "ty_idx": 7 + }, + { + "name": "fees", + "ty_idx": 24 + }, + { + "name": "custom_payload", + "ty_idx": 14 + } + ] + }, + { + "kind": "struct", + "name": "GramboGraduateEvent", + "ty_idx": 25, + "prefix": { + "prefix_num": 179558236, + "prefix_len": 32 + }, + "fields": [ + { + "name": "query_id", + "ty_idx": 11 + }, + { + "name": "ton_to_dex", + "ty_idx": 6 + }, + { + "name": "tokens_to_dex", + "ty_idx": 6 + } + ] + }, + { + "kind": "alias", + "name": "MasterExternalMessage", + "ty_idx": 40, + "target_ty_idx": 41 + }, + { + "kind": "struct", + "name": "GramboCurveState", + "ty_idx": 32, + "fields": [ + { + "name": "collected_ton", + "ty_idx": 6 + }, + { + "name": "tokens_sold", + "ty_idx": 6 + }, + { + "name": "graduated", + "ty_idx": 5 + }, + { + "name": "fee_addr_1", + "ty_idx": 7 + }, + { + "name": "fee_addr_2", + "ty_idx": 7 + } + ] + }, + { + "kind": "struct", + "name": "GramboDexConfig", + "ty_idx": 34, + "fields": [ + { + "name": "stonfi_router", + "ty_idx": 7 + }, + { + "name": "pton_wallet", + "ty_idx": 7 + } + ] + }, + { + "kind": "struct", + "name": "GramboMasterStorage", + "ty_idx": 30, + "fields": [ + { + "name": "virtual_ton_reserve", + "ty_idx": 6 + }, + { + "name": "ton_target", + "ty_idx": 6 + }, + { + "name": "factory", + "ty_idx": 7 + }, + { + "name": "total_supply", + "ty_idx": 6 + }, + { + "name": "seed", + "ty_idx": 31 + }, + { + "name": "curve_state", + "ty_idx": 33 + }, + { + "name": "wallet_code", + "ty_idx": 3 + }, + { + "name": "metadata", + "ty_idx": 3 + }, + { + "name": "dex_config", + "ty_idx": 35 + } + ] + }, + { + "kind": "struct", + "name": "GetCurveStateResult", + "ty_idx": 43, + "fields": [ + { + "name": "virtual_ton_reserve", + "ty_idx": 11 + }, + { + "name": "ton_target", + "ty_idx": 11 + }, + { + "name": "collected_ton", + "ty_idx": 11 + }, + { + "name": "tokens_sold", + "ty_idx": 1 + }, + { + "name": "graduated", + "ty_idx": 5 + } + ] + }, + { + "kind": "struct", + "name": "GetJettonDataResult", + "ty_idx": 44, + "fields": [ + { + "name": "total_supply", + "ty_idx": 1 + }, + { + "name": "mintable", + "ty_idx": 1 + }, + { + "name": "admin_address", + "ty_idx": 7 + }, + { + "name": "jetton_content", + "ty_idx": 3 + }, + { + "name": "jetton_wallet_code", + "ty_idx": 3 + } + ] + } + ], + "incoming_messages": [ + { + "body_ty_idx": 12 + }, + { + "body_ty_idx": 13 + }, + { + "body_ty_idx": 15 + }, + { + "body_ty_idx": 19 + }, + { + "body_ty_idx": 20 + }, + { + "body_ty_idx": 21 + } + ], + "incoming_external": [ + { + "body_ty_idx": 22 + }, + { + "body_ty_idx": 25 + } + ], + "outgoing_messages": [ + { + "body_ty_idx": 26 + }, + { + "body_ty_idx": 27 + }, + { + "body_ty_idx": 28 + }, + { + "body_ty_idx": 29 + } + ], + "emitted_events": [], + "storage": { + "storage_ty_idx": 30 + }, + "get_methods": [ + { + "tvm_method_id": 89420, + "name": "get_amount_out", + "parameters": [ + { + "name": "ton_in", + "ty_idx": 11 + } + ], + "return_ty_idx": 1 + }, + { + "tvm_method_id": 113951, + "name": "get_ton_out", + "parameters": [ + { + "name": "tokens_in", + "ty_idx": 1 + } + ], + "return_ty_idx": 11 + }, + { + "tvm_method_id": 124044, + "name": "get_curve_state", + "parameters": [], + "return_ty_idx": 43 + }, + { + "tvm_method_id": 106029, + "name": "get_jetton_data", + "parameters": [], + "return_ty_idx": 44 + }, + { + "tvm_method_id": 103289, + "name": "get_wallet_address", + "parameters": [ + { + "name": "owner_address", + "ty_idx": 7 + } + ], + "return_ty_idx": 7 + } + ], + "thrown_errors": [ + { + "kind": "plain_int", + "err_code": 74 + }, + { + "kind": "plain_int", + "err_code": 65296 + }, + { + "kind": "plain_int", + "err_code": 65344 + }, + { + "kind": "plain_int", + "err_code": 65347 + }, + { + "kind": "plain_int", + "err_code": 65360 + }, + { + "kind": "plain_int", + "err_code": 65397 + }, + { + "kind": "plain_int", + "err_code": 65398 + } + ], + "compiler_name": "tolk", + "compiler_version": "1.4.1", + "code_boc64": "te6ccgEBDQEApAABFP8A9KQT9LzyyAsBAgFiAgMAEtAw+JHyQPLASgIBIAQFAAm+6mGDhAIBIAYHAgEgCAkAD7pIxwVHAAcIAgFYCgsACbej5g4QAE+tvJhGhDACxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id/pAAlWvFrgQRoQwAsROplLUCShZxn2kTkyjrdZWWw4ol9ZAosUb+zcNiHf6RERADAwAAA==" +} diff --git a/abi-tolk/schemas/grambo/grambo_jetton_master.tolk b/abi-tolk/schemas/grambo/grambo_jetton_master.tolk new file mode 100644 index 00000000..c401cc1a --- /dev/null +++ b/abi-tolk/schemas/grambo/grambo_jetton_master.tolk @@ -0,0 +1,205 @@ +// Grambo Jetton Master (Bonding Curve) Contract ABI schema + +import "@stdlib/common" + +struct GramboTradeFees { + referrer_fee: coins + fee_1: coins + fee_2: coins +} + +struct GramboSellParams { + min_ton_out: coins + referrer: address + custom_payload: cell? +} + +struct (0x372f1ae3) GramboLaunch { + query_id: uint64 + buyer: address + virtual_ton_reserve: coins + ton_target: coins + prebuy_amount: coins +} + +struct (0x2f54494e) GramboBuy { + query_id: uint64 + ton_amount: coins + recipient: address + min_tokens_out: coins + referrer: address + custom_payload: cell? +} + +struct (0x31fc1276) GramboSellNotification { + query_id: uint64 + amount: coins + from: address + response_destination: address + sell_params: Cell? +} + +struct (0x17b5012c) GramboProvideWalletAddress { + query_id: uint64 + owner: address + include_address: bool +} + +struct (0x7966410f) GramboUnlockWallet { + query_id: uint64 + owner: address +} + +struct (0x43e84bb5) GramboWithdraw { + query_id: uint64 + amount: coins +} + +type MasterIncomingMessage = + | GramboLaunch + | GramboBuy + | GramboSellNotification + | GramboProvideWalletAddress + | GramboUnlockWallet + | GramboWithdraw + +struct (0x178d4519) JettonInternalTransfer { + query_id: uint64 + amount: coins + from: address + response_address: address + forward_ton_amount: coins + forward_payload: cell +} + +struct (0x6b75d3e2) GramboActivateWallet { + query_id: uint64 +} + +struct (0x29cb7264) GramboTakeWalletAddress { + query_id: uint64 + owner_address: cell? +} + +struct (0xd53276db) JettonExcess { + query_id: uint64 +} + +type MasterOutgoingMessage = + | JettonInternalTransfer + | GramboActivateWallet + | GramboTakeWalletAddress + | JettonExcess + +struct (0x5025398e) GramboSwapEvent { + query_id: uint64 + recipient: address + is_buy: bool + new_collected_ton: coins + ton_amount: coins + token_amount: coins + referrer: address + fees: Cell + custom_payload: cell? +} + +struct (0x0ab3d75c) GramboGraduateEvent { + query_id: uint64 + ton_to_dex: coins + tokens_to_dex: coins +} + +type MasterExternalMessage = + | GramboSwapEvent + | GramboGraduateEvent + +struct GramboCurveState { + collected_ton: coins + tokens_sold: coins + graduated: bool + fee_addr_1: address + fee_addr_2: address +} + +struct GramboDexConfig { + stonfi_router: address + pton_wallet: address +} + +struct GramboMasterStorage { + virtual_ton_reserve: coins + ton_target: coins + factory: address + total_supply: coins + seed: uint256 + curve_state: Cell + wallet_code: cell + metadata: cell + dex_config: Cell +} + +contract grambo_jetton_master { + incomingMessages: MasterIncomingMessage + outgoingMessages: MasterOutgoingMessage + incomingExternal: MasterExternalMessage + storage: GramboMasterStorage + forceAbiExport: [MasterIncomingMessage, MasterOutgoingMessage, MasterExternalMessage] +} + +fun onInternalMessage(in: InMessage) { + throw 74; // Unauthorized + throw 65296; // Already launched + throw 65344; // Slippage error + throw 65347; // Unauthorized + throw 65360; // Insufficient value or balance + throw 65397; // Not graduated + throw 65398; // Already graduated +} + +get fun get_amount_out(ton_in: uint64): int { + return 0; +} + +get fun get_ton_out(tokens_in: int): uint64 { + return 0; +} + +struct GetCurveStateResult { + virtual_ton_reserve: uint64 + ton_target: uint64 + collected_ton: uint64 + tokens_sold: int + graduated: bool +} + +get fun get_curve_state(): GetCurveStateResult { + return GetCurveStateResult { + virtual_ton_reserve: 0, + ton_target: 0, + collected_ton: 0, + tokens_sold: 0, + graduated: false, + }; +} + +struct GetJettonDataResult { + total_supply: int + mintable: int + admin_address: address + jetton_content: cell + jetton_wallet_code: cell +} + +get fun get_jetton_data(): GetJettonDataResult { + return GetJettonDataResult { + total_supply: 0, + mintable: 0, + admin_address: address("EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs"), + jetton_content: beginCell().endCell(), + jetton_wallet_code: beginCell().endCell(), + }; +} + +get fun get_wallet_address(owner_address: address): address { + return address("EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs"); +} diff --git a/abi-tolk/schemas/grambo/grambo_jetton_wallet.json b/abi-tolk/schemas/grambo/grambo_jetton_wallet.json new file mode 100644 index 00000000..bc4d0db8 --- /dev/null +++ b/abi-tolk/schemas/grambo/grambo_jetton_wallet.json @@ -0,0 +1,247 @@ +{ + "abi_schema_version": "1.0", + "contract_name": "grambo_jetton_wallet", + "unique_types": [ + { + "kind": "void" + }, + { + "kind": "int" + }, + { + "kind": "slice" + }, + { + "kind": "cell" + }, + { + "kind": "builder" + }, + { + "kind": "bool" + }, + { + "kind": "coins" + }, + { + "kind": "address" + }, + { + "kind": "intN", + "n": 32 + }, + { + "kind": "uintN", + "n": 32 + }, + { + "kind": "intN", + "n": 64 + }, + { + "kind": "uintN", + "n": 64 + }, + { + "kind": "AliasRef", + "alias_name": "WalletIncomingMessage" + }, + { + "kind": "StructRef", + "struct_name": "GramboActivateWallet" + }, + { + "kind": "StructRef", + "struct_name": "GramboSellNotification" + }, + { + "kind": "StructRef", + "struct_name": "GramboSellParams" + }, + { + "kind": "nullable", + "inner_ty_idx": 3 + }, + { + "kind": "cellOf", + "inner_ty_idx": 15 + }, + { + "kind": "nullable", + "inner_ty_idx": 17 + }, + { + "kind": "StructRef", + "struct_name": "GramboWalletStorage" + }, + { + "kind": "shapedTuple", + "items_ty_idx": [ + 12 + ] + }, + { + "kind": "StructRef", + "struct_name": "GetWalletDataResult" + } + ], + "struct_instantiations": [], + "alias_instantiations": [], + "declarations": [ + { + "kind": "struct", + "name": "GramboSellParams", + "ty_idx": 15, + "fields": [ + { + "name": "min_ton_out", + "ty_idx": 6 + }, + { + "name": "referrer", + "ty_idx": 7 + }, + { + "name": "custom_payload", + "ty_idx": 16 + } + ] + }, + { + "kind": "struct", + "name": "GramboSellNotification", + "ty_idx": 14, + "prefix": { + "prefix_num": 838603382, + "prefix_len": 32 + }, + "fields": [ + { + "name": "query_id", + "ty_idx": 11 + }, + { + "name": "amount", + "ty_idx": 6 + }, + { + "name": "from", + "ty_idx": 7 + }, + { + "name": "response_destination", + "ty_idx": 7 + }, + { + "name": "sell_params", + "ty_idx": 18 + } + ] + }, + { + "kind": "struct", + "name": "GramboActivateWallet", + "ty_idx": 13, + "prefix": { + "prefix_num": 1802884066, + "prefix_len": 32 + }, + "fields": [ + { + "name": "query_id", + "ty_idx": 11 + } + ] + }, + { + "kind": "alias", + "name": "WalletIncomingMessage", + "ty_idx": 12, + "target_ty_idx": 13 + }, + { + "kind": "struct", + "name": "GramboWalletStorage", + "ty_idx": 19, + "fields": [ + { + "name": "activated", + "ty_idx": 5 + }, + { + "name": "balance", + "ty_idx": 6 + }, + { + "name": "owner", + "ty_idx": 7 + }, + { + "name": "master", + "ty_idx": 7 + } + ] + }, + { + "kind": "struct", + "name": "GetWalletDataResult", + "ty_idx": 21, + "fields": [ + { + "name": "balance", + "ty_idx": 1 + }, + { + "name": "owner_address", + "ty_idx": 7 + }, + { + "name": "jetton_master_address", + "ty_idx": 7 + }, + { + "name": "jetton_wallet_code", + "ty_idx": 3 + } + ] + } + ], + "incoming_messages": [ + { + "body_ty_idx": 12 + } + ], + "incoming_external": [], + "outgoing_messages": [ + { + "body_ty_idx": 14 + } + ], + "emitted_events": [], + "storage": { + "storage_ty_idx": 19 + }, + "get_methods": [ + { + "tvm_method_id": 112384, + "name": "get_wallet_status", + "parameters": [], + "return_ty_idx": 5 + }, + { + "tvm_method_id": 97026, + "name": "get_wallet_data", + "parameters": [], + "return_ty_idx": 21 + } + ], + "thrown_errors": [ + { + "kind": "plain_int", + "err_code": 65397 + } + ], + "compiler_name": "tolk", + "compiler_version": "1.4.1", + "code_boc64": "te6ccgEBBwEAfQABFP8A9KQT9LzyyAsBAgFiAgMAGNAw+JHyQIIA/3Xy8AIBIAQFAZm/2BOEaEMALETqZS1AkoWcZ9pE5Mo63WVlsOKJfWQKLFG/s3DYh3+kaEMALETqZS1AkoWcZ9pE5Mo63WVlsOKJfWQKLFG/s3DYh3+kRAYAB724A4QAAA==" +} diff --git a/abi-tolk/schemas/grambo/grambo_jetton_wallet.tolk b/abi-tolk/schemas/grambo/grambo_jetton_wallet.tolk new file mode 100644 index 00000000..7f050bb1 --- /dev/null +++ b/abi-tolk/schemas/grambo/grambo_jetton_wallet.tolk @@ -0,0 +1,62 @@ +// Grambo Jetton Wallet Contract ABI schema + +import "@stdlib/common" + +struct GramboSellParams { + min_ton_out: coins + referrer: address + custom_payload: cell? +} + +struct (0x31fc1276) GramboSellNotification { + query_id: uint64 + amount: coins + from: address + response_destination: address + sell_params: Cell? +} + +struct (0x6b75d3e2) GramboActivateWallet { + query_id: uint64 +} + +type WalletIncomingMessage = + | GramboActivateWallet + +struct GramboWalletStorage { + activated: bool + balance: coins + owner: address + master: address +} + +contract grambo_jetton_wallet { + incomingMessages: WalletIncomingMessage + outgoingMessages: GramboSellNotification + storage: GramboWalletStorage + forceAbiExport: [WalletIncomingMessage] +} + +fun onInternalMessage(in: InMessage) { + throw 65397; // Wallet not activated +} + +get fun get_wallet_status(): bool { + return false; +} + +struct GetWalletDataResult { + balance: int + owner_address: address + jetton_master_address: address + jetton_wallet_code: cell +} + +get fun get_wallet_data(): GetWalletDataResult { + return GetWalletDataResult { + balance: 0, + owner_address: address("EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs"), + jetton_master_address: address("EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs"), + jetton_wallet_code: beginCell().endCell(), + }; +} diff --git a/abi/schemas/grambo.xml b/abi/schemas/grambo.xml new file mode 100644 index 00000000..4f186607 --- /dev/null +++ b/abi/schemas/grambo.xml @@ -0,0 +1,232 @@ + + + trade_fees#_ + referrer_fee:(VarUInteger 16) + fee_1:(VarUInteger 16) + fee_2:(VarUInteger 16) + = GramboTradeFees; + + sell_params#_ min_ton_out:(VarUInteger 16) + referrer:MsgAddress + custom_payload:(Maybe ^Cell) = GramboSellParams; + + _#_ collected_ton:(VarUInteger 16) + tokens_sold:(VarUInteger 16) + graduated:bool + fee_addr_1:MsgAddress + fee_addr_2:MsgAddress = GramboCurveState; + + _#_ stonfi_router:MsgAddress + pton_wallet:MsgAddress = GramboDexConfig; + + _#_ virtual_ton_reserve:(VarUInteger 16) + ton_target:(VarUInteger 16) + factory:MsgAddress + total_supply:(VarUInteger 16) + seed:uint256 + curve_state:^GramboCurveState + wallet_code:^Cell + metadata:^Cell + dex_config:^GramboDexConfig = GramboMasterStorage; + + _#_ activated:bool + balance:(VarUInteger 16) + owner:MsgAddress + master:MsgAddress = GramboWalletStorage; + + + + + + + + + + + + Invalid curve parameters + Unauthorized + Insufficient message value + + + + + + + + + + + + + + + + + + + + + + + Unauthorized + Already launched + Slippage error + Unauthorized + Insufficient value or balance + Not graduated + Already graduated + + + + + + + + + + + Wallet not activated + + + + + uint64 + + + int257 + + + + + + int257 + + + uint64 + + + + + + uint64 + uint64 + uint64 + int257 + bool + + + + + + bool + + + + + deploy#0d4295e0 + query_id:uint64 + metadata:^Cell + ton_target:(VarUInteger 16) + prebuy_amount:(VarUInteger 16) + = InternalMsgBody; + + + + update_data#20b031d9 + new_data:^Cell = InternalMsgBody; + + + + update_code#61d196c1 + new_code:^Cell = InternalMsgBody; + + + + launch#372f1ae3 + query_id:uint64 + buyer:MsgAddress + virtual_ton_reserve:(VarUInteger 16) + ton_target:(VarUInteger 16) + prebuy_amount:(VarUInteger 16) + = InternalMsgBody; + + + + buy#2f54494e + query_id:uint64 + ton_amount:(VarUInteger 16) + recipient:MsgAddress + min_tokens_out:(VarUInteger 16) + referrer:MsgAddress + custom_payload:(Maybe ^Cell) + = InternalMsgBody; + + + + sell_notification#31fc1276 + query_id:uint64 + amount:(VarUInteger 16) + from:MsgAddress + response_destination:MsgAddress + sell_params:(Maybe ^GramboSellParams) + = InternalMsgBody; + + + + provide_wallet_address#17b5012c + query_id:uint64 + owner:MsgAddress + include_address:bool + = InternalMsgBody; + + + + take_wallet_address#29cb7264 + query_id:uint64 + owner_address:(Maybe ^Cell) + = InternalMsgBody; + + + + unlock_wallet#7966410f + query_id:uint64 + owner:MsgAddress + = InternalMsgBody; + + + + withdraw#43e84bb5 + query_id:uint64 + amount:(VarUInteger 16) + = InternalMsgBody; + + + + activate_wallet#6b75d3e2 + query_id:uint64 + = InternalMsgBody; + + + + swap_event#5025398e + query_id:uint64 + recipient:MsgAddress + is_buy:Bool + new_collected_ton:(VarUInteger 16) + ton_amount:(VarUInteger 16) + token_amount:(VarUInteger 16) + referrer:MsgAddress + fees:^GramboTradeFees + custom_payload:(Maybe ^Cell) + = ExtOutMsgBody; + + + + graduate_event#0ab3d75c + query_id:uint64 + ton_to_dex:(VarUInteger 16) + tokens_to_dex:(VarUInteger 16) + = ExtOutMsgBody; + +