Migrate ERC165 tests (#4794)
This commit is contained in:
@ -1,5 +1,14 @@
|
||||
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: signature => ethers.FunctionFragment.from(signature).selector,
|
||||
selector,
|
||||
interfaceId,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user