Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable fairburn #726

Open
wants to merge 2 commits into
base: initia
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ deploy-local:
docker kill stargaze || true
docker volume rm -f stargaze_data
docker run --rm -d --name stargaze \
-e DENOM=ustars \
-e DENOM=ugaze \
-e CHAINID=testing \
-e GAS_LIMIT=$(GAS_LIMIT) \
-p 1317:1317 \
Expand Down
8 changes: 4 additions & 4 deletions contracts/collections/sg721-updatable/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ use crate::state::ENABLE_UPDATABLE;

use cw721_base::Extension;
use cw_utils::nonpayable;
use sg1::checked_fair_burn;
use sg1::transfer_funds_to_launchpad_dao;
use sg721_base::ContractError::Unauthorized;
use sg721_base::Sg721Contract;
use sg_utils::NATIVE_DENOM;
pub type Sg721UpdatableContract<'a> = Sg721Contract<'a, Extension>;

const CONTRACT_NAME: &str = "crates.io:sg721-updatable";
Expand Down Expand Up @@ -50,7 +51,7 @@ pub fn _instantiate(

pub fn execute_enable_updatable(
deps: DepsMut,
env: Env,
_env: Env,
info: MessageInfo,
) -> Result<Response, ContractError> {
let enable_updates = ENABLE_UPDATABLE.load(deps.storage)?;
Expand All @@ -66,8 +67,7 @@ pub fn execute_enable_updatable(
return Err(ContractError::Base(Unauthorized {}));
}

// Check fee matches enable updatable fee and add fairburn msg
checked_fair_burn(&info, &env, ENABLE_UPDATABLE_FEE, None, &mut res)?;
transfer_funds_to_launchpad_dao(&info, ENABLE_UPDATABLE_FEE, NATIVE_DENOM, &mut res)?;

ENABLE_UPDATABLE.save(deps.storage, &true)?;

Expand Down
27 changes: 9 additions & 18 deletions contracts/factories/base-factory/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use cosmwasm_std::{
use cw2::set_contract_version;
use cw_utils::must_pay;
use semver::Version;
use sg1::{checked_fair_burn, transfer_funds_to_launchpad_dao};
use sg1::transfer_funds_to_launchpad_dao;
use sg2::msg::UpdateMinterParamsMsg;
use sg2::query::{AllowedCollectionCodeIdResponse, AllowedCollectionCodeIdsResponse, Sg2QueryMsg};
use sg2::MinterParams;
Expand Down Expand Up @@ -53,7 +53,7 @@ pub fn execute(

pub fn execute_create_minter(
deps: DepsMut,
env: Env,
_env: Env,
info: MessageInfo,
msg: BaseMinterCreateMsg,
) -> Result<Response, ContractError> {
Expand All @@ -64,22 +64,13 @@ pub fn execute_create_minter(
must_not_be_frozen(&params)?;

let mut res = Response::new();
if params.creation_fee.denom == NATIVE_DENOM {
checked_fair_burn(
&info,
&env,
params.creation_fee.amount.u128(),
None,
&mut res,
)?;
} else {
transfer_funds_to_launchpad_dao(
&info,
params.creation_fee.amount.u128(),
&params.creation_fee.denom,
&mut res,
)?;
}

transfer_funds_to_launchpad_dao(
&info,
params.creation_fee.amount.u128(),
&params.creation_fee.denom,
&mut res,
)?;

let msg = WasmMsg::Instantiate {
admin: Some(info.sender.to_string()),
Expand Down
35 changes: 12 additions & 23 deletions contracts/factories/open-edition-factory/src/contract.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
use base_factory::contract::{
must_be_allowed_collection, must_not_be_frozen, must_pay_exact_amount, update_params,
};
use base_factory::ContractError as BaseContractError;
#[cfg(not(feature = "library"))]
use cosmwasm_std::entry_point;
use cosmwasm_std::{
Expand All @@ -6,13 +10,7 @@ use cosmwasm_std::{
};
use cw2::set_contract_version;
use semver::Version;
use sg_utils::NATIVE_DENOM;

use base_factory::contract::{
must_be_allowed_collection, must_not_be_frozen, must_pay_exact_amount, update_params,
};
use base_factory::ContractError as BaseContractError;
use sg1::{checked_fair_burn, transfer_funds_to_launchpad_dao};
use sg1::transfer_funds_to_launchpad_dao;
use sg2::query::{AllowedCollectionCodeIdResponse, AllowedCollectionCodeIdsResponse, Sg2QueryMsg};

use crate::error::ContractError;
Expand Down Expand Up @@ -69,22 +67,13 @@ pub fn execute_create_minter(
must_not_be_frozen(&params)?;

let mut res = Response::new();
if params.creation_fee.denom == NATIVE_DENOM {
checked_fair_burn(
&info,
&env,
params.creation_fee.amount.u128(),
None,
&mut res,
)?;
} else {
transfer_funds_to_launchpad_dao(
&info,
params.creation_fee.amount.u128(),
&params.creation_fee.denom,
&mut res,
)?;
}

transfer_funds_to_launchpad_dao(
&info,
params.creation_fee.amount.u128(),
&params.creation_fee.denom,
&mut res,
)?;

msg.init_msg = OpenEditionMinterInitMsgExtension::validate(
msg.init_msg.clone(),
Expand Down
27 changes: 9 additions & 18 deletions contracts/factories/token-merge-factory/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use cosmwasm_std::{
use cw2::set_contract_version;
use cw_utils::must_pay;
use semver::Version;
use sg1::{checked_fair_burn, transfer_funds_to_launchpad_dao};
use sg1::transfer_funds_to_launchpad_dao;
use sg_utils::NATIVE_DENOM;

use crate::error::ContractError;
Expand Down Expand Up @@ -51,7 +51,7 @@ pub fn execute(

pub fn execute_create_minter(
deps: DepsMut,
env: Env,
_env: Env,
info: MessageInfo,
msg: TokenMergeMinterCreateMsg,
) -> Result<Response, ContractError> {
Expand All @@ -67,22 +67,13 @@ pub fn execute_create_minter(
ensure!(!params.frozen, ContractError::Frozen {});

let mut res = Response::new();
if params.creation_fee.denom == NATIVE_DENOM {
checked_fair_burn(
&info,
&env,
params.creation_fee.amount.u128(),
None,
&mut res,
)?;
} else {
transfer_funds_to_launchpad_dao(
&info,
params.creation_fee.amount.u128(),
&params.creation_fee.denom,
&mut res,
)?;
}

transfer_funds_to_launchpad_dao(
&info,
params.creation_fee.amount.u128(),
&params.creation_fee.denom,
&mut res,
)?;

// Check the number of tokens is more than zero and less than the max limit
if msg.init_msg.num_tokens == 0 || msg.init_msg.num_tokens > params.max_token_limit {
Expand Down
27 changes: 9 additions & 18 deletions contracts/factories/vending-factory/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use cosmwasm_std::{
use cw2::set_contract_version;
use cw_utils::must_pay;
use semver::Version;
use sg1::{checked_fair_burn, transfer_funds_to_launchpad_dao};
use sg1::transfer_funds_to_launchpad_dao;
use sg2::query::{AllowedCollectionCodeIdResponse, AllowedCollectionCodeIdsResponse, Sg2QueryMsg};
use sg_utils::NATIVE_DENOM;

Expand Down Expand Up @@ -53,7 +53,7 @@ pub fn execute(

pub fn execute_create_minter(
deps: DepsMut,
env: Env,
_env: Env,
info: MessageInfo,
msg: VendingMinterCreateMsg,
) -> Result<Response, ContractError> {
Expand All @@ -64,22 +64,13 @@ pub fn execute_create_minter(
must_not_be_frozen(&params)?;

let mut res = Response::new();
if params.creation_fee.denom == NATIVE_DENOM {
checked_fair_burn(
&info,
&env,
params.creation_fee.amount.u128(),
None,
&mut res,
)?;
} else {
transfer_funds_to_launchpad_dao(
&info,
params.creation_fee.amount.u128(),
&params.creation_fee.denom,
&mut res,
)?;
}

transfer_funds_to_launchpad_dao(
&info,
params.creation_fee.amount.u128(),
&params.creation_fee.denom,
&mut res,
)?;

// Check the number of tokens is more than zero and less than the max limit
if msg.init_msg.num_tokens == 0 || msg.init_msg.num_tokens > params.extension.max_token_limit {
Expand Down
7 changes: 4 additions & 3 deletions contracts/minters/base-minter/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use cosmwasm_std::{
};
use cw2::set_contract_version;
use cw_utils::{must_pay, nonpayable, parse_reply_instantiate_data};
use sg1::checked_fair_burn;
use sg1::transfer_funds_to_launchpad_dao;
use sg2::query::Sg2QueryMsg;
use sg4::{QueryMsg, Status, StatusResponse, SudoMsg};
use sg721::{ExecuteMsg as Sg721ExecuteMsg, InstantiateMsg as Sg721InstantiateMsg};
Expand Down Expand Up @@ -111,7 +111,7 @@ pub fn execute(

pub fn execute_mint_sender(
deps: DepsMut,
env: Env,
_env: Env,
info: MessageInfo,
token_uri: String,
) -> Result<Response, ContractError> {
Expand Down Expand Up @@ -150,7 +150,8 @@ pub fn execute_mint_sender(
if network_fee != funds_sent {
return Err(ContractError::InvalidMintPrice {});
}
checked_fair_burn(&info, &env, network_fee.u128(), None, &mut res)?;

transfer_funds_to_launchpad_dao(&info, network_fee.u128(), NATIVE_DENOM, &mut res)?;

// Create mint msgs
let mint_msg = Sg721ExecuteMsg::<Extension, Empty>::Mint {
Expand Down
10 changes: 4 additions & 6 deletions contracts/minters/token-merge-minter/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ use cw_utils::{may_pay, nonpayable, parse_reply_instantiate_data};
use nois::{int_in_range, shuffle};

use semver::Version;
use sg1::{checked_fair_burn, distribute_mint_fees};
use sg1::{distribute_mint_fees, transfer_funds_to_launchpad_dao};
use sg4::{Status, StatusResponse, SudoMsg};
use sg721::{ExecuteMsg as Sg721ExecuteMsg, InstantiateMsg as Sg721InstantiateMsg};
use sg_utils::GENESIS_MINT_START_TIME;
use sg_utils::{GENESIS_MINT_START_TIME, NATIVE_DENOM};
use sha2::{Digest, Sha256};

use std::convert::TryInto;
Expand Down Expand Up @@ -349,12 +349,10 @@ pub fn execute_shuffle(
.query_wasm_smart(config.factory, &FactoryQueryMsg::Params {})?;
let factory_params = factory.params;

// Check exact shuffle fee payment included in message
checked_fair_burn(
transfer_funds_to_launchpad_dao(
&info,
&env,
factory_params.shuffle_fee.amount.u128(),
None,
NATIVE_DENOM,
&mut res,
)?;

Expand Down
10 changes: 4 additions & 6 deletions contracts/minters/vending-minter-featured/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ use cw721_base::Extension;
use cw_utils::{may_pay, maybe_addr, nonpayable, parse_reply_instantiate_data};

use semver::Version;
use sg1::{checked_fair_burn, distribute_mint_fees};
use sg1::{distribute_mint_fees, transfer_funds_to_launchpad_dao};
use sg2::query::Sg2QueryMsg;
use sg4::{MinterConfig, Status, StatusResponse, SudoMsg};
use sg721::{ExecuteMsg as Sg721ExecuteMsg, InstantiateMsg as Sg721InstantiateMsg};
use sg_tiered_whitelist::msg::{QueryMsg as TieredWhitelistQueryMsg, StageResponse};
use sg_utils::GENESIS_MINT_START_TIME;
use sg_utils::{GENESIS_MINT_START_TIME, NATIVE_DENOM};
use sg_whitelist::msg::{
ConfigResponse as WhitelistConfigResponse, HasMemberResponse, QueryMsg as WhitelistQueryMsg,
};
Expand Down Expand Up @@ -367,12 +367,10 @@ pub fn execute_shuffle(
.query_wasm_smart(config.factory, &Sg2QueryMsg::Params {})?;
let factory_params = factory.params;

// Check exact shuffle fee payment included in message
checked_fair_burn(
transfer_funds_to_launchpad_dao(
&info,
&env,
factory_params.extension.shuffle_fee.amount.u128(),
None,
NATIVE_DENOM,
&mut res,
)?;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ use cw721_base::Extension;
use cw_utils::{may_pay, maybe_addr, nonpayable, parse_reply_instantiate_data};

use semver::Version;
use sg1::{checked_fair_burn, distribute_mint_fees};
use sg1::{distribute_mint_fees, transfer_funds_to_launchpad_dao};
use sg2::query::Sg2QueryMsg;
use sg4::{MinterConfig, Status, StatusResponse, SudoMsg};
use sg721::{ExecuteMsg as Sg721ExecuteMsg, InstantiateMsg as Sg721InstantiateMsg};
use sg_utils::GENESIS_MINT_START_TIME;
use sg_utils::{GENESIS_MINT_START_TIME, NATIVE_DENOM};
use sg_whitelist::msg::{
ConfigResponse as WhitelistConfigResponse, HasMemberResponse, QueryMsg as WhitelistQueryMsg,
};
Expand Down Expand Up @@ -369,12 +369,10 @@ pub fn execute_shuffle(
.query_wasm_smart(config.factory, &Sg2QueryMsg::Params {})?;
let factory_params = factory.params;

// Check exact shuffle fee payment included in message
checked_fair_burn(
transfer_funds_to_launchpad_dao(
&info,
&env,
factory_params.extension.shuffle_fee.amount.u128(),
None,
NATIVE_DENOM,
&mut res,
)?;

Expand Down
10 changes: 4 additions & 6 deletions contracts/minters/vending-minter-merkle-wl/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ use cw721_base::Extension;
use cw_utils::{may_pay, maybe_addr, nonpayable, parse_reply_instantiate_data};
use nois::{int_in_range, shuffle};
use semver::Version;
use sg1::{checked_fair_burn, distribute_mint_fees};
use sg1::{distribute_mint_fees, transfer_funds_to_launchpad_dao};
use sg2::query::Sg2QueryMsg;
use sg4::{MinterConfig, Status, StatusResponse, SudoMsg};
use sg721::{ExecuteMsg as Sg721ExecuteMsg, InstantiateMsg as Sg721InstantiateMsg};
use sg_utils::GENESIS_MINT_START_TIME;
use sg_utils::{GENESIS_MINT_START_TIME, NATIVE_DENOM};
use sg_whitelist::msg::{
ConfigResponse as WhitelistConfigResponse, HasMemberResponse, QueryMsg as WhitelistQueryMsg,
};
Expand Down Expand Up @@ -368,12 +368,10 @@ pub fn execute_shuffle(
.query_wasm_smart(config.factory, &Sg2QueryMsg::Params {})?;
let factory_params = factory.params;

// Check exact shuffle fee payment included in message
checked_fair_burn(
transfer_funds_to_launchpad_dao(
&info,
&env,
factory_params.extension.shuffle_fee.amount.u128(),
None,
NATIVE_DENOM,
&mut res,
)?;

Expand Down
Loading
Loading