From c801467865c521981e9c28f90b750d424cb75bff Mon Sep 17 00:00:00 2001 From: WaDadidou Date: Tue, 15 Oct 2024 12:53:10 -0400 Subject: [PATCH 1/5] chore: restore rust TS scripts --- rust/cw-contracts/nft-launchpad/deploy.ts | 51 ++++++++++---------- rust/cw-contracts/nft-tr721/deploy.ts | 21 ++++----- rust/scripts/submit-collection.ts | 16 ------- rust/scripts/utils.ts | 57 ----------------------- rust/utils/mnemonic.ts | 1 + rust/utils/scripts.ts | 56 ++++++++++++++++++++++ 6 files changed, 90 insertions(+), 112 deletions(-) delete mode 100644 rust/scripts/submit-collection.ts delete mode 100644 rust/scripts/utils.ts create mode 100644 rust/utils/mnemonic.ts create mode 100644 rust/utils/scripts.ts diff --git a/rust/cw-contracts/nft-launchpad/deploy.ts b/rust/cw-contracts/nft-launchpad/deploy.ts index 6b4ca97cd..e5f469e3d 100644 --- a/rust/cw-contracts/nft-launchpad/deploy.ts +++ b/rust/cw-contracts/nft-launchpad/deploy.ts @@ -1,28 +1,25 @@ -// ERROR: import is restricted from being used by a pattern. Scripts imports are only allowed in scripts no-restricted-imports -// =====> So I comment this file +import { deploy, instantiate } from "../../utils/scripts"; -// import { deploy, instantiate } from "../../scripts/utils"; -// -// const WASM_FILE = "nft_launchpad-aarch64.wasm"; -// const DEPLOYER = "tori1zsgm6hvx4a3t08vsanwdcvvnv2xca9faavzccm"; -// -// const main = async () => { -// const codeId = await deploy(WASM_FILE); -// const initMsg = { -// config: { -// name: "Teritori launchpad", -// supported_networks: [], -// nft_code_id: 1, -// deployer: DEPLOYER, -// }, -// }; -// const contractAddress = await instantiate( -// codeId, -// "Teritori Launchpad", -// initMsg, -// ); -// -// console.log("CodeId:", codeId, "- Contract Address:", contractAddress); -// }; -// -// main(); +const WASM_FILE = "nft_launchpad-aarch64.wasm"; +const DEPLOYER = "tori1zsgm6hvx4a3t08vsanwdcvvnv2xca9faavzccm"; + +const main = async () => { + const codeId = await deploy(WASM_FILE); + const initMsg = { + config: { + name: "Teritori launchpad", + supported_networks: [], + nft_code_id: 1, + deployer: DEPLOYER, + }, + }; + const contractAddress = await instantiate( + codeId, + "Teritori Launchpad", + initMsg, + ); + + console.log("CodeId:", codeId, "- Contract Address:", contractAddress); +}; + +main(); diff --git a/rust/cw-contracts/nft-tr721/deploy.ts b/rust/cw-contracts/nft-tr721/deploy.ts index c35f6b200..5c47e40ae 100644 --- a/rust/cw-contracts/nft-tr721/deploy.ts +++ b/rust/cw-contracts/nft-tr721/deploy.ts @@ -1,13 +1,10 @@ -// ERROR: import is restricted from being used by a pattern. Scripts imports are only allowed in scripts no-restricted-imports -// =====> So I comment this file +import { deploy } from "../../utils/scripts"; -// import { deploy } from "../../scripts/utils"; -// -// const WASM_FILE = "nft_tr721-aarch64.wasm"; -// -// const main = async () => { -// const codeId = await deploy(WASM_FILE); -// console.log("CodeId:", codeId); -// }; -// -// main(); +const WASM_FILE = "nft_tr721-aarch64.wasm"; + +const main = async () => { + const codeId = await deploy(WASM_FILE); + console.log("CodeId:", codeId); +}; + +main(); diff --git a/rust/scripts/submit-collection.ts b/rust/scripts/submit-collection.ts deleted file mode 100644 index e223611dc..000000000 --- a/rust/scripts/submit-collection.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { getClientInfos } from "./utils"; - -// import { getLaunchpadClient } from "@/utils/backend"; - -const main = async () => { - // const networkId = "teritori-testnet"; - const { - // wallet, - client, - sender, - } = await getClientInfos(); - - console.log({ client, sender }); -}; - -main(); diff --git a/rust/scripts/utils.ts b/rust/scripts/utils.ts deleted file mode 100644 index 4931399b4..000000000 --- a/rust/scripts/utils.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { SigningCosmWasmClient } from "@cosmjs/cosmwasm-stargate"; -import { DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; -import { GasPrice } from "@cosmjs/stargate"; - -// import { MNEMONIC } from "./mnemonic"; - -const GAS_PRICE = GasPrice.fromString("0.025utori"); - -const NODE_RPC = "https://rpc.testnet.teritori.com:443"; -// const CHAIN_ID = "teritori-test-7"; - -export const getClientInfos = async () => { - const wallet = await DirectSecp256k1HdWallet.fromMnemonic( - "???", - // MNEMONIC - { - prefix: "tori", - }, - ); - - const client = await SigningCosmWasmClient.connectWithSigner( - NODE_RPC, - wallet, - { gasPrice: GAS_PRICE }, - ); - - const sender = await wallet.getAccounts().then((res) => res[0]?.address); - - console.log("Sender:", sender); - - return { wallet, client, sender }; -}; - -// const getWasmFile = (wasmFile: string) => { -// const filePath = path.join(__dirname, "../..", "artifacts", wasmFile); -// console.log("filePath:", filePath); -// return fs.readFileSync(filePath); -// }; - -// const deploy = async (wasmFile: string) => { -// const { client, sender } = await getClientInfos(); -// const uploadRes = await client.upload(sender, getWasmFile(wasmFile), "auto"); -// -// return uploadRes.codeId; -// }; -// const instantiate = async (codeId: number, label: string, msg: any) => { -// const { client, sender } = await getClientInfos(); -// -// const instantiateRes = await client.instantiate( -// sender, -// codeId, -// msg, -// `${label} - ${codeId}`, -// "auto", -// ); -// return instantiateRes.contractAddress; -// }; diff --git a/rust/utils/mnemonic.ts b/rust/utils/mnemonic.ts new file mode 100644 index 000000000..4dd7881ee --- /dev/null +++ b/rust/utils/mnemonic.ts @@ -0,0 +1 @@ +export const MNEMONIC = "MNEMONIC"; diff --git a/rust/utils/scripts.ts b/rust/utils/scripts.ts new file mode 100644 index 000000000..be5a2ad64 --- /dev/null +++ b/rust/utils/scripts.ts @@ -0,0 +1,56 @@ +import { SigningCosmWasmClient } from "@cosmjs/cosmwasm-stargate"; +import { DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; +import { GasPrice } from "@cosmjs/stargate"; +import * as fs from "fs"; +import path from "path"; + +import { MNEMONIC } from "./mnemonic"; + +const GAS_PRICE = GasPrice.fromString("0.025utori"); + +const NODE_RPC = "https://rpc.testnet.teritori.com:443"; +// const CHAIN_ID = "teritori-test-7"; + +export const getClientInfos = async () => { + const wallet = await DirectSecp256k1HdWallet.fromMnemonic(MNEMONIC, { + prefix: "tori", + }); + + const client = await SigningCosmWasmClient.connectWithSigner( + NODE_RPC, + wallet, + { gasPrice: GAS_PRICE }, + ); + + const sender = await wallet.getAccounts().then((res) => res[0]?.address); + console.log("Sender:", sender); + + return { wallet, client, sender }; +}; + +const getWasmFile = (wasmFile: string) => { + const filePath = path.join(__dirname, "../..", "artifacts", wasmFile); + console.log("filePath:", filePath); + return fs.readFileSync(filePath); +}; + +export const deploy = async (wasmFile: string) => { + const { client, sender } = await getClientInfos(); + const wasmCode = new Uint8Array(getWasmFile(wasmFile)); + const uploadRes = await client.upload(sender, wasmCode, "auto"); + + return uploadRes.codeId; +}; + +export const instantiate = async (codeId: number, label: string, msg: any) => { + const { client, sender } = await getClientInfos(); + + const instantiateRes = await client.instantiate( + sender, + codeId, + msg, + `${label} - ${codeId}`, + "auto", + ); + return instantiateRes.contractAddress; +}; From ab5d594b8efc0670ca231ab61a48f74872f31f5b Mon Sep 17 00:00:00 2001 From: WaDadidou Date: Tue, 15 Oct 2024 21:28:42 +0200 Subject: [PATCH 2/5] chore: remove comments from launchapd.proto, make generate --- api/launchpad/v1/launchpad.proto | 129 ------------------ go/pkg/launchpadpb/launchpad_grpc.pb.go | 2 - packages/api/launchpad/v1/launchpad.ts | 17 --- .../nft-tr721/NftTr721.types.ts | 2 + rust/apipb/src/launchpad.v1.rs | 22 --- .../nft-tr721/schema/nft-tr721.json | 32 +++++ .../schema/raw/response_to_all_nft_info.json | 16 +++ .../schema/raw/response_to_nft_info.json | 16 +++ 8 files changed, 66 insertions(+), 170 deletions(-) diff --git a/api/launchpad/v1/launchpad.proto b/api/launchpad/v1/launchpad.proto index 868a83de3..4f4be95d8 100644 --- a/api/launchpad/v1/launchpad.proto +++ b/api/launchpad/v1/launchpad.proto @@ -7,7 +7,6 @@ service LaunchpadService { rpc UploadMetadatas(UploadMetadatasRequest) returns (UploadMetadatasResponse); rpc CalculateCollectionMerkleRoot(CalculateCollectionMerkleRootRequest) returns (CalculateCollectionMerkleRootResponse); rpc TokenMetadata(TokenMetadataRequest) returns (TokenMetadataResponse); - // rpc CollectionsByCreator(CollectionsByCreatorRequest) returns (CollectionsByCreatorResponse); rpc LaunchpadProjectsByCreator(LaunchpadProjectsByCreatorRequest) returns (LaunchpadProjectsByCreatorResponse); rpc LaunchpadProjects(LaunchpadProjectsRequest) returns (LaunchpadProjectsResponse); rpc LaunchpadProjectById(LaunchpadProjectByIdRequest) returns (LaunchpadProjectByIdResponse); @@ -35,20 +34,6 @@ enum Status { // ------------------------------- -// message CollectionsByCreatorRequest { -// string creator_id = 1; -// string network_id = 2; -// int32 limit = 3; -// int32 offset = 4; -// Sort sort = 5; -// SortDirection sort_direction = 6; -// optional Status status = 7; -// } - -// message CollectionsByCreatorResponse { -// repeated string collections = 1; -// } - message LaunchpadProjectsByCreatorRequest { string creator_id = 1; string network_id = 2; @@ -57,8 +42,6 @@ message LaunchpadProjectsByCreatorRequest { Sort sort = 5; SortDirection sort_direction = 6; optional Status status = 7; - // TODO: user authentication (Member of the admin DAO) using a token - // string user_address = 8; } message LaunchpadProjectsByCreatorResponse { @@ -72,8 +55,6 @@ message LaunchpadProjectsRequest { Sort sort = 4; SortDirection sort_direction = 5; optional Status status = 6; - // TODO: user authentication (Member of the admin DAO) using a token - // string user_address = 7; } message LaunchpadProjectsResponse { @@ -83,8 +64,6 @@ message LaunchpadProjectsResponse { message LaunchpadProjectByIdRequest { string network_id = 1; string project_id = 2; - // TODO: user authentication (Member of the admin DAO) using a token - // string user_address = 3; } message LaunchpadProjectByIdResponse { @@ -128,8 +107,6 @@ message TokenMetadataResponse { message LaunchpadProjectsCountRequest { string network_id = 1; optional Status status = 2; - // TODO: user authentication (Member of the admin DAO) using a token - // string user_address = 3; } message LaunchpadProjectsCountResponse { @@ -167,110 +144,4 @@ message Trait { string value = 3; } -// message UpdateCollectionWhitelistsRequest { -// string sender = 1; -// string network_id = 2; -// uint32 project_id = 3; -// repeated WhitelistMintInfo whitelist_mint_infos = 4; -// } - -// message UpdateCollectionWhitelistsResponse { -// repeated string merkle_roots = 1; -// } - -// message WhitelistedAddressMerkleInfoRequest { -// string sender = 1; -// string network_id = 2; -// uint32 project_id = 3; -// uint32 whitelist_id = 4; -// string address = 5; -// } - -// message WhitelistedAddressMerkleInfoResponse { -// string merkle_root = 1; -// repeated string merkle_proof = 2; -// } - -// message ProjectInfo { -// // Collection info ---------------------------- -// string name = 1; -// string desc = 2; -// string symbol = 3; -// string cover_img_uri = 4; -// string target_network = 5; -// string external_link = 6; - -// // Collection details ---------------------------- -// string website_link = 7; - -// string twitter_profile = 8; -// uint64 twitter_followers_count = 9; - -// string contact_discord_name = 10; -// string contact_email = 11; - -// bool is_project_derivative = 12; - -// string project_type = 13; -// string project_desc = 14; - -// bool is_applied_previously = 15; - -// // Team info -------------------------------------- -// string team_desc = 16; -// string team_link = 17; - -// string partners = 18; - -// string investment_desc = 19; -// string investment_link = 20; - -// string whitepaper_link = 21; -// string roadmap_link = 22; - -// // Additional info ---------------------------- -// string artwork_desc = 23; - -// bool is_ready_for_mint = 24; - -// uint32 expected_supply = 25; -// uint64 expected_public_mint_price = 26; -// uint64 expected_mint_date = 27; - -// uint64 escrow_mint_proceeds_period = 28; -// bool is_dox = 29; - -// uint32 dao_whitelist_count = 30; - -// // Minting details ---------------------------- -// uint32 tokens_count = 31; -// uint64 unit_price = 32; -// uint32 limit_per_address = 33; -// uint64 start_time = 34; - -// // Whitelist minting -------------------------- -// // repeated WhitelistMinting whitelist_mintings = 35; - -// // Royalty -------------------------- -// string royalty_address = 35; -// uint32 royalty_percentage = 36; - -// // Extend info -------------------------- -// string base_token_uri = 37; -// string merkle_root = 38; -// string deployed_address = 39; -// } - -// message WhitelistMintInfo { -// repeated string addresses = 1; -// uint64 unit_price = 2; -// string denom = 3; -// uint32 limit_per_address = 4; -// uint32 addresses_count = 5; -// uint64 start_time = 6; -// uint64 end_time = 7; -// } - - - diff --git a/go/pkg/launchpadpb/launchpad_grpc.pb.go b/go/pkg/launchpadpb/launchpad_grpc.pb.go index 3338ebdc0..71fdc99ff 100644 --- a/go/pkg/launchpadpb/launchpad_grpc.pb.go +++ b/go/pkg/launchpadpb/launchpad_grpc.pb.go @@ -25,7 +25,6 @@ type LaunchpadServiceClient interface { UploadMetadatas(ctx context.Context, in *UploadMetadatasRequest, opts ...grpc.CallOption) (*UploadMetadatasResponse, error) CalculateCollectionMerkleRoot(ctx context.Context, in *CalculateCollectionMerkleRootRequest, opts ...grpc.CallOption) (*CalculateCollectionMerkleRootResponse, error) TokenMetadata(ctx context.Context, in *TokenMetadataRequest, opts ...grpc.CallOption) (*TokenMetadataResponse, error) - // rpc CollectionsByCreator(CollectionsByCreatorRequest) returns (CollectionsByCreatorResponse); LaunchpadProjectsByCreator(ctx context.Context, in *LaunchpadProjectsByCreatorRequest, opts ...grpc.CallOption) (*LaunchpadProjectsByCreatorResponse, error) LaunchpadProjects(ctx context.Context, in *LaunchpadProjectsRequest, opts ...grpc.CallOption) (*LaunchpadProjectsResponse, error) LaunchpadProjectById(ctx context.Context, in *LaunchpadProjectByIdRequest, opts ...grpc.CallOption) (*LaunchpadProjectByIdResponse, error) @@ -110,7 +109,6 @@ type LaunchpadServiceServer interface { UploadMetadatas(context.Context, *UploadMetadatasRequest) (*UploadMetadatasResponse, error) CalculateCollectionMerkleRoot(context.Context, *CalculateCollectionMerkleRootRequest) (*CalculateCollectionMerkleRootResponse, error) TokenMetadata(context.Context, *TokenMetadataRequest) (*TokenMetadataResponse, error) - // rpc CollectionsByCreator(CollectionsByCreatorRequest) returns (CollectionsByCreatorResponse); LaunchpadProjectsByCreator(context.Context, *LaunchpadProjectsByCreatorRequest) (*LaunchpadProjectsByCreatorResponse, error) LaunchpadProjects(context.Context, *LaunchpadProjectsRequest) (*LaunchpadProjectsResponse, error) LaunchpadProjectById(context.Context, *LaunchpadProjectByIdRequest) (*LaunchpadProjectByIdResponse, error) diff --git a/packages/api/launchpad/v1/launchpad.ts b/packages/api/launchpad/v1/launchpad.ts index bca09d8ea..b11d70279 100644 --- a/packages/api/launchpad/v1/launchpad.ts +++ b/packages/api/launchpad/v1/launchpad.ts @@ -136,10 +136,6 @@ export interface LaunchpadProjectsByCreatorRequest { offset: number; sort: Sort; sortDirection: SortDirection; - /** - * TODO: user authentication (Member of the admin DAO) using a token - * string user_address = 8; - */ status?: Status | undefined; } @@ -153,10 +149,6 @@ export interface LaunchpadProjectsRequest { offset: number; sort: Sort; sortDirection: SortDirection; - /** - * TODO: user authentication (Member of the admin DAO) using a token - * string user_address = 7; - */ status?: Status | undefined; } @@ -166,10 +158,6 @@ export interface LaunchpadProjectsResponse { export interface LaunchpadProjectByIdRequest { networkId: string; - /** - * TODO: user authentication (Member of the admin DAO) using a token - * string user_address = 3; - */ projectId: string; } @@ -213,10 +201,6 @@ export interface TokenMetadataResponse { export interface LaunchpadProjectsCountRequest { networkId: string; - /** - * TODO: user authentication (Member of the admin DAO) using a token - * string user_address = 3; - */ status?: Status | undefined; } @@ -1915,7 +1899,6 @@ export interface LaunchpadService { metadata?: grpc.Metadata, ): Promise; TokenMetadata(request: DeepPartial, metadata?: grpc.Metadata): Promise; - /** rpc CollectionsByCreator(CollectionsByCreatorRequest) returns (CollectionsByCreatorResponse); */ LaunchpadProjectsByCreator( request: DeepPartial, metadata?: grpc.Metadata, diff --git a/packages/contracts-clients/nft-tr721/NftTr721.types.ts b/packages/contracts-clients/nft-tr721/NftTr721.types.ts index 4e004c4d5..4281fc76b 100644 --- a/packages/contracts-clients/nft-tr721/NftTr721.types.ts +++ b/packages/contracts-clients/nft-tr721/NftTr721.types.ts @@ -129,6 +129,8 @@ export interface Metadata { image?: string | null; image_data?: string | null; name?: string | null; + royalty_payment_address?: string | null; + royalty_percentage?: number | null; youtube_url?: string | null; } export interface Trait { diff --git a/rust/apipb/src/launchpad.v1.rs b/rust/apipb/src/launchpad.v1.rs index a7ff9d8cd..bce910d3e 100644 --- a/rust/apipb/src/launchpad.v1.rs +++ b/rust/apipb/src/launchpad.v1.rs @@ -1,20 +1,6 @@ // @generated // ------------------------------- -// message CollectionsByCreatorRequest { -// string creator_id = 1; -// string network_id = 2; -// int32 limit = 3; -// int32 offset = 4; -// Sort sort = 5; -// SortDirection sort_direction = 6; -// optional Status status = 7; -// } - -// message CollectionsByCreatorResponse { -// repeated string collections = 1; -// } - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct LaunchpadProjectsByCreatorRequest { @@ -30,8 +16,6 @@ pub struct LaunchpadProjectsByCreatorRequest { pub sort: i32, #[prost(enumeration="SortDirection", tag="6")] pub sort_direction: i32, - /// TODO: user authentication (Member of the admin DAO) using a token - /// string user_address = 8; #[prost(enumeration="Status", optional, tag="7")] pub status: ::core::option::Option, } @@ -54,8 +38,6 @@ pub struct LaunchpadProjectsRequest { pub sort: i32, #[prost(enumeration="SortDirection", tag="5")] pub sort_direction: i32, - /// TODO: user authentication (Member of the admin DAO) using a token - /// string user_address = 7; #[prost(enumeration="Status", optional, tag="6")] pub status: ::core::option::Option, } @@ -70,8 +52,6 @@ pub struct LaunchpadProjectsResponse { pub struct LaunchpadProjectByIdRequest { #[prost(string, tag="1")] pub network_id: ::prost::alloc::string::String, - /// TODO: user authentication (Member of the admin DAO) using a token - /// string user_address = 3; #[prost(string, tag="2")] pub project_id: ::prost::alloc::string::String, } @@ -142,8 +122,6 @@ pub struct TokenMetadataResponse { pub struct LaunchpadProjectsCountRequest { #[prost(string, tag="1")] pub network_id: ::prost::alloc::string::String, - /// TODO: user authentication (Member of the admin DAO) using a token - /// string user_address = 3; #[prost(enumeration="Status", optional, tag="2")] pub status: ::core::option::Option, } diff --git a/rust/cw-contracts/nft-tr721/schema/nft-tr721.json b/rust/cw-contracts/nft-tr721/schema/nft-tr721.json index 9de487b1b..d22bc5ba7 100644 --- a/rust/cw-contracts/nft-tr721/schema/nft-tr721.json +++ b/rust/cw-contracts/nft-tr721/schema/nft-tr721.json @@ -1468,6 +1468,22 @@ "null" ] }, + "royalty_payment_address": { + "description": "The payment address, may be different to or the same as the minter addr question: how do we validate this?", + "type": [ + "string", + "null" + ] + }, + "royalty_percentage": { + "description": "This is how much the minter takes as a cut when sold royalties are owed on this token if it is Some", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0.0 + }, "youtube_url": { "type": [ "string", @@ -2850,6 +2866,22 @@ "null" ] }, + "royalty_payment_address": { + "description": "The payment address, may be different to or the same as the minter addr question: how do we validate this?", + "type": [ + "string", + "null" + ] + }, + "royalty_percentage": { + "description": "This is how much the minter takes as a cut when sold royalties are owed on this token if it is Some", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0.0 + }, "youtube_url": { "type": [ "string", diff --git a/rust/cw-contracts/nft-tr721/schema/raw/response_to_all_nft_info.json b/rust/cw-contracts/nft-tr721/schema/raw/response_to_all_nft_info.json index 5735f5d39..cb45c91e7 100644 --- a/rust/cw-contracts/nft-tr721/schema/raw/response_to_all_nft_info.json +++ b/rust/cw-contracts/nft-tr721/schema/raw/response_to_all_nft_info.json @@ -149,6 +149,22 @@ "null" ] }, + "royalty_payment_address": { + "description": "The payment address, may be different to or the same as the minter addr question: how do we validate this?", + "type": [ + "string", + "null" + ] + }, + "royalty_percentage": { + "description": "This is how much the minter takes as a cut when sold royalties are owed on this token if it is Some", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0.0 + }, "youtube_url": { "type": [ "string", diff --git a/rust/cw-contracts/nft-tr721/schema/raw/response_to_nft_info.json b/rust/cw-contracts/nft-tr721/schema/raw/response_to_nft_info.json index 198f6cce1..58a4c95b1 100644 --- a/rust/cw-contracts/nft-tr721/schema/raw/response_to_nft_info.json +++ b/rust/cw-contracts/nft-tr721/schema/raw/response_to_nft_info.json @@ -78,6 +78,22 @@ "null" ] }, + "royalty_payment_address": { + "description": "The payment address, may be different to or the same as the minter addr question: how do we validate this?", + "type": [ + "string", + "null" + ] + }, + "royalty_percentage": { + "description": "This is how much the minter takes as a cut when sold royalties are owed on this token if it is Some", + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0.0 + }, "youtube_url": { "type": [ "string", From 57f96411900ac81a817cbb369b99efcd7b64f28c Mon Sep 17 00:00:00 2001 From: WaDadidou Date: Tue, 15 Oct 2024 15:35:04 -0400 Subject: [PATCH 3/5] chore: remove comments from launchpad service --- go/pkg/launchpad/service.go | 85 ------------------------------------- 1 file changed, 85 deletions(-) diff --git a/go/pkg/launchpad/service.go b/go/pkg/launchpad/service.go index 059946814..38a60dc90 100644 --- a/go/pkg/launchpad/service.go +++ b/go/pkg/launchpad/service.go @@ -323,27 +323,6 @@ func (s *Launchpad) LaunchpadProjects(ctx context.Context, req *launchpadpb.Laun return nil, errors.Wrap(err, fmt.Sprintf("unknown network id '%s'", networkID)) } - // userAddress := req.GetUserAddress() - // if userAddress == "" { - // return nil, errors.New("missing user address") - // } - - // daoService := dao.NewDAOService(context.Background(), &dao.Config{ - // Logger: s.conf.Logger, - // IndexerDB: s.conf.IndexerDB, - // NetStore: &s.conf.NetworkStore, - // }) - - // isUserAdminResponse, err := daoService.IsUserAdmin(context.Background(), &daopb.IsUserAdminRequest{ - // UserAddress: userAddress, - // }) - // if err != nil { - // return nil, errors.Wrap(err, "failed to verify user's authentication") - // } - // if !isUserAdminResponse.IsUserAdmin { - // return nil, errors.New("Unauthorized") - // } - status := req.GetStatus() if status < 0 { return nil, errors.New("invalid status") @@ -423,27 +402,6 @@ func (s *Launchpad) LaunchpadProjectById(ctx context.Context, req *launchpadpb.L return nil, errors.New("missing project id") } - // userAddress := req.GetUserAddress() - // if userAddress == "" { - // return nil, errors.New("missing user address") - // } - - // daoService := dao.NewDAOService(context.Background(), &dao.Config{ - // Logger: s.conf.Logger, - // IndexerDB: s.conf.IndexerDB, - // NetStore: &s.conf.NetworkStore, - // }) - - // isUserAdminResponse, err := daoService.IsUserAdmin(context.Background(), &daopb.IsUserAdminRequest{ - // UserAddress: userAddress, - // }) - // if err != nil { - // return nil, errors.Wrap(err, "failed to verify user's authentication") - // } - // if !isUserAdminResponse.IsUserAdmin { - // return nil, errors.New("Unauthorized") - // } - var project *indexerdb.LaunchpadProject err = s.conf.IndexerDB.Raw(`SELECT * FROM launchpad_projects AS lp WHERE lp.project_id = ? AND lp.network_id = ?`, projectID, networkID).Scan(&project).Error @@ -493,27 +451,6 @@ func (s *Launchpad) LaunchpadProjectsCount(ctx context.Context, req *launchpadpb statusFilterSQL = "AND NOT lp.deployed_address = ''" } - // userAddress := req.GetUserAddress() - // if userAddress == "" { - // return nil, errors.New("missing user address") - // } - - // daoService := dao.NewDAOService(context.Background(), &dao.Config{ - // Logger: s.conf.Logger, - // IndexerDB: s.conf.IndexerDB, - // NetStore: &s.conf.NetworkStore, - // }) - - // isUserAdminResponse, err := daoService.IsUserAdmin(context.Background(), &daopb.IsUserAdminRequest{ - // UserAddress: userAddress, - // }) - // if err != nil { - // return nil, errors.Wrap(err, "failed to verify user's authentication") - // } - // if !isUserAdminResponse.IsUserAdmin { - // return nil, errors.New("Unauthorized") - // } - var count uint32 err = s.conf.IndexerDB.Raw(fmt.Sprintf(`SELECT COUNT(*) FROM launchpad_projects AS lp WHERE lp.network_id = ? %s`, statusFilterSQL), networkID).Scan(&count).Error if err != nil { @@ -524,25 +461,3 @@ func (s *Launchpad) LaunchpadProjectsCount(ctx context.Context, req *launchpadpb Count: count, }, nil } - -// func (s *Launchpad) IsUserAdmin(userAddress string) (bool, error) { -// // TODO: user authentication (Member of the admin DAO) -// // Control if sender is member of the admin DAO -// daoAdminAddress := "tori129kpfu7krgumuc38hfyxwfluq7eu06rhr3awcztr3a9cgjjcx5hswlqj8v" -// var isUserAuthorized bool -// err := s.conf.IndexerDB.Raw(`SELECT EXISTS ( -// SELECT 1 -// FROM dao_members dm -// JOIN daos d ON dm.dao_contract_address = d.contract_address -// WHERE d.contract_address = ? -// AND dm.member_address = ? -// ) AS dao_exists; -// `, -// daoAdminAddress, -// userAddress, -// ).Scan(&isUserAuthorized).Error -// if err != nil { -// return false, errors.Wrap(err, "failed to query database") -// } -// return isUserAuthorized, nil -// } From 7c7ae45bb36cd54fda0ae78817ac3cc8ca8caac9 Mon Sep 17 00:00:00 2001 From: WaDadidou Date: Tue, 15 Oct 2024 18:42:28 -0400 Subject: [PATCH 4/5] feat: Launchpad Admin: Plug proposals and Approve collection (deploy_collection) --- packages/components/dao/DAOProposals.tsx | 22 +-- .../hooks/launchpad/useDeployCollection.ts | 63 --------- .../hooks/launchpad/useGetLaunchpadAdmin.ts | 70 ++++++++++ .../launchpad/useIsUserLaunchpadAdmin.ts | 14 +- .../useProposeApproveDeployCollection.ts | 128 ++++++++++++++++++ .../LaunchpadApplicationReviewScreen.tsx | 51 +++++-- .../component/ApplicationDetail.tsx | 15 +- packages/utils/launchpad.ts | 2 + 8 files changed, 259 insertions(+), 106 deletions(-) delete mode 100644 packages/hooks/launchpad/useDeployCollection.ts create mode 100644 packages/hooks/launchpad/useGetLaunchpadAdmin.ts create mode 100644 packages/hooks/launchpad/useProposeApproveDeployCollection.ts diff --git a/packages/components/dao/DAOProposals.tsx b/packages/components/dao/DAOProposals.tsx index 5df9bfe14..eadb50de3 100644 --- a/packages/components/dao/DAOProposals.tsx +++ b/packages/components/dao/DAOProposals.tsx @@ -46,10 +46,11 @@ export const DAOProposals: React.FC<{ // TODO: double check we properly use threshold and quorum // TODO: use correct threshold, quorum and total power for passed/executed proposals -const ProposalRow: React.FC<{ +export const ProposalRow: React.FC<{ daoId: string | undefined; proposal: AppProposalResponse; -}> = ({ daoId, proposal }) => { + style?: StyleProp; +}> = ({ daoId, proposal, style }) => { const [network] = parseUserId(daoId); const halfGap = 24; @@ -109,13 +110,16 @@ const ProposalRow: React.FC<{ return ( { - const selectedNetworkId = useSelectedNetworkId(); - const selectedWallet = useSelectedWallet(); - const { isUserLaunchpadAdmin } = useIsUserLaunchpadAdmin( - selectedWallet?.userId, - ); - const { setToast } = useFeedbacks(); - - const deployCollection = useCallback( - async (collectionId: string) => { - if (!selectedWallet || !isUserLaunchpadAdmin) return; - const walletAddress = selectedWallet.address; - - const signingComswasmClient = - await getKeplrSigningCosmWasmClient(selectedNetworkId); - const cosmwasmLaunchpadFeature = getNetworkFeature( - selectedNetworkId, - NetworkFeature.NFTLaunchpad, - ); - if (!cosmwasmLaunchpadFeature) return; - - const nftLaunchpadContractClient = new NftLaunchpadClient( - signingComswasmClient, - walletAddress, - cosmwasmLaunchpadFeature.launchpadContractAddress, - ); - - try { - await nftLaunchpadContractClient.deployCollection({ - collectionId, - }); - - setToast({ - mode: "normal", - type: "success", - title: "Collection deployed", - }); - } catch (e: any) { - console.error("Error deploying a NFT Collection in the Launchpad: ", e); - setToast({ - mode: "normal", - type: "error", - title: "Error deploying a NFT Collection in the Launchpad", - message: e.message, - }); - } - }, - [selectedNetworkId, selectedWallet, setToast, isUserLaunchpadAdmin], - ); - - return { deployCollection }; -}; diff --git a/packages/hooks/launchpad/useGetLaunchpadAdmin.ts b/packages/hooks/launchpad/useGetLaunchpadAdmin.ts new file mode 100644 index 000000000..28db6ea8f --- /dev/null +++ b/packages/hooks/launchpad/useGetLaunchpadAdmin.ts @@ -0,0 +1,70 @@ +import { useQuery } from "@tanstack/react-query"; + +import { useSelectedNetworkId } from "./../useSelectedNetwork"; +import useSelectedWallet from "./../useSelectedWallet"; + +import { useFeedbacks } from "@/context/FeedbacksProvider"; +import { NftLaunchpadClient } from "@/contracts-clients/nft-launchpad"; +import { getNetworkFeature, NetworkFeature, getUserId } from "@/networks"; +import { getKeplrSigningCosmWasmClient } from "@/networks/signer"; + +export const useGetLaunchpadAdmin = () => { + const selectedWallet = useSelectedWallet(); + const userAddress = selectedWallet?.address; + const selectedNetworkId = useSelectedNetworkId(); + const { setToast } = useFeedbacks(); + + const { data, ...other } = useQuery( + ["getLaunchpadAdmin", userAddress, selectedNetworkId], + async () => { + try { + if (!userAddress) { + throw Error("No user address"); + } + const signingComswasmClient = + await getKeplrSigningCosmWasmClient(selectedNetworkId); + const cosmwasmLaunchpadFeature = getNetworkFeature( + selectedNetworkId, + NetworkFeature.NFTLaunchpad, + ); + + if (!cosmwasmLaunchpadFeature) { + throw Error("No Launchpad feature"); + } + + const nftLaunchpadContractClient = new NftLaunchpadClient( + signingComswasmClient, + userAddress, + cosmwasmLaunchpadFeature.launchpadContractAddress, + ); + + if (!nftLaunchpadContractClient) { + throw Error("Launchpad contract client not found"); + } + + // The Launchapd Admin DAO is the deployer set in the config of the nft-launchpad contract + const config = await nftLaunchpadContractClient.getConfig(); + if (!config.deployer) { + throw Error("No Launchpad admin set"); + } + + const adminDaoId = getUserId(selectedNetworkId, config.deployer); + + return adminDaoId; + } catch (e: any) { + console.error("Error veryfing Launchpad admin: ", e); + setToast({ + mode: "normal", + type: "error", + title: "Error veryfing Launchpad admin", + message: e.message, + }); + return false; + } + }, + { + enabled: !!userAddress, + }, + ); + return { launchpadAdminId: data, ...other }; +}; diff --git a/packages/hooks/launchpad/useIsUserLaunchpadAdmin.ts b/packages/hooks/launchpad/useIsUserLaunchpadAdmin.ts index 0d391a419..c537c5972 100644 --- a/packages/hooks/launchpad/useIsUserLaunchpadAdmin.ts +++ b/packages/hooks/launchpad/useIsUserLaunchpadAdmin.ts @@ -20,10 +20,10 @@ export const useIsUserLaunchpadAdmin = (userId?: string) => { try { const [network, userAddress] = parseUserId(userId); if (!userId) { - throw Error("No user id"); + throw new Error("Invalid sender"); } if (!network) { - throw Error("No network parsed from user id"); + throw new Error("Invalid network"); } const networkId = network.id; @@ -35,7 +35,7 @@ export const useIsUserLaunchpadAdmin = (userId?: string) => { ); if (!cosmwasmLaunchpadFeature) { - throw Error("No Launchpad feature"); + throw new Error("No Launchpad feature"); } const daoClient = mustGetDAOClient(networkId); @@ -46,16 +46,16 @@ export const useIsUserLaunchpadAdmin = (userId?: string) => { ); if (!daoClient) { - throw Error("DAO client not found"); + throw new Error("DAO client not found"); } if (!nftLaunchpadContractClient) { - throw Error("Launchpad contract client not found"); + throw new Error("Launchpad contract client not found"); } // The Launchapd Admin DAO is the deployer set in the config of the nft-launchpad contract const config = await nftLaunchpadContractClient.getConfig(); if (!config.deployer) { - throw Error("No Launchpad admin set"); + throw new Error("No Launchpad admin set"); } const adminDaoId = getUserId(networkId, config.deployer); @@ -64,8 +64,6 @@ export const useIsUserLaunchpadAdmin = (userId?: string) => { daoId: adminDaoId, }); - console.log("=== isMember", isMember); - return isMember; } catch (e: any) { console.error("Error veryfing Launchpad admin: ", e); diff --git a/packages/hooks/launchpad/useProposeApproveDeployCollection.ts b/packages/hooks/launchpad/useProposeApproveDeployCollection.ts new file mode 100644 index 000000000..bfe0d88b3 --- /dev/null +++ b/packages/hooks/launchpad/useProposeApproveDeployCollection.ts @@ -0,0 +1,128 @@ +import { useCallback } from "react"; + +import { useGetLaunchpadAdmin } from "./useGetLaunchpadAdmin"; +import { useIsUserLaunchpadAdmin } from "./useIsUserLaunchpadAdmin"; +import { DaoProposalSingleClient } from "../../contracts-clients/dao-proposal-single/DaoProposalSingle.client"; +import { mustGetNonSigningCosmWasmClient } from "../../networks"; +import { DEPLOY_PROPOSAL_DESC_PREFIX } from "../../utils/launchpad"; +import { useDAOMakeProposal } from "../dao/useDAOMakeProposal"; +import { useDAOFirstProposalModule } from "../dao/useDAOProposalModules"; +import { useDAOProposals } from "../dao/useDAOProposals"; + +import { useFeedbacks } from "@/context/FeedbacksProvider"; +import { useSelectedNetworkId } from "@/hooks/useSelectedNetwork"; +import useSelectedWallet from "@/hooks/useSelectedWallet"; +import { getNetworkFeature, NetworkFeature } from "@/networks"; +import { getKeplrSigningCosmWasmClient } from "@/networks/signer"; + +export const useProposeApproveDeployCollection = () => { + const { launchpadAdminId } = useGetLaunchpadAdmin(); // It's a DAO + const makeProposal = useDAOMakeProposal(launchpadAdminId); + const selectedNetworkId = useSelectedNetworkId(); + const selectedWallet = useSelectedWallet(); + const userAddress = selectedWallet?.address; + const { isUserLaunchpadAdmin } = useIsUserLaunchpadAdmin( + selectedWallet?.userId, + ); + const { setToast } = useFeedbacks(); + const { daoProposals } = useDAOProposals(launchpadAdminId); + const { daoFirstProposalModule } = + useDAOFirstProposalModule(launchpadAdminId); + + // Make a proposal deploy_collection and approve it + const proposeApproveDeployCollection = useCallback( + async (projectId: string) => { + try { + if (!isUserLaunchpadAdmin) { + throw new Error("Unauthorized"); + } + if (!userAddress) { + throw new Error("Invalid sender"); + } + if (!daoFirstProposalModule?.address) { + throw new Error("Invalid DAO Proposal module"); + } + + const cosmwasmLaunchpadFeature = getNetworkFeature( + selectedNetworkId, + NetworkFeature.NFTLaunchpad, + ); + + if (!cosmwasmLaunchpadFeature) { + throw new Error("No Launchpad feature"); + } + + // ---- Make the proposal + await makeProposal(userAddress, { + title: "Approve Launchpad collection", + description: DEPLOY_PROPOSAL_DESC_PREFIX + projectId, + msgs: [ + { + wasm: { + execute: { + contract_addr: + cosmwasmLaunchpadFeature.launchpadContractAddress, + msg: Buffer.from( + JSON.stringify({ + deploy_collection: { + collection_id: projectId, + }, + }), + ).toString("base64"), + funds: [], + }, + }, + }, + ], + }); + + const nonSigningCosmWasmClient = + await mustGetNonSigningCosmWasmClient(selectedNetworkId); + + // ---- Get the proposal id + const proposals = await nonSigningCosmWasmClient.queryContractSmart( + daoFirstProposalModule.address, + { + list_proposals: { start_after: null, limit: 1 }, + }, + ); + const proposalId = proposals.proposals[0].id; + + const signingCosmWasmClient = + await getKeplrSigningCosmWasmClient(selectedNetworkId); + const daoProposalClient = new DaoProposalSingleClient( + signingCosmWasmClient, + userAddress, + daoFirstProposalModule?.address, + ); + + // ---- Approve the proposal + await daoProposalClient.vote({ proposalId, vote: "yes" }, "auto"); + + setToast({ + mode: "normal", + type: "success", + title: "Successfully approved the Launchpad Collection", + }); + } catch (e: any) { + console.error("Error approving the Launchpad Collection: ", e); + setToast({ + mode: "normal", + type: "error", + title: "Error approving the Launchpad Collection", + message: e.message, + }); + } + }, + [ + selectedNetworkId, + userAddress, + setToast, + isUserLaunchpadAdmin, + daoFirstProposalModule, + makeProposal, + ], + ); + + return { proposeApproveDeployCollection, daoProposals, launchpadAdminId }; +}; diff --git a/packages/screens/Launchpad/LaunchpadAdmin/LaunchpadApplicationReview/LaunchpadApplicationReviewScreen.tsx b/packages/screens/Launchpad/LaunchpadAdmin/LaunchpadApplicationReview/LaunchpadApplicationReviewScreen.tsx index 9c84fcda7..0898a2a4b 100644 --- a/packages/screens/Launchpad/LaunchpadAdmin/LaunchpadApplicationReview/LaunchpadApplicationReviewScreen.tsx +++ b/packages/screens/Launchpad/LaunchpadAdmin/LaunchpadApplicationReview/LaunchpadApplicationReviewScreen.tsx @@ -1,18 +1,21 @@ import React, { useState } from "react"; import { View } from "react-native"; -import { useDeployCollection } from "./../../../../hooks/launchpad/useDeployCollection"; import { ApplicationDetail } from "./component/ApplicationDetail"; import { CreatorInformation } from "./component/CreatorInformation"; import { InvestmentInformation } from "./component/InvestmentInformation"; import { ProjectInformation } from "./component/ProjectInformation"; import { TeamInformation } from "./component/TeamInformation"; +import { PrimaryButton } from "../../../../components/buttons/PrimaryButton"; +import { ProposalRow } from "../../../../components/dao/DAOProposals"; +import { AppProposalResponse } from "../../../../hooks/dao/useDAOProposals"; +import { useProposeApproveDeployCollection } from "../../../../hooks/launchpad/useProposeApproveDeployCollection"; +import { DEPLOY_PROPOSAL_DESC_PREFIX } from "../../../../utils/launchpad"; import { BrandText } from "@/components/BrandText"; import { NotFound } from "@/components/NotFound"; import { ScreenContainer } from "@/components/ScreenContainer"; import { SpacerColumn } from "@/components/spacer"; -import { useFeedbacks } from "@/context/FeedbacksProvider"; import { useIsUserLaunchpadAdmin } from "@/hooks/launchpad/useIsUserLaunchpadAdmin"; import { useLaunchpadProjectById } from "@/hooks/launchpad/useLaunchpadProjectById"; import { useAppNavigation } from "@/hooks/navigation/useAppNavigation"; @@ -34,10 +37,17 @@ export const LaunchpadApplicationReviewScreen: ScreenFC< const navigation = useAppNavigation(); const selectedNetworkId = useSelectedNetworkId(); const [isLoading, setLoading] = useState(false); - const { setLoadingFullScreen } = useFeedbacks(); - const { deployCollection } = useDeployCollection(); const userId = useSelectedWallet()?.userId; const { isUserLaunchpadAdmin } = useIsUserLaunchpadAdmin(userId); + const { proposeApproveDeployCollection, daoProposals, launchpadAdminId } = + useProposeApproveDeployCollection(); + // We find the deploy proposal by searching projectId into the proposal's description + const proposal = daoProposals?.find( + (appProposalResponse: AppProposalResponse) => + appProposalResponse.proposal.description === + DEPLOY_PROPOSAL_DESC_PREFIX + projectId, + ); + const { launchpadProject } = useLaunchpadProjectById({ projectId, networkId: selectedNetworkId, @@ -48,18 +58,14 @@ export const LaunchpadApplicationReviewScreen: ScreenFC< const onPressApprove = async () => { setLoading(true); - setLoadingFullScreen(true); - try { - await deployCollection(projectId); + await proposeApproveDeployCollection(projectId); } catch (e) { - console.error("Error deploying the NFT collection", e); + console.error("Error approving the collection", e); setLoading(false); - setLoadingFullScreen(false); } setTimeout(() => { setLoading(false); - setLoadingFullScreen(false); }, 1000); }; @@ -128,10 +134,29 @@ export const LaunchpadApplicationReviewScreen: ScreenFC< - + + + {proposal ? ( + + ) : ( + + + + )} + + void; - isApproveLoading?: boolean; -}> = ({ collectionData, projectStatus, onPressApprove, isApproveLoading }) => { +}> = ({ collectionData, projectStatus }) => { const { width } = useMaxResolution(); return ( @@ -109,7 +106,7 @@ export const ApplicationDetail: React.FC<{ iconSvg={twitterSVG} // onPress={() => Linking.openURL(collectionData.twitter_profile)} /> - {collectionData.website_link && ( + {!!collectionData.website_link && ( )} - - {width >= breakpointM ? ( diff --git a/packages/utils/launchpad.ts b/packages/utils/launchpad.ts index 97ea4e9bb..f2a2081ce 100644 --- a/packages/utils/launchpad.ts +++ b/packages/utils/launchpad.ts @@ -5,6 +5,8 @@ import { ZodCollectionDataResult, } from "@/utils/types/launchpad"; +export const DEPLOY_PROPOSAL_DESC_PREFIX = "Symbol/ID: "; + export const launchpadProjectStatus = (launchpadProject: LaunchpadProject) => !launchpadProject.merkleRoot ? "INCOMPLETE" From c81b3c3e51ca0147446e8c62a1d2639526049629 Mon Sep 17 00:00:00 2001 From: WaDadidou Date: Tue, 15 Oct 2024 18:43:40 -0400 Subject: [PATCH 5/5] chore: remove comments --- .../LaunchpadAdministrationOverviewScreen.tsx | 3 --- .../LaunchpadApplicationReviewScreen.tsx | 1 - .../LaunchpadApplications/LaunchpadApplicationsScreen.tsx | 3 --- .../LaunchpadReadyApplicationsScreen.tsx | 1 - 4 files changed, 8 deletions(-) diff --git a/packages/screens/Launchpad/LaunchpadAdmin/LaunchpadAdministrationOverview/LaunchpadAdministrationOverviewScreen.tsx b/packages/screens/Launchpad/LaunchpadAdmin/LaunchpadAdministrationOverview/LaunchpadAdministrationOverviewScreen.tsx index f7a8f93ff..3de125ac5 100644 --- a/packages/screens/Launchpad/LaunchpadAdmin/LaunchpadAdministrationOverview/LaunchpadAdministrationOverviewScreen.tsx +++ b/packages/screens/Launchpad/LaunchpadAdmin/LaunchpadAdministrationOverview/LaunchpadAdministrationOverviewScreen.tsx @@ -34,7 +34,6 @@ export const LaunchpadAdministrationOverviewScreen: React.FC = () => { const { counts } = useLaunchpadProjectsCounts( { networkId: selectedNetworkId, - // userAddress: selectedWallet?.address || "", }, [Status.STATUS_COMPLETE, Status.STATUS_INCOMPLETE, Status.STATUS_CONFIRMED], ); @@ -176,7 +175,6 @@ const PendingApplicationsTable: FC = () => { const selectedNetworkId = useSelectedNetworkId(); const { launchpadProjects = [] } = useLaunchpadProjects({ networkId: selectedNetworkId, - // userAddress: selectedWallet?.address || "", offset: 0, limit: 10, sort: Sort.SORT_UNSPECIFIED, @@ -190,7 +188,6 @@ const PendingConfirmationsTable: FC = () => { const selectedNetworkId = useSelectedNetworkId(); const { launchpadProjects = [] } = useLaunchpadProjects({ networkId: selectedNetworkId, - // userAddress: selectedWallet?.address || "", offset: 0, limit: 10, sort: Sort.SORT_UNSPECIFIED, diff --git a/packages/screens/Launchpad/LaunchpadAdmin/LaunchpadApplicationReview/LaunchpadApplicationReviewScreen.tsx b/packages/screens/Launchpad/LaunchpadAdmin/LaunchpadApplicationReview/LaunchpadApplicationReviewScreen.tsx index 0898a2a4b..d5c9f83b2 100644 --- a/packages/screens/Launchpad/LaunchpadAdmin/LaunchpadApplicationReview/LaunchpadApplicationReviewScreen.tsx +++ b/packages/screens/Launchpad/LaunchpadAdmin/LaunchpadApplicationReview/LaunchpadApplicationReviewScreen.tsx @@ -51,7 +51,6 @@ export const LaunchpadApplicationReviewScreen: ScreenFC< const { launchpadProject } = useLaunchpadProjectById({ projectId, networkId: selectedNetworkId, - // userAddress: selectedWallet?.address || "", }); const collectionData = launchpadProject && parseCollectionData(launchpadProject); diff --git a/packages/screens/Launchpad/LaunchpadAdmin/LaunchpadApplications/LaunchpadApplicationsScreen.tsx b/packages/screens/Launchpad/LaunchpadAdmin/LaunchpadApplications/LaunchpadApplicationsScreen.tsx index 8c56e17c7..b86f7f4d2 100644 --- a/packages/screens/Launchpad/LaunchpadAdmin/LaunchpadApplications/LaunchpadApplicationsScreen.tsx +++ b/packages/screens/Launchpad/LaunchpadAdmin/LaunchpadApplications/LaunchpadApplicationsScreen.tsx @@ -28,7 +28,6 @@ export const LaunchpadApplicationsScreen: React.FC = () => { const { counts } = useLaunchpadProjectsCounts( { networkId: selectedNetworkId, - // userAddress: selectedWallet?.address || "", }, [Status.STATUS_COMPLETE, Status.STATUS_INCOMPLETE], ); @@ -141,7 +140,6 @@ const PendingApplicationsTable: FC = () => { const selectedNetworkId = useSelectedNetworkId(); const { launchpadProjects = [] } = useLaunchpadProjects({ networkId: selectedNetworkId, - // userAddress: selectedWallet?.address || "", offset: 0, limit: 100, // TODO: Pagination sort: Sort.SORT_UNSPECIFIED, @@ -155,7 +153,6 @@ const PendingConfirmationsTable: FC = () => { const selectedNetworkId = useSelectedNetworkId(); const { launchpadProjects = [] } = useLaunchpadProjects({ networkId: selectedNetworkId, - // userAddress: selectedWallet?.address || "", offset: 0, limit: 100, // TODO: Pagination sort: Sort.SORT_UNSPECIFIED, diff --git a/packages/screens/Launchpad/LaunchpadAdmin/LaunchpadReadyApplications/LaunchpadReadyApplicationsScreen.tsx b/packages/screens/Launchpad/LaunchpadAdmin/LaunchpadReadyApplications/LaunchpadReadyApplicationsScreen.tsx index 85ee06926..0d1a260de 100644 --- a/packages/screens/Launchpad/LaunchpadAdmin/LaunchpadReadyApplications/LaunchpadReadyApplicationsScreen.tsx +++ b/packages/screens/Launchpad/LaunchpadAdmin/LaunchpadReadyApplications/LaunchpadReadyApplicationsScreen.tsx @@ -27,7 +27,6 @@ export const LaunchpadReadyApplicationsScreen: React.FC = () => { const { isUserLaunchpadAdmin } = useIsUserLaunchpadAdmin(userId); const { launchpadProjects = [] } = useLaunchpadProjects({ networkId: selectedNetworkId, - // userAddress: selectedWallet?.address || "", offset: 0, limit: 100, // TODO: Pagination sort: Sort.SORT_UNSPECIFIED,