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

remediations #4

Merged
merged 60 commits into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
98f2eb9
fix: H1
zeroknots Jun 17, 2024
0e34dad
fix: H2. using _msgSender for registry check
zeroknots Jun 17, 2024
2406309
fix: M1
zeroknots Jun 17, 2024
77b9157
fix: M3
zeroknots Jun 17, 2024
fae3c77
fix: M4
zeroknots Jun 17, 2024
fc5404b
fix: M5
zeroknots Jun 17, 2024
7a53178
fix: L1
zeroknots Jun 17, 2024
0ca432c
fix: L2
zeroknots Jun 17, 2024
18e86b3
fix: L4
zeroknots Jun 17, 2024
0c612da
fix: W4
zeroknots Jun 17, 2024
f7eb247
fix: W5
zeroknots Jun 17, 2024
487e8c9
wip
zeroknots Jun 17, 2024
535e8f2
fix: I2
zeroknots Jun 17, 2024
f76e42f
fix: I3
zeroknots Jun 17, 2024
817ef13
fix: internal finding
zeroknots Jun 17, 2024
79c0094
fix: use operation enum for executions
zeroknots Jun 17, 2024
63af900
fix: slight gas improvement
zeroknots Jun 17, 2024
be9e05a
fix: H1
zeroknots Jun 18, 2024
bab5361
chore: improve readability
zeroknots Jun 18, 2024
a5e21e6
fix: H1 with EP in 2771
zeroknots Jun 18, 2024
73a9924
fix: add multitype uninstall function
zeroknots Jun 18, 2024
f1fdf78
fix: hook uninstall dos
zeroknots Jun 18, 2024
6200ed4
fix: W8
zeroknots Jun 18, 2024
d36bfed
chore: add test case
zeroknots Jun 18, 2024
4918df8
Update src/core/ModuleManager.sol
kopy-kat Jun 19, 2024
ecf38b5
Merge pull request #5 from rhinestonewtf/feature/fix-hook-uninstall-dos
kopy-kat Jun 19, 2024
180f0ac
hotfix: fixed typos flagged by Lukas
zeroknots Jun 21, 2024
1e61385
feat: add 4337 storage
kopy-kat Jun 27, 2024
ebef70c
Revert "feat: add 4337 storage"
kopy-kat Jun 27, 2024
a8d25f7
feat: make storage 4337 compliant
kopy-kat Jun 27, 2024
0506673
chore: renaming initializeAccount
zeroknots Jun 27, 2024
0f89432
feat: testing launchpad for 4337 compliance
zeroknots Jun 27, 2024
e7151ea
feat: adding launchpad function to allow existing safes to use launch…
zeroknots Jun 27, 2024
4f6daa3
feat: prototype implementation to allow safe checknsignature signers
zeroknots Jun 27, 2024
349ff72
fixed bug in validation
zeroknots Jun 28, 2024
128bf6a
wip
zeroknots Jun 28, 2024
3cac556
WIPip
zeroknots Jun 28, 2024
67cd00c
feat: all tests passing
kopy-kat Jun 28, 2024
7a66b3b
feature: clean up safe owner verification in launchpad
kopy-kat Jun 29, 2024
5092f78
feature: add existing safe test
kopy-kat Jun 29, 2024
8df99dd
feat: add support viewer contract
kopy-kat Jun 29, 2024
80a6c7a
chore: add deployments
kopy-kat Jun 29, 2024
b4ced92
chore: update supportviewer
kopy-kat Jun 30, 2024
ec0ebdf
Merge pull request #8 from rhinestonewtf/feature/safe-owner-cleanup
kopy-kat Jul 1, 2024
ca2d1a1
Merge pull request #9 from rhinestonewtf/feature/safe-owner-launchpad
kopy-kat Jul 1, 2024
8a1bde5
fix: tests
kopy-kat Jul 1, 2024
4573126
fix: abstract contracts
kopy-kat Jul 1, 2024
3dc8fdb
fix: linting
kopy-kat Jul 1, 2024
ca4ce07
chore: internal review
zeroknots Jul 1, 2024
dd2b4c5
rm: broadcast
zeroknots Jul 1, 2024
3c57ecd
feat: add safe as validator module addr
zeroknots Jul 1, 2024
45ccd05
chore: update lock
kopy-kat Jul 1, 2024
d961421
fix: relative imports
kopy-kat Jul 1, 2024
9bf62e7
fix: typo
kopy-kat Jul 5, 2024
065da36
fix: remove unused using for
kopy-kat Jul 5, 2024
1d25d2d
fix: update checknsignatures to latest
kopy-kat Jul 8, 2024
1a08bda
feat: add audit report
kopy-kat Jul 8, 2024
bedaf2f
Merge pull request #11 from rhinestonewtf/fix/final-remediations
kopy-kat Jul 8, 2024
ff8df1d
Merge pull request #7 from rhinestonewtf/feature/4337-compliance
kopy-kat Jul 8, 2024
e8cbed6
fix: ignore userOp builder lint
kopy-kat Jul 8, 2024
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
Prev Previous commit
Next Next commit
fix: I3
  • Loading branch information
zeroknots committed Jun 17, 2024
commit f76e42f37f463ca3364042d933223d248cd08bf4
4 changes: 2 additions & 2 deletions src/ISafe7579.sol
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,8 @@ interface ISafe7579 is IERC7579Account {
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* Query Account Details */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
function getValidatorPaginated(
address start,
function getValidatorsPaginated(
address cursor,
uint256 pageSize
)
external
Expand Down
18 changes: 9 additions & 9 deletions src/Safe7579.sol
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,12 @@ contract Safe7579 is ISafe7579, ISafeOp, AccessControl, Initializer {
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
ISafe safe = ISafe(msg.sender);
if (execType == EXECTYPE_DEFAULT) {
// DEFAULT EXEC & SINGLE CALL
// DEFAULT EXEC & BATCH CALL
if (callType == CALLTYPE_BATCH) {
Execution[] calldata executions = executionCalldata.decodeBatch();
_exec(safe, executions);
}
// DEFAULT EXEC & BATCH CALL
// DEFAULT EXEC & SINGLE CALL
else if (callType == CALLTYPE_SINGLE) {
(address target, uint256 value, bytes calldata callData) =
executionCalldata.decodeSingle();
Expand Down Expand Up @@ -171,7 +171,7 @@ contract Safe7579 is ISafe7579, ISafeOp, AccessControl, Initializer {

/**
* Internal function that will be solely called by executeFromExecutor. Not super uniform code,
* but we need need the JUMPI to avoid stack too deep, due to the modifiers in the
* but we need the JUMPI to avoid stack too deep, due to the modifiers in the
* executeFromExecutor function
*/
function _executeReturn(
Expand All @@ -187,12 +187,12 @@ contract Safe7579 is ISafe7579, ISafeOp, AccessControl, Initializer {
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

if (execType == EXECTYPE_DEFAULT) {
// DEFAULT EXEC & SINGLE CALL
// DEFAULT EXEC & BATCH CALL
if (callType == CALLTYPE_BATCH) {
Execution[] calldata executions = executionCalldata.decodeBatch();
returnDatas = _execReturn(ISafe(msg.sender), executions);
}
// DEFAULT EXEC & BATCH CALL
// DEFAULT EXEC & SINGLE CALL
else if (callType == CALLTYPE_SINGLE) {
(address target, uint256 value, bytes calldata callData) =
executionCalldata.decodeSingle();
Expand All @@ -215,12 +215,12 @@ contract Safe7579 is ISafe7579, ISafeOp, AccessControl, Initializer {
/* TRY EXEC */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
else if (execType == EXECTYPE_TRY) {
// TRY EXEC & SINGLE CALL
// TRY EXEC & BATCH CALL
if (callType == CALLTYPE_BATCH) {
Execution[] calldata executions = executionCalldata.decodeBatch();
(, returnDatas) = _tryExecReturn(ISafe(msg.sender), executions);
}
// TRY EXEC & BATCH CALL
// TRY EXEC & SINGLE CALL
else if (callType == CALLTYPE_SINGLE) {
(address target, uint256 value, bytes calldata callData) =
executionCalldata.decodeSingle();
Expand Down Expand Up @@ -383,7 +383,7 @@ contract Safe7579 is ISafe7579, ISafeOp, AccessControl, Initializer {
withHook(IERC7579Account.installModule.selector)
onlyEntryPointOrSelf
{
// internal install functions will decode the initData param, and return sanitzied
// internal install functions will decode the initData param, and return sanitized
// moduleInitData. This is the initData that will be passed to Module.onInstall()
bytes memory moduleInitData;
if (moduleType == MODULE_TYPE_VALIDATOR) {
Expand Down Expand Up @@ -423,7 +423,7 @@ contract Safe7579 is ISafe7579, ISafeOp, AccessControl, Initializer {
withHook(IERC7579Account.uninstallModule.selector)
onlyEntryPointOrSelf
{
// internal uninstall functions will decode the deInitData param, and return sanitzied
// internal uninstall functions will decode the deInitData param, and return sanitized
// moduleDeInitData. This is the initData that will be passed to Module.onUninstall()
bytes memory moduleDeInitData;
if (moduleType == MODULE_TYPE_VALIDATOR) {
Expand Down
8 changes: 4 additions & 4 deletions src/core/ModuleManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ abstract contract ModuleManager is ISafe7579, AccessControl, Receiver, RegistryA
/**
* Get paginated list of installed validators
*/
function getValidatorPaginated(
address start,
function getValidatorsPaginated(
address cursor,
uint256 pageSize
)
external
Expand All @@ -108,7 +108,7 @@ abstract contract ModuleManager is ISafe7579, AccessControl, Receiver, RegistryA
{
return $validators.getEntriesPaginated({
account: msg.sender,
start: start,
start: cursor,
pageSize: pageSize
});
}
Expand Down Expand Up @@ -492,7 +492,7 @@ abstract contract ModuleManager is ISafe7579, AccessControl, Receiver, RegistryA
/**
* To make it easier to install multiple modules at once, this function will
* install multiple modules at once. The init data is expected to be a abi encoded tuple
* of (uint[] types, bytes[] contexts, bytes[] moduleInitData)
* of (uint[] types, bytes[] contexts, bytes moduleInitData)
* @dev Install multiple modules at once
* @param module address of the module
* @param initData initialization data for the module
Expand Down