Skip to content

Commit

Permalink
from 0x00000000 to 0xffffffff for interface check (#298)
Browse files Browse the repository at this point in the history
* from 0x00000 to 0xffff for interface check

* correct action
  • Loading branch information
novaknole committed Feb 26, 2023
1 parent 93c041d commit cb0621d
Show file tree
Hide file tree
Showing 15 changed files with 31 additions and 10 deletions.
4 changes: 4 additions & 0 deletions packages/contracts/test/core/dao/dao.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ describe('DAO', function () {
'Unauthorized'
);

it('does not support the empty interface', async () => {
expect(await dao.supportsInterface('0xffffffff')).to.be.false;
});

describe('initialize', async () => {
it('reverts if trying to re-initialize', async () => {
await expect(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1971,7 +1971,7 @@ describe('Plugin Setup Processor', function () {
// Solidity default values, the below overrides them with the correct data
// So when PSP calls it, it can expect the same information as if it would call
// the normal/original `proxy/plugin`.
fake.supportsInterface.whenCalledWith('0x00000000').returns(false);
fake.supportsInterface.whenCalledWith('0xffffffff').returns(false);
fake.supportsInterface.whenCalledWith('0x01ffc9a7').returns(true);
fake.supportsInterface.whenCalledWith('0x41de6830').returns(true);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ describe('AdminSetup', function () {
implementationAddress = await adminSetup.implementation();
});

it('does not support the empty interface', async () => {
expect(await adminSetup.supportsInterface('0xffffffff')).to.be.false;
});

it('creates admin address base with the correct interface', async () => {
const factory = await ethers.getContractFactory('Admin');
const adminAddressContract = factory.attach(implementationAddress);
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/test/plugins/governance/admin/admin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ describe('Admin', function () {

describe('plugin interface: ', async () => {
it('does not support the empty interface', async () => {
expect(await plugin.supportsInterface('0x00000000')).to.be.false;
expect(await plugin.supportsInterface('0xffffffff')).to.be.false;
});

it('supports the `IERC165Upgradeable` interface', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ describe('AddresslistVotingSetup', function () {
]);
});

it('does not support the empty interface', async () => {
expect(await addresslistVotingSetup.supportsInterface('0xffffffff')).to.be
.false;
});

it('creates address list voting base with the correct interface', async () => {
const factory = await ethers.getContractFactory('AddresslistVoting');
const addresslistVotingContract = factory.attach(implementationAddress);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ describe('AddresslistVoting', function () {

describe('plugin interface: ', async () => {
it('does not support the empty interface', async () => {
expect(await voting.supportsInterface('0x00000000')).to.be.false;
expect(await voting.supportsInterface('0xffffffff')).to.be.false;
});

it('supports the `IERC165Upgradeable` interface', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ describe('MajorityVotingMock', function () {

describe('plugin interface: ', async () => {
it('does not support the empty interface', async () => {
expect(await votingBase.supportsInterface('0x00000000')).to.be.false;
expect(await votingBase.supportsInterface('0xffffffff')).to.be.false;
});

it('supports the `IERC165Upgradeable` interface', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ describe('TokenVotingSetup', function () {
]);
});

it('does not support the empty interface', async () => {
expect(await tokenVotingSetup.supportsInterface('0xffffffff')).to.be.false;
});

it('creates token voting base with the correct interface', async () => {
const factory = await ethers.getContractFactory('TokenVoting');
const tokenVoting = factory.attach(implementationAddress);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ describe('TokenVoting', function () {

describe('plugin interface: ', async () => {
it('does not support the empty interface', async () => {
expect(await voting.supportsInterface('0x00000000')).to.be.false;
expect(await voting.supportsInterface('0xffffffff')).to.be.false;
});

it('supports the `IERC165Upgradeable` interface', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ describe('MultisigSetup', function () {
implementationAddress = await multisigSetup.implementation();
});

it('does not support the empty interface', async () => {
expect(await multisigSetup.supportsInterface('0xffffffff')).to.be.false;
});

it('creates multisig base with the correct interface', async () => {
const factory = await ethers.getContractFactory('Multisig');
const multisigContract = factory.attach(implementationAddress);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ describe('Multisig', function () {

describe('plugin interface: ', async () => {
it('does not support the empty interface', async () => {
expect(await multisig.supportsInterface('0x00000000')).to.be.false;
expect(await multisig.supportsInterface('0xffffffff')).to.be.false;
});

it('supports the `IERC165Upgradeable` interface', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ describe('MerkleDistributor', function () {

describe('plugin interface: ', async () => {
it('does not support the empty interface', async () => {
expect(await distributor.supportsInterface('0x00000000')).to.be.false;
expect(await distributor.supportsInterface('0xffffffff')).to.be.false;
});

it('supports the `IERC165Upgradeable` interface', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ describe('MerkleMinter', function () {

describe('plugin interface: ', async () => {
it('does not support the empty interface', async () => {
expect(await minter.supportsInterface('0x00000000')).to.be.false;
expect(await minter.supportsInterface('0xffffffff')).to.be.false;
});

it('supports the `IERC165Upgradeable` interface', async () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/test/token/erc20/governance-erc20.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ describe('GovernanceERC20', function () {

describe('supportsInterface:', async () => {
it('does not support the empty interface', async () => {
expect(await token.supportsInterface('0x00000000')).to.be.false;
expect(await token.supportsInterface('0xffffffff')).to.be.false;
});

it('supports the `IERC165Upgradeable` interface', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ describe('GovernanceWrappedERC20', function () {

describe('supportsInterface:', async () => {
it('does not support the empty interface', async () => {
expect(await governanceToken.supportsInterface('0x00000000')).to.be.false;
expect(await governanceToken.supportsInterface('0xffffffff')).to.be.false;
});

it('supports the `IERC165Upgradeable` interface', async () => {
Expand Down

0 comments on commit cb0621d

Please sign in to comment.