-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(contracts): revisit functions visibility and inheritance
Ensure contracts integrating MACI can override certain functions, as well as use public for functions which are likely to be called from within an inheriting contract. Also remove private for constants in favour of internal.
- Loading branch information
Showing
8 changed files
with
23 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,10 +30,10 @@ contract PollFactory is Params, DomainObjs, IPollFactory { | |
MaxValues calldata _maxValues, | ||
TreeDepths calldata _treeDepths, | ||
PubKey calldata _coordinatorPubKey, | ||
IMACI _maci, | ||
address _maci, | ||
Check warning Code scanning / Slither Conformance to Solidity naming conventions Warning
Parameter PollFactory.deploy(uint256,Params.MaxValues,Params.TreeDepths,DomainObjs.PubKey,address,TopupCredit,address)._maci is not in mixedCase
|
||
TopupCredit _topupCredit, | ||
address _pollOwner | ||
) public returns (address pollAddr) { | ||
) public virtual returns (address pollAddr) { | ||
/// @notice Validate _maxValues | ||
/// maxVoteOptions must be less than 2 ** 50 due to circuit limitations; | ||
/// it will be packed as a 50-bit value along with other values as one | ||
|
@@ -46,7 +46,11 @@ contract PollFactory is Params, DomainObjs, IPollFactory { | |
AccQueue messageAq = new AccQueueQuinaryMaci(_treeDepths.messageTreeSubDepth); | ||
|
||
/// @notice the smart contracts that a Poll would interact with | ||
ExtContracts memory extContracts = ExtContracts({ maci: _maci, messageAq: messageAq, topupCredit: _topupCredit }); | ||
ExtContracts memory extContracts = ExtContracts({ | ||
maci: IMACI(_maci), | ||
messageAq: messageAq, | ||
topupCredit: _topupCredit | ||
}); | ||
|
||
// deploy the poll | ||
Poll poll = new Poll(_duration, _maxValues, _treeDepths, _coordinatorPubKey, extContracts); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters