File tree Expand file tree Collapse file tree 1 file changed +25
-7
lines changed Expand file tree Collapse file tree 1 file changed +25
-7
lines changed Original file line number Diff line number Diff line change @@ -385,19 +385,37 @@ contract MigratorZap is Ownable {
385
385
)
386
386
{
387
387
vTokenV3 = v3NFTXFactory.vault (vaultIdV3);
388
+ address assetAddress = INFTXVaultV3 (vTokenV3).assetAddress ();
389
+ bool isCryptoPunk = (assetAddress == TransferLib.CRYPTO_PUNKS);
388
390
389
391
// random redeem v2 vTokens. Directly transferring to the v3 vault
390
- uint256 [] memory idsToRedeem ;
392
+ uint256 [] memory emptyArray ;
391
393
uint256 [] memory idsRedeemed = INFTXVaultV2 (vTokenV2).redeemTo (
392
394
vTokenV2Balance / 1 ether,
393
- idsToRedeem ,
394
- is1155 ? address (this ) : vTokenV3
395
+ emptyArray ,
396
+ is1155 ? address (this ) : (isCryptoPunk ? address ( this ) : vTokenV3)
395
397
);
398
+ if (isCryptoPunk) {
399
+ for (uint256 i; i < idsRedeemed.length ; ) {
400
+ // from TransferLib._approveCryptoPunkERC721()
401
+ bytes memory data = abi.encodeWithSignature (
402
+ "offerPunkForSaleToAddress(uint256,uint256,address) " ,
403
+ idsRedeemed[i],
404
+ 0 ,
405
+ vTokenV3 // to = v3 vault address
406
+ );
407
+ (bool success , bytes memory resultData ) = TransferLib
408
+ .CRYPTO_PUNKS
409
+ .call (data);
410
+ require (success, string (resultData));
411
+
412
+ unchecked {
413
+ ++ i;
414
+ }
415
+ }
416
+ }
396
417
if (is1155) {
397
- IERC1155 (INFTXVaultV3 (vTokenV3).assetAddress ()).setApprovalForAll (
398
- vTokenV3,
399
- true
400
- );
418
+ IERC1155 (assetAddress).setApprovalForAll (vTokenV3, true );
401
419
}
402
420
403
421
// fractional portion of vToken would be left
You can’t perform that action at this time.
0 commit comments