{"id":13409575,"url":"https://github.com/jamiew/loot-fork","last_synced_at":"2025-10-05T13:05:51.987Z","repository":{"id":66289738,"uuid":"402211920","full_name":"jamiew/loot-fork","owner":"jamiew","description":"Loot (for Forkers). A hardhat development environment bootstrapped with the Loot smart contract","archived":false,"fork":false,"pushed_at":"2023-02-04T15:43:18.000Z","size":198,"stargazers_count":29,"open_issues_count":0,"forks_count":7,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-08-11T12:52:40.055Z","etag":null,"topics":["erc721","ethereum","hardhat","loot","nft","nfts","solidity"],"latest_commit_sha":null,"homepage":"","language":"Solidity","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/jamiew.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-09-01T21:49:24.000Z","updated_at":"2025-01-12T17:37:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"354acd78-f261-4051-a3d6-b30a836b90f3","html_url":"https://github.com/jamiew/loot-fork","commit_stats":{"total_commits":9,"total_committers":1,"mean_commits":9.0,"dds":0.0,"last_synced_commit":"f8c8e60a4a298b7ab52174caf987881a9fcc47f6"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jamiew/loot-fork","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamiew%2Floot-fork","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamiew%2Floot-fork/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamiew%2Floot-fork/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamiew%2Floot-fork/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jamiew","download_url":"https://codeload.github.com/jamiew/loot-fork/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamiew%2Floot-fork/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270758484,"owners_count":24640252,"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-16T02:00:11.002Z","response_time":91,"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":["erc721","ethereum","hardhat","loot","nft","nfts","solidity"],"created_at":"2024-07-30T20:01:02.073Z","updated_at":"2025-10-05T13:05:46.927Z","avatar_url":"https://github.com/jamiew.png","language":"Solidity","funding_links":[],"categories":["Open-Source Example Repositories"],"sub_categories":[],"readme":"# Loot (for Forkers)\n\nQuick proof of concept for my boi [@codyb](https://twitter.com/codybrown) and all the cryptokeepers at [Definitely Crypto](https://defdao.xyz)\n\n1. It's [@dhof](https://twitter.com/dhof/)'s beautiful little [LOOT contract](https://etherscan.io/address/0xff9c1b15b16263c61d017ee9f65c50e4ae0113d7#code)\n\n2. But with the flattened [OpenZeppelin contracts](https://openzeppelin.com/contracts/) extracted back into their original `imports`, for cleanliness\n\n3. Then a healthy dose of `npx hardhat` boilerplate (Advanced Example) which is A Pretty Great Way To Write Solidity\n\n4. And then this brilliant README\n\n5. Good luck, we're all counting on you\n\n![Speed Project Approved: 1 Hour](http://fffff.at/files/2009/09/speedproject-approved-stamp-1h.gif)\n\n\n## Vamanoooooooooooooos\n\nCheckout this repo and install dependencies\n\n```\ngit clone https://github.com/jamiew/loot-fork\ncd loot-fork\nnpm install\n```\n\ncompile the contract and deploy to the internal `hardhat` network\n\n```\nnpx hardhat compile\nnpx hardhat run scripts/deploy.js\n```\n\n## Here's the next level\n\na real example requires you to run a local Ganache blockchain simulator (AKA the `localhost` network, chainId `31337`):\n\n```shell\n# in one terminal, run a lil blockchain\nnpx hardhat node --show-stack-traces\n\n# in another terminal, deploy the contract and copy the deployed address\nnpx hardhat run --network localhost scripts/deploy.js\n```\n\nthen start `npx hardhat console` and you can interact with said contract\n\n```shell\nnpx hardhat console --network localhost\n```\n\nin the console, connect to our newly deployed `LootFork`:\n\n```javascript\nconst Contract = await ethers.getContractFactory('LootFork');\nconst contract = await Contract.attach(\"ADDRESS_FROM_DEPLOYMENT_GOES_HERE\");\n```\n\nthen let's call some contract methods:\n\n```javascript\n(await contract.name()).toString()\n// 'LootFork'\n\n(await contract.totalSupply()).toString();\n// '0'\n// (because we haven't minted anything yet)\n\n(await contract.getWeapon(1)).toString();\n// '\"Grim Shout\" Grave Wand of Skill +1'\n```\n\nif you want some loots, mint them to one of the default accounts setup by `hardhat node` (ganache). they cryptorich, they got like 10k ETH each\n\n```javascript\nlet tokenId = 1;\nlet account = (await ethers.getSigners())[0];\nlet txn = (await contract.connect(account).claim(tokenId));\nlet receipt = (await txn.wait());\nconsole.log(receipt.events[0].args)\n/*\n[\n  from: '0x0000000000000000000000000000000000000000',\n  to: '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266',\n  tokenId: BigNumber { _hex: '0x03', _isBigNumber: true }\n]\n*/\n```\n\ndid it work though?\n```javascript\n(await contract.totalSupply()).toString();\n// '1'\n\n(await contract.tokenURI(1));\n// 'data:application/json;base64,eyJuYW1lIjogIkJhZyAjMSIsICJkZXNjcmlwdGlvbiI6ICJMb290IGlzIHJhbmRvbWl6ZWQgYWR2ZW50dXJlciBnZWFyIGdlbmVyYXRlZCBh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b1pYSWdRbVZzZER3dmRHVjRkRDQ4ZEdWNGRDQjRQU0l4TUNJZ2VUMGlNVEF3SWlCamJHRnpjejBpWW1GelpTSStJa1JsWVhSb0lGSnZiM1FpSUU5eWJtRjBaU0JIY21WaGRtVnpJRzltSUZOcmFXeHNQQzkwWlhoMFBqeDBaWGgwSUhnOUlqRXdJaUI1UFNJeE1qQWlJR05zWVhOelBTSmlZWE5sSWo1VGRIVmtaR1ZrSUV4bFlYUm9aWElnUjJ4dmRtVnpQQzkwWlhoMFBqeDBaWGgwSUhnOUlqRXdJaUI1UFNJeE5EQWlJR05zWVhOelBTSmlZWE5sSWo1T1pXTnJiR0ZqWlNCdlppQkZibXhwWjJoMFpXNXRaVzUwUEM5MFpYaDBQangwWlhoMElIZzlJakV3SWlCNVBTSXhOakFpSUdOc1lYTnpQU0ppWVhObElqNUhiMnhrSUZKcGJtYzhMM1JsZUhRK1BDOXpkbWMrIn0='\n```\n\nlooks good to me\n\ncongratulations jeffrey bezos u did it\n\n\n## put that bad boy on mainnet and get lootrich\n\nor perhaps start with rinkeby, my favorite testnet\n\nThis largely requires funding a wallet and registering API keys with [Alchemy](https://docs.alchemy.com/alchemy/introduction/getting-started) and [Etherscan]()\n\nCopy `.env.sample` to `.env` and edit in your keys\n\nThen:\n\n```shell\nnpx hardhat run scripts/deploy.js --network rinkeby\n```\n\nyou can interact with this contract via `npx hardhat console` the same way as above, just substitute `--network rinkeby` for `--network localhost`\n\nYou can also use the `hardhat-etherscan-verify` plugin to verify the contract on Etherscan, which is required to be truly eleet\n\n```\nnpx hardhat verify --network rinkeby \u003cYOUR_CONTRACT_ADDRESS\u003e\n```\n\nSubstitute `mainnet` for `rinkeby` to deploy for realsies. good luck\n\n\n# more reading\n\n* [Hardhat docs](https://hardhat.org/getting-started/)\n* [OpenZeppelin docs](https://docs.openzeppelin.com/openzeppelin/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamiew%2Floot-fork","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjamiew%2Floot-fork","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamiew%2Floot-fork/lists"}