function create(
string memory _daoName,
string memory _daoSymbol,
uint8 _quorum,
address[] memory _partners,
uint256[] memory _shares
) external returns (bool) {
Dao dao = new Dao(_daoName, _daoSymbol, _quorum, _partners, _shares);
subscriptions[address(dao)] = block.timestamp + freeTrial;
require(daos.add(address(dao)));
emit DaoCreated(address(dao));
return true;
}
mapping(address => uint256) public subscriptions;
uint256 public monthlyCost;
uint256 public freeTrial;
If monthlyCost > 0, only dao with subscriptions[daoAddress] == true can execute voting
Anyone can buy subscription for any DAO. Pay with XDAO tokens
function subscribe(address _dao) external returns (bool) {
require(daos.contains(_dao));
IERC20(xdao).safeTransferFrom(msg.sender, owner(), monthlyCost);
if (subscriptions[_dao] == 0 || subscriptions[_dao] < block.timestamp) {
subscriptions[_dao] = block.timestamp + 30 days;
} else {
subscriptions[_dao] += 30 days;
}
return true;
}