-
Notifications
You must be signed in to change notification settings - Fork 0
feat: update to AA 0.8.0 #23
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
base: main
Are you sure you want to change the base?
Conversation
Reviewer's Guide by SourceryThis pull request updates the Account Abstraction package to version 0.8.0 and makes necessary adjustments to the SmartAccount contract to align with the new version. The changes include updating import paths, modifying signature validation logic, adding deposit management functions, and adjusting access control for the Sequence diagram for execute functionsequenceDiagram
participant User
participant SmartAccount
participant EntryPoint
User->>SmartAccount: execute(dest, value, func)
activate SmartAccount
SmartAccount->>SmartAccount: _requireForExecute()
alt msg.sender == EntryPoint || msg.sender == owner
SmartAccount->>SmartAccount: _call(dest, value, func)
SmartAccount-->>User: TransactionExecuted(dest, value, func)
else
SmartAccount-->>User: Revert("account: not Owner or EntryPoint")
end
deactivate SmartAccount
Sequence diagram for deposit managementsequenceDiagram
participant User
participant SmartAccount
participant EntryPoint
User->>SmartAccount: addDeposit()
activate SmartAccount
SmartAccount->>EntryPoint: depositTo{value: msg.value}(address(this))
activate EntryPoint
EntryPoint-->>SmartAccount: Deposit
deactivate EntryPoint
SmartAccount-->>User: Deposit added
deactivate SmartAccount
User->>SmartAccount: withdrawDepositTo(withdrawAddress, amount)
activate SmartAccount
SmartAccount->>EntryPoint: withdrawTo(withdrawAddress, amount)
activate EntryPoint
EntryPoint-->>SmartAccount: Withdrawal
deactivate EntryPoint
SmartAccount-->>User: Withdrawal complete
deactivate SmartAccount
Updated class diagram for SmartAccountclassDiagram
class SmartAccount {
address owner
address _entryPoint
constructor(address anOwner, address entryPointAddress)
function initialize(address anOwner)
function _initialize(address anOwner)
function execute(address dest, uint256 value, bytes calldata func)
function validateUserOp(UserOperation calldata userOp, bytes32 userOpHash, uint256 missingAccountFunds) external returns (uint256 validationData)
function _requireForExecute() internal view
function setOwner(address newOwner) external
function setEntryPoint(address newEntryPoint) external
function getDeposit() public view returns (uint256)
function addDeposit() public payable
function withdrawDepositTo(address payable withdrawAddress, uint256 amount) public
receive() external payable
}
SmartAccount --|> BaseAccount : extends
SmartAccount --|> TokenCallbackHandler : extends
SmartAccount --|> UUPSUpgradeable : extends
SmartAccount --|> Initializable : extends
note for SmartAccount "Updated to AA 0.8.0"
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @daanporon - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider extracting the signature validation logic into a separate function for better readability.
- It might be worth adding some events for the deposit/withdrawal functions.
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Review instructions: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
📦 Packages
|
!! BLOCKED
Our Besu node needs to be updated for Cancun support
We need PUSH0 (Shangai) and Transient storage TSTORE, TLOAD (Shanghai)
Summary by Sourcery
Update SmartAccount contract to be compatible with Account Abstraction (AA) version 0.8.0, including changes to import paths, signature validation, and adding new deposit-related functions.
New Features:
Enhancements:
Build:
Chores: