You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
326 B
14 lines
326 B
const { ethers } = require('hardhat');
|
|
|
|
const selector = signature => ethers.FunctionFragment.from(signature).selector;
|
|
|
|
const interfaceId = signatures =>
|
|
ethers.toBeHex(
|
|
signatures.reduce((acc, signature) => acc ^ ethers.toBigInt(selector(signature)), 0n),
|
|
4,
|
|
);
|
|
|
|
module.exports = {
|
|
selector,
|
|
interfaceId,
|
|
};
|
|
|