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

Implement updates from internal review #9

Merged
merged 13 commits into from
Feb 1, 2024
Merged

Implement updates from internal review #9

merged 13 commits into from
Feb 1, 2024

Conversation

spengrah
Copy link
Member

  • changes the name to HatsAccount
  • cleans up comments, natspec, and dependencies
  • more sensible rejection threshold
  • more efficient valid vote counting

@spengrah spengrah requested a review from gershido January 30, 2024 04:07
Copy link
Contributor

@gershido gershido left a comment

Choose a reason for hiding this comment

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

Regarding the following function:

  function isExecutableNow(bytes32 _proposalId, address[] calldata _voters) external view returns (bool) {
    _checkExecutableNow(_proposalId, _voters);
    return true;
  }

_checkExecutableNow reverts if not executable, returns true if yes. A slightly different design here can be that _checkExecutableNow won't have a return value at all. Then the view function isExecutableNow can have the actual logic and return true/false, and the internal_checkExecutableNow will use it and revert or not. Same also with isRejectableNow

src/HatsAccountMofN.sol Outdated Show resolved Hide resolved
@gershido
Copy link
Contributor

Wonder if we want to add the tx parameters to the TxExecuted event:

  function execute(address _to, uint256 _value, bytes calldata _data, uint8 _operation)
    external
    payable
    returns (bytes memory result)
  {
    if (!_isValidSigner(msg.sender)) revert InvalidSigner();


    // increment the state var
    _beforeExecute();


    // execute the call, routing delegatecalls through the sandbox, and bubble up the result
    result = LibHatsAccount._execute(_to, _value, _data, _operation);


    // log the executor
    emit TxExecuted(msg.sender);
  }

@spengrah
Copy link
Member Author

Wonder if we want to add the tx parameters to the TxExecuted event:

@gershido my thinking in leaving them out was that we could get them from the tx args. But happy to include them in the event if that would improve things on the subgraph side

@spengrah
Copy link
Member Author

added improvements based on discussion with @gershido:

  • even more efficient valid vote counting
  • simplify/consolidate logic for _checkExecutableNow and isExecutableNow and Rejectable equivalents

may add tx params to the HatsAccount1ofN.TxExecuted event pending @gershido's subgraph research

@spengrah spengrah requested a review from gershido January 31, 2024 19:10
@gershido
Copy link
Contributor

gershido commented Feb 1, 2024

Lgtm!

Regarding the HatsAccount1ofN.TxExecuted event, it won't be a problem to index the call info with the current implementation.

@spengrah spengrah marked this pull request as ready for review February 1, 2024 19:02
@spengrah spengrah merged commit da97020 into main Feb 1, 2024
2 of 3 checks passed
@spengrah spengrah deleted the internal-review branch February 1, 2024 19:02
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