UNPKG

@settlemint/solidity-supplychain

Version:

Smart contract set to build a supplychain usecase in SettleMint

556 lines (550 loc) 24.4 kB
// This file was autogenerated by hardhat-viem, do not edit it. // prettier-ignore // tslint:disable // eslint-disable import type { Address } from "viem"; import type { GetContractReturnType } from "@nomicfoundation/hardhat-viem/types"; import "@nomicfoundation/hardhat-viem/types"; export interface ExampleSupplyChain$Type { "_format": "hh-sol-artifact-1", "contractName": "ExampleSupplyChain", "sourceName": "contracts/ExampleSupplyChain.sol", "abi": [ { "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, { "inputs": [ { "internalType": "address", "name": "owner", "type": "address" } ], "name": "OwnableInvalidOwner", "type": "error" }, { "inputs": [ { "internalType": "address", "name": "account", "type": "address" } ], "name": "OwnableUnauthorizedAccount", "type": "error" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "string", "name": "lotType", "type": "string" }, { "indexed": false, "internalType": "string", "name": "quantity", "type": "string" }, { "indexed": false, "internalType": "string", "name": "operatorId", "type": "string" }, { "indexed": false, "internalType": "string", "name": "originId", "type": "string" }, { "indexed": false, "internalType": "string", "name": "lotNo", "type": "string" }, { "indexed": false, "internalType": "string", "name": "transporterId", "type": "string" } ], "name": "CreateLotEvent", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "string", "name": "lotNos", "type": "string" }, { "indexed": false, "internalType": "string", "name": "operatorId", "type": "string" }, { "indexed": false, "internalType": "string", "name": "machineId", "type": "string" }, { "indexed": false, "internalType": "string", "name": "processingHouseId", "type": "string" }, { "indexed": false, "internalType": "string", "name": "timestamp", "type": "string" }, { "indexed": false, "internalType": "string", "name": "firstProcessLotId", "type": "string" } ], "name": "FirstProcessEvent", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" } ], "name": "OwnershipTransferred", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "string", "name": "secondProcessLotId", "type": "string" }, { "indexed": false, "internalType": "string", "name": "operatorId", "type": "string" }, { "indexed": false, "internalType": "string", "name": "packageId", "type": "string" }, { "indexed": false, "internalType": "string", "name": "weight", "type": "string" }, { "indexed": false, "internalType": "string", "name": "packagingType", "type": "string" }, { "indexed": false, "internalType": "string", "name": "packingLotId", "type": "string" } ], "name": "PackagingEvent", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "string", "name": "firstProcessLotIds", "type": "string" }, { "indexed": false, "internalType": "string", "name": "machineId", "type": "string" }, { "indexed": false, "internalType": "string", "name": "operatorId", "type": "string" }, { "indexed": false, "internalType": "string", "name": "secondProcessOutputLotId", "type": "string" }, { "indexed": false, "internalType": "string", "name": "secondProcessLotId", "type": "string" } ], "name": "SecondProcessEvent", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "string", "name": "packageId", "type": "string" }, { "indexed": false, "internalType": "string", "name": "operatorId", "type": "string" }, { "indexed": false, "internalType": "string", "name": "transporterId", "type": "string" }, { "indexed": false, "internalType": "string", "name": "cartonId", "type": "string" }, { "indexed": false, "internalType": "string", "name": "transportLotId", "type": "string" } ], "name": "TransportEvent", "type": "event" }, { "inputs": [], "name": "_firstProcessLotId", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "_packingLotId", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "_secondProcessLotId", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "_transportLotId", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "string", "name": "lotType", "type": "string" }, { "internalType": "string", "name": "quantity", "type": "string" }, { "internalType": "string", "name": "operatorId", "type": "string" }, { "internalType": "string", "name": "originId", "type": "string" }, { "internalType": "string", "name": "lotNo", "type": "string" }, { "internalType": "string", "name": "transporterId", "type": "string" } ], "name": "createLot", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "owner", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "string", "name": "secondProcessLotId", "type": "string" }, { "internalType": "string", "name": "operatorId", "type": "string" }, { "internalType": "string", "name": "packageId", "type": "string" }, { "internalType": "string", "name": "weight", "type": "string" }, { "internalType": "string", "name": "packagingType", "type": "string" } ], "name": "packing", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "string", "name": "lotNos", "type": "string" }, { "internalType": "string", "name": "operatorId", "type": "string" }, { "internalType": "string", "name": "machineId", "type": "string" }, { "internalType": "string", "name": "processingHouseId", "type": "string" }, { "internalType": "string", "name": "timestamp", "type": "string" } ], "name": "registerFirstProcess", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "string", "name": "firstProcessLotIds", "type": "string" }, { "internalType": "string", "name": "machineId", "type": "string" }, { "internalType": "string", "name": "operatorId", "type": "string" }, { "internalType": "string", "name": "secondProcessOutputLotId", "type": "string" } ], "name": "registerSecondProcess", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "newOwner", "type": "address" } ], "name": "transferOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "string", "name": "packageId", "type": "string" }, { "internalType": "string", "name": "operatorId", "type": "string" }, { "internalType": "string", "name": "transporterId", "type": "string" }, { "internalType": "string", "name": "cartonId", "type": "string" } ], "name": "transport", "outputs": [], "stateMutability": "nonpayable", "type": "function" } ], "bytecode": "0x608080604052346075573315605f5760008054336001600160a01b0319821681178355916001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a3610ae1908161007b8239f35b631e4fbdf760e01b600052600060045260246000fd5b600080fdfe608080604052600436101561001357600080fd5b60003560e01c90816334687fc51461051957508063386a0d26146104fb578063715018a61461047d5780637b844d861461045f5780638da5cb5b1461042b578063ac366bc6146103da578063ad2f19f314610388578063c57397ec1461028e578063e32328101461022f578063e5dbd1ae1461019d578063f2fde38b146100c65763f342554c146100a357600080fd5b346100c15760006003193601126100c1576020600454604051908152f35b600080fd5b346100c15760206003193601126100c15760043573ffffffffffffffffffffffffffffffffffffffff81168091036100c157610100610884565b801561016e5773ffffffffffffffffffffffffffffffffffffffff600054827fffffffffffffffffffffffff0000000000000000000000000000000000000000821617600055167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3005b7f1e4fbdf700000000000000000000000000000000000000000000000000000000600052600060045260246000fd5b346100c1576101ab36610623565b92906002549060018201809211610200577f14b6c7296a7ef1f1d61274d04d7364309a7a32fbb21087fb4c15a5d1534ac899946101ee836101fb946002556108d3565b91604051958695866107bc565b0390a1005b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b346100c15761023d366106b2565b9093916003549160018301809311610200577fc779766e64dba61c56c17693faa61ae802bcdc203a1479bfb4970edd3ab7e64f95610281846101fb956003556108d3565b9260405196879687610817565b346100c15760c06003193601126100c15760043567ffffffffffffffff81116100c1576102bf9036906004016105e1565b60243567ffffffffffffffff81116100c1576102df9036906004016105e1565b60443567ffffffffffffffff81116100c1576102ff9036906004016105e1565b9160643567ffffffffffffffff81116100c1576103209036906004016105e1565b9260843567ffffffffffffffff81116100c1576103419036906004016105e1565b9060a4359167ffffffffffffffff83116100c1577f8982a390c0fb1688e369d1ab91e529cae84e472205007ac93be646ec121f9410956102816101fb9436906004016105e1565b346100c157610396366106b2565b9093916001549160018301809311610200577fd494bd9dcaeef0e3e0fd19a0b13af05abf8ca5ffd5e70724ed987b2fcfa443d395610281846101fb956001556108d3565b346100c1576103e836610623565b92906004549060018201809211610200577f5a6ec825b52239f3c530cc18dca698150d270962d2021703403dcd6815b1af61946101ee836101fb946004556108d3565b346100c15760006003193601126100c157602073ffffffffffffffffffffffffffffffffffffffff60005416604051908152f35b346100c15760006003193601126100c1576020600354604051908152f35b346100c15760006003193601126100c157610496610884565b600073ffffffffffffffffffffffffffffffffffffffff81547fffffffffffffffffffffffff000000000000000000000000000000000000000081168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b346100c15760006003193601126100c1576020600254604051908152f35b346100c15760006003193601126100c1576020906001548152f35b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f604051930116820182811067ffffffffffffffff82111761057857604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b67ffffffffffffffff811161057857601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b81601f820112156100c1578035906106006105fb836105a7565b610534565b92828452602083830101116100c157816000926020809301838601378301015290565b9060806003198301126100c15760043567ffffffffffffffff81116100c1578261064f916004016105e1565b9160243567ffffffffffffffff81116100c1578161066f916004016105e1565b9160443567ffffffffffffffff81116100c1578261068f916004016105e1565b916064359067ffffffffffffffff82116100c1576106af916004016105e1565b90565b60a06003198201126100c15760043567ffffffffffffffff81116100c157816106dd916004016105e1565b9160243567ffffffffffffffff81116100c157826106fd916004016105e1565b9160443567ffffffffffffffff81116100c1578161071d916004016105e1565b9160643567ffffffffffffffff81116100c1578261073d916004016105e1565b916084359067ffffffffffffffff82116100c1576106af916004016105e1565b919082519283825260005b8481106107a75750507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8460006020809697860101520116010190565b80602080928401015182828601015201610768565b93906106af95936107ed610809946107df6107fb9460a08a5260a08a019061075d565b9088820360208a015261075d565b90868203604088015261075d565b90848203606086015261075d565b91608081840391015261075d565b94919361085a6108769461084c6106af999761083e6108689660c08c5260c08c019061075d565b908a820360208c015261075d565b9088820360408a015261075d565b90868203606088015261075d565b90848203608086015261075d565b9160a081840391015261075d565b73ffffffffffffffffffffffffffffffffffffffff6000541633036108a557565b7f118cdaa7000000000000000000000000000000000000000000000000000000006000523360045260246000fd5b806000917a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000821015610a83575b806d04ee2d6d415b85acef8100000000600a921015610a68575b662386f26fc10000811015610a54575b6305f5e100811015610a43575b612710811015610a34575b6064811015610a26575b1015610a1b575b600a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff602160018501947fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe06109b16109a86105fb896105a7565b978089526105a7565b013660208801378501015b01917f30313233343536373839616263646566000000000000000000000000000000008282061a8353048015610a16577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600a91926109bc565b505090565b60019091019061094e565b606460029104930192610947565b6127106004910493019261093d565b6305f5e10060089104930192610932565b662386f26fc1000060109104930192610925565b6d04ee2d6d415b85acef810000000060209104930192610915565b50604091507a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000081046108fb56fea264697066735822122013382ce296d4b0716000436fe7ec232ee130a3b5da482ae87e3b5a106f092bae64736f6c634300081b0033", "deployedBytecode": "0x608080604052600436101561001357600080fd5b60003560e01c90816334687fc51461051957508063386a0d26146104fb578063715018a61461047d5780637b844d861461045f5780638da5cb5b1461042b578063ac366bc6146103da578063ad2f19f314610388578063c57397ec1461028e578063e32328101461022f578063e5dbd1ae1461019d578063f2fde38b146100c65763f342554c146100a357600080fd5b346100c15760006003193601126100c1576020600454604051908152f35b600080fd5b346100c15760206003193601126100c15760043573ffffffffffffffffffffffffffffffffffffffff81168091036100c157610100610884565b801561016e5773ffffffffffffffffffffffffffffffffffffffff600054827fffffffffffffffffffffffff0000000000000000000000000000000000000000821617600055167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3005b7f1e4fbdf700000000000000000000000000000000000000000000000000000000600052600060045260246000fd5b346100c1576101ab36610623565b92906002549060018201809211610200577f14b6c7296a7ef1f1d61274d04d7364309a7a32fbb21087fb4c15a5d1534ac899946101ee836101fb946002556108d3565b91604051958695866107bc565b0390a1005b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b346100c15761023d366106b2565b9093916003549160018301809311610200577fc779766e64dba61c56c17693faa61ae802bcdc203a1479bfb4970edd3ab7e64f95610281846101fb956003556108d3565b9260405196879687610817565b346100c15760c06003193601126100c15760043567ffffffffffffffff81116100c1576102bf9036906004016105e1565b60243567ffffffffffffffff81116100c1576102df9036906004016105e1565b60443567ffffffffffffffff81116100c1576102ff9036906004016105e1565b9160643567ffffffffffffffff81116100c1576103209036906004016105e1565b9260843567ffffffffffffffff81116100c1576103419036906004016105e1565b9060a4359167ffffffffffffffff83116100c1577f8982a390c0fb1688e369d1ab91e529cae84e472205007ac93be646ec121f9410956102816101fb9436906004016105e1565b346100c157610396366106b2565b9093916001549160018301809311610200577fd494bd9dcaeef0e3e0fd19a0b13af05abf8ca5ffd5e70724ed987b2fcfa443d395610281846101fb956001556108d3565b346100c1576103e836610623565b92906004549060018201809211610200577f5a6ec825b52239f3c530cc18dca698150d270962d2021703403dcd6815b1af61946101ee836101fb946004556108d3565b346100c15760006003193601126100c157602073ffffffffffffffffffffffffffffffffffffffff60005416604051908152f35b346100c15760006003193601126100c1576020600354604051908152f35b346100c15760006003193601126100c157610496610884565b600073ffffffffffffffffffffffffffffffffffffffff81547fffffffffffffffffffffffff000000000000000000000000000000000000000081168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b346100c15760006003193601126100c1576020600254604051908152f35b346100c15760006003193601126100c1576020906001548152f35b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f604051930116820182811067ffffffffffffffff82111761057857604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b67ffffffffffffffff811161057857601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b81601f820112156100c1578035906106006105fb836105a7565b610534565b92828452602083830101116100c157816000926020809301838601378301015290565b9060806003198301126100c15760043567ffffffffffffffff81116100c1578261064f916004016105e1565b9160243567ffffffffffffffff81116100c1578161066f916004016105e1565b9160443567ffffffffffffffff81116100c1578261068f916004016105e1565b916064359067ffffffffffffffff82116100c1576106af916004016105e1565b90565b60a06003198201126100c15760043567ffffffffffffffff81116100c157816106dd916004016105e1565b9160243567ffffffffffffffff81116100c157826106fd916004016105e1565b9160443567ffffffffffffffff81116100c1578161071d916004016105e1565b9160643567ffffffffffffffff81116100c1578261073d916004016105e1565b916084359067ffffffffffffffff82116100c1576106af916004016105e1565b919082519283825260005b8481106107a75750507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8460006020809697860101520116010190565b80602080928401015182828601015201610768565b93906106af95936107ed610809946107df6107fb9460a08a5260a08a019061075d565b9088820360208a015261075d565b90868203604088015261075d565b90848203606086015261075d565b91608081840391015261075d565b94919361085a6108769461084c6106af999761083e6108689660c08c5260c08c019061075d565b908a820360208c015261075d565b9088820360408a015261075d565b90868203606088015261075d565b90848203608086015261075d565b9160a081840391015261075d565b73ffffffffffffffffffffffffffffffffffffffff6000541633036108a557565b7f118cdaa7000000000000000000000000000000000000000000000000000000006000523360045260246000fd5b806000917a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000821015610a83575b806d04ee2d6d415b85acef8100000000600a921015610a68575b662386f26fc10000811015610a54575b6305f5e100811015610a43575b612710811015610a34575b6064811015610a26575b1015610a1b575b600a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff602160018501947fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe06109b16109a86105fb896105a7565b978089526105a7565b013660208801378501015b01917f30313233343536373839616263646566000000000000000000000000000000008282061a8353048015610a16577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600a91926109bc565b505090565b60019091019061094e565b606460029104930192610947565b6127106004910493019261093d565b6305f5e10060089104930192610932565b662386f26fc1000060109104930192610925565b6d04ee2d6d415b85acef810000000060209104930192610915565b50604091507a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000081046108fb56fea264697066735822122013382ce296d4b0716000436fe7ec232ee130a3b5da482ae87e3b5a106f092bae64736f6c634300081b0033", "linkReferences": {}, "deployedLinkReferences": {} } declare module "@nomicfoundation/hardhat-viem/types" { export function deployContract( contractName: "ExampleSupplyChain", constructorArgs?: [], config?: DeployContractConfig ): Promise<GetContractReturnType<ExampleSupplyChain$Type["abi"]>>; export function deployContract( contractName: "contracts/ExampleSupplyChain.sol:ExampleSupplyChain", constructorArgs?: [], config?: DeployContractConfig ): Promise<GetContractReturnType<ExampleSupplyChain$Type["abi"]>>; export function sendDeploymentTransaction( contractName: "ExampleSupplyChain", constructorArgs?: [], config?: SendDeploymentTransactionConfig ): Promise<{ contract: GetContractReturnType<ExampleSupplyChain$Type["abi"]>; deploymentTransaction: GetTransactionReturnType; }>; export function sendDeploymentTransaction( contractName: "contracts/ExampleSupplyChain.sol:ExampleSupplyChain", constructorArgs?: [], config?: SendDeploymentTransactionConfig ): Promise<{ contract: GetContractReturnType<ExampleSupplyChain$Type["abi"]>; deploymentTransaction: GetTransactionReturnType; }>; export function getContractAt( contractName: "ExampleSupplyChain", address: Address, config?: GetContractAtConfig ): Promise<GetContractReturnType<ExampleSupplyChain$Type["abi"]>>; export function getContractAt( contractName: "contracts/ExampleSupplyChain.sol:ExampleSupplyChain", address: Address, config?: GetContractAtConfig ): Promise<GetContractReturnType<ExampleSupplyChain$Type["abi"]>>; }