Skip to content

Commit

Permalink
likenft: Remove parent from class storage
Browse files Browse the repository at this point in the history
Unlike cosmos, EVM will not have any relation as iscn as parent. The
relation will be added to metaClass later on.
  • Loading branch information
rickmak committed Jan 23, 2025
2 parents 469f18f + a394d36 commit 55ee86c
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 59 deletions.
3 changes: 0 additions & 3 deletions likenft/contracts/Class.sol
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ contract Class is ERC721A, Ownable {
$.name = msgNewClass.input.name;
$.symbol = msgNewClass.input.symbol;
$.data.metadata = msgNewClass.input.metadata;
$.data.parent.type_ = msgNewClass.parent.type_;
$.data.parent.iscn_id_prefix = msgNewClass.parent.iscn_id_prefix;
$.data.config = msgNewClass.input.config;
}

Expand Down Expand Up @@ -81,7 +79,6 @@ contract Class is ERC721A, Ownable {

for (uint i = 0; i < quantity; i++) {
uint256 _tokenId = nextTokenId + i;
nftDataMap[_tokenId].class_parent = $.data.parent;
nftDataMap[_tokenId].metadata = metadata_list[i];
}
}
Expand Down
5 changes: 0 additions & 5 deletions likenft/scripts/examples/newClass.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ async function newClass() {

const tx = await likeNFT.newClass({
creator: signer.address,
parent: {
type_: 1,
iscn_id_prefix:
"iscn://likecoin-chain/FyZ13m_hgwzUC6UoaS3vFdYvdG6QXfajU3vcatw7X1c",
},
input: {
name: "《所謂「我不投資」,就是 all in 在法定貨幣》",
symbol: "BOOK",
Expand Down
20 changes: 0 additions & 20 deletions likenft/test/LikeNFT.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ describe("LikeNFT", () => {
await likeNFTOwnerSigner
.newClass({
creator: this.ownerSigner,
parent: {
type_: 1,
iscn_id_prefix:
"iscn://likecoin-chain/FyZ13m_hgwzUC6UoaS3vFdYvdG6QXfajU3vcatw7X1c/1",
},
input: {
name: "My Book",
symbol: "KOOB",
Expand Down Expand Up @@ -78,11 +73,6 @@ describe("LikeNFT", () => {
await likeNFTOwnerSigner
.newClass({
creator: this.ownerSigner,
parent: {
type_: 1,
iscn_id_prefix:
"iscn://likecoin-chain/FyZ13m_hgwzUC6UoaS3vFdYvdG6QXfajU3vcatw7X1c/1",
},
input: {
name: "My Book",
symbol: "KOOB",
Expand Down Expand Up @@ -149,11 +139,6 @@ describe("LikeNFT class operations", () => {
likeNFTOwnerSigner
.newClass({
creator: this.ownerSigner,
parent: {
type_: 1,
iscn_id_prefix:
"iscn://likecoin-chain/FyZ13m_hgwzUC6UoaS3vFdYvdG6QXfajU3vcatw7X1c/1",
},
input: {
name: "My Book",
symbol: "KOOB",
Expand Down Expand Up @@ -376,11 +361,6 @@ describe("LikeNFT token operations", () => {
likeNFTOwnerSigner
.newClass({
creator: this.ownerSigner,
parent: {
type_: 1,
iscn_id_prefix:
"iscn://likecoin-chain/FyZ13m_hgwzUC6UoaS3vFdYvdG6QXfajU3vcatw7X1c/1",
},
input: {
name: "My Book",
symbol: "KOOB",
Expand Down
2 changes: 0 additions & 2 deletions likenft/types/Class.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
pragma solidity ^0.8.9;

import {ClassConfig} from "./ClassConfig.sol";
import {ClassParent} from "./ClassParent.sol";

struct ClassStorage {
string name;
Expand All @@ -12,6 +11,5 @@ struct ClassStorage {

struct ClassDataStorage {
string metadata;
ClassParent parent;
ClassConfig config;
}
15 changes: 0 additions & 15 deletions likenft/types/ClassParent.sol

This file was deleted.

9 changes: 0 additions & 9 deletions likenft/types/ClassParentInput.sol

This file was deleted.

3 changes: 0 additions & 3 deletions likenft/types/NFTData.sol
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;

import {ClassParent} from "./ClassParent.sol";

struct NFTData {
string metadata;
ClassParent class_parent;
}
2 changes: 0 additions & 2 deletions likenft/types/msgs/MsgNewClass.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
pragma solidity ^0.8.9;

import {ClassInput} from "../ClassInput.sol";
import {ClassParentInput} from "../ClassParentInput.sol";

struct MsgNewClass {
address creator;
ClassParentInput parent;
ClassInput input;
}

0 comments on commit 55ee86c

Please sign in to comment.