(
token: Contract,
approve: {
owner: string
spender: string
value: BigNumber
},
nonce: BigNumber,
deadline: BigNumber
)
| 50 | } |
| 51 | |
| 52 | export async function getApprovalDigest( |
| 53 | token: Contract, |
| 54 | approve: { |
| 55 | owner: string |
| 56 | spender: string |
| 57 | value: BigNumber |
| 58 | }, |
| 59 | nonce: BigNumber, |
| 60 | deadline: BigNumber |
| 61 | ): Promise<string> { |
| 62 | const name = await token.name() |
| 63 | const DOMAIN_SEPARATOR = getDomainSeparator(name, token.address) |
| 64 | return keccak256( |
| 65 | solidityPack( |
| 66 | ['bytes1', 'bytes1', 'bytes32', 'bytes32'], |
| 67 | [ |
| 68 | '0x19', |
| 69 | '0x01', |
| 70 | DOMAIN_SEPARATOR, |
| 71 | keccak256( |
| 72 | defaultAbiCoder.encode( |
| 73 | ['bytes32', 'address', 'address', 'uint256', 'uint256', 'uint256'], |
| 74 | [PERMIT_TYPEHASH, approve.owner, approve.spender, approve.value, nonce, deadline] |
| 75 | ) |
| 76 | ) |
| 77 | ] |
| 78 | ) |
| 79 | ) |
| 80 | } |
| 81 | |
| 82 | export async function mineBlock(provider: Web3Provider, timestamp: number): Promise<void> { |
| 83 | await new Promise(async (resolve, reject) => { |
no test coverage detected