{"id":14989722,"url":"https://github.com/dapphub/ds-dach","last_synced_at":"2025-04-12T00:32:04.927Z","repository":{"id":77492954,"uuid":"137626825","full_name":"dapphub/ds-dach","owner":"dapphub","description":"Dai Automated Clearing House","archived":false,"fork":false,"pushed_at":"2020-01-30T09:40:46.000Z","size":116,"stargazers_count":52,"open_issues_count":2,"forks_count":11,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-10-31T08:52:21.144Z","etag":null,"topics":["chai","dai","defi","uniswap"],"latest_commit_sha":null,"homepage":"https://stablecoin.services","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dapphub.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2018-06-17T03:42:38.000Z","updated_at":"2023-09-08T17:41:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"c12651be-5988-45d2-8e02-224bfc826ac9","html_url":"https://github.com/dapphub/ds-dach","commit_stats":{"total_commits":47,"total_committers":2,"mean_commits":23.5,"dds":"0.021276595744680882","last_synced_commit":"49a3ccfd5d44415455441feeb2f5a39286b8de71"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dapphub%2Fds-dach","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dapphub%2Fds-dach/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dapphub%2Fds-dach/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dapphub%2Fds-dach/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dapphub","download_url":"https://codeload.github.com/dapphub/ds-dach/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223486880,"owners_count":17153241,"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":["chai","dai","defi","uniswap"],"created_at":"2024-09-24T14:18:49.568Z","updated_at":"2024-11-07T09:03:38.501Z","avatar_url":"https://github.com/dapphub.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ds-dach\nDeployed on mainnet at https://etherscan.io/address/0x64043a98f097fD6ef0D3ad41588a6B0424723b3a#code\n\nThe Dai Automated Clearing House can perform the following actions:\n\n- Clearing of Dai and Chai cheques\n- Clearing of Dai -\u003e Eth or Chai -\u003e Eth uniswap sales\n- Clearing of Chai joins or exits\n\nFor example,\nA `Cheque` is a signed message containing the following information:\n\n* `sender : address`, the author of the cheque\n* `receiver : address`, the receiver of the funds\n* `amount : uint256`, a token amount to transfer to the receiver from the `sender`\n* `expiry : uint256`, a time after which the cheque can no longer be cleared\n* `fee : uint256` a token amount to be transfered from the `sender` to whoever submits the cheque to the clearing house\n* `nonce: uint256`, for replay protection\n* `relayer : address`, the address authorized to clear the transaction\n\nAnyone who obtains such a signed message can clear them, paying the gas cost of the transaction in exchange for the fee.\n\n## Signature generation\nThe contract uses the typed signature format of [EIP-712](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-712.md) to provide a nice user interface and separate similar looking `Cheques` that might be used by other clearing houses. \n\nIf you want to try it out, here's a guide that utilizes the api at https://api.stablecoin.services to clear a dai transfer.\nThis requires that you have `seth` and `ethsign` installed, and a local wallet with some dai or chai available. To install `seth` and `ethsign`, see [dapp.tools](https://dapp.tools).\n\n# Generating the signed message:\nFirst, generate a dai cheque using the script provided at bin/daiCheque. For example, to generate a cheque of `0.1` Dai to the ethereum foundation multisig at `0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae`, paying 0.2 dai in tx fees.\n\nFirst, set the environment ETH_FROM to whatever account you would like to sign the cheque with:\n```sh\nexport ETH_FROM=0xacab #your acc\n```\nthen generate the cheque and store it in a file we'll call `cheque.json`:\n```sh\n./bin/daiCheque 0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae $(seth --to-wei 0.1 'ether') $(seth --to-wei 0.2 'ether') \u003e cheque.json\n```\nBefore clearing the cheque, you need to authorize the `dach` contract:\n```sh\nseth send 0x6b175474e89094c44da98b954eedeac495271d0f \"approve(address,uint256)\" 0x64043a98f097fD6ef0D3ad41588a6B0424723b3a $(seth --to-int256 -1)\n```\nwe can then submit the cheque to be cleared using the stablecoin.services api:\n```sh\ncurl -X POST https://api.stablecoin.services/v1/daiCheque -d @cheque.json -H \"Content-Type: application/json\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdapphub%2Fds-dach","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdapphub%2Fds-dach","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdapphub%2Fds-dach/lists"}