优化检查owner逻辑

This commit is contained in:
CounterFire2023 2024-07-22 15:52:38 +08:00
parent 6dd7a4ed0c
commit 3982eea8c7

View File

@ -84,8 +84,8 @@ export class Locker {
return txHash
}
async execUnlock(provider, chainId, nft, tokenIds) {
const nftContract = new ethers.Contract(nft, erc721Abi, provider.getSigner())
for (let tokenId of tokenIds) {
const nftContract = new ethers.Contract(nft, erc721Abi, provider.getSigner())
const owner = await nftContract.ownerOf(tokenId)
if (owner.toLowerCase() != lockAddressImtbl.toLowerCase() && owner.toLowerCase() != lockAddressMain.toLowerCase()) {
throw new Error('params mismatch, perhaps one transaction is pending')