What is supposed to be in the "signature" input box? The code for the "deposit"-function and the "validate signature"-function are below. I deployed a similar contract without the "calldata" part and it worked perfectly fine, however, I was missing some information. But I just can not figure out what is supposed to be in that box or how to derive it. Many thanks in advance.
function deposit(
address contractAddress,
uint256[] memory tokenIds,
bytes calldata signature
) public nonReentrant {
require(!depositPaused, "Deposit paused");
require(stakingLaunched, "Staking is not launched yet");
require(
contractAddress != address(0) &&
contractAddress == address(CBCNft),
"Unknown contract"
);
ContractTypes contractType = _contractTypes[contractAddress];
if (tokenIds.length > 0) {
require(_validateSignature(
signature,
contractAddress,
tokenIds
), "Invalid data provided");
_setTokensValues(contractAddress, tokenIds);
}
Staker storage user = _stakers[_msgSender()];
uint256 newYield = user.currentYield;
for (uint256 i; i < tokenIds.length; i++) {
require(IERC721(contractAddress).ownerOf(tokenIds[i]) == _msgSender(), "Not the owner");
IERC721(contractAddress).safeTransferFrom(_msgSender(), address(this), tokenIds[i]);
_ownerOfToken[contractAddress][tokenIds[i]] = _msgSender();
if (user.currentYield != 0 ) {
newYield += getTokenYield(contractAddress, tokenIds[i]);
}
if (contractType == ContractTypes.CBC) { user.stakedCBC.push(tokenIds[i]); }
}
accumulate(_msgSender());
user.currentYield = newYield;
emit Deposit(_msgSender(), contractAddress, tokenIds.length);
}
function _validateSignature(
bytes calldata signature,
address contractAddress,
uint256[] memory tokenIds
) internal view returns (bool) {
bytes32 dataHash = keccak256(abi.encodePacked(contractAddress, tokenIds));
bytes32 message = ECDSA.toEthSignedMessageHash(dataHash);
address receivedAddress = ECDSA.recover(message, signature);
return (receivedAddress != address(0) && receivedAddress == signerAddress);
}