Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions test/access/manager/AccessManager.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1677,6 +1677,30 @@ describe('AccessManager', function () {
});
});
});

it('BUG: execute can bypass target admin delay to update authority', async function () {
const newAuthority = await ethers.deployContract('$AccessManager', [this.admin]);

// set a delay on the target - and wait for it to be active
await this.manager.$_setTargetAdminDelay(this.target, 10n);
await time.increaseBy.timestamp(5n * 86400n, true); // minSetBack is 5 days

await expect(this.manager.getTargetAdminDelay(this.target)).to.eventually.equal(10n);

// cannot update directly - there is a delay
await expect(
this.manager.connect(this.admin).updateAuthority(this.target, newAuthority),
).to.be.revertedWithCustomError(this.manager, 'AccessManagerNotScheduled');

// bypass the check by just doing execute
await expect(
this.manager
.connect(this.admin)
.execute(this.target, this.target.interface.encodeFunctionData('setAuthority', [newAuthority.target])),
)
.to.emit(this.target, 'AuthorityUpdated')
.withArgs(newAuthority);
});
});

describe('access managed self operations', function () {
Expand Down
Loading