Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uniqueness check on pool whitelisting #261

Closed
wants to merge 8 commits into from
Closed

Conversation

z0r0z
Copy link
Contributor

@z0r0z z0r0z commented Oct 20, 2021

adds check in addToWhitelist that reads from stored pool identifier to confirm duplicative pools are not added to MasterDeployer whitelist.

seeks to resolve #253

add uniqueness check via pool id
add pool id to fetch from deployer
add pool id to fetch from deployer
add pool id to fetch from deployer
add pool id to fetch from deployer
@coveralls
Copy link

Pull Request Test Coverage Report for Build 1361983274

  • 5 of 7 (71.43%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.02%) to 25.287%

Changes Missing Coverage Covered Lines Changed/Added Lines %
contracts/deployer/MasterDeployer.sol 5 7 71.43%
Totals Coverage Status
Change from base Build 1354712947: 0.02%
Covered Lines: 502
Relevant Lines: 1867

💛 - Coveralls

whitelistedFactories[_factory] = true;
bytes32 identifier = IPool(_factory).poolIdentifier();
for (uint256 i = 0; i < factoryList.length; i++) {
require(identifier != factories[factoryList[i]].identifier, "FACTORY_NOT_UNIQUE");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it possible to unit test this behaviour ?

mapping(address => bool) public whitelistedFactories;
mapping(address => Type) public factories;

struct Type {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can find a more meaningful name, FactoryInfo ? or something else

@z0r0z z0r0z closed this Dec 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Identifier uniqueness isn't enforced
3 participants