Update docs

This commit is contained in:
github-actions
2022-07-27 19:55:55 +00:00
parent 0e33f67bd8
commit 08c3b2b156
25 changed files with 192 additions and 142 deletions

View File

@ -7,6 +7,7 @@ const ERC165MissingData = artifacts.require('ERC165MissingData');
const ERC165MaliciousData = artifacts.require('ERC165MaliciousData');
const ERC165NotSupported = artifacts.require('ERC165NotSupported');
const ERC165InterfacesSupported = artifacts.require('ERC165InterfacesSupported');
const ERC165ReturnBombMock = artifacts.require('ERC165ReturnBombMock');
const DUMMY_ID = '0xdeadbeef';
const DUMMY_ID_2 = '0xcafebabe';
@ -243,4 +244,23 @@ contract('ERC165Checker', function (accounts) {
expect(supported[0]).to.equal(false);
});
});
it('Return bomb resistance', async function () {
this.target = await ERC165ReturnBombMock.new();
const tx1 = await this.mock.supportsInterface.sendTransaction(this.target.address, DUMMY_ID);
expect(tx1.receipt.gasUsed).to.be.lessThan(120000); // 3*30k + 21k + some margin
const tx2 = await this.mock.getSupportedInterfaces.sendTransaction(
this.target.address,
[
DUMMY_ID,
DUMMY_ID_2,
DUMMY_ID_3,
DUMMY_UNSUPPORTED_ID,
DUMMY_UNSUPPORTED_ID_2,
],
);
expect(tx2.receipt.gasUsed).to.be.lessThan(250000); // (2+5)*30k + 21k + some margin
});
});