You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.
getCollectionID function enforces that an NFT must be stored before returning the corresponding collectionID. However, in the foreign-chain part of the execution of the cross-chain ccm, there is a call to the isNFTSupported function, which in turn calls getCollectionID function. This is a problem, since at that point the NFT is not yet stored on the foreign chain, and the execution would fail.
module argument of lock function is not checked against a possible nft input value, equal to the current value of NFT_NOT_LOCKED. This results in an unexpected behaviour of not locking the module.
Checks whether an NFT is escrowed or locked should be factored out to separate functions with self-explanatory names. Thus, when these checks are encountered elsewhere in the pseudocode, their purpose would be clear.
Several typos and/or code quality improvements are recommended.
In crossChainNFTTransferParamsSchema for the cross-chain transfer command, the property messageFeeTokenID is not needed, since it is does not appear anywhere in the execution.
Current Specifications
In getCollectionID, there is a check which ensures that NFT should be stored in the NFT store:
defgetCollectionID(nftID: NFTID) ->CollectionID:
ifNFTStore[nftID] doesnotexist:
raiseException("NFT substore entry does not exist")
returnnftID[`LENGTH_CHAIN_ID`:(`LENGTH_CHAIN_ID`+`LENGTH_COLLECTION_ID`)]
In lock, there is no check that module should not be equal to NFT_NOT_LOCKED.
In several functions, there are checks to ensure that an NFT is/isn't escrowed, e.g.
iflen(getNFTOwner(nftID)) ==LENGTH_CHAIN_ID:
Furthermore, in several functions there are checks to ensure that an NFT is/isn't locked, e.g.
ifgetLockingModule(nftID) !=NFT_NOT_LOCKED:
In pattern definition for lockingModule property of userStoreSchema there is a typo (extra ] at the end of pattern expression):
In lock, add the check to ensure that the value of the moduleargument is not equal to NFT_NOT_LOCKED.
Define dedicated functions isNFTEscrowed and isNFTLocked that perform the mentioned checks and refactor the code accordingly.
Remove the extra symbols.
Remove messageFeeTokenID from crossChainNFTTransferParamsSchema and update the code accordingly. The following check in the verify function of the cross-chain transfer command now becomes obsolete:
Motivation
Several issues in LIP 0052 have been noticed:
getCollectionID
function enforces that an NFT must be stored before returning the correspondingcollectionID
. However, in the foreign-chain part of the execution of the cross-chain ccm, there is a call to theisNFTSupported
function, which in turn callsgetCollectionID
function. This is a problem, since at that point the NFT is not yet stored on the foreign chain, and the execution would fail.module
argument oflock
function is not checked against a possiblenft
input value, equal to the current value ofNFT_NOT_LOCKED
. This results in an unexpected behaviour of not locking the module.crossChainNFTTransferParamsSchema
for the cross-chain transfer command, the propertymessageFeeTokenID
is not needed, since it is does not appear anywhere in the execution.Current Specifications
getCollectionID
, there is a check which ensures that NFT should be stored in the NFT store:lock
, there is no check thatmodule
should not be equal toNFT_NOT_LOCKED
.Furthermore, in several functions there are checks to ensure that an NFT is/isn't locked, e.g.
lockingModule
property ofuserStoreSchema
there is a typo (extra]
at the end of pattern expression):Furthermore, the specification of the
getCollectionID
function has unnecessary "`" characters:Also, the return statement of the
getAttributes
function has unnecessary parentheses:messageFeeTokenID
is a property ofcrossChainNFTTransferParamsSchema
.Proposed Specifications
getCollectionID
, remove the check whether NFT is stored in the NFT store:lock
, add the check to ensure that the value of themodule
argument is not equal toNFT_NOT_LOCKED
.isNFTEscrowed
andisNFTLocked
that perform the mentioned checks and refactor the code accordingly.messageFeeTokenID
fromcrossChainNFTTransferParamsSchema
and update the code accordingly. The following check in theverify
function of the cross-chain transfer command now becomes obsolete:Affected LIPs
0052
The text was updated successfully, but these errors were encountered: