feat: Sepolia card account end-to-end demo scripts (No Merge)#31
Open
livingrockrises wants to merge 5 commits into
Open
feat: Sepolia card account end-to-end demo scripts (No Merge)#31livingrockrises wants to merge 5 commits into
livingrockrises wants to merge 5 commits into
Conversation
Collaborator
Author
Key implementation notes
Test runs (Sepolia)
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Adds a full suite of Sepolia demo scripts covering the card account lifecycle using Startale smart accounts (ERC-7579) and the Rhinestone SDK.
All sepolia scripts run without a paymaster — the counterfactual smart account must be pre-funded with Sepolia ETH before running.
Scripts (run in order)
Scripts run without a paymaster — the counterfactual smart account must be pre-funded with Sepolia ETH before running.
Scripts (run in order)
demo_basic_userop_without_pm.tsindex: 0demo_install_controller_validator.tsindex: 0demo_make_card_account.tsindex: 1CardAccountFactory.makeNewCardAccountvia UserOp to deploy a card account cloneScripts (run in order)
demo_basic_userop_without_pm.tsindex: 0demo_install_controller_validator.tsindex: 0demo_make_card_account.tsindex: 1CardAccountFactory.makeNewCardAccountvia UserOp to deploy a card account clonedemo_basic_userop_without_pm.tsindex: 0demo_install_controller_validator.tsindex: 0demo_make_card_account.tsindex: 1CardAccountFactory.makeNewCardAccountvia UserOp to deploy a card account clonedemo_install_controller_validator.tsindex: 0demo_make_card_account.tsindex: 1CardAccountFactory.makeNewCardAccountvia UserOp to deploy a card account clonedemo_deploy_nexus_with_controller_validator.tsdemo_card_account_usdc_approval.tsindex: 1demo_card_account_usdc_approval.tsindex: 1demo_deposit_from_user_account.tsindex: 0depositFromUserAccounton the card account — pulls USDSC from user SA into card account (default: 500 USDSC)demo_settle_card_balance.tsindex: 0settleCardBalance— sends USDSC from card account to Startale treasuryKey addresses (Sepolia)
0x7E426d026f604d1c47b50059752122d8ab1E2C280x22C9Baf7A0db2190AD74fCE24faBD68Ec6F97DAcRequired env vars
SEPOLIA_BUNDLER_URL=
OWNER_PRIVATE_KEY=
CONTROLLER_VALIDATOR_ADDRESS=
CARD_ACCOUNT_FACTORY_ADDRESS=
CARD_ACCOUNT_ADDRESS= # set after running demo_make_card_account
|--------|----------------|--------------|
|
demo_make_card_account.ts|index: 1| CallsCardAccountFactory.makeNewCardAccountvia UserOp to deploy a card account clone ||
demo_deploy_nexus_with_controller_validator.ts| — | Alternative: deploy a Rhinestone Nexus account with ControllerValidator as the sole validator (useful for testing a new card account implementation) ||
demo_card_account_usdc_approval.ts|index: 1| Grants unlimited USDSC approval from the user's SA to the card account ||
demo_deposit_from_user_account.ts|index: 0| Card controller callsdepositFromUserAccounton the card account — pulls USDSC from user SA into card account (default: 500 USDSC) ||
demo_settle_card_balance.ts|index: 0| Card controller callssettleCardBalance— sends USDSC from card account to Startale treasury (default: 10 USDSC) |Key addresses (Sepolia)
0x7E426d026f604d1c47b50059752122d8ab1E2C28(named USDR on Sepolia)0x22C9Baf7A0db2190AD74fCE24faBD68Ec6F97DAcRequired env vars
SEPOLIA_BUNDLER_URL=
OWNER_PRIVATE_KEY=
CONTROLLER_VALIDATOR_ADDRESS=
CARD_ACCOUNT_FACTORY_ADDRESS=
CARD_ACCOUNT_ADDRESS= # set after running demo_make_card_account
RHINESTONE_API_KEY= # only needed for demo_deploy_nexus_with_controller_validator
Test plan
demo_make_card_account— card account deployed at0xBf0136996da3165d252a60471e7b6CbDB9153928demo_card_account_usdc_approval— unlimited USDSC approval set (tx0xd4256d...)demo_deposit_from_user_account— 500 USDSC deposited into card account (tx0x976f9a...)demo_settle_card_balance— 10 USDSC settled to Startale treasury (tx0x33703e...)