i have a function transferWithData(address to, uint256 amount, bytes data)
it basically transfer ERC20 token but it has an additional 'data' field, in order to inject a certificate generated off-chain by an issuer.
Certificate contains:
- The function ID which ensures the certificate can’t be used on an other function.
- parameters which ensures the input parameters have been validated by the issuer.
- validity date which ensures the certificate can’t be used after validity date.
- nonce which ensures the certificate can’t be used twice.
Finally the certificate is signed by the issuer and passed as parameter in the transferWithData function.
my question is that how to verify this certificate on chain. i am able to recover the issuer address using ecrecover
. but i also need to validate the certificate content. I am following this repo https://github.com/NDAXlO/ERC1400/blob/master/contracts/mocks/CertificateControllerMock.sol
thanks