Skip to content

Conversation

nms-7
Copy link
Contributor

@nms-7 nms-7 commented May 4, 2023

adds whitelist to orchestrator contract so that whitelisted contracts can call rebase

@nms-7 nms-7 requested review from brandoniles and aalavandhan May 4, 2023 11:53
@@ -22,6 +22,8 @@ contract Orchestrator is Ownable {
// Stable ordering is not guaranteed.
Transaction[] public transactions;

address[] private whitelist;
Copy link
Member

@aalavandhan aalavandhan May 4, 2023

Choose a reason for hiding this comment

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

Maybe use EnumerableSet here, so we don't have to loop through the list to check existence every time?

EnumerableSet is a little more expensive on write though (uses 2 slots instead of 1)

@@ -42,7 +44,24 @@ contract Orchestrator is Ownable {
*/
function rebase() external {
require(msg.sender == tx.origin); // solhint-disable-line avoid-tx-origin
Copy link
Member

Choose a reason for hiding this comment

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

We could just have one rebase function but add a modifier where we check if either msg.sender == tx.origin or msg.sender is part of the whitelist

@aalavandhan
Copy link
Member

aalavandhan commented May 4, 2023

We could also update the orchestrator to the latest solidity version as we do this

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.

2 participants