Skip to content

Commit

Permalink
narrowing down issues
Browse files Browse the repository at this point in the history
  • Loading branch information
brossetti1 committed Sep 27, 2022
1 parent 3d02721 commit a0939bb
Showing 1 changed file with 23 additions and 6 deletions.
29 changes: 23 additions & 6 deletions contracts/Baal.sol
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,12 @@ contract Baal is Module, EIP712Upgradeable, ReentrancyGuardUpgradeable, BaseRela
(address, address, address, address, address, bytes)
);

require(_lootToken != address(0), '!lootToken');
require(_sharesToken != address(0), '!sharesToken');
require(_multisendLibrary != address(0), '!multisendLibrary');
require(_avatar != address(0), '!avatar');
require(_lootToken != address(0), '!lootToken');
require(_sharesToken != address(0), '!sharesToken');
require(_multisendLibrary != address(0), '!multisendLibrary');
require(_avatar != address(0), '!avatar');
// no need to check _forwarder address exists, the default is address(0) for no forwarder

__Ownable_init();
__ReentrancyGuard_init();
__EIP712_init("Vote", "4");
Expand Down Expand Up @@ -272,7 +274,7 @@ contract Baal is Module, EIP712Upgradeable, ReentrancyGuardUpgradeable, BaseRela
_initializationMultisendData,
Enum.Operation.DelegateCall
),
"call failure"
"call failure1"
);

emit SetupComplete(
Expand Down Expand Up @@ -305,6 +307,11 @@ contract Baal is Module, EIP712Upgradeable, ReentrancyGuardUpgradeable, BaseRela
uint256 baalGas,
string calldata details
) external payable nonReentrant returns (uint256) {
// TODO not sure if this is necessary?
if (expiration > 0) {
// if expiration is 0, the proposal will never expire.
require(expiration > block.timestamp, 'exp < now');
}
require(
expiration == 0 ||
expiration > block.timestamp + votingPeriod + gracePeriod,
Expand Down Expand Up @@ -575,7 +582,7 @@ contract Baal is Module, EIP712Upgradeable, ReentrancyGuardUpgradeable, BaseRela
bytes calldata _data
) external baalOnly {
(bool success, ) = _to.call{value: _value}(_data);
require(success, "call failure");
require(success, "call failure2");
}

// ****************
Expand Down Expand Up @@ -827,12 +834,22 @@ contract Baal is Module, EIP712Upgradeable, ReentrancyGuardUpgradeable, BaseRela
_governanceConfig,
(uint32, uint32, uint256, uint256, uint256, uint256)
);
require(quorum >= 0 && minRetention <= 100, 'bad quorum');
require(minRetention >= 0 && minRetention <= 100, 'bad minRetention');

// on initialization of governance config, there is no shares token
// skip this check on initialization of governance config.
if (sponsorThreshold > 0 && address(sharesToken) != address(0)) {
require(sponsor <= totalShares(), 'sponsor < sharesSupply');
}

if (voting != 0) votingPeriod = voting; /*if positive, reset min. voting periods to first `value`*/
if (grace != 0) gracePeriod = grace; /*if positive, reset grace period to second `value`*/
proposalOffering = newOffering; /*set new proposal offering amount */
quorumPercent = quorum;
sponsorThreshold = sponsor;
minRetentionPercent = minRetention;

emit GovernanceConfigSet(
voting,
grace,
Expand Down

0 comments on commit a0939bb

Please sign in to comment.