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:
Ernesto García
2023-07-03 12:02:06 -06:00
committed by GitHub
parent 06861dce54
commit bb64458928
38 changed files with 779 additions and 666 deletions

View File

@ -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 () {