Skip to content
This repository was archived by the owner on Jul 6, 2022. It is now read-only.

Commit 57603ea

Browse files
author
Victor Wiebe
committed
fix: erc20Dividend bug and example
1 parent 766238a commit 57603ea

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

examples/erc20Dividend.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ window.addEventListener('load', async () => {
160160
token: await polymathAPI.polyToken.address(),
161161
expiry: new Date(2035, 2),
162162
maturity: new Date(2018, 1),
163-
checkpointId: 1,
163+
checkpointId: 2,
164164
excluded: [randomInvestors[0], randomInvestors[1]],
165165
});
166166

@@ -179,7 +179,7 @@ window.addEventListener('load', async () => {
179179
token: await polymathAPI.polyToken.address(),
180180
expiry: new Date(2035, 2),
181181
maturity: new Date(2018, 1),
182-
checkpointId: 2,
182+
checkpointId: 3,
183183
});
184184

185185
console.log('4 types of erc20 dividends created');

examples/etherDividend.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ window.addEventListener('load', async () => {
159159
value: new BigNumber(1),
160160
expiry: new Date(2035, 2),
161161
maturity: new Date(2018, 1),
162-
checkpointId: 1,
162+
checkpointId: 2,
163163
excluded: [randomInvestors[0], randomInvestors[1]],
164164
});
165165

@@ -176,7 +176,7 @@ window.addEventListener('load', async () => {
176176
value: new BigNumber(1),
177177
expiry: new Date(2035, 2),
178178
maturity: new Date(2018, 1),
179-
checkpointId: 2,
179+
checkpointId: 3,
180180
});
181181

182182
console.log('4 types of ether dividends created');

src/contract_wrappers/modules/checkpoint/dividend_checkpoint_wrapper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ export default abstract class DividendCheckpointWrapper extends ModuleWrapper {
504504

505505
if (checkpointId) {
506506
const currentCheckpointId = await stContract.currentCheckpointId.callAsync();
507-
assert.assert(checkpointId < currentCheckpointId.toNumber(), 'Invalid checkpoint');
507+
assert.assert(checkpointId <= currentCheckpointId.toNumber(), 'Invalid checkpoint');
508508
}
509509

510510
const callerAddress = await this.getCallerAddress(txData);

0 commit comments

Comments
 (0)