From 402d9dad4a6558e6c9a325e9e4b034febe0d3bb6 Mon Sep 17 00:00:00 2001 From: Ian He <39037239+ianhe8x@users.noreply.github.com> Date: Tue, 16 Apr 2024 17:20:51 +1200 Subject: [PATCH] [release] v1.1.0 --- package.json | 2 +- publish/mainnet.json | 6 ++++++ test/VestingL2.test.ts | 6 ++++-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index d0045f91..dd7b0f10 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@subql/contract-sdk", - "version": "1.0.4-1", + "version": "1.1.0", "main": "index.js", "license": "GPL3", "scripts": { diff --git a/publish/mainnet.json b/publish/mainnet.json index ae1424d4..d8712b0c 100644 --- a/publish/mainnet.json +++ b/publish/mainnet.json @@ -211,6 +211,12 @@ "address": "0x8611F6647C57339b994aE5C1BB7cD8b101eB4716", "bytecodeHash": "122b9796060b8325d5f2fc93d3d6ffe3f362cb676fcae9c225f15f8796de0d56", "lastUpdate": "Thu, 22 Feb 2024 13:16:16 GMT" + }, + "L2Vesting": { + "innerAddress": "0x28Dd4101572a7eEF583e9Ad4cfFc619b3fC7B163", + "address": "0x915FbbfF55775B6243A3edB42BE08554C44DE45a", + "bytecodeHash": "5994844f015a7b599b6e5a10a50cec76be5e60fa20439f0fdd2cfd49df3a15ed", + "lastUpdate": "Tue, 16 Apr 2024 05:16:47 GMT" } } } \ No newline at end of file diff --git a/test/VestingL2.test.ts b/test/VestingL2.test.ts index 9d9a2602..3d9c4e31 100644 --- a/test/VestingL2.test.ts +++ b/test/VestingL2.test.ts @@ -14,7 +14,7 @@ type ClaimVestingEvent = { user: string; amount: BigNumber }; describe('Vesting Contract', () => { const mockProvider = waffle.provider; - const [wallet, wallet1, wallet2, wallet3, wallet4, b0, b1, b2, b3, b4, b5] = mockProvider.getWallets(); + const [wallet, wallet1, wallet2, wallet3, wallet4, wallet5, b0, b1, b2, b3, b4, b5] = mockProvider.getWallets(); let sqToken: ERC20; let vestingContract: L2Vesting; @@ -384,6 +384,8 @@ describe('Vesting Contract', () => { await vestingContract.connect(wallet1).claim(planId); expect(await sqToken.balanceOf(wallet1.address)).to.gt(balance1.add(claimable1)); expect(await sqToken.balanceOf(wallet1.address)).to.lt(balance1.add(claimable1).add(parseEther(0.001))); + // wallet4 + expect(await vestingContract.claimableAmount(planId, wallet4.address)).to.eq(0); // claim after vesting period await timeTravel(vestingPeriod / 2); await vestingContract.connect(wallet1).claim(planId); @@ -392,7 +394,7 @@ describe('Vesting Contract', () => { it('claim with invalid condition should fail', async () => { // claim on non-vesting account should fail - await expect(vestingContract.connect(wallet4).claim(planId)).to.be.revertedWith('V011'); + await expect(vestingContract.connect(wallet5).claim(planId)).to.be.revertedWith('V011'); await expect(vestingContract.connect(wallet1).claim(planId2)).to.be.revertedWith('V011'); // claim with zero claimable amount should fail // # case 1 (not start vesting)