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

Migration from sg721 to cw721 CollectionInfo #668

Open
wants to merge 20 commits into
base: main
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
1,943 changes: 1,256 additions & 687 deletions Cargo.lock

Large diffs are not rendered by default.

15 changes: 11 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ cw-controllers = "1.1.0"
cw2 = "1.1.0"
cw4 = "1.1.0"
cw4-group = "1.1.0"
cw721 = "0.18.0"
cw721-base = "0.18.0"
cw721 = { git = "https://github.com/arkprotocol/cw-nfts.git", branch = "collection-info"} # TODO: switch to official repo once merged
cw721-base = { git = "https://github.com/arkprotocol/cw-nfts.git", branch = "collection-info"} # TODO: switch to official repo once merged
cw-multi-test = "0.20.0"
cw-storage-plus = "1.2.0"
cw-utils = "1.0.1"
Expand All @@ -37,9 +37,14 @@ serde = { version = "1.0", default-features = false, features = ["deri
serde_json = "1.0"
sg1 = { version = "3.5.0", path = "packages/sg1" }
sg2 = { version = "3.5.0", path = "packages/sg2" }
# NOTE: `v3.8.0-prerelease` contains commit for switch to new cw721 with collection metadata
# This is needed for testing legacy migration from collection info -> collection metadata
sg2-v3-8-0-prerelease = { git = "https://github.com/public-awesome/launchpad", rev = "b584245bcc7ff07d9b384df1ccc4e3e2466d92db", package = "sg2" } # needed for testing legacy migration
sg4 = { version = "3.5.0", path = "packages/sg4" }
sg721 = { version = "3.5.0", path = "packages/sg721" }
sg721-v3-8-0-prerelease = { git = "https://github.com/public-awesome/launchpad", rev = "b584245bcc7ff07d9b384df1ccc4e3e2466d92db", package = "sg721" } # needed for testing legacy migration
sg721-base = { version = "3.5.0", path = "contracts/collections/sg721-base" }
sg721-base-v3-8-0-prerelease = { git = "https://github.com/public-awesome/launchpad", rev = "b584245bcc7ff07d9b384df1ccc4e3e2466d92db", package = "sg721-base" } # needed for testing legacy migration
sg721-nt = { version = "3.5.0", path = "contracts/collections/sg721-nt" }
sg721-updatable = { version = "3.5.0", path = "contracts/collections/sg721-updatable" }
sg-controllers = { version = "3.5.0", path = "packages/controllers" }
Expand All @@ -50,13 +55,15 @@ sg-splits = { version = "3.5.0", path = "contracts/splits" }
sg-std = { version = "3.2.0" }
sg-whitelist = { version = "3.5.0", path = "contracts/whitelists/whitelist" }
thiserror = "1.0.31"
url = "2.2.2"
url = "^2.5"
sha2 = { version = "0.10.2", default-features = false }

whitelist-mtree = { version = "3.5.0", path = "contracts/whitelists/whitelist-merkletree" }
vending-minter-merkle-wl = { version = "3.5.0", path = "contracts/minters/vending-minter-merkle-wl" }
vending-factory = { version = "3.5.0", path = "contracts/factories/vending-factory" }
vending-factory-v3-8-0-prerelease = { git = "https://github.com/public-awesome/launchpad", rev = "b584245bcc7ff07d9b384df1ccc4e3e2466d92db", package = "vending-factory" } # needed for testing legacy migration
vending-minter = { version = "3.5.0", path = "contracts/minters/vending-minter" }
vending-minter-v3-8-0-prerelease = { git = "https://github.com/public-awesome/launchpad", rev = "b584245bcc7ff07d9b384df1ccc4e3e2466d92db", package = "vending-minter" } # needed for testing legacy migration
open-edition-factory = { version = "3.5.0", path = "contracts/factories/open-edition-factory" }
open-edition-minter = { version = "3.5.0", path = "contracts/minters/open-edition-minter" }
whitelist-immutable = { version = "3.5.0", path = "contracts/whitelists/whitelist-immutable" }
Expand All @@ -66,7 +73,7 @@ sg-eth-airdrop = { version = "3.5.0", path = "contracts/sg-eth-airdrop
test-suite = { version = "3.5.0", path = "test-suite" }

semver = "1"
cw-ownable = "0.5.1"
cw-ownable = { git = "https://github.com/public-awesome/cw-plus-plus.git", branch = "main"} # TODO: switch to official https://github.com/larry0x/cw-plus-plus once merged
anybuf = "0.3.0"

[profile.release.package.sg721]
Expand Down
32 changes: 23 additions & 9 deletions contracts/collections/sg721-base/examples/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@ use std::fs::create_dir_all;
use cosmwasm_schema::{export_schema, export_schema_with_title, remove_schemas, schema_for};

use cosmwasm_std::Empty;

use cw721::{
AllNftInfoResponse, ApprovalResponse, ApprovalsResponse, ContractInfoResponse, NftInfoResponse,
NumTokensResponse, OperatorsResponse, OwnerOfResponse, TokensResponse,
use cw721_base::{
msg::{
AllNftInfoResponse, ApprovalResponse, ApprovalsResponse,
CollectionInfoAndExtensionResponse, MinterResponse, NftInfoResponse, NumTokensResponse,
OperatorsResponse, OwnerOfResponse, TokensResponse,
},
DefaultOptionalCollectionExtension, DefaultOptionalNftExtension,
};
use cw721_base::MinterResponse;
use sg721::InstantiateMsg;
#[allow(deprecated)]
use sg721_base::msg::{CollectionInfoResponse, QueryMsg};

fn main() {
Expand All @@ -20,10 +23,18 @@ fn main() {
remove_schemas(&out_dir).unwrap();

export_schema(&schema_for!(InstantiateMsg), &out_dir);
export_schema(&schema_for!(QueryMsg), &out_dir);
export_schema(
&schema_for!(QueryMsg<DefaultOptionalNftExtension, DefaultOptionalCollectionExtension, Empty>),
&out_dir,
);
#[allow(deprecated)]
export_schema(&schema_for!(CollectionInfoResponse), &out_dir);
export_schema(
&schema_for!(CollectionInfoAndExtensionResponse<DefaultOptionalCollectionExtension>),
&out_dir,
);
export_schema_with_title(
&schema_for!(AllNftInfoResponse<Empty>),
&schema_for!(AllNftInfoResponse<DefaultOptionalNftExtension>),
&out_dir,
"AllNftInfoResponse",
);
Expand All @@ -37,9 +48,12 @@ fn main() {
export_schema(&schema_for!(ApprovalResponse), &out_dir);
export_schema(&schema_for!(ApprovalsResponse), &out_dir);
export_schema(&schema_for!(OperatorsResponse), &out_dir);
export_schema(&schema_for!(ContractInfoResponse), &out_dir);
export_schema(
&schema_for!(CollectionInfoAndExtensionResponse<DefaultOptionalCollectionExtension>),
&out_dir,
);
export_schema_with_title(
&schema_for!(NftInfoResponse<Empty>),
&schema_for!(NftInfoResponse<DefaultOptionalNftExtension>),
&out_dir,
"NftInfoResponse",
);
Expand Down
Loading
Loading