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

audit: add quorum to the avatar setup event #206

Merged
merged 1 commit into from
Jun 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/execution-strategies/AvatarExecutionStrategy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ contract AvatarExecutionStrategy is SimpleQuorumExecutionStrategy {
/// @param _owner Address of the owner of the strategy.
/// @param _target Address of the avatar that this module will pass transactions to.
/// @param _spaces Array of whitelisted space contracts.
event AvatarExecutionStrategySetUp(address _owner, address _target, address[] _spaces);
event AvatarExecutionStrategySetUp(address _owner, address _target, address[] _spaces, uint256 _quorum);

/// @notice Emitted each time the Target is set.
/// @param newTarget The new target address.
Expand Down Expand Up @@ -45,7 +45,7 @@ contract AvatarExecutionStrategy is SimpleQuorumExecutionStrategy {
__SpaceManager_init(_spaces);
__SimpleQuorumExecutionStrategy_init(_quorum);
target = _target;
emit AvatarExecutionStrategySetUp(_owner, _target, _spaces);
emit AvatarExecutionStrategySetUp(_owner, _target, _spaces, _quorum);
}

/// @notice Sets the target address.
Expand Down
6 changes: 5 additions & 1 deletion test/AvatarExecutionStrategy.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { ERC1967Proxy } from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy
abstract contract AvatarExecutionStrategyTest is SpaceTest {
error InvalidSpace();

event AvatarExecutionStrategySetUp(address _owner, address _target, address[] _spaces);
event AvatarExecutionStrategySetUp(address _owner, address _target, address[] _spaces, uint256 _quorum);
event TargetSet(address indexed newTarget);
event SpaceEnabled(address space);
event SpaceDisabled(address space);
Expand Down Expand Up @@ -268,6 +268,8 @@ contract AvatarExecutionStrategyTestDirect is AvatarExecutionStrategyTest {

address[] memory spaces = new address[](1);
spaces[0] = address(space);
vm.expectEmit(true, true, true, true);
emit AvatarExecutionStrategySetUp(owner, address(avatar), spaces, quorum);
avatarExecutionStrategy = new AvatarExecutionStrategy(owner, address(avatar), spaces, quorum);
avatar.enableModule(address(avatarExecutionStrategy));
}
Expand All @@ -279,6 +281,8 @@ contract AvatarExecutionStrategyTestProxy is AvatarExecutionStrategyTest {

address[] memory spaces = new address[](1);
spaces[0] = address(space);
vm.expectEmit(true, true, true, true);
emit AvatarExecutionStrategySetUp(owner, address(avatar), spaces, quorum);
AvatarExecutionStrategy masterAvatarExecutionStrategy = new AvatarExecutionStrategy(
owner,
address(avatar),
Expand Down