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

Batching (accountCreation +) addOwnerAddress(spendPermissions) + approve(user, protocol, ....) + (more...) #25

Open
evmKnows opened this issue Nov 4, 2024 · 0 comments

Comments

@evmKnows
Copy link

evmKnows commented Nov 4, 2024

Hi there,

first and foremost thank you for fleshing out an AA native "Permit2"

Would be particularly interested if the AA / Spend-Permission architecture would allow a batch / zap style onboarding to AA + SpendPermissions contract + dApp,

and if it is generally recommended to compress user actions all-in-one (balance between convenient UX vs. establishing expectations of "signing long jsons" > users being overloaded with TypedData > reading them less > potentially getting rekt in the future)

would love to hear your thoughts.

Vaguely fleshed out snippet below:

        CoinbaseSmartWallet.Call[] memory calls = new CoinbaseSmartWallet.Call[](3);
        calls[0].target = address(account);
        calls[0].value = 0;
        calls[0].data = abi.encodeWithSignature("createAccount(bytes[],uint256)", allInitialOwners, 0);
        calls[1].target = address(account);
        calls[1].value = 0;
        calls[1].data = abi.encodeWithSignature("addOwnerAddress(address)", address(spendPermissions));
        calls[2].target = address(spendPermissions);
        calls[2].value = 0;
    	calls[2].data = abi.encodeWithSignature(
    		"approve((address,address,address,uint160,uint48,uint48,uint48,uint256,bytes))",
    		.....
		);
		.... perform more calls
		
        bytes memory prepareData = abi.encodeWithSignature("executeBatch((address,uint256,bytes)[])", calls);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant