Skip to content

Commit

Permalink
Review how to verify data owner.
Browse files Browse the repository at this point in the history
  • Loading branch information
waterflier committed Dec 24, 2023
1 parent ea94987 commit 1e7cac8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
7 changes: 5 additions & 2 deletions contracts/public_data_storage.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ using SortedScoreList for SortedScoreList.List;
interface IERCPublicDataContract {
//return the owner of the data
function getDataOwner(bytes32 dataHash) external view returns (address);
}

interface IERC721VerfiyDataHash{
//return token data hash
function tokenDataHash(uint256 _tokenId) external view returns (bytes32);
}
Expand Down Expand Up @@ -188,9 +190,10 @@ contract PublicDataStorage {
// 当合约不是IERCPublicDataContract时,是否可以将owner设置为contract地址?
// 是不是可以认为这是个Ownerable合约?
// TODO: 这里要考虑一下Owner的粒度: 合约Owner,Collection Owner,Token Owner
publicDataInfo.owner = Ownable(publicDataContract).owner();

//publicDataInfo.nftContract = IERC721VerfiyDataHash(publicDataContract);
} else {
require(dataMixedHash == IERCPublicDataContract(publicDataContract).tokenDataHash(tokenId));
require(dataMixedHash == IERC721VerfiyDataHash(publicDataContract).tokenDataHash(tokenId));
publicDataInfo.nftContract = publicDataContract;
publicDataInfo.tokenId = tokenId;
}
Expand Down
8 changes: 7 additions & 1 deletion doc/user-story.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,13 @@ DMC上DeFi
4. 经常分享自己拥有的NFT的数据Hash,让更多的人来Sponsor或SHOW数据

### 如何确定PublicData的Owner?
TODO:Improve
1. 固定Owenr,Sponsor就是Owner
2. 指定NFT合约,但未指定Index,这说明指该合约有查询数据Owner的方法。目前可以配置的就是我们的NFT Bridge合约,这种情况下Owner就是NFT Bridge合约的Owner
3. 指定NFT合约和Index,是指该数据的Owner就是特定NFT合约和Index的Owner。这种指定方法是我们最推荐的,可以和现在NFT生态很好的结合。但为了提高可信性,我们要求建立这种关系是可验证的。

#### 公共数据与NFT Owner的可验证连接
1. NFT合约本身实现了ERCXXXPublicData接口 (新NFT合约)
2. 官方的NFT Bridge合约实现了ERCXXXPublicData接口,并可查询到对应NFT合约 (已存NFT合约)

## Sponosr视角的合约调用顺序

Expand Down

0 comments on commit 1e7cac8

Please sign in to comment.