{"id":20943336,"url":"https://github.com/apillon/embedded-wallet-contracts","last_synced_at":"2025-10-24T09:59:02.954Z","repository":{"id":253104167,"uuid":"841387217","full_name":"Apillon/embedded-wallet-contracts","owner":"Apillon","description":null,"archived":false,"fork":false,"pushed_at":"2025-05-27T13:02:19.000Z","size":1408,"stargazers_count":2,"open_issues_count":1,"forks_count":9,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-24T09:59:02.795Z","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/Apillon.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,"zenodo":null}},"created_at":"2024-08-12T09:59:10.000Z","updated_at":"2025-05-27T13:02:23.000Z","dependencies_parsed_at":"2024-08-14T13:57:09.812Z","dependency_job_id":"fe37ed81-4677-49fa-b389-43a3bf7b859d","html_url":"https://github.com/Apillon/embedded-wallet-contracts","commit_stats":null,"previous_names":["apillon/embedded-wallet-contracts"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Apillon/embedded-wallet-contracts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Apillon%2Fembedded-wallet-contracts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Apillon%2Fembedded-wallet-contracts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Apillon%2Fembedded-wallet-contracts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Apillon%2Fembedded-wallet-contracts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Apillon","download_url":"https://codeload.github.com/Apillon/embedded-wallet-contracts/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Apillon%2Fembedded-wallet-contracts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280776480,"owners_count":26388950,"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","status":"online","status_checked_at":"2025-10-24T02:00:06.418Z","response_time":73,"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":"2024-11-18T23:35:58.429Z","updated_at":"2025-10-24T09:59:02.948Z","avatar_url":"https://github.com/Apillon.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Oasis contracts\n\nThis repo contains smart contracts that [Oasis] use.\n\n#### About AccountManager.sol contract\n\nThe Account Manager is a smart contract that handles account creation, credential management, simple message signing, and transaction signing. Its goal is to manage accounts for all EVM-compatible chains and substrate parachains, with the added option of exporting private keys for direct use in other wallet providers.\n\n### Architecture\ncheck `EW-diagram.pdf`\n\n## Flow examples\n\n### Create accounts\nAccountManager.sol \u003e AccountFactory.sol \u003e (AccountEVM.sol or AccountSubstrate.sol)\n\n### getWalletList, Sign message, Add/Remove wallet, Export privateKey, Sign transaction\nAccountManager.sol \u003e Account.sol \u003e (AccountEVM.sol or AccountSubstrate.sol)\n\n## Development\n\n\u003e Instructions for development.\n\n### Project setup\n\nCreate `secrets.json` file in root folder and insert private keys used to deploy.\n\n### Test\n\nFor normal tests run.\n\nRun `npm test`.\n\nFor tests regarding sapphire (e2e) functions make sure to run tests in you sapphire localnet.\n\nFirst run the localnet:\n\n```sh\ndocker run -it -p8545:8545 -p8546:8546 ghcr.io/oasisprotocol/sapphire-localnet\n```\n\nThen run the tests\n\n```sh\nnpx hardhat test ./pathtotest —-network sapphireLocalnet\n```\n\n\n### Build\n\nRun `npm run build`.\n\n### Flatten\n\nRun `npm run flatten`.\n\n## Deployment\n\n\u003e Smart contract deployment instructions.\n\n#### Deploy AccountManager.sol\n\n1. Set signer address in `scripts/deploy-account-manager.ts` (this address provides signature for gasless transactions)\n2. Set initial value to be transfered on gaspaying address\n3. Run `npx hardhat run --network sapphireTestnet ./scripts/deploy-account-manager.ts`\n\nNote: deployment should be executed with unwrapped ethers provider in order to be able to verify contract in next stage. All further transactions should be done using wrapped sapphire provider.\n\n#### Account registration\n\n1. Set `accountManagerAddress`, `usernamePlain`, `password` in `scripts/registration.ts`\n2. Run `npx hardhat run --network sapphireTestnet ./scripts/registration.ts`\n\n#### Gasless Account registration (predefined address with funds loaded pays for gas)\n\n1. Set `accountManagerAddress`, `usernamePlain`, `password` in `scripts/registration-gasless.ts`\n2. Run `npx hardhat run --network sapphireTestnet ./scripts/registration-gasless.ts`\n\nNote: `usernamePlain` has to be unique. If the transaction fails verify that `signer` address is the same on the AccountManager.sol \u0026 in the script\n\n#### Verify if registration success\n\n1. Set `accountManagerAddress`, `usernamePlain` in `scripts/user-exists.ts`\n2. Run `npx hardhat run --network sapphireTestnet ./scripts/user-exists.ts`\n\n#### Change signer in AccountManager\n\n1. Set `accountManagerAddress`, `newSigner` in `scripts/set-signer.ts`\n2. Run `npx hardhat run --network sapphireTestnet ./scripts/set-signer.ts`\n\n#### Get AccountManager data\n\n1. Set `accountManagerAddress` in `scripts/account-manager-data.ts`\n2. Run `npx hardhat run --network sapphireTestnet ./scripts/account-manager-data.ts`\n\n## Verify contract\n\nTo verify on Sourcify.eth:\n\n- Select: Import from solidity JSON\n- Set compiler the same as hardhat.config\n- choose file: leave blank\n- In drag and drop section you select all JSON files inside embedded-wallet-contracts/artifacts/build-info\n- You wait for it to load then under each contract you set address and chain\n\n## Helper scripts\n\n#### Output ABI in json format\n1. Run `npx hardhat run ./scripts/helper/convert-abi.ts`\n\n#### Generate signature for gasless registration\n\n1. Set `gasPrice`, `gasLimit`, `timestamp`, `gaslessData` in `scripts/helper/generate-signature-for-register.ts`\n2. Run `npx hardhat run ./scripts/helper/generate-signature-for-register.ts`\n\n## Examples - how to use a keypair generated via AccountManager\n\n#### Transfer ETH (using password)\n\n1. Set `accountManagerAddress`, `usernamePlain`, `password`, `receiverAddress` in `scripts/examples/proxy-call-transfer.ts`\n2. Run `npx hardhat run --network sapphireTestnet ./scripts/examples/proxy-call-transfer.ts`\n\nNote: Make sure you have some ETH on the sender address (if you don't know your sender address, than you can get it by calling `./scripts/user-exists.ts`)\n\n#### Transfer ERC20 (using password)\n\n1. Set `accountManagerAddress`, `usernamePlain`, `password`, `receiverAddress`, `erc20Address`, `erc20Amount` in `scripts/examples/proxy-call-erc20-transfer.ts`\n2. Run `npx hardhat run --network sapphireTestnet ./scripts/examples/proxy-call-erc20-transfer.ts`\n\nNote: \n- Make sure you have some ETH on the sender address (if you don't know your sender address, than you can get it by calling `./scripts/user-exists.ts`).\n- Make sure you have sufficient ERC20 token on the sender address too.\n- You can either deploy your own erc20 token or use an existing one.\n\n#### Transfer ETH on Amoy, generate transaction on sapphire \u0026 execute on Amoy (using password)\n\n1. Set `accountManagerAddress`, `usernamePlain`, `password`, `txRequest` in `scripts/examples/proxy-call-cross-chain.ts`\n2. Run `npx hardhat run --network sapphireTestnet ./scripts/examples/proxy-call-cross-chain.ts`\n\nNote: \n- Make sure you have some ETH (Amoy) on the sender address (if you don't know your sender address, than you can get it by calling `./scripts/user-exists.ts`).\n- Make sure you set the right nonce in `txRequest` (nonce on Amoy chain)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapillon%2Fembedded-wallet-contracts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapillon%2Fembedded-wallet-contracts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapillon%2Fembedded-wallet-contracts/lists"}