Skip to content

Commit

Permalink
unneeded allowance approval
Browse files Browse the repository at this point in the history
  • Loading branch information
benceharomi committed Jul 5, 2024
1 parent b015bd7 commit ac40e25
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions core/tests/ts-integration/tests/erc20.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ describe('ERC20 contract checks', () => {
let alice: zksync.Wallet;
let bob: zksync.Wallet;
let tokenDetails: Token;
let baseTokenDetails: Token;
let aliceErc20: zksync.Contract;

beforeAll(async () => {
Expand All @@ -25,7 +24,6 @@ describe('ERC20 contract checks', () => {
bob = testMaster.newEmptyAccount();

tokenDetails = testMaster.environment().erc20Token;
baseTokenDetails = testMaster.environment().baseToken;
aliceErc20 = new zksync.Contract(tokenDetails.l2Address, zksync.utils.IERC20, alice);
});

Expand Down Expand Up @@ -210,17 +208,10 @@ describe('ERC20 contract checks', () => {

test('Can perform a deposit with precalculated max value', async () => {
console.log('nonce0', await alice.getNonce());

const maxAmountBase = await alice.getBalanceL1(baseTokenDetails.l1Address);
console.log('nonce1', await alice.getNonce());

const maxAmount = await alice.getBalanceL1(tokenDetails.l1Address);
console.log('nonce2', await alice.getNonce());

// Approving the needed allowance to ensure that the user has enough funds.
await (await alice.approveERC20(baseTokenDetails.l1Address, maxAmountBase)).wait();
console.log('nonce3', await alice.getNonce());

await (await alice.approveERC20(tokenDetails.l1Address, maxAmount)).wait();
console.log('nonce4', await alice.getNonce());

Expand Down

0 comments on commit ac40e25

Please sign in to comment.