{"id":21247192,"url":"https://github.com/alchemyplatform/creating-smart-contract-and-sending-userops","last_synced_at":"2025-07-10T22:32:16.572Z","repository":{"id":226269860,"uuid":"687645828","full_name":"alchemyplatform/creating-smart-contract-and-sending-userops","owner":"alchemyplatform","description":null,"archived":false,"fork":false,"pushed_at":"2024-03-06T18:25:23.000Z","size":14,"stargazers_count":2,"open_issues_count":2,"forks_count":12,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-05-21T04:11:05.925Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alchemyplatform.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-09-05T17:50:38.000Z","updated_at":"2024-05-21T04:11:05.925Z","dependencies_parsed_at":"2024-03-08T06:33:53.954Z","dependency_job_id":null,"html_url":"https://github.com/alchemyplatform/creating-smart-contract-and-sending-userops","commit_stats":null,"previous_names":["alchemyplatform/creating-smart-contract-and-sending-userops"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alchemyplatform%2Fcreating-smart-contract-and-sending-userops","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alchemyplatform%2Fcreating-smart-contract-and-sending-userops/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alchemyplatform%2Fcreating-smart-contract-and-sending-userops/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alchemyplatform%2Fcreating-smart-contract-and-sending-userops/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alchemyplatform","download_url":"https://codeload.github.com/alchemyplatform/creating-smart-contract-and-sending-userops/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225658502,"owners_count":17503667,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-21T02:17:01.505Z","updated_at":"2024-11-21T02:17:02.131Z","avatar_url":"https://github.com/alchemyplatform.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Creating a Smart Contract Account and sending ETH\n\nThis repository serves as the codebase for Alchemy's Creating a Smart Contract Account and sending ETH [tutorial](https://docs.alchemy.com/docs/creating-a-smart-contract-account-and-sending-userops). This tutorial walks you through creating a smart contract account (SCA) using Alchemy AA-SDK and executing transactions (such as sending ETH) from the SCA to another SCA or an Externally Owned Account (EOA).\n\nWe've structured this project to implement the process in four different ways:\n\n- Using TypeScript with AA-core \u0026 AA-Alchemy\n- Using JavaScript with AA-core \u0026 AA-Alchemy\n\n## Prerequisites\n\nYou will need the latest recommended [Node](https://nodejs.org/en) version v18.16.1 to use this repository.\n\nTo check which version you have, run the following in your preferred terminal:\n\n```\nnode -v\n```\n\nIf v18.16.1 appears, you are ready to use the repository! If it does not, the best way to install and change your node versions is through [Node Version Manager](https://github.com/nvm-sh/nvm#intro)\n\nClick the above link to install nvm if you do not already have it. Then run the following command.\n\n```\nnvm install 18.16.1\nnode -v\n```\n\nIn your terminal, you should now see\n\n```\nNow using node v18.16.1 (npm v9.5.1)\nv18.16.1\n```\n\n## Setup\n\nClone the repository and install the dependencies:\n\n```\ngit clone https://github.com/alchemyplatform/creating-smart-contract-and-sending-userops.git\ncd creating-smart-contract-and-sending-userops\nnpm install\n```\n\nThen create your `.env` file based on `.env.example`.\n\nOnce you have created and populated your `.env`, run the following commands\n\n```\nnpm run getCFaddress\nnpm run sendETH\n```\n\nThe first command executes [getCounterfactual.ts](https://github.com/alchemyplatform/creating-smart-contract-and-sending-userops/blob/main/scripts/getCounterfactual.ts) to fetch the counterfactual address. The second command executes [sendETHToSCA.ts](https://github.com/alchemyplatform/creating-smart-contract-and-sending-userops/blob/main/scripts/sendEthToSCA.ts) to send ETH from your EOA to the SCA.\n\n## Explaining the Scripts\n\nLet's briefly review the files within the [Scripts](https://github.com/alchemyplatform/creating-smart-contract-and-sending-userops/tree/main/scripts) folder.\n\n#### getCounterfactual.ts\n\n- retrieves the counterfactual address derived from [CREATE2](https://eips.ethereum.org/EIPS/eip-1014) and saves in the `accountInfo.json` file, which will be created the first time you this file is executed.\n\n#### sendEthToSCA.ts\n\n- sends ETH from your EOA to your SCA. The `to` address is your counterfactual address.\n\n## Executing the code\n\nThe respective index file in the relevant language (TypeScript/JavaScript) will be executed depending on which command you run. They each accomplish the same goal, creating a SCA and sending ETH from it - only the methodology differs.\n\nThe four main commands are:\n\n- `npm run execute:ts`\n- `npm run execute:js`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falchemyplatform%2Fcreating-smart-contract-and-sending-userops","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falchemyplatform%2Fcreating-smart-contract-and-sending-userops","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falchemyplatform%2Fcreating-smart-contract-and-sending-userops/lists"}