Skip to content

Commit

Permalink
Update description.
Browse files Browse the repository at this point in the history
  • Loading branch information
nventuro committed Mar 27, 2019
1 parent e27a908 commit 850ca0f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions README.md
Expand Up @@ -127,12 +127,12 @@ Same as `inLogs`, but for events emitted in an arbitrary transaction (of hash `t
---


### makeInterfaceId (interfaces = [])
#### ERC165
### makeInterfaceId
#### ERC165 (interfaces = [])
Calculates the [ERC165](https://eips.ethereum.org/EIPS/eip-165) interface ID of a contract, given a series of function signatures.

#### ERC1820
Calculates the [ERC1820](https://eips.ethereum.org/EIPS/eip-1820) interface hash of a function, given its signature.
#### ERC1820 (name)
Calculates the [ERC1820](https://eips.ethereum.org/EIPS/eip-1820) interface hash of a contract, given its name.

---

Expand Down
4 changes: 2 additions & 2 deletions src/makeInterfaceId.js
Expand Up @@ -18,8 +18,8 @@ function ERC165 (functionSignatures = []) {
return `0x${interfaceIdBuffer.toString('hex')}`;
}

function ERC1820 (functionSignature) {
return web3.utils.soliditySha3(functionSignature); // keccak256
function ERC1820 (interfaceName) {
return web3.utils.soliditySha3(interfaceName); // keccak256
}

module.exports = {
Expand Down
4 changes: 2 additions & 2 deletions test/src/makeInterfaceId.test.js
Expand Up @@ -19,8 +19,8 @@ describe('makeInterfaceId', function () {
});
});

describe('ERC165', function () {
it('calculates the interface id from function signatures', async function () {
describe('ERC1820', function () {
it('calculates the interface hash a from a contract name', async function () {
expect(makeInterfaceId.ERC1820('ERC777Token')).to.equal(
'0xac7fbab5f54a3ca8194167523c6753bfeb96a445279294b6125b68cce2177054'
);
Expand Down

0 comments on commit 850ca0f

Please sign in to comment.