Skip to content

Commit

Permalink
[release] v1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ianhe8x authored Apr 16, 2024
1 parent 78213d1 commit 402d9da
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@subql/contract-sdk",
"version": "1.0.4-1",
"version": "1.1.0",
"main": "index.js",
"license": "GPL3",
"scripts": {
Expand Down
6 changes: 6 additions & 0 deletions publish/mainnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
6 changes: 4 additions & 2 deletions test/VestingL2.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand All @@ -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)
Expand Down

0 comments on commit 402d9da

Please sign in to comment.