POV: you are a developer looking to integrate the fun.xyz wallet SDK
gasSponsor
address instead of a funwallet address
approve()
or permit()
the token paymaster to spend their ETHTokenPriceOracle.sol
calculates the token:gas price and takes a corresponding amount of tokens from the funwallet's approveNote: is the target rule even useful? You can just call an arbitrary contract with a given target rule, ie badToken.approve() and get all your funds drained since you don't know what badToken.approve() does
Explain the pipeline of the create3 deployer: Why does it start where it does and what is the purpose of everything
Go through functions that are uncommented and add them
Draw a picture for whitelist/blacklist mode for tokens
If RBAC is a new design, explain the design, if it is the same design but with structs instead of assembly, explain the validation and why it is so complex
What is the purpose of modules, and why do we have an approve and exec and approve and swap module and nothing else?
Which contracts are meant to be deployed and standalone and which contracts are not?
Why is FunWallet inheriting all this stuff in such a weird way? Ie wallet exec, then overriding functions with walletxec in the funwallet? In object oriented programming, you inherit from abstract classes if you are making a more detailed class, but it seems like we are just inheriting stuff since we don't want to put those functions in Funwallet.sol
Why do we have this random _transferERC20 function in funwallet.sol
What is the purpose of sigTimeRange
If you are going to add assembly, add comments explaining what it does and why this is better than not using asembly, ie requireFromModule
Encodepacked vs using all this assembly
Userauth: ECDSA. Used to verify users have some ownership of some ID. _validateSignatureECDSA()
Remove functions from hashlib
Change how we do error handling
Refactor abstract contracts,
Use libraries instead of abstract contracts
Look at entrypoint v6 and nonce manager
hardcode address in approve and swap, passed in in the constructor
batching instead of modules since we can just have rbac rules in batching
RBAC: Create a system where users in the wallet can give access to users to use certain functions. Optimize for gas costs
All features in the Funwallet are expected to be executed from execFromEntrypoint(address target, uint256 value, bytes calldata)
or execFromEntrypointWithFee(address target, uint256 value, bytes calldata)
There are two parts to call execFromEntrypoint, the access control flow and the execution flow.
The core concept of RBAC is the role:
struct Role {
bool allowlistMode;
uint256 deadline;
bytes32 targetSelectorMerkleRoot;
}
allowlistMode: default false, will only allow targetSelectors in the targetSelectorMerkleRoot