{"id":20811202,"url":"https://github.com/andromedatechnology/ethereum-observer-contract-hardhat","last_synced_at":"2026-05-10T02:35:07.806Z","repository":{"id":249782218,"uuid":"417154873","full_name":"AndromedaTechnology/ethereum-observer-contract-hardhat","owner":"AndromedaTechnology","description":"🔮 Simple Ethereum Smart Contract that stores a Daily Summary from Ethereum Observer API.","archived":false,"fork":false,"pushed_at":"2022-12-13T02:53:59.000Z","size":236,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-18T14:46:02.764Z","etag":null,"topics":["ethereum","hardhat","smart-contracts","solidity","typescript"],"latest_commit_sha":null,"homepage":"https://andromeda.technology","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/AndromedaTechnology.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":"2021-10-14T14:07:12.000Z","updated_at":"2022-12-14T23:53:22.000Z","dependencies_parsed_at":"2024-07-23T10:40:00.030Z","dependency_job_id":null,"html_url":"https://github.com/AndromedaTechnology/ethereum-observer-contract-hardhat","commit_stats":null,"previous_names":["andromedatechnology/ethereum-observer-contract-hardhat"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndromedaTechnology%2Fethereum-observer-contract-hardhat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndromedaTechnology%2Fethereum-observer-contract-hardhat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndromedaTechnology%2Fethereum-observer-contract-hardhat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndromedaTechnology%2Fethereum-observer-contract-hardhat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AndromedaTechnology","download_url":"https://codeload.github.com/AndromedaTechnology/ethereum-observer-contract-hardhat/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243158971,"owners_count":20245669,"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":["ethereum","hardhat","smart-contracts","solidity","typescript"],"created_at":"2024-11-17T20:37:47.540Z","updated_at":"2026-05-10T02:35:07.772Z","avatar_url":"https://github.com/AndromedaTechnology.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eEthereum Observer - Smart Contract - Hardhat, TypeScript\u003c/h1\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://ethereum-observer-api.andromeda.technology\"\u003e\u003cimg src=\"./storage/img/hero.png\"  alt=\"Ethereum Observer - Contract - Hardhat\" /\u003e\u003c/a\u003e\n  \u003cbr /\u003e\n  \u003cbr /\u003e\n  \u003ca href=\"https://ethereum-observer-api.andromeda.technology\"\u003eSimple contract to store Ethereum Observer Summary\u003c/a\u003e\n  \u003cbr /\u003e\n  \u003ca href=\"https://ethereum-observer-api.andromeda.technology\"\u003ehttps://ethereum-observer-api.andromeda.technology\u003c/a\u003e\n\u003c/p\u003e\n\nSimple `Ethereum Smart Contract` that stores a `Daily Summary` of **[Ethereum Observer API](https://github.com/AndromedaTechnology/ethereum-observer-api)**.\n\nUse it as a scalable `Smart Contract Development boilerplate` and/or a learning resource.\n\n# 1. Project\n\n- Contract, written in Solidity,\n- Contract tests, TypeScript,\n- Deployment script, TypeScript,\n- Accounts task, TypeScript.\n\n# 2. Contract\n\n- Method: `addSummary(dayId, blocks, gas)`,\n  - **available to contract creator only**,\n  - reverts the state and returns `WriteAccessForbiden` Error if not run by the contract creator,\n  - raises `SummaryAdded` Event otherwise,\n- Method: `getSummary(dayId)`\n  - available to anyone,\n- Method: `getCreator()`\n  - returns contract creator address.\n\n# 3. Technology\n\n- [Hardhat](https://hardhat.org/) - Ethereum development environment for professionals,\n- [TypeScript](https://www.typescriptlang.org/) - to level-up Hardhat environment robustness while writing tests and scripts (e.g. deployment),\n- [Solidity](https://soliditylang.org/) - Smart Contract development language,\n- [Ethers.js](https://docs.ethers.io/) - communication with Ethereum (e.g. accounts, deployment, testing, ...),\n- [Waffle](https://getwaffle.io/) - contract testing library.\n\n# 4. Configuration (.env file)\n\n1. Duplicate `.env.example` to `.env`.\n2. Enter your [Etherscan](https://etherscan.io/) API key (to verify deployment status of your contract),\n3. Enter your Ropsten node URL (eg from [Alchemy](https://www.alchemy.com/)) (Hardhat will send transactions to this Ethereum node),\n4. Enter the private key of the account which will send the deployment transaction, and of the guest account (used for testing).\n\n## 4.1. Accounts\n\n- Set `PRIVATE_KEY` - creator of the Contract,\n- Set `PRIVATE_KEY_GUEST` - used to [test access rights to Contract methods](https://hardhat.org/guides/waffle-testing.html#testing-from-a-different-account).\n\nNote: Private keys can be obtained by creating two (2) accounts in [MetaMask](https://metamask.io/) (e.g. in different browsers).\n\n# 5. Tests\n\nRun `npx hardhat test`.\n\nContract `NetworkSummary`:\n\n- Sets the proper creator address,\n- Forbids write access to non-creator,\n- Stores summary for the day and returns it.\n\n# 6. Deployment\n\nWith a valid `.env` file in place, to deploy your contract run:\n\n```shell\nnpx hardhat run --network ropsten scripts/deploy.ts\n```\n\nThen, copy the deployment address and paste it in to replace `DEPLOYED_CONTRACT_ADDRESS` in the verification section (check `6.1.`).\n\n## 6.1. Deployment verification - Etherscan\n\nTo try out Etherscan verification, you first need to deploy a contract to an Ethereum network that's supported by Etherscan, such as Ropsten (check `6.`).\n\n```shell\nnpx hardhat verify --network ropsten DEPLOYED_CONTRACT_ADDRESS \"Hello, Hardhat!\"\n```\n\n# 7. Tasks\n\nPrevious sections covered most of the commands you should try out, to get up and running quickly and get a sense of what is going on.\n\nIf you wish to dive deeper, check out the available tasks:\n\n```shell\nnpx hardhat accounts # built-in Hardhat network accounts\nnpx hardhat --network [name] accounts # [name]: e.g. `ropsten`\nnpx hardhat compile\nnpx hardhat clean\nnpx hardhat test\nnpx hardhat node\nnpx hardhat help\nREPORT_GAS=true npx hardhat test\nnpx hardhat coverage\nnpx hardhat run scripts/deploy.ts\nTS_NODE_FILES=true npx ts-node scripts/deploy.ts\nnpx eslint '**/*.{js,ts}'\nnpx eslint '**/*.{js,ts}' --fix\nnpx prettier '**/*.{json,sol,md}' --check\nnpx prettier '**/*.{json,sol,md}' --write\nnpx solhint 'contracts/**/*.sol'\nnpx solhint 'contracts/**/*.sol' --fix\n```\n\n# 8. Performance\n\nFor faster runs of your tests and scripts, consider skipping ts-node's type checking by setting the environment variable `TS_NODE_TRANSPILE_ONLY` to `1` in hardhat's environment.\n\nFor more details see [the documentation](https://hardhat.org/guides/typescript.html#performance-optimizations).\n\n# 9. Social\n\nAndromeda\n\n- [Medium](https://medium.com/andromeda-technology)\n- [Twitter](https://twitter.com/andromeda_node)\n\n# 10. Rest\n\nHero image source: [Hardhat.org](https://hardhat.org).\n\n# 11. Related\n\n[🔭 Ethereum Observer API - Simple tracker for Ethereum Network](https://github.com/AndromedaTechnology/ethereum-observer-api)\n\n- Simple block and transaction tracker for Ethereum network,\n- TypeScript,\n- Koa.js,\n- MongoDB,\n- Jest,\n- Docker.\n\n[🚀 FireStarter API - Progressive Startup API Boilerplate](https://github.com/AndromedaTechnology/firestarter-api)\n\n- Easy to extend, Progressive and Scalable API boilerplate to power your startup,\n- TypeScript,\n- Koa.js,\n- MongoDB,\n- Jest,\n- Docker.\n\n[🏄 Habitus - Journal, Habit, Emotion tracker](https://github.com/AndromedaTechnology/habitus)\n\n- State-of-the-art tracker for emotions, habits and thoughts,\n- Healthiest version of you,\n- Gamified,\n- Anonymous and open source.\n- TypeScript, Koa.js, Vue.js, MongoDB, Jest.\n\n# 12. Contribute\n\nCheck [Self-Aware Software Artisan](http://selfawaresoftwareartisan.com) before contributing.\n\n\u003cbr/\u003e\n\u003ch5 align=\"center\"\u003e\n  \u003ca href=\"https://startedincroatia.com\"\u003eStarted in Europe, Croatia 🇭🇷\u003c/a\u003e\n\u003c/h5\u003e\n\u003ch3 align=\"center\"\u003e\n  Crafted with ❤️ \u003cbr /\u003e\n  by contributors around the 🌍 World and \u003ca href=\"https://andromeda.technology/\"\u003e🌌 Andromeda\u003c/a\u003e.\n\u003c/h3\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandromedatechnology%2Fethereum-observer-contract-hardhat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandromedatechnology%2Fethereum-observer-contract-hardhat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandromedatechnology%2Fethereum-observer-contract-hardhat/lists"}