Created
February 8, 2022 18:47
-
-
Save MCarlomagno/44da58e059f9b7c1709c6d4f682c0bc3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity >=0.7.0 <0.9.0; | |
import "github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v3.3/contracts/cryptography/ECDSA.sol"; | |
import "github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v3.3/contracts/utils/ReentrancyGuard.sol"; | |
contract UniDirectionalPaymentChannel is ReentrancyGuard { | |
// ... | |
function _verify(uint _amount, bytes memory _sig) private view returns (bool) { | |
return _getEthSignedHash(_amount).recover(_sig) == sender; | |
} | |
function verify(uint _amount, bytes memory _sig) external view returns (bool) { | |
return _verify(_amount, _sig); | |
} | |
// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment