I have an error when trying to use Recover function of ECDSA Library. What is the problem?
import "hardhat/console.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "./IToken.sol";
import "./BSCToken.sol";
import "./ETHToken.sol";
import "./TokenBase.sol";
contract Bridge {
using ECDSA for bytes32;
address public admin;
TokenBase public token;
uint256 public nonce;
event SwapInitialized(
address _from,
address _to,
uint256 _amount,
uint256 _chainId,
uint256 _nonce,
string _symbol
);
constructor(address _token) {
admin = msg.sender;
token = TokenBase(_token);
}
function swap(
address _to,
uint256 _amount,
uint256 _chainId,
uint256 _nonce,
string memory _symbol
) external {
token.burn(msg.sender, _amount);
emit SwapInitialized(
msg.sender,
_to,
_amount,
_chainId,
_nonce,
_symbol
);
}
function reedem(
address _to,
uint256 _amount,
uint256 _nonce,
string memory _symbol,
bytes32 _signatureV,
bytes32 _signatureR,
bytes32 _signatureS
) external {
bytes32 signedDataHash = keccak256(
abi.encodePacked(_to, _amount, _nonce, _symbol)
);
bytes32 message = signedDataHash.toEthSignedMessageHash();
message.recover(_signatureV, _signatureR, _signatureS);
token.mint(_to, _amount);
}
}