Skip to content

Commit

Permalink
Updated keys template
Browse files Browse the repository at this point in the history
  • Loading branch information
flashburst committed Jul 18, 2022
1 parent 73fc82f commit c491b07
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions util/extract/keys/template-ts.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
const pre = `import { ethers } from 'ethers'
const pre = `import { keccak256 as solidityKeccak256 } from '@ethersproject/solidity'
import { formatBytes32String } from '@ethersproject/strings'
const encodeKey = (x: string): string => ethers.utils.solidityKeccak256(['bytes32'], [x])
const encodeKeys = (x: string[], y: string[]): string => ethers.utils.solidityKeccak256(x, y)
const toBytes32 = (x: string): string => ethers.utils.formatBytes32String(x)
const encodeKey = (x: string): string => solidityKeccak256(['bytes32'], [x])
const encodeKeys = (x: string[], y: string[]): string => solidityKeccak256(x, y)
const toBytes32 = (x: string): string => formatBytes32String(x)
const getCoverContractKey = (namespace: string, coverKey: string): string => encodeKeys(['bytes32', 'bytes32'], [namespace, coverKey])
const qualifyBytes32 = (k: string): string => encodeKeys(['bytes32', 'bytes32'], [PROTOCOL.NS.CONTRACTS, k])
const qualify = (k: string): string => encodeKeys(['bytes32', 'address'], [PROTOCOL.NS.CONTRACTS, k])
Expand Down

0 comments on commit c491b07

Please sign in to comment.