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

chore: update Allo.sol #24

Merged
merged 49 commits into from
Jul 7, 2023
Merged

chore: update Allo.sol #24

merged 49 commits into from
Jul 7, 2023

Conversation

thelostone-mc
Copy link
Member

No description provided.

Copy link
Member Author

@thelostone-mc thelostone-mc left a comment

Choose a reason for hiding this comment

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

Left a few open questions

contracts/core/Allo.sol Outdated Show resolved Hide resolved
@thelostone-mc thelostone-mc force-pushed the update-allo branch 6 times, most recently from 5edd588 to f2b4801 Compare June 25, 2023 05:25
@thelostone-mc thelostone-mc force-pushed the update-registry branch 4 times, most recently from 8bba45c to ed12f40 Compare June 26, 2023 00:54
@thelostone-mc thelostone-mc force-pushed the update-allo branch 2 times, most recently from 8405f8c to b786c82 Compare June 26, 2023 09:41
@thelostone-mc thelostone-mc force-pushed the update-allo branch 2 times, most recently from 355794a to 5566079 Compare June 26, 2023 10:11
@nfrgosselin nfrgosselin linked an issue Jun 26, 2023 that may be closed by this pull request
@thelostone-mc thelostone-mc marked this pull request as ready for review June 30, 2023 11:03
contracts/core/Allo.sol Outdated Show resolved Hide resolved
contracts/core/Allo.sol Show resolved Hide resolved
contracts/core/Allo.sol Outdated Show resolved Hide resolved
contracts/core/Allo.sol Outdated Show resolved Hide resolved
contracts/core/Allo.sol Outdated Show resolved Hide resolved
contracts/core/Allo.sol Outdated Show resolved Hide resolved
contracts/core/Allo.sol Outdated Show resolved Hide resolved
Comment on lines +277 to +288
// grant pool owners roles
for (uint256 i = 0; i < _owners.length;) {
_grantRole(POOL_OWNER_ROLE, _owners[i]);
unchecked {
i++;
}
}

// todo: return the poolId? what do we want to return here?
return _poolId;
// grant admin roles to pool creator
_grantRole(POOL_ADMIN_ROLE, msg.sender);
// set admin role for POOL_OWNER_ROLE
_setRoleAdmin(POOL_OWNER_ROLE, POOL_ADMIN_ROLE);
Copy link
Contributor

Choose a reason for hiding this comment

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

Personally I think I'd name these opposite? It doesn't really matter but I think of admins as all the people who can control the pool, and the owner is the one who actually owns it and has ultimate say.

Copy link
Contributor

Choose a reason for hiding this comment

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

You thinking something like this:

// grant pool admin roles
for (uint256 i = 0; i < _admins.length;) {
    _grantRole(POOL_ADMIN_ROLE, _admins[i]);
    unchecked {
        i++;
    }
}

// grant owner role to pool creator
_grantRole(POOL_OWNER_ROLE, msg.sender);

// Note: do we want this? set admin role for pool creator
// _grantRole(POOL_ADMIN_ROLE, msg.sender);

Copy link
Member Author

@thelostone-mc thelostone-mc Jul 7, 2023

Choose a reason for hiding this comment

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

Yup we've changes this to better naming convention on the strategy PR. It's called admin and pool manager

Comment on lines +166 to +168
// DISCUSS: We either
// - allow cloning of every contract (use the bool)
// - or we force cloning of only approved contracts
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this DISCUSS still relevant or is it old? I think current implementation here is perfect, but if there's still question, let's talk about it.

Copy link
Member Author

Choose a reason for hiding this comment

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

This still needs to be discussed cause the boolean arguments don't make a lot of sense at this point the way the contract is written. Looking at the code you realise, that the bool is in theory a dummy argument cause :

  • if you pass bool as true but the strategy is not approved -> it reverts
  • if you pass bool as true but the strategy is approved -> it clones
  • if you pass bool as false but the strategy is approved -> it reverts
  • if you pass bool as false but the strategy is not approved -> it doesn't clone

This feels the the same as

  • if contract is approved -> it clones
  • if contract Is not approved -> it doesn't clone

The boolean is added just to share more clarity on reverts which I'm not sure if worth it (i could be wrong but hence the discussion )

@thelostone-mc
Copy link
Member Author

@zobront Merging this off so that we can proceed with the strategies PR
Things to discuss :

Things to verify :

@thelostone-mc thelostone-mc merged commit 0feac71 into main Jul 7, 2023
@thelostone-mc thelostone-mc deleted the update-allo branch July 7, 2023 07:01
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.

Create Allo.sol
5 participants