{"id":25595517,"url":"https://github.com/polywrap/safe-playground","last_synced_at":"2026-06-18T18:32:00.117Z","repository":{"id":173191598,"uuid":"612304844","full_name":"polywrap/safe-playground","owner":"polywrap","description":null,"archived":false,"fork":false,"pushed_at":"2023-06-29T19:45:37.000Z","size":5458,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-21T11:45:31.699Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/polywrap.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,"publiccode":null,"codemeta":null}},"created_at":"2023-03-10T16:35:59.000Z","updated_at":"2023-07-05T19:33:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"8a8f05ba-3b29-4e8d-bd3a-0c85752961f1","html_url":"https://github.com/polywrap/safe-playground","commit_stats":null,"previous_names":["cbrzn/safe-playground","polywrap/safe-playground"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/polywrap/safe-playground","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polywrap%2Fsafe-playground","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polywrap%2Fsafe-playground/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polywrap%2Fsafe-playground/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polywrap%2Fsafe-playground/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/polywrap","download_url":"https://codeload.github.com/polywrap/safe-playground/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polywrap%2Fsafe-playground/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34503507,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-18T02:00:06.871Z","response_time":128,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2025-02-21T11:29:36.417Z","updated_at":"2026-06-18T18:32:00.112Z","avatar_url":"https://github.com/polywrap.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# **AA Wrap Demo** \u0026middot; [![license](https://img.shields.io/badge/license-MIT-blue)](https://shields.io)\n\n## Table of Contents\n\n- [The AA Wrap](#the-account-abstraction-aa-wrap)\n- [Demo Overview](#demo-overview)\n- [Demo Setup](#demo-setup)\n- [Demo Scripts](#demo-scripts)\n- [Multiplatform Support: Rust](#multiplatform-support-rust)\n- [Scripts Explanation](#scripts-explanation)\n- [Community \u0026 Contributing](#community--contributing)\n\n## The Account Abstraction (AA) Wrap\n\n\u003cimg src=\"images/multiplatform.png\" width=\"500x\"\u003e\n\nThe AA Wrap is a Polywrap-powered version of the [Safe Account Abstraction (AA) SDK](https://docs.safe.global/learn/safe-core/safe-core-account-abstraction-sdk).\n\nThe Safe AA SDK lets developers build [\"smart accounts\"](https://docs.safe.global/learn/what-is-a-smart-contract-account), accounts with fully customizable functionality. Smart accounts aim to bring much-needed UX improvements to web3.\n\nToday, the AA Wrap includes functionality to:\n\n- create customizable, secure, and modular smart accounts.\n- enable a gas-less user experience via Gelato, offer sponsored transactions, and allow for fee payments in ERC-20 tokens.\n\n## Demo Overview\n\nIn this demo, you'll be executing scripts that showcase the AA Wrap's main value props: **multi-platform** and **composability**.\n\n\u003cimg src=\"images/fetch.png\" width=\"300x\"\u003e\n\n1. **Multi–platform** – The same AA Wrap is fetched from IPFS and then integrated into two different programming environments: JavaScript and Rust.\n\n2. **Composability** – The AA Wrap's functionality can be easily extended by composing it with other Wraps. The current AA Wrap is composed of 3 separate Wraps: Ethers, Gelato Relay and Safe{Core}.\n\n## Demo Setup\n\nFirst, you'll set up the demo.\n\n1. Create and configure a `.env` file with the following variables (you can use the `RPC_URL` provided below):\n\n```bash\nOWNER_ONE_PRIVATE_KEY=\nOWNER_TWO_PRIVATE_KEY=\nRPC_URL=\"https://goerli.infura.io/v3/41fbecf847994df5a9652b1210effd8a\"\n```\n\n2. Create two new accounts in MetaMask for testing purposes. [Export the private keys](https://support.metamask.io/hc/en-us/articles/360015289632-How-to-export-an-account-s-private-key) and input them as values for `OWNER_ONE_PRIVATE_KEY` and `OWNER_TWO_PRIVATE_KEY`.\n\n\u003e ⚠️ Make sure these two accounts are ones that you're only using for testing purposes!\n\n3. Supply your two accounts with Goerli ETH in order to send transactions. You can use a [Goerli faucet](https://goerlifaucet.com/) to do this.\n\n4. Change directory to `js`:\n\n```\ncd js\n```\n\n5. Update the salt nonce in `./scripts/deploy-safe.ts` to `0x` followed by a few randomly chosen digits. For example,\n\nThis salt nonce is used later to create the new Safe address.\n\n```ts\nconst SALT_NONCE = \"0x185593\";\n```\n\n6. Run the `./scripts/deploy-safe.ts` script to deploy the Safe smart account.\n\n```\nyarn deploy\n```\n\n\u003e For the purposes of this demo, we're deploying to the Goerli test network. You can view your Safe on [Goerli Etherscan block explorer](https://goerli.etherscan.io/).\n\n7. Add the Safe address in your `.env` file:\n\nYou should have received the Safe address after deploying it.\n\n```bash\nSAFE_ADDRESS=\"0x...\"\n```\n\nCongratulations! You're done configuring the demo and deploying your own Safe smart account. 🥳\n\n### Demo Scripts\n\nThe scripts below show complex transactions that your smart account can execute. Run `yarn` and then the script name to execute it.\n\n| Script              | Description                                                   |\n| ------------------- | ------------------------------------------------------------- |\n| `execute`           | Updates a stored value on a smart contract                    |\n| `execute-sponsored` | Uses the Gelato relay Wrap to execute a sponsored transaction |\n| `execute-multisend` | Sends transactions to multiple recipients                     |\n\n## Multiplatform Support: Rust\n\nOne of the AA Wrap's powerful advantages is that it can be used in any app, as long as the app has a Polywrap client library installed.\n\nThe above scripts were run in a JavaScript environment. We've also prepared scripts that run in **Rust** below.\n\nFirst, you need to be in the `rs` directory.\n\nThen, update the salt nonce in the `./bin/deploy.rs` file:\n\n```rs\n    let deployment_input = DeploymentArgs {\n        input: DeploymentInput {\n            safe_account_config: AccountConfig {\n                owners: vec![signer_address.unwrap()],\n                threshold: 1,\n            },\n            safe_deployment_config: DeploymentConfig {\n                salt_nonce: \"0x...\".to_string(),\n            },\n            connection: None,\n        },\n    };\n```\n\nThen run:\n\n```\ncargo run --bin --release \u003cscript\u003e\n```\n\nWhere `\u003cscript\u003e` is one of the following:\n\n| Script                | Description                     |\n| --------------------- | ------------------------------- |\n| `deploy`              | Deploys your Safe smart account |\n| `add_owners`          | Add owners to the Safe          |\n| `get_owners`          | Get the list of owners          |\n| `sponsor_transaction` | Execute a sponsored transaction |\n\n# Scripts Explanation\n\nThis section presents an in-depth look at two of the scripts: multisend and sponsored transactions.\n\n## Multisend\n\nThis script sends test ERC-20 tokens to two separate recipient addresses.\n\n1. Invokes **Ethers Wrap** to mint test ERC-20 tokens to the Safe\n2. Invokes **Ethers Wrap** to transfer half of the test tokens to `receiverOne` and the other half to `receiverTwo`\n3. Invokes **Safe Wrap** to batch these two transactions into a multisend transaction using `createMultiSendTransaction` method\n4. Invokes **Safe Wrap** to add the signatures of the two owners to this batch transaction\n5. Invokes **Safe Wrap** to `executeTransaction`\n\n## Sponsored Transaction\n\nThis script sends a transaction to the Gelato Relayer which executes the transaction on behalf of the user.\n\n1. Invokes **Ethers Wrap** to store a value `7` on a `storage` smart contract\n2. Defines `metaTransactionData` which has the `storage` smart contract address\n3. Invokes **Ethers Wrap** to estimate the ETH gas fees to be paid\n4. Invokes **Account Abstraction Wrap** to predict the Safe address using `getSafeAddress` method\n5. Invokes **Account Abstraction Wrap** to `relayTransaction`, relaying the transaction to update the `storage` contract value to `7`\n\n# Community \u0026 Contributing\n\nThe AA Wrap was developed and maintained by the [Polywrap DAO](https://polywrap.io/). We believe that the AA Wrap brings a new depth of code re-useability and modularity to the already powerful account abstraction suite that the Safe team built.\n\nTo learn more about Polywrap and contribute to the AA Wrap, please join our [Discord community](https://discord.gg/qK9S46gTbF).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolywrap%2Fsafe-playground","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpolywrap%2Fsafe-playground","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolywrap%2Fsafe-playground/lists"}