Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 6 additions & 11 deletions src/core/ElasticDAO.sol
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,13 @@ contract ElasticDAO is ReentryProtection {
event ElasticGovernanceTokenDeployed(address indexed tokenAddress);
event MaxVotingLambdaChanged(bytes32 settingName, uint256 value);
event ControllerChanged(bytes32 settingName, address value);
event ExitDAO(
address indexed memberAddress,
uint256 shareAmount,
uint256 ethAmount
);
event ExitDAO(address indexed memberAddress, uint256 shareAmount, uint256 ethAmount);
event FailedToFullyPenalize(
address indexed memberAddress,
uint256 attemptedAmount,
uint256 actualAmount
);
event JoinDAO(
address indexed memberAddress,
uint256 shareAmount,
uint256 ethAmount
);
event JoinDAO(address indexed memberAddress, uint256 shareAmount, uint256 ethAmount);
event SeedDAO(address indexed summonerAddress, uint256 amount);
event SummonedDAO(address indexed summonedBy);

Expand All @@ -54,7 +46,10 @@ contract ElasticDAO is ReentryProtection {
modifier onlyAfterTokenInitialized() {
Ecosystem.Instance memory ecosystem = _getEcosystem();
bool tokenInitialized =
Token(ecosystem.tokenModelAddress).exists(ecosystem.governanceTokenAddress, ecosystem);
Token(_getEcosystem().tokenModelAddress).exists(
ecosystem.governanceTokenAddress,
ecosystem.daoAddress
);
require(tokenInitialized, 'ElasticDAO: Please call initializeToken first');
_;
}
Expand Down
4 changes: 2 additions & 2 deletions src/core/ElasticDAOFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ contract ElasticDAOFactory is ReentryProtection {
/**
* @notice returns deployed DAO count
*/
function deployedDAOCount() external view returns (uint) {
return deployedDAOAddresses.length;
function deployedDAOCount() external view returns (uint256) {
return deployedDAOAddresses.length;
}

/**
Expand Down
5 changes: 1 addition & 4 deletions src/libraries/SafeMath.sol
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,7 @@ library SafeMath {
* Requirements:
* - The divisor cannot be zero.
*/
function div(
uint256 a,
uint256 b
) internal pure returns (uint256) {
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
uint256 c = a / b;
require(c > 0, 'SafeMath: division by zero');
Expand Down
2 changes: 1 addition & 1 deletion src/models/DAO.sol
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ contract DAO is EternalModel, ReentryProtection {
* @param _uuid - address of the unique user ID
* @return recordExists bool
*/
function exists(address _uuid, Ecosystem.Instance memory) external view returns (bool) {
function exists(address _uuid) external view returns (bool) {
return _exists(_uuid);
}

Expand Down
8 changes: 2 additions & 6 deletions src/models/Token.sol
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,8 @@ contract Token is EternalModel, ReentryProtection {
return record;
}

function exists(address _uuid, Ecosystem.Instance memory _ecosystem)
external
view
returns (bool)
{
return _exists(_uuid, _ecosystem.daoAddress);
function exists(address _uuid, address _daoAddress) external view returns (bool) {
return _exists(_uuid, _daoAddress);
}

/**
Expand Down