Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What changes were made?
"Magic Spend "has been updated to be "MagicSpend".
How was this tested?
Locally - visually.
_Below the line is how the README now looks ✅ _
MagicSpend
MagicSpend is a contract that allows onchain accounts to present valid Withdraw Requests and receive funds. A Withdraw Request is defined as
Where signature is an EIP-191 compliant signature of the message
MagicSpend is an ERC-4337 compliant paymaster (EntryPoint v0.6) and also enables withdraw requests with asset ETH (
address(0)
) to be used to pay transaction gas.This contract is part of a broader MagicSpend product from Coinbase, which as a whole allows Coinbase users to seamlessly use their assets onchain.
We have started a discussion around a possible new wallet RPC to enable apps to have better awareness of this "just in time" funding.
Detailed Flows
When the withdrawing account is an ERC-4337 compliant smart contract (like Smart Wallet), there are three different ways the MagicSpend smart contract can be used
Pay gas only
UserOperation.sender
, a smart contract wallet (SCW), to validate the user operation.UserOperation.calldata
UserOperation.calldata
.Transfer funds during execution only
This is the simplest flow. The MagicSpend account is agnostic to any details of this transaction, even whether or not the caller is a SCW. It simply validates the withdraw and transfers funds if valid.
Pay gas and transfer funds during execution
This flow is like "Pay gas only” with the addition of (7.) and (8.). Here, the SCW also requests funds during execution. In this flow, a user might be, for example, trying to mint an NFT and needs funds for the mint.
Deployments
Developing
After cloning the repo, run the tests using Forge, from Foundry
forge test
You can run the echinda tests with this make command