@@ -738,7 +738,8 @@ internal void MintToken(RuntimeVM Runtime, IToken token, Address source, Address
738
738
739
739
var nft = ReadNFT ( Runtime , token . Symbol , tokenID ) ;
740
740
using ( var m = new ProfileMarker ( "Nexus.WriteNFT" ) )
741
- WriteNFT ( Runtime , token . Symbol , tokenID , Runtime . Chain . Name , destination , nft . ROM , nft . RAM , nft . SeriesID , nft . Timestamp , nft . Infusion , ! isSettlement ) ;
741
+ WriteNFT ( Runtime , token . Symbol , tokenID , Runtime . Chain . Name , source , destination , nft . ROM , nft . RAM ,
742
+ nft . SeriesID , nft . Timestamp , nft . Infusion , ! isSettlement ) ;
742
743
743
744
using ( var m = new ProfileMarker ( "Runtime.Notify" ) )
744
745
if ( isSettlement )
@@ -934,7 +935,8 @@ internal void InfuseToken(RuntimeVM Runtime, IToken token, Address from, BigInte
934
935
infusion [ index ] = new TokenInfusion ( infuseToken . Symbol , value + temp . Value ) ;
935
936
}
936
937
937
- WriteNFT ( Runtime , token . Symbol , tokenID , nft . CurrentChain , nft . CurrentOwner , nft . ROM , nft . RAM , nft . SeriesID , nft . Timestamp , infusion , true ) ;
938
+ WriteNFT ( Runtime , token . Symbol , tokenID , nft . CurrentChain , nft . Creator , nft . CurrentOwner , nft . ROM , nft . RAM ,
939
+ nft . SeriesID , nft . Timestamp , infusion , true ) ;
938
940
939
941
Runtime . Notify ( EventKind . Infusion , nft . CurrentOwner , new InfusionEventData ( token . Symbol , tokenID , infuseToken . Symbol , value , nft . CurrentChain ) ) ;
940
942
}
@@ -1020,7 +1022,8 @@ internal void TransferToken(RuntimeVM Runtime, IToken token, Address source, Add
1020
1022
1021
1023
Runtime . Expect ( Runtime . InvokeTriggerOnAccount ( true , destination , AccountTrigger . OnReceive , source , destination , token . Symbol , tokenID ) != TriggerResult . Failure , "account received trigger failed" ) ;
1022
1024
1023
- WriteNFT ( Runtime , token . Symbol , tokenID , Runtime . Chain . Name , destination , nft . ROM , nft . RAM , nft . SeriesID , Runtime . Time , nft . Infusion , true ) ;
1025
+ WriteNFT ( Runtime , token . Symbol , tokenID , Runtime . Chain . Name , nft . Creator , destination , nft . ROM , nft . RAM ,
1026
+ nft . SeriesID , Runtime . Time , nft . Infusion , true ) ;
1024
1027
1025
1028
if ( destination . IsSystem && ( destination == Runtime . CurrentContext . Address || isInfusion ) )
1026
1029
{
@@ -1220,7 +1223,9 @@ internal void DestroyNFT(RuntimeVM Runtime, string symbol, BigInteger tokenID, A
1220
1223
Runtime . CallNativeContext ( NativeContractKind . Storage , nameof ( StorageContract . DeleteData ) , contractAddress , tokenKey ) ;
1221
1224
}
1222
1225
1223
- internal void WriteNFT ( RuntimeVM Runtime , string symbol , BigInteger tokenID , string chainName , Address owner , byte [ ] rom , byte [ ] ram , BigInteger seriesID , Timestamp timestamp , IEnumerable < TokenInfusion > infusion , bool mustExist )
1226
+ internal void WriteNFT ( RuntimeVM Runtime , string symbol , BigInteger tokenID , string chainName , Address creator ,
1227
+ Address owner , byte [ ] rom , byte [ ] ram , BigInteger seriesID , Timestamp timestamp ,
1228
+ IEnumerable < TokenInfusion > infusion , bool mustExist )
1224
1229
{
1225
1230
Runtime . Expect ( ram != null && ram . Length < TokenContent . MaxRAMSize , "invalid nft ram update" ) ;
1226
1231
@@ -1260,7 +1265,17 @@ internal void WriteNFT(RuntimeVM Runtime, string symbol, BigInteger tokenID, str
1260
1265
else
1261
1266
{
1262
1267
Runtime . Expect ( ! mustExist , $ "nft { symbol } { tokenID } does not exist") ;
1263
- var genID = GenerateNFT ( Runtime , symbol , chainName , owner , rom , ram , seriesID ) ;
1268
+ Address _creator ;
1269
+ if ( this . GetProtocolVersion ( Runtime . RootStorage ) >= 7 )
1270
+ {
1271
+ _creator = creator ;
1272
+ }
1273
+ else
1274
+ {
1275
+ _creator = owner ;
1276
+ }
1277
+
1278
+ var genID = GenerateNFT ( Runtime , symbol , chainName , _creator , rom , ram , seriesID ) ;
1264
1279
Runtime . Expect ( genID == tokenID , "failed to regenerate NFT" ) ;
1265
1280
}
1266
1281
}
0 commit comments