Implement recommendations from 5.0 audit Phase 1A (#4398)
Co-authored-by: Francisco Giordano <fg@frang.io> Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
This commit is contained in:
@ -97,6 +97,15 @@ contract('ERC20Wrapper', function (accounts) {
|
||||
value: initialSupply,
|
||||
});
|
||||
});
|
||||
|
||||
it('reverts minting to the wrapper contract', async function () {
|
||||
await this.underlying.approve(this.token.address, MAX_UINT256, { from: initialHolder });
|
||||
await expectRevertCustomError(
|
||||
this.token.depositFor(this.token.address, MAX_UINT256, { from: initialHolder }),
|
||||
'ERC20InvalidReceiver',
|
||||
[this.token.address],
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('withdraw', function () {
|
||||
@ -156,6 +165,14 @@ contract('ERC20Wrapper', function (accounts) {
|
||||
value: initialSupply,
|
||||
});
|
||||
});
|
||||
|
||||
it('reverts withdrawing to the wrapper contract', async function () {
|
||||
expectRevertCustomError(
|
||||
this.token.withdrawTo(this.token.address, initialSupply, { from: initialHolder }),
|
||||
'ERC20InvalidReceiver',
|
||||
[this.token.address],
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('recover', function () {
|
||||
|
||||
Reference in New Issue
Block a user