Skip to content

Commit

Permalink
Merge branch 'main' into tasiov/sg-1051-names-renewal
Browse files Browse the repository at this point in the history
  • Loading branch information
jason-c-child authored Apr 26, 2024
2 parents 8c53bdd + e910317 commit 81a25e7
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 76 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -253,4 +253,4 @@ jobs:
-c "$CIRCLE_SHA1" \
-n "$TITLE" -b "$BODY" \
-delete \
"$TAG" ./artifacts/
"$TAG" ./artifacts/
121 changes: 52 additions & 69 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ license = "Apache-2.0"
[workspace.dependencies]
cosmwasm-schema = "1.2.1"
cosmwasm-std = "1.2.1"
cw2 = "0.16.0"
cw2 = "1.1.2"
cw721 = "0.16.0"
cw721-base = "0.16.0"
cw-controllers = "0.16.0"
Expand All @@ -31,11 +31,11 @@ sg-metadata = "0.22.9"
sg-multi-test = "0.22.9"
sg-std = "0.22.9"
thiserror = "1.0.31"
sg-name-common = { path = "./packages/sg-name-common" }
sg-name = { path = "./packages/sg-name" }
sg-name-market = { path = "./packages/sg-name-market" }
sg-name-minter = { path = "./packages/sg-name-minter" }
name-marketplace = { path = "./contracts/marketplace", features = ["library"] }
sg-name-common = { version = "1.2.5", path = "./packages/sg-name-common" }
sg-name = { version = "1.2.5", path = "./packages/sg-name" }
sg-name-market = { version = "1.2.5", path = "./packages/sg-name-market" }
sg-name-minter = { version = "1.2.5", path = "./packages/sg-name-minter" }
name-marketplace = { version = "1.2.5", path = "./contracts/marketplace", features = ["library"] }
name-minter = { path = "./contracts/name-minter", features = ["library"] }
sg721-name = { path = "./contracts/sg721-name", features = ["library"] }

Expand Down
13 changes: 13 additions & 0 deletions contracts/sg721-name/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use cw721_base::{state::TokenInfo, MintMsg};
use cw_utils::{nonpayable, Expiration};

use sg721::ExecuteMsg as Sg721ExecuteMsg;
use sg721_base::msg::CollectionInfoResponse;
use sg721_base::ContractError::{Claimed, Unauthorized};
use sg_name::{Metadata, TextRecord, MAX_TEXT_LENGTH, NFT};
use sg_name_market::SgNameMarketplaceExecuteMsg;
Expand Down Expand Up @@ -607,6 +608,18 @@ fn validate_address(deps: Deps, sender: &Addr, addr: Addr) -> Result<Addr, Contr
return Ok(addr);
}

let contract_details = cw2::query_contract_info(&deps.querier, addr.to_string())?;
if contract_details.contract.contains("sg721-base")
|| contract_details.contract.contains("sg721-updatable")
{
let collection_info: CollectionInfoResponse = deps
.querier
.query_wasm_smart(&addr, &sg721_base::msg::QueryMsg::CollectionInfo {})?;
if collection_info.creator == sender.to_string() {
return Ok(addr);
}
}

let ContractInfoResponse { admin, creator, .. } =
deps.querier.query_wasm_contract_info(&addr)?;

Expand Down

0 comments on commit 81a25e7

Please sign in to comment.