{"id":23991059,"url":"https://github.com/tedlivist/emitwinner","last_synced_at":"2026-06-16T15:32:07.924Z","repository":{"id":270621529,"uuid":"910941206","full_name":"TedLivist/emitWinner","owner":"TedLivist","description":"Solution to the Alchemy Ethereum course W4 challenge","archived":false,"fork":false,"pushed_at":"2025-01-01T21:49:23.000Z","size":66,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-25T04:41:56.526Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/TedLivist.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":"2025-01-01T21:16:54.000Z","updated_at":"2025-01-01T21:49:25.000Z","dependencies_parsed_at":"2025-01-01T22:28:38.681Z","dependency_job_id":"e8e71c1e-4b49-45c8-b493-3640bfaf7577","html_url":"https://github.com/TedLivist/emitWinner","commit_stats":null,"previous_names":["tedlivist/emitwinner"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/TedLivist/emitWinner","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TedLivist%2FemitWinner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TedLivist%2FemitWinner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TedLivist%2FemitWinner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TedLivist%2FemitWinner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TedLivist","download_url":"https://codeload.github.com/TedLivist/emitWinner/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TedLivist%2FemitWinner/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34412788,"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-16T02:00:06.860Z","response_time":126,"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-01-07T19:04:00.255Z","updated_at":"2026-06-16T15:32:07.907Z","avatar_url":"https://github.com/TedLivist.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Solution to ALCHEMY Ethereum course W4 assignment\n\nThe assignment was to emit an event on method `(attempt)` of a deployed sepolia contract (goerli no longer functional, so used a sepolia contract instead).\n\nThe method requires that the `msg.sender` and the `tx.origin` not be the same in order to successfully emit the event.\n\nTo achieve this, I deployed a contract `(Contract)` that implemented an interface `(IContract)` of the `attempt` method on the target contract. During the deployment of the `Contract`, an instance of the target contract is saved on the contract state.\n\nThen, a new method `(attemptCall)` was added to call the interface method using the instance of the target contract. This way the initiator of the tx is `tx.origin` but the `msg.sender` would be my contract. This successfully emits the event [here](https://sepolia.etherscan.io/address/0x890697B6bf90eA125D2Bc3B7B4F5AB2ec610C373#events). \n\nThis is the transactioin hash `(0x46ccbc12122d0b3a7e8b0a545e95fd589926f9fc6620457382f6ec80eb31dfa3)`. As you can see, the `Winner` address is a contract address, but upon closer inspection of the transaction you can see that the initiator is an EOA which is different from the contract address, hence the emission of event.\n\nThe `scripts` directory contains `deploy` and `callAttempt` JS files. The deploy file was used to deploy the `Contract`, while, `callAttempt` was used to initiate the transaction.\n\n\n# Sample Hardhat Project\n\nThis project demonstrates a basic Hardhat use case. It comes with a sample contract, a test for that contract, and a Hardhat Ignition module that deploys that contract.\n\nTry running some of the following tasks:\n\n```shell\nnpx hardhat help\nnpx hardhat test\nREPORT_GAS=true npx hardhat test\nnpx hardhat node\nnpx hardhat ignition deploy ./ignition/modules/Lock.js\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftedlivist%2Femitwinner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftedlivist%2Femitwinner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftedlivist%2Femitwinner/lists"}