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
Prev Previous commit
Next Next commit
coverage
  • Loading branch information
Amxx authored and cairoeth committed Jul 16, 2024
commit 1e6911e192f620b0599a9a49ac441a001892e432
12 changes: 12 additions & 0 deletions test/token/ERC20/extensions/ERC20TemporaryApproval.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,5 +126,17 @@ describe('ERC20TemporaryApproval', function () {
expect(await this.token.allowance(this.batch, this.spender)).to.equal(persistentExpected);
});
}

it('reverts when the recipient is the zero address', async function () {
await expect(this.token.connect(this.holder).temporaryApprove(ethers.ZeroAddress, 1n))
.to.be.revertedWithCustomError(this.token, 'ERC20InvalidSpender')
.withArgs(ethers.ZeroAddress);
});

it('reverts when the token owner is the zero address', async function () {
await expect(this.token.$_temporaryApprove(ethers.ZeroAddress, this.recipient, 1n))
.to.be.revertedWithCustomError(this.token, 'ERC20InvalidApprover')
.withArgs(ethers.ZeroAddress);
});
});
});