{"id":16392034,"url":"https://github.com/mikeshultz/ethmsg-contracts","last_synced_at":"2025-08-31T13:33:34.426Z","repository":{"id":147876710,"uuid":"122768258","full_name":"mikeshultz/ethmsg-contracts","owner":"mikeshultz","description":"Contracts for ethmsg","archived":false,"fork":false,"pushed_at":"2018-02-25T20:07:11.000Z","size":43,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-22T22:27:50.994Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mikeshultz.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-02-24T18:38:38.000Z","updated_at":"2018-02-25T19:17:27.000Z","dependencies_parsed_at":"2023-04-13T12:33:37.345Z","dependency_job_id":null,"html_url":"https://github.com/mikeshultz/ethmsg-contracts","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mikeshultz/ethmsg-contracts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikeshultz%2Fethmsg-contracts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikeshultz%2Fethmsg-contracts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikeshultz%2Fethmsg-contracts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikeshultz%2Fethmsg-contracts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mikeshultz","download_url":"https://codeload.github.com/mikeshultz/ethmsg-contracts/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikeshultz%2Fethmsg-contracts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272988755,"owners_count":25026959,"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-08-31T02:00:09.071Z","response_time":79,"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-10-11T04:48:17.924Z","updated_at":"2025-08-31T13:33:34.377Z","avatar_url":"https://github.com/mikeshultz.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ethmsg Contracts\n\nThese are the contracts for ethmsg.\n\n## Contracts\n\n### EMRouter\n\nEMRouter is the primary routing contract.  It's where the dapp will find the \nother contracts and assets it needs.  For instance, if it needs to know where \nthe live MessageStore contract is, it'll ask EMRouter.  If it needs to know \nwhere a JavaScript file is on IPFS, it'll ask EMRouter.\n\n#### Public Views\n\n##### getAsset(string name)\n\n`getAsset()` will return a hex-encoded IPFS hash for an asset.\n\n##### getAddress(string name)\n\n`getAddress()` will return an IPFS hash for an ABI(if applicable) and an address\nwhere a contract might be found.\n\nFor instance, to get the location for MessageStore, you might call it like this:\n\n    const results = router.getAddress('messagestore');\n    const abiHash = results[0];\n    const address = results[1];\n\n### MessageStore\n\nMessageStore is the primary persistence contract for EthMsg.  It stores pretty\nmuch all state necessary for the dapp.\n\n#### Public Views\n\n##### get(address user)\n\n`get()` will provide information on the latest message from a user.  It provides\nthe block number when it was `created`, the `decryptionKey` used to decrypt the\nmessage(if applicable) and the IPFS `contenHash` of the method.\n\n##### get(address user, uint index)\n\nThis version of `get()` will will provide information on the a message at a \nspecific index for a user.  It provides the block number when it was `created`, \nthe `decryptionKey` used to decrypt the message(if applicable) and the IPFS \n`contenHash` of the method.\n\n##### getLength(address user)\n\n`getLength()` will return the total number of messages stored by a user.\n\n##### add(bytes32 decryptionKey, bytes32 contenHash)\n\n`add()` is used to save a message to Ethmsg.  Only `contentHash` is required.\n\n## Test\n\nMake sure you have ganache-cli running as a test network.\n    ganache-cli -a10\n\nThen just run the truffle/mocha test suite.\n\n    truffle test","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikeshultz%2Fethmsg-contracts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmikeshultz%2Fethmsg-contracts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikeshultz%2Fethmsg-contracts/lists"}