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

fix: various bugs/missing features #7

Merged
merged 29 commits into from
Jul 8, 2024

Conversation

kopy-kat
Copy link
Member

@kopy-kat kopy-kat commented Jun 27, 2024

This PR fixes a few things:

  • make Safe7579 storage 4337 compatible, meaning that we can initialize and write to the storage during account creation
  • move functionality to getSafeOp into separate contract for readability
  • move functionality of ERC-7579 generic view functions into contract and inherit by Safe7579 and Launchpad
  • add missing feature of fallback signature validation into launchpad

@@ -25,8 +32,16 @@ import { MODULE_TYPE_VALIDATOR } from "erc7579/interfaces/IERC7579Module.sol";
* technique](https://github.com/safe-global/safe-modules/pull/184)
* @author rhinestone | zeroknots.eth
*/
contract Safe7579Launchpad is IAccount, SafeStorage {
event ModuleInstalled(uint256 moduleTypeId, address module);
Copy link
Member

Choose a reason for hiding this comment

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

This is now in IERC7579AccountEvents

@@ -110,6 +125,28 @@ contract Safe7579Launchpad is IAccount, SafeStorage {
});
}

function addSafe7579(
Copy link
Member

Choose a reason for hiding this comment

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

additional function that allows existing safe accounts to get safe7579 with a single transaction

// because the `EncodedSafeOpStruct` struct has no "dynamic" fields so its memory layout
// is identical to the
// result of `abi.encode`-ing the individual fields.
EncodedSafeOpStruct memory encodedSafeOp = EncodedSafeOpStruct({
Copy link
Member

Choose a reason for hiding this comment

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

this is fixing discussed struct change:
#3

} from "@ERC4337/account-abstraction/contracts/core/UserOperationLib.sol";
import { SAFE_OP_TYPEHASH, ISafeOp } from "../interfaces/ISafeOp.sol";

abstract contract SafeOp is ISafeOp {
Copy link
Member

Choose a reason for hiding this comment

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

moved this logic to an abstract contract as this functionality has to be utilized by both Safe7579 and Launchpad

@kopy-kat kopy-kat changed the title feat: make storage 4337 compliant fix: various bugs/missing features Jul 1, 2024
@kopy-kat kopy-kat merged commit ff8df1d into feature/remediation Jul 8, 2024
2 checks passed
@kopy-kat kopy-kat deleted the feature/4337-compliance branch July 8, 2024 20:36
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