Skip to content

Commit

Permalink
Release 3.1.0 (#601)
Browse files Browse the repository at this point in the history
* Release 3.1.0

* 3.1.0 updatable (#600)

* change fee to 2000 stars

* Add enable updatable fee to sudomsg

* Update types

* add fee query, add test

* change res to Uint128 instead of custom struct

* Refactor and rm sudoparams (#598)

* update version

---------

Co-authored-by: John Y <j@publicawesome.com>

---------

Co-authored-by: John Y <j@publicawesome.com>
  • Loading branch information
jhernandezb and yubrew authored Aug 1, 2023
1 parent 5152fa7 commit 980e703
Show file tree
Hide file tree
Showing 14 changed files with 155 additions and 87 deletions.
100 changes: 50 additions & 50 deletions Cargo.lock

Large diffs are not rendered by default.

50 changes: 25 additions & 25 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ members = [
resolver = "2"

[workspace.package]
version = "3.0.0"
version = "3.1.0"
edition = "2021"
homepage = "https://stargaze.zone"
repository = "https://github.com/public-awesome/launchpad"
license = "Apache-2.0"

[workspace.dependencies]
base-factory = { version = "3.0.0", path = "contracts/factories/base-factory" }
base-minter = { version = "3.0.0", path = "contracts/minters/base-minter" }
base-factory = { version = "3.1.0", path = "contracts/factories/base-factory" }
base-minter = { version = "3.1.0", path = "contracts/minters/base-minter" }
cosmwasm-schema = "1.2.1"
cosmwasm-std = "1.2.1"
cw-controllers = "1.1.0"
Expand All @@ -33,31 +33,31 @@ cw-storage-plus = "1.1.0"
cw-utils = "1.0.1"
schemars = "0.8.11"
serde = { version = "1.0.145", default-features = false, features = ["derive"] }
sg1 = { version = "3.0.0", path = "packages/sg1" }
sg2 = { version = "3.0.0", path = "packages/sg2" }
sg4 = { version = "3.0.0", path = "packages/sg4" }
sg721 = { version = "3.0.0", path = "packages/sg721" }
sg721-base = { version = "3.0.0", path = "contracts/collections/sg721-base" }
sg721-nt = { version = "3.0.0", path = "contracts/collections/sg721-nt" }
sg721-updatable = { version = "3.0.0", path = "contracts/collections/sg721-updatable" }
sg-controllers = { version = "3.0.0", path = "packages/controllers" }
sg-metadata = { version = "3.0.0", path = "packages/sg-metadata" }
sg-multi-test = { version = "3.0.0", path = "packages/sg-multi-test" }
sg-splits = { version = "3.0.0", path = "contracts/splits" }
sg-std = { version = "3.0.0" }
sg-whitelist = { version = "3.0.0", path = "contracts/whitelists/whitelist" }
sg1 = { version = "3.1.0", path = "packages/sg1" }
sg2 = { version = "3.1.0", path = "packages/sg2" }
sg4 = { version = "3.1.0", path = "packages/sg4" }
sg721 = { version = "3.1.0", path = "packages/sg721" }
sg721-base = { version = "3.1.0", path = "contracts/collections/sg721-base" }
sg721-nt = { version = "3.1.0", path = "contracts/collections/sg721-nt" }
sg721-updatable = { version = "3.1.0", path = "contracts/collections/sg721-updatable" }
sg-controllers = { version = "3.1.0", path = "packages/controllers" }
sg-metadata = { version = "3.1.0", path = "packages/sg-metadata" }
sg-multi-test = { version = "3.1.0", path = "packages/sg-multi-test" }
sg-splits = { version = "3.1.0", path = "contracts/splits" }
sg-std = { version = "3.1.0" }
sg-whitelist = { version = "3.1.0", path = "contracts/whitelists/whitelist" }
thiserror = "1.0.31"
url = "2.2.2"
sha2 = { version = "0.10.2", default-features = false }
vending-factory = { version = "3.0.0", path = "contracts/factories/vending-factory" }
vending-minter = { version = "3.0.0", path = "contracts/minters/vending-minter" }
open-edition-factory = { version = "3.0.0", path = "contracts/factories/open-edition-factory" }
open-edition-minter = { version = "3.0.0", path = "contracts/minters/open-edition-minter" }
whitelist-immutable = { version = "3.0.0", path = "contracts/whitelists/whitelist-immutable" }
sg-whitelist-flex = { version = "3.0.0", path = "contracts/whitelists/whitelist-flex" }
ethereum-verify = { version = "3.0.0", path = "packages/ethereum-verify" }
sg-eth-airdrop = { version = "3.0.0", path = "contracts/sg-eth-airdrop" }
test-suite = { version = "3.0.0", path = "test-suite" }
vending-factory = { version = "3.1.0", path = "contracts/factories/vending-factory" }
vending-minter = { version = "3.1.0", path = "contracts/minters/vending-minter" }
open-edition-factory = { version = "3.1.0", path = "contracts/factories/open-edition-factory" }
open-edition-minter = { version = "3.1.0", path = "contracts/minters/open-edition-minter" }
whitelist-immutable = { version = "3.1.0", path = "contracts/whitelists/whitelist-immutable" }
sg-whitelist-flex = { version = "3.1.0", path = "contracts/whitelists/whitelist-flex" }
ethereum-verify = { version = "3.1.0", path = "packages/ethereum-verify" }
sg-eth-airdrop = { version = "3.1.0", path = "contracts/sg-eth-airdrop" }
test-suite = { version = "3.1.0", path = "test-suite" }
semver = "1"
cw-ownable = "0.5.1"

Expand Down
8 changes: 6 additions & 2 deletions contracts/collections/sg721-updatable/src/contract.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::error::ContractError;
use crate::state::FROZEN_TOKEN_METADATA;
use cosmwasm_std::{Empty, StdError};
use cosmwasm_std::{Empty, StdError, Uint128};

use cosmwasm_std::{Deps, StdResult};

Expand Down Expand Up @@ -31,7 +31,7 @@ const COMPATIBLE_CONTRACT_NAMES_FOR_MIGRATION: [&str; 4] = [
"sg721-updatable",
"crates.io:sg721-updatable",
];
const ENABLE_UPDATABLE_FEE: u128 = 500_000_000;
const ENABLE_UPDATABLE_FEE: u128 = 2_000_000_000;

pub fn _instantiate(
deps: DepsMut,
Expand Down Expand Up @@ -153,6 +153,10 @@ pub fn query_enable_updatable(deps: Deps) -> StdResult<EnableUpdatableResponse>
Ok(EnableUpdatableResponse { enabled })
}

pub fn query_enable_updatable_fee() -> StdResult<Uint128> {
Ok(Uint128::from(ENABLE_UPDATABLE_FEE))
}

pub fn query_frozen_token_metadata(deps: Deps) -> StdResult<FrozenTokenMetadataResponse> {
let frozen = FROZEN_TOKEN_METADATA.load(deps.storage)?;
Ok(FrozenTokenMetadataResponse { frozen })
Expand Down
6 changes: 4 additions & 2 deletions contracts/collections/sg721-updatable/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@ pub mod entry {
use crate::{
contract::{
_instantiate, _migrate, execute_enable_updatable, execute_freeze_token_metadata,
execute_update_token_metadata, query_enable_updatable, query_frozen_token_metadata,
Sg721UpdatableContract,
execute_update_token_metadata, query_enable_updatable, query_enable_updatable_fee,
query_frozen_token_metadata, Sg721UpdatableContract,
},
msg::ExecuteMsg,
};
use cosmwasm_std::{entry_point, to_binary, Empty};
use cosmwasm_std::{Binary, Deps, DepsMut, Env, MessageInfo, StdResult};
use cw721_base::Extension;

use sg_std::Response;

#[entry_point]
Expand Down Expand Up @@ -57,6 +58,7 @@ pub mod entry {
pub fn query(deps: Deps, env: Env, msg: QueryMsg) -> StdResult<Binary> {
match msg {
QueryMsg::EnableUpdatable {} => to_binary(&query_enable_updatable(deps)?),
QueryMsg::EnableUpdatableFee {} => to_binary(&query_enable_updatable_fee()?),
QueryMsg::FreezeTokenMetadata {} => to_binary(&query_frozen_token_metadata(deps)?),
_ => Sg721UpdatableContract::default().query(deps, env, msg.into()),
}
Expand Down
1 change: 1 addition & 0 deletions contracts/collections/sg721-updatable/src/msg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ where
#[cw_serde]
pub enum QueryMsg {
EnableUpdatable {},
EnableUpdatableFee {},
FreezeTokenMetadata {},
OwnerOf {
token_id: String,
Expand Down
2 changes: 1 addition & 1 deletion contracts/factories/base-factory/schema/base-factory.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"contract_name": "base-factory",
"contract_version": "3.0.0",
"contract_version": "3.1.0",
"idl_version": "1.0.0",
"instantiate": {
"$schema": "http://json-schema.org/draft-07/schema#",
Expand Down
2 changes: 1 addition & 1 deletion contracts/minters/base-minter/schema/base-minter.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"contract_name": "base-minter",
"contract_version": "3.0.0",
"contract_version": "3.1.0",
"idl_version": "1.0.0",
"instantiate": {
"$schema": "http://json-schema.org/draft-07/schema#",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"contract_name": "vending-minter-wl-flex",
"contract_version": "3.0.0",
"contract_version": "3.1.0",
"idl_version": "1.0.0",
"instantiate": {
"$schema": "http://json-schema.org/draft-07/schema#",
Expand Down
2 changes: 1 addition & 1 deletion contracts/sg-eth-airdrop/schema/sg-eth-airdrop.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"contract_name": "sg-eth-airdrop",
"contract_version": "3.0.0",
"contract_version": "3.1.0",
"idl_version": "1.0.0",
"instantiate": {
"$schema": "http://json-schema.org/draft-07/schema#",
Expand Down
2 changes: 1 addition & 1 deletion contracts/splits/schema/sg-splits.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"contract_name": "sg-splits",
"contract_version": "3.0.0",
"contract_version": "3.1.0",
"idl_version": "1.0.0",
"instantiate": {
"$schema": "http://json-schema.org/draft-07/schema#",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"contract_name": "sg-whitelist-flex",
"contract_version": "3.0.0",
"contract_version": "3.1.0",
"idl_version": "1.0.0",
"instantiate": {
"$schema": "http://json-schema.org/draft-07/schema#",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"contract_name": "whitelist-immutable",
"contract_version": "3.0.0",
"contract_version": "3.1.0",
"idl_version": "1.0.0",
"instantiate": {
"$schema": "http://json-schema.org/draft-07/schema#",
Expand Down
61 changes: 61 additions & 0 deletions test-suite/src/sg721_base/tests/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -791,4 +791,65 @@ mod tests {
assert_eq!(res, expected_onwership_response);
}
}

mod sg721_mutable {
use cosmwasm_std::{coin, Addr};
use cw721::NumTokensResponse;
use cw_multi_test::{BankSudo, Executor, SudoMsg};
use sg2::tests::mock_collection_params;
use sg721_updatable::msg::QueryMsg;
use sg_multi_test::StargazeApp;
use sg_std::NATIVE_DENOM;
const ADMIN: &str = "admin";

use crate::common_setup::setup_minter::common::constants::CREATION_FEE;
use crate::{
common_setup::{
contract_boxes::contract_sg721_updatable,
setup_minter::vending_minter::mock_params::mock_create_minter,
},
sg721_base::tests::integration_tests::tests::proper_instantiate_factory,
};
use vending_factory::msg::ExecuteMsg;

fn proper_instantiate() -> (StargazeApp, Addr) {
let (mut app, factory_contract) = proper_instantiate_factory();
let sg721_id = app.store_code(contract_sg721_updatable());

let collection_params = mock_collection_params();
let mut m = mock_create_minter(None, collection_params, None);
m.collection_params.code_id = sg721_id;
let msg = ExecuteMsg::CreateMinter(m);

let creation_fee = coin(CREATION_FEE, NATIVE_DENOM);

app.sudo(SudoMsg::Bank(BankSudo::Mint {
to_address: ADMIN.to_string(),
amount: vec![creation_fee.clone()],
}))
.unwrap();

let bal = app.wrap().query_all_balances(ADMIN).unwrap();
assert_eq!(bal, vec![creation_fee.clone()]);

// this should create the minter + sg721
let cosmos_msg = factory_contract.call_with_funds(msg, creation_fee).unwrap();

let res = app.execute(Addr::unchecked(ADMIN), cosmos_msg);
assert!(res.is_ok());

(app, Addr::unchecked("contract2"))
}

#[test]
fn create_sg721_mutable_collection() {
let (app, contract) = proper_instantiate();

let res: NumTokensResponse = app
.wrap()
.query_wasm_smart(contract, &QueryMsg::NumTokens {})
.unwrap();
assert_eq!(res.count, 0);
}
}
}
2 changes: 1 addition & 1 deletion ts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@stargazezone/launchpad",
"version": "3.0.0",
"version": "3.1.0",
"description": "Stargaze Launchpad CosmWasm Typescript Types",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 980e703

Please sign in to comment.