Add a SafeERC20:safePermit function (#3280)
This commit is contained in:
@ -7,6 +7,14 @@ const EIP712Domain = [
|
||||
{ name: 'verifyingContract', type: 'address' },
|
||||
];
|
||||
|
||||
const Permit = [
|
||||
{ name: 'owner', type: 'address' },
|
||||
{ name: 'spender', type: 'address' },
|
||||
{ name: 'value', type: 'uint256' },
|
||||
{ name: 'nonce', type: 'uint256' },
|
||||
{ name: 'deadline', type: 'uint256' },
|
||||
];
|
||||
|
||||
async function domainSeparator (name, version, chainId, verifyingContract) {
|
||||
return '0x' + ethSigUtil.TypedDataUtils.hashStruct(
|
||||
'EIP712Domain',
|
||||
@ -17,5 +25,6 @@ async function domainSeparator (name, version, chainId, verifyingContract) {
|
||||
|
||||
module.exports = {
|
||||
EIP712Domain,
|
||||
Permit,
|
||||
domainSeparator,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user