Skip to content

Commit f7f45b0

Browse files
committed
Check that there is a non-zero supply when creating a dividend
1 parent 6d092e7 commit f7f45b0

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

contracts/modules/Checkpoint/ERC20/ERC20DividendCheckpoint.sol

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ contract ERC20DividendCheckpoint is ERC20DividendCheckpointStorage, DividendChec
165165
require(_name[0] != 0);
166166
uint256 dividendIndex = dividends.length;
167167
uint256 currentSupply = securityTokenInstance.totalSupplyAt(_checkpointId);
168+
require(currentSupply > 0, "Invalid supply");
168169
uint256 excludedSupply = 0;
169170
dividends.push(
170171
Dividend(

contracts/modules/Checkpoint/Ether/EtherDividendCheckpoint.sol

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ contract EtherDividendCheckpoint is DividendCheckpoint {
131131
require(_name[0] != 0);
132132
uint256 dividendIndex = dividends.length;
133133
uint256 currentSupply = ISecurityToken(securityToken).totalSupplyAt(_checkpointId);
134+
require(currentSupply > 0, "Invalid supply");
134135
uint256 excludedSupply = 0;
135136
dividends.push(
136137
Dividend(

0 commit comments

Comments
 (0)