DividendDistributor
Distributes cash dividends (in an ERC20 stablecoin) to holders of a single share class as tracked by ShareClass.
State Variables
stablecoin
IERC20 public stablecoin;
shareRegistry
ShareClass public shareRegistry;
dividendCount
uint256 public dividendCount;
dividends
mapping(uint256 => DividendEvent) public dividends;
Functions
constructor
constructor(address stablecoinAddress, address shareRegistryAddress);
declareDividend
Declares a new dividend event.
function declareDividend(uint256 totalAmount, uint256 claimDeadline) external;
Parameters
Name
Type
Description
totalAmount
uint256
The total stablecoin amount allocated for this dividend.
claimDeadline
uint256
The timestamp by which users must claim (0 if indefinite).
claimDividend
Allows a shareholder to claim their portion of the specified dividend.
function claimDividend(uint256 dividendId) external;
Parameters
Name
Type
Description
dividendId
uint256
The ID of the dividend event.
closeDividend
Optionally close the dividend event if you want to finalize it after some time.
function closeDividend(uint256 dividendId) external;
Parameters
Name
Type
Description
dividendId
uint256
The ID of the dividend event to close.
Events
DividendDeclared
event DividendDeclared(uint256 indexed dividendId, uint256 totalAmount, uint256 totalSupplySnapshot);
DividendClaimed
event DividendClaimed(uint256 indexed dividendId, address indexed claimant, uint256 amount);
Structs
DividendEvent
struct DividendEvent {
uint256 totalAmount;
uint256 totalSupplySnapshot;
uint256 claimDeadline;
bool isActive;
mapping(address => bool) hasClaimed;
}
Last updated
Was this helpful?