Repository: public-awesome/launchpad (rust)

Issue:
Revert withdraw functionality
Want to remove this feature until it has been audited. This release should only have random minting and a few other minor updates.

Pull request:
Revert withdraw functionality for now
Fixes #306 

Integrate it with creator staking + vesting at a future date.

TODO:
- [x] fix e2e tests

Patch:
diff --git a/Cargo.lock b/Cargo.lock
index ca7da24a..a3e69927 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -591,7 +591,7 @@ checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f"
 
 [[package]]
 name = "minter"
-version = "0.12.5"
+version = "0.13.0"
 dependencies = [
  "cosmwasm-schema",
  "cosmwasm-std",
diff --git a/contracts/minter/Cargo.toml b/contracts/minter/Cargo.toml
index 0e19508f..33b56ce1 100644
--- a/contracts/minter/Cargo.toml
+++ b/contracts/minter/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "minter"
-version = "0.12.5"
+version = "0.13.0"
 authors = ["Jake Hartnell <jake@stargaze.zone>"]
 edition = "2018"
 
diff --git a/contracts/minter/schema/execute_msg.json b/contracts/minter/schema/execute_msg.json
index e0763c56..3c8cd31b 100644
--- a/contracts/minter/schema/execute_msg.json
+++ b/contracts/minter/schema/execute_msg.json
@@ -113,18 +113,6 @@
         }
       },
       "additionalProperties": false
-    },
-    {
-      "type": "object",
-      "required": [
-        "withdraw"
-      ],
-      "properties": {
-        "withdraw": {
-          "type": "object"
-        }
-      },
-      "additionalProperties": false
     }
   ],
   "definitions": {
diff --git a/contracts/minter/src/contract.rs b/contracts/minter/src/contract.rs
index f2490395..47aab812 100644
--- a/contracts/minter/src/contract.rs
+++ b/contracts/minter/src/contract.rs
@@ -2,7 +2,7 @@
 use cosmwasm_std::entry_point;
 use cosmwasm_std::{
     coin, to_binary, Addr, BankMsg, Binary, Coin, CosmosMsg, Decimal, Deps, DepsMut, Empty, Env,
-    MessageInfo, Order, Reply, ReplyOn, StdError, StdResult, Timestamp, WasmMsg,
+    MessageInfo, Order, Reply, ReplyOn, StdError, StdResult, Timestamp, Uint128, WasmMsg,
 };
 use cw2::set_contract_version;
 use cw721_base::{msg::ExecuteMsg as Cw721ExecuteMsg, MintMsg};
@@ -175,41 +175,9 @@ pub fn execute(
         ExecuteMsg::SetWhitelist { whitelist } => {
             execute_set_whitelist(deps, env, info, &whitelist)
         }
-        ExecuteMsg::Withdraw {} => execute_withdraw(deps, env, info),
     }
 }
 
-pub fn execute_withdraw(
-    deps: DepsMut,
-    env: Env,
-    info: MessageInfo,
-) -> Result<Response, ContractError> {
-    let config = CONFIG.load(deps.storage)?;
-    if config.admin != info.sender {
-        return Err(ContractError::Unauthorized(
-            "Sender is not an admin".to_owned(),
-        ));
-    };
-
-    // query balance from the contract
-    let balance = deps
-        .querier
-        .query_balance(env.contract.address, NATIVE_DENOM)?;
-    if balance.amount.is_zero() {
-        return Err(ContractError::ZeroBalance {});
-    }
-
-    // send contract balance to creator
-    let send_msg = CosmosMsg::Bank(BankMsg::Send {
-        to_address: info.sender.to_string(),
-        amount: vec![balance],
-    });
-
-    Ok(Response::default()
-        .add_attribute("action", "withdraw")
-        .add_message(send_msg))
-}
-
 pub fn execute_set_whitelist(
     deps: DepsMut,
     env: Env,
@@ -379,7 +347,6 @@ fn _execute_mint(
     }
 
     let mut res = Response::new();
-    let mut msgs: Vec<CosmosMsg<StargazeMsgWrapper>> = vec![];
 
     // Create network fee msgs
     let fee_percent = if is_admin {
@@ -426,7 +393,7 @@ fn _execute_mint(
         msg: to_binary(&mint_msg)?,
         funds: vec![],
     });
-    msgs.append(&mut vec![msg]);
+    res = res.add_message(msg);
 
     // Remove mintable token id from map
     MINTABLE_TOKEN_IDS.remove(deps.storage, mintable_token_id);
@@ -437,6 +404,18 @@ fn _execute_mint(
     let new_mint_count = mint_count(deps.as_ref(), &info)? + 1;
     MINTER_ADDRS.save(deps.storage, info.clone().sender, &new_mint_count)?;
 
+    let seller_amount = if !is_admin {
+        let amount = mint_price.amount - network_fee;
+        let msg = BankMsg::Send {
+            to_address: config.admin.to_string(),
+            amount: vec![coin(amount.u128(), config.unit_price.denom)],
+        };
+        res = res.add_message(msg);
+        amount
+    } else {
+        Uint128::zero()
+    };
+
     Ok(res
         .add_attribute("action", action)
         .add_attribute("sender", info.sender)
@@ -444,7 +423,7 @@ fn _execute_mint(
         .add_attribute("token_id", mintable_token_id.to_string())
         .add_attribute("network_fee", network_fee)
         .add_attribute("mint_price", mint_price.amount)
-        .add_messages(msgs))
+        .add_attribute("seller_amount", seller_amount))
 }
 
 pub fn execute_update_start_time(
diff --git a/contracts/minter/src/error.rs b/contracts/minter/src/error.rs
index a1b21913..aba566bc 100644
--- a/contracts/minter/src/error.rs
+++ b/contracts/minter/src/error.rs
@@ -75,9 +75,6 @@ pub enum ContractError {
     #[error("Token id: {token_id} already sold")]
     TokenIdAlreadySold { token_id: u32 },
 
-    #[error("ZeroBalance")]
-    ZeroBalance {},
-
     #[error("{0}")]
     Payment(#[from] PaymentError),
 
diff --git a/contracts/minter/src/msg.rs b/contracts/minter/src/msg.rs
index b85c4ef4..eae3f409 100644
--- a/contracts/minter/src/msg.rs
+++ b/contracts/minter/src/msg.rs
@@ -25,7 +25,6 @@ pub enum ExecuteMsg {
     UpdatePerAddressLimit { per_address_limit: u32 },
     MintTo { recipient: String },
     MintFor { token_id: u32, recipient: String },
-    Withdraw {},
 }
 
 #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
diff --git a/types/contracts/claim/admin_response.d.ts b/types/contracts/claim/admin_response.d.ts
new file mode 100644
index 00000000..6e477ef8
--- /dev/null
+++ b/types/contracts/claim/admin_response.d.ts
@@ -0,0 +1,7 @@
+/**
+ * Returned from Admin.query_admin()
+ */
+export interface AdminResponse {
+admin?: (string | null)
+[k: string]: unknown
+}
diff --git a/types/contracts/claim/execute_msg.d.ts b/types/contracts/claim/execute_msg.d.ts
index 7b17788c..95cbb563 100644
--- a/types/contracts/claim/execute_msg.d.ts
+++ b/types/contracts/claim/execute_msg.d.ts
@@ -4,7 +4,7 @@ minter_address: string
 [k: string]: unknown
 }
 } | {
-sale_finalized_hook: SaleFinalizedHookMsg
+sale_hook: SaleHookMsg
 } | {
 update_admin: {
 admin?: (string | null)
@@ -31,7 +31,7 @@ marketplace_addr?: (string | null)
  */
 export type Uint128 = string
 
-export interface SaleFinalizedHookMsg {
+export interface SaleHookMsg {
 buyer: string
 collection: string
 price: Coin
diff --git a/types/contracts/claim/index.ts b/types/contracts/claim/index.ts
index d06b95c7..f4d46e7d 100644
--- a/types/contracts/claim/index.ts
+++ b/types/contracts/claim/index.ts
@@ -1,2 +1,4 @@
+export * from './admin_response'
 export * from './execute_msg'
 export * from './instantiate_msg'
+export * from './marketplace_response'
diff --git a/types/contracts/claim/marketplace_response.d.ts b/types/contracts/claim/marketplace_response.d.ts
new file mode 100644
index 00000000..540d2068
--- /dev/null
+++ b/types/contracts/claim/marketplace_response.d.ts
@@ -0,0 +1,15 @@
+/**
+ * A human readable address.
+ * 
+ * In Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.
+ * 
+ * This type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.
+ * 
+ * This type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.
+ */
+export type Addr = string
+
+export interface MarketplaceResponse {
+marketplace?: (Addr | null)
+[k: string]: unknown
+}
diff --git a/types/contracts/ics721/channel_response.d.ts b/types/contracts/ics721/channel_response.d.ts
new file mode 100644
index 00000000..7b4dbd20
--- /dev/null
+++ b/types/contracts/ics721/channel_response.d.ts
@@ -0,0 +1,7 @@
+import { ChannelInfo } from "./shared-types";
+
+export interface ChannelResponse {
+class_ids: string[]
+info: ChannelInfo
+[k: string]: unknown
+}
diff --git a/types/contracts/ics721/index.ts b/types/contracts/ics721/index.ts
index 3b2e4e39..cee9408b 100644
--- a/types/contracts/ics721/index.ts
+++ b/types/contracts/ics721/index.ts
@@ -1,3 +1,8 @@
-export * from './execute_msg'
-export * from './instantiate_msg'
-export * from './query_msg'
+export * from "./channel_response";
+export * from "./execute_msg";
+export * from "./instantiate_msg";
+export * from "./list_channels_response";
+export * from "./port_response";
+export * from "./query_msg";
+export * from "./shared-types";
+export * from "./tokens_response";
diff --git a/types/contracts/ics721/list_channels_response.d.ts b/types/contracts/ics721/list_channels_response.d.ts
new file mode 100644
index 00000000..bbbc0ec6
--- /dev/null
+++ b/types/contracts/ics721/list_channels_response.d.ts
@@ -0,0 +1,6 @@
+import { ChannelInfo } from "./shared-types";
+
+export interface ListChannelsResponse {
+channels: ChannelInfo[]
+[k: string]: unknown
+}
diff --git a/types/contracts/ics721/port_response.d.ts b/types/contracts/ics721/port_response.d.ts
new file mode 100644
index 00000000..d5671b7f
--- /dev/null
+++ b/types/contracts/ics721/port_response.d.ts
@@ -0,0 +1,4 @@
+export interface PortResponse {
+port_id: string
+[k: string]: unknown
+}
diff --git a/types/contracts/ics721/shared-types.d.ts b/types/contracts/ics721/shared-types.d.ts
new file mode 100644
index 00000000..89262191
--- /dev/null
+++ b/types/contracts/ics721/shared-types.d.ts
@@ -0,0 +1,20 @@
+export interface ChannelInfo {
+    [k: string]: unknown;
+    /**
+     * the connection this exists on (you can use to query client/consensus info)
+     */
+    connection_id: string;
+    /**
+     * the remote channel/port we connect to
+     */
+    counterparty_endpoint: IbcEndpoint;
+    /**
+     * id of this channel
+     */
+    id: string;
+}
+export interface IbcEndpoint {
+    [k: string]: unknown;
+    channel_id: string;
+    port_id: string;
+}
diff --git a/types/contracts/ics721/tokens_response.d.ts b/types/contracts/ics721/tokens_response.d.ts
new file mode 100644
index 00000000..7e485699
--- /dev/null
+++ b/types/contracts/ics721/tokens_response.d.ts
@@ -0,0 +1,4 @@
+export interface TokensResponse {
+tokens: string[]
+[k: string]: unknown
+}
diff --git a/types/contracts/minter/execute_msg.d.ts b/types/contracts/minter/execute_msg.d.ts
index 6e324467..b65c77e3 100644
--- a/types/contracts/minter/execute_msg.d.ts
+++ b/types/contracts/minter/execute_msg.d.ts
@@ -27,8 +27,4 @@ recipient: string
 token_id: number
 [k: string]: unknown
 }
-} | {
-withdraw: {
-[k: string]: unknown
-}
 })
diff --git a/types/contracts/minter/index.ts b/types/contracts/minter/index.ts
index 194b9ca4..7164f528 100644
--- a/types/contracts/minter/index.ts
+++ b/types/contracts/minter/index.ts
@@ -2,5 +2,9 @@ export * from "./config_response";
 export * from "./config";
 export * from "./execute_msg";
 export * from "./instantiate_msg";
+export * from "./mint_count_response";
+export * from "./mint_price_response";
+export * from "./mintable_num_tokens_response";
 export * from "./query_msg";
 export * from "./shared-types";
+export * from "./start_time_response";
diff --git a/types/contracts/minter/mint_count_response.d.ts b/types/contracts/minter/mint_count_response.d.ts
new file mode 100644
index 00000000..22222dec
--- /dev/null
+++ b/types/contracts/minter/mint_count_response.d.ts
@@ -0,0 +1,5 @@
+export interface MintCountResponse {
+address: string
+count: number
+[k: string]: unknown
+}
diff --git a/types/contracts/minter/mint_price_response.d.ts b/types/contracts/minter/mint_price_response.d.ts
new file mode 100644
index 00000000..d7a4726a
--- /dev/null
+++ b/types/contracts/minter/mint_price_response.d.ts
@@ -0,0 +1,8 @@
+import { Coin } from "./shared-types";
+
+export interface MintPriceResponse {
+current_price: Coin
+public_price: Coin
+whitelist_price?: (Coin | null)
+[k: string]: unknown
+}
diff --git a/types/contracts/minter/mintable_num_tokens_response.d.ts b/types/contracts/minter/mintable_num_tokens_response.d.ts
new file mode 100644
index 00000000..42115628
--- /dev/null
+++ b/types/contracts/minter/mintable_num_tokens_response.d.ts
@@ -0,0 +1,4 @@
+export interface MintableNumTokensResponse {
+count: number
+[k: string]: unknown
+}
diff --git a/types/contracts/minter/start_time_response.d.ts b/types/contracts/minter/start_time_response.d.ts
new file mode 100644
index 00000000..c923a58d
--- /dev/null
+++ b/types/contracts/minter/start_time_response.d.ts
@@ -0,0 +1,4 @@
+export interface StartTimeResponse {
+start_time: string
+[k: string]: unknown
+}
diff --git a/types/contracts/royalty-group/hooks_response.d.ts b/types/contracts/royalty-group/hooks_response.d.ts
new file mode 100644
index 00000000..3b19cf10
--- /dev/null
+++ b/types/contracts/royalty-group/hooks_response.d.ts
@@ -0,0 +1,4 @@
+export interface HooksResponse {
+hooks: string[]
+[k: string]: unknown
+}
diff --git a/types/contracts/royalty-group/index.ts b/types/contracts/royalty-group/index.ts
index b588e91d..a0090067 100644
--- a/types/contracts/royalty-group/index.ts
+++ b/types/contracts/royalty-group/index.ts
@@ -1,6 +1,8 @@
 export * from "./admin_response";
 export * from "./execute_msg";
+export * from "./hooks_response";
 export * from "./instantiate_msg";
+export * from "./list_members_response";
 export * from "./member_list_response";
 export * from "./member_response";
 export * from "./query_msg";
diff --git a/types/contracts/royalty-group/list_members_response.d.ts b/types/contracts/royalty-group/list_members_response.d.ts
new file mode 100644
index 00000000..935853b4
--- /dev/null
+++ b/types/contracts/royalty-group/list_members_response.d.ts
@@ -0,0 +1,6 @@
+import { Member } from "./shared-types";
+
+export interface ListMembersResponse {
+members: Member[]
+[k: string]: unknown
+}
diff --git a/types/contracts/whitelist/has_ended_response.d.ts b/types/contracts/whitelist/has_ended_response.d.ts
new file mode 100644
index 00000000..5c3c69cb
--- /dev/null
+++ b/types/contracts/whitelist/has_ended_response.d.ts
@@ -0,0 +1,4 @@
+export interface HasEndedResponse {
+has_ended: boolean
+[k: string]: unknown
+}
diff --git a/types/contracts/whitelist/has_member_response.d.ts b/types/contracts/whitelist/has_member_response.d.ts
new file mode 100644
index 00000000..6cbc8ce7
--- /dev/null
+++ b/types/contracts/whitelist/has_member_response.d.ts
@@ -0,0 +1,4 @@
+export interface HasMemberResponse {
+has_member: boolean
+[k: string]: unknown
+}
diff --git a/types/contracts/whitelist/has_started_response.d.ts b/types/contracts/whitelist/has_started_response.d.ts
new file mode 100644
index 00000000..f29a027a
--- /dev/null
+++ b/types/contracts/whitelist/has_started_response.d.ts
@@ -0,0 +1,4 @@
+export interface HasStartedResponse {
+has_started: boolean
+[k: string]: unknown
+}
diff --git a/types/contracts/whitelist/index.ts b/types/contracts/whitelist/index.ts
index cc9f50b3..a75dcf73 100644
--- a/types/contracts/whitelist/index.ts
+++ b/types/contracts/whitelist/index.ts
@@ -1,7 +1,11 @@
 export * from "./config_response";
 export * from "./config";
 export * from "./execute_msg";
+export * from "./has_ended_response";
+export * from "./has_member_response";
+export * from "./has_started_response";
 export * from "./instantiate_msg";
+export * from "./is_active_response";
 export * from "./members_response";
 export * from "./query_msg";
 export * from "./shared-types";
diff --git a/types/contracts/whitelist/is_active_response.d.ts b/types/contracts/whitelist/is_active_response.d.ts
new file mode 100644
index 00000000..54c160e4
--- /dev/null
+++ b/types/contracts/whitelist/is_active_response.d.ts
@@ -0,0 +1,4 @@
+export interface IsActiveResponse {
+is_active: boolean
+[k: string]: unknown
+}


Test patch:
diff --git a/contracts/minter/src/contract_tests.rs b/contracts/minter/src/contract_tests.rs
index dca6257b..f3473d11 100644
--- a/contracts/minter/src/contract_tests.rs
+++ b/contracts/minter/src/contract_tests.rs
@@ -414,7 +414,10 @@ fn happy_path() {
     // Balances are correct
     // The creator should get the unit price - mint fee for the mint above
     let creator_balances = router.wrap().query_all_balances(creator.clone()).unwrap();
-    assert_eq!(creator_balances, coins(INITIAL_BALANCE, NATIVE_DENOM));
+    assert_eq!(
+        creator_balances,
+        coins(INITIAL_BALANCE + UNIT_PRICE - MINT_FEE, NATIVE_DENOM)
+    );
     // The buyer's tokens should reduce by unit price
     let buyer_balances = router.wrap().query_all_balances(buyer.clone()).unwrap();
     assert_eq!(
@@ -485,13 +488,12 @@ fn happy_path() {
     assert_eq!(res.count, 1);
     assert_eq!(res.address, buyer.to_string());
 
-    // Minter contract should have a balance
+    // Minter contract should have no balance
     let minter_balance = router
         .wrap()
         .query_all_balances(minter_addr.clone())
         .unwrap();
-    assert_eq!(1, minter_balance.len());
-    assert_eq!(minter_balance[0].amount.u128(), UNIT_PRICE - MINT_FEE);
+    assert_eq!(0, minter_balance.len());
 
     // Check that NFT is transferred
     let query_owner_msg = Cw721QueryMsg::OwnerOf {
@@ -1107,13 +1109,13 @@ fn mint_for_token_id_addr() {
     );
     assert!(res.is_ok());
 
-    // Minter contract should have a balance
+    // Minter contract should have no balance
     let minter_balance = router
         .wrap()
         .query_all_balances(minter_addr.clone())
         .unwrap();
-    assert_eq!(minter_balance[0].amount.u128(), UNIT_PRICE - MINT_FEE);
-    assert_eq!(1, minter_balance.len());
+    println!("minter_balance: {:?}", minter_balance);
+    assert_eq!(0, minter_balance.len());
 
     // Mint fails, invalid token_id
     let token_id = 0;
@@ -1455,57 +1457,3 @@ fn unhappy_path() {
     let res = router.execute_contract(buyer, minter_addr, &mint_msg, &coins(UNIT_PRICE, "uatom"));
     assert!(res.is_err());
 }
-
-#[test]
-fn can_withdraw() {
-    // create minter
-    let mut router = custom_mock_app();
-    let (creator, buyer) = setup_accounts(&mut router);
-    let num_tokens = 4;
-    let (minter_addr, _config) = setup_minter_contract(&mut router, &creator, num_tokens);
-
-    setup_block_time(&mut router, GENESIS_MINT_START_TIME + 1);
-
-    // someone who isn't the creator cannot withdraw
-    let withdraw_msg = ExecuteMsg::Withdraw {};
-    router
-        .execute_contract(buyer.clone(), minter_addr.clone(), &withdraw_msg, &[])
-        .unwrap_err();
-
-    // withdraw with a zero balance
-    router
-        .execute_contract(creator.clone(), minter_addr.clone(), &withdraw_msg, &[])
-        .unwrap_err();
-
-    // do a mint
-    let mint_msg = ExecuteMsg::Mint {};
-    let res = router.execute_contract(
-        buyer,
-        minter_addr.clone(),
-        &mint_msg,
-        &coins(UNIT_PRICE, NATIVE_DENOM),
-    );
-    assert!(res.is_ok());
-
-    // Minter contract should have a balance
-    let minter_balance = router
-        .wrap()
-        .query_all_balances(minter_addr.clone())
-        .unwrap();
-    assert_eq!(minter_balance[0].amount.u128(), UNIT_PRICE - MINT_FEE);
-
-    // withdraw
-    let res = router.execute_contract(creator.clone(), minter_addr.clone(), &withdraw_msg, &[]);
-    assert!(res.is_ok());
-
-    // Minter contract should have no balance
-    let minter_balance = router.wrap().query_all_balances(minter_addr).unwrap();
-    assert_eq!(0, minter_balance.len());
-
-    // creator should have received their payment
-    let creator_balances = router.wrap().query_all_balances(creator).unwrap();
-    assert_eq!(
-        creator_balances,
-        coins(INITIAL_BALANCE + UNIT_PRICE - MINT_FEE, NATIVE_DENOM)
-    );
-}
diff --git a/e2e/full_test.go b/e2e/full_test.go
index 823d1fcc..fc1ec4f3 100644
--- a/e2e/full_test.go
+++ b/e2e/full_test.go
@@ -247,10 +247,10 @@ func TestMinter(t *testing.T) {
 		app.BankKeeper.GetBalance(ctx, accs[1].Address, "ustars"),
 	)
 
-	// Creator should have the same amount they started with since it hasn't been withdrawn yet
+	// Creator should have earned 90%
 	require.Equal(t,
 		app.BankKeeper.GetBalance(ctx, creator.Address, "ustars"),
-		sdk.NewInt64Coin("ustars", 1_000_000_000),
+		sdk.NewInt64Coin("ustars", 1_090_000_000),
 	)
 
 	// 2,505 STARS should have been burned so far
@@ -293,27 +293,12 @@ func TestMinter(t *testing.T) {
 		app.DistrKeeper.GetFeePoolCommunityCoins(ctx).AmountOf("ustars").TruncateInt64(),
 	)
 
-	// Creator should have the same balance before withdrawal
-	require.Equal(t,
-		sdk.NewInt64Coin("ustars", 1_000_000_000),
-		app.BankKeeper.GetBalance(ctx, creator.Address, "ustars"),
-	)
-
-	// withdraw succeeds
-	_, err = msgServer.ExecuteContract(sdk.WrapSDKContext(ctx), &wasmtypes.MsgExecuteContract{
-		Contract: minterAddress,
-		Sender:   creator.Address.String(),
-		Msg:      []byte(`{"withdraw":{}}`),
-	})
-	require.NoError(t, err)
-
 	// Creator should have earned 90% of total sales
 	// 1000 (balance) + (100 * 90 STARS)
 	require.Equal(t,
 		sdk.NewInt64Coin("ustars", 10_000_000_000),
 		app.BankKeeper.GetBalance(ctx, creator.Address, "ustars"),
 	)
-
 }
 
 func TestWhitelistMinter(t *testing.T) {
@@ -576,7 +561,6 @@ func TestWhitelistMinter(t *testing.T) {
 	})
 	require.Error(t, err)
 	require.Contains(t, err.Error(), "Sold out")
-	// TODO: fake refund since test failed
 
 	// Check Supply
 	// - 50 whitelist fee
@@ -594,28 +578,13 @@ func TestWhitelistMinter(t *testing.T) {
 		app.DistrKeeper.GetFeePoolCommunityCoins(ctx).AmountOf("ustars").TruncateInt64(),
 	)
 
-	// Creator should have their initial balance before withdrawal
-	// 900 (balance)
-	require.Equal(t,
-		sdk.NewInt64Coin("ustars", 900_000_000),
-		app.BankKeeper.GetBalance(ctx, creator.Address, "ustars"),
-	)
-
-	// withdraw succeeds
-	_, err = msgServer.ExecuteContract(sdk.WrapSDKContext(ctx), &wasmtypes.MsgExecuteContract{
-		Contract: minterAddress,
-		Sender:   creator.Address.String(),
-		Msg:      []byte(`{"withdraw":{}}`),
-	})
-	require.NoError(t, err)
-
 	// Creator should have earned 90% of total sales
 	// 900 (balance)
 	// 50STARS * 90% * 50 sold = 2,250
-	// 100STARS * 90% * 50 sold = 4,500 + 100 (1 failed mint)
-	// should have 7,750 STARS
+	// 100STARS * 90% * 50 sold = 4,500
+	// should have 7,650 STARS
 	require.Equal(t,
-		sdk.NewInt64Coin("ustars", 7_750_000_000),
+		sdk.NewInt64Coin("ustars", 7_650_000_000),
 		app.BankKeeper.GetBalance(ctx, creator.Address, "ustars"),
 	)