Skip to content

Commit

Permalink
chore: exclude p2p
Browse files Browse the repository at this point in the history
  • Loading branch information
zhoujia6139 committed Nov 16, 2023
1 parent dffd693 commit 636b355
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions contracts/misc/ParaXApeCoinStakingVoting.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
pragma solidity ^0.8.0;
import {INToken} from "../interfaces/INToken.sol";
import "../dependencies/openzeppelin/contracts//IERC20.sol";
import "../dependencies/openzeppelin/contracts//IERC721.sol";
import "../dependencies/yoga-labs/ApeCoinStaking.sol";

contract ParaXApeCoinStakingVoting {
Expand Down Expand Up @@ -62,8 +63,13 @@ contract ParaXApeCoinStakingVoting {
return 0;
}

IERC721 underlyingNFT = IERC721(ntoken.UNDERLYING_ASSET_ADDRESS());
for (uint256 i = 0; i < balance; i++) {
uint256 tokenId = ntoken.tokenOfOwnerByIndex(userAddress, i);
//ensure nToken owns the underlying asset(to exclude P2P case)
if (underlyingNFT.ownerOf(tokenId) != address(ntoken)) {
continue;
}

(uint256 stakedAmount, ) = apeCoinStaking.nftPosition(
poolId,
Expand Down

0 comments on commit 636b355

Please sign in to comment.