Skip to content

Instantly share code, notes, and snippets.

View snasreeen's full-sized avatar
🎯
Focusing

Nasreen Taj snasreeen

🎯
Focusing
View GitHub Profile
@snasreeen
snasreeen / .deps...npm....resolution-index.json
Created April 30, 2026 06:45
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.34+commit.80d5c536.js&optimize=undefined&runs=200&gist=
{
"contracts/SupplyChain.sol": {
"__sources__": {
"contracts/SupplyChain.sol": {
"content": "// SPDX-License-Identifier: MIT\r\npragma solidity ^0.8.0;\r\n\r\ncontract SupplyChain {\r\n\r\n enum Stage{\r\n Created,\r\n AtShop,\r\n Delivered\r\n }\r\n\r\n struct Product{\r\n uint id;\r\n string name;\r\n Stage stage;\r\n string[] history;\r\n }\r\n\r\n mapping(uint => Product) public products;\r\n\r\n\r\n function createProduct(\r\n uint _id,\r\n string memory _name\r\n ) public {\r\n\r\n products[_id].id = _id;\r\n products[_id].name = _name;\r\n products[_id].stage = Stage.Created;\r\n\r\n products[_id].history.push(\r\n \"Created at Factory\"\r\n );\r\n }\r\n\r\n\r\n function moveToShop(uint _id) public {\r\n\r\n require(\r\n products[_id].stage == Stage.Created,\r\n \"Wrong Stage\"\r\n );\r\n\r\n products[_id].