Discover more of SonicScan Block Explorer's tools and services in one place.
Contract Source Code:
File 1 of 1 : DelegatorCaller
// SPDX-License-Identifier: MIT pragma solidity 0.8.0; interface IERC721 { function balanceOf(address owner) external view returns (uint256); } interface SacraRelay { struct CallWithERC2771 { uint chainId; address target; bytes data; address user; uint userNonce; uint userDeadline; } function callFromDelegator(CallWithERC2771 calldata callInfo) external; } contract DelegatorCaller { SacraRelay public sacraRelay; constructor(address _sacraRelay) { sacraRelay = SacraRelay(_sacraRelay); } // Function to get the NFT balance of a given address for a specific contract function getNFTBalance(address nftContract, address owner) public view returns (uint256) { return IERC721(nftContract).balanceOf(owner); } function kek( SacraRelay.CallWithERC2771 calldata callInfo, address nftContract, uint256 minimum ) public { // Call the relay function sacraRelay.callFromDelegator(callInfo); // Check NFT balance uint256 balance = IERC721(nftContract).balanceOf(callInfo.user); require(balance >= minimum, "Insufficient NFT balance"); } }
Please enter a contract address above to load the contract details and source code.
Please DO NOT store any passwords or private keys here. A private note (up to 100 characters) can be saved and is useful for transaction tracking.
This website uses cookies to improve your experience. By continuing to use this website, you agree to its Terms and Privacy Policy.