bcnmy / scw-contracts

SCW contracts for Biconomy Smart Account
MIT License
115 stars 82 forks source link

WIP:: Custom method selector SVM (ABI SVM) #174

Closed filmakarov closed 7 months ago

filmakarov commented 10 months ago

Summary

Introduces the new Session Validation Module, which can validate an action, performed by userOp, based on:

It allows a dApp to validate calls from a SmartAccount to any method of any contract. This SVM can be a useful building block for custom flows via the Batched Session Router.

Detailed Document: ABI SVM the universal Session Validation Module 2716292a4efe4b6b96d4910927ea3cca.pdf

Related Issue: #SMA-363

Change Type

Checklist

linear[bot] commented 10 months ago
SMA-363 ABI Session Validation Module

[https://github.com/zerodevapp/kernel/blob/main/src/validator/SessionKeyValidator.sol](https://github.com/zerodevapp/kernel/blob/main/src/validator/SessionKeyValidator.sol)

livingrockrises commented 8 months ago

If the argument is address then how does rules like <= >= apply and be relevant

livingrockrises commented 8 months ago

can you document more about how to add rules. I think we will hand hold people a lot understanding offset especially. and generating session key data accordingly cause this heavily depends on contract and method

livingrockrises commented 8 months ago

can sessionKeyData just be concat of

sessionKey,
permission.destContract,
permission.functionSelector,

and not providing anything else at all?

filmakarov commented 8 months ago

can you document more about how to add rules. I think we will hand hold people a lot understanding offset especially. and generating session key data accordingly cause this heavily depends on contract and method

Yeah, it is explained here I think https://www.notion.so/biconomy/ABI-SVM-the-universal-Session-Validation-Module-for-basic-use-cases-2716292a4efe4b6b96d4910927ea3cca Looking forward to getting your feedback on this doc

filmakarov commented 8 months ago

If the argument is address then how does rules like <= >= apply and be relevant

technically any address is a uint as well. so technically it can be applied, but logically it rarely makes sense but since we consider everything as bytes32 not address or uint, all the conditions can be applied to any arg

filmakarov commented 8 months ago

can sessionKeyData just be concat of

sessionKey,
permission.destContract,
permission.functionSelector,

and not providing anything else at all?

yes, added according test case

livingrockrises commented 8 months ago

can you document more about how to add rules. I think we will hand hold people a lot understanding offset especially. and generating session key data accordingly cause this heavily depends on contract and method

Yeah, it is explained here I think https://www.notion.so/biconomy/ABI-SVM-the-universal-Session-Validation-Module-for-basic-use-cases-2716292a4efe4b6b96d4910927ea3cca Looking forward to getting your feedback on this doc

will provide feedback this week

livingrockrises commented 8 months ago

can sessionKeyData just be concat of

sessionKey,
permission.destContract,
permission.functionSelector,

and not providing anything else at all?

yes, added according test case

can you link it here or on dm. sorry for trouble again

filmakarov commented 8 months ago

==== SELF-REVIEW AND INTERNAL REVIEWS ARE DONE ====

filmakarov commented 8 months ago

Linking the documentation in the PR Description

filmakarov commented 8 months ago

Passing to Security Auditors