{"id":15060038,"url":"https://github.com/decentralisedme/1-horse-store","last_synced_at":"2026-02-21T05:49:16.581Z","repository":{"id":255635921,"uuid":"851350330","full_name":"Decentralisedme/1-horse-store","owner":"Decentralisedme","description":"The fascinating world of  opcodes and the understanding their structure in the evm environment  ","archived":false,"fork":false,"pushed_at":"2024-11-04T18:20:47.000Z","size":53,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-15T04:12:52.381Z","etag":null,"topics":["assembly","bytecode","huff","opcodes","yul"],"latest_commit_sha":null,"homepage":"","language":"C++","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/Decentralisedme.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":"2024-09-02T23:52:09.000Z","updated_at":"2024-11-04T18:20:51.000Z","dependencies_parsed_at":"2024-09-06T12:38:32.670Z","dependency_job_id":"692906c3-4c23-498b-aad7-43d09fd5cd9f","html_url":"https://github.com/Decentralisedme/1-horse-store","commit_stats":null,"previous_names":["decentralisedme/1-horse-store"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Decentralisedme/1-horse-store","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Decentralisedme%2F1-horse-store","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Decentralisedme%2F1-horse-store/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Decentralisedme%2F1-horse-store/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Decentralisedme%2F1-horse-store/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Decentralisedme","download_url":"https://codeload.github.com/Decentralisedme/1-horse-store/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Decentralisedme%2F1-horse-store/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279926935,"owners_count":26245501,"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-19T02:00:07.647Z","response_time":64,"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":["assembly","bytecode","huff","opcodes","yul"],"created_at":"2024-09-24T22:51:34.072Z","updated_at":"2025-10-19T22:17:50.024Z","avatar_url":"https://github.com/Decentralisedme.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Intro to lower lavel bytecode\nThe exercise is to develop the same contract in Solidity, Yul and Huff, plus some inline assembly.\nThis is a great intro to lower level langs which helps to get a clear undestanding of EVM behaviour especially when it comes down to stack, storage, memory and how they interact via stack syntax.\n\n## Tools:\nThese are tools which I found very usefull:\n-   **Scripts**:\n- Get the Function Signature: `cast sig \"isHappyHorse(uint256)\"`\n- Conversion Hex to Dex and viceversa: `cast to-base 0x15180 dec`\n- Foundry chisel: REPL \n- Test debug: `forge test --debug`\n- huffmate: import Hashmap.huff / CommonErrors.huff\n\n\n# Horse Store V1\n1. write basic simplestorage/horsestore\n\n#### Process\n1. I send the data\n2. Dispacher selects the function\n3. Dispacher sends the data to the funciton\n\n\n## Tests\n#### Set-up:\n1. Huff Foundry Extension - Fundry-Huff- to be installed:\n```shell\n$ forge install huff-language/foundry-huff --no-commit\n```\n2. Foundry.toml to be updated: \n```shell\n$ ffi = true\n$ remappings = [\n    'foundry-huff=lib/foundry-huff/src',\n    '@openzeppelin/=lib/openzeppelin-contracts/',\n]\n```\n\nThis will allow to use/import the `{HuffDeplo}`\n\n#### Crating tests and running them:\nWrote the following files:\n1. Base_TestV1.t.sol: abstract contract that contains all the tests\nTwo test functions:\n```shell\n$ function testReadValue() public {}\n```\n```shell\n$ function testWriteValue() public {}\n```\n\n2. HorseStoreSolc.t.sol: contract is Base_TestV1, used to test solidity contracts\n3. HorseStoreHuff.t.sol: contract is Base_TestV1, used to test huff contracts\n\nTo run the tests you can simply:\n```shell\n$ forge test\n```\nOr if you want to check Huff test only:\n```shell\n$ forge test --match-path *Huff* -vvv\n```\nWith debag you can check the steps on each Opcode - \n```shell\n$ forge test --match-path *Huff* --debug testReadValue -vvv\n```\n## Huff\nGive us the contract deployment\n## Yul\nWe have inline assembly yul where we use yul in solidity,and we have stand alone Yul where we only ise Yul.\nInstall extension: Solidity + Yul Semantic Syntax\nYul has not `contracts` but `objects`\nWe need to write our contract deployment\n\n\n# Horse Store V2\nIn version 2, HorseStore is a ERC721 contract so there are few considerations:\n- ERC721 Interface Functions need to be declared:\n```shell\n$ '#'define function Transfer(address, uint256) nonpayable returns()\n```\n- ERC721 Interfaces Events need to declared\n- Storage Slots to be delared as constants\n- Immutable offsets also to be declared as constans\n\n\n\n\n-   **Chisel**: Fast, utilitarian, and verbose \n## Documentation\n\n\n```shell\n$ forge build\n```\n\n### Test\n\n```shell\n$ forge test\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdecentralisedme%2F1-horse-store","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdecentralisedme%2F1-horse-store","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdecentralisedme%2F1-horse-store/lists"}