{"id":21231164,"url":"https://github.com/clemlak/snowflakeinvoicing","last_synced_at":"2026-04-14T17:32:05.361Z","repository":{"id":101905817,"uuid":"172030119","full_name":"clemlak/SnowflakeInvoicing","owner":"clemlak","description":"Ethereum smart contract built on top of Hydro Snowflake that allows a business to invoice another business or consumer for a specific amount, on a specified date, and in a certain amount of Hydro.","archived":false,"fork":false,"pushed_at":"2019-03-16T15:34:41.000Z","size":188,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-03T10:29:07.122Z","etag":null,"topics":["ethereum","hydro","smart-contracts","snowflake"],"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/clemlak.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}},"created_at":"2019-02-22T08:51:40.000Z","updated_at":"2021-12-26T06:59:41.000Z","dependencies_parsed_at":"2023-04-29T11:46:53.606Z","dependency_job_id":null,"html_url":"https://github.com/clemlak/SnowflakeInvoicing","commit_stats":{"total_commits":37,"total_committers":1,"mean_commits":37.0,"dds":0.0,"last_synced_commit":"f47caa2bbd1971983ca1566782a4ee4fe1c5a1b5"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/clemlak/SnowflakeInvoicing","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clemlak%2FSnowflakeInvoicing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clemlak%2FSnowflakeInvoicing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clemlak%2FSnowflakeInvoicing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clemlak%2FSnowflakeInvoicing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/clemlak","download_url":"https://codeload.github.com/clemlak/SnowflakeInvoicing/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clemlak%2FSnowflakeInvoicing/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31808505,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T11:13:53.975Z","status":"ssl_error","status_checked_at":"2026-04-14T11:13:53.299Z","response_time":153,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["ethereum","hydro","smart-contracts","snowflake"],"created_at":"2024-11-20T23:41:10.986Z","updated_at":"2026-04-14T17:32:05.340Z","avatar_url":"https://github.com/clemlak.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Snowflake Invoicing\n\n## Introduction\nSnowflake Invoicing allows a business to invoice another business or consumer for a specific amount, on a specified date, and in a certain amount of Hydro.\nThis Ethereum smart contract is built on top of [Hydro Snowflake](https://medium.com/hydrogen-api/examining-erc-1484-hydro-snowflake-cc3753a5ff52) as defined [here](https://github.com/HydroBlockchain/hcdp/issues/254).\n\n## Usage\nThe resolver is located at `contracts/resolvers/Invoicing.sol`.\n\n### Create a draft invoice\n\nCreates a new draft invoice.\n\n```javascript\nfunction createDraftInvoice(\n    string memory id,\n    uint256[] memory customers,\n    uint256 amount,\n    bool allowPartialPayment,\n    uint256 minimumAmountDue,\n    Terms paymentTerm,\n    uint256 term\n)\n```\n\n#### Parameters\n| Name | Type | Description\n|---|:---:|---|\n| id | string | A custom id for the invoice |\n| customers | uint256[] | The ein of the customers (in an array) |\n| amount | uint256 | The amount of the invoice (in HYDRO) |\n| allowPartialPayment | bool | If partial payment is allowed |\n| minimumAmountDue | string | The minimum amount for a payment |\n| paymentTerm | Terms (uint8) | The type of term of payment (DueOnReceipt, DueOnDate, NoDueDate, NetD) |\n| term | uint256 | The term of payment (in days or a timestamp) |\n\n### Update invoice customers\n\nUpdates the payment data of an invoice (only if the invoice is still a draft).\n\n```javascript\nfunction updateInvoiceCustomers(\n    uint256 invoiceId,\n    uint256[] memory customers\n)\n```\n\n#### Parameters\n| Name | Type | Description\n|---|:---:|---|\n| invoiceId | uint256 | The id of the invoice |\n| customers | uint256[] | The ein of the new customers (in an array) |\n\n### Update invoice payment data\n\nUpdates the payment data of an invoice (only if the invoice is still a draft).\n\n```javascript\nfunction updateInvoicePayment(\n    uint256 invoiceId,\n    uint256 amount,\n    bool allowPartialPayment,\n    uint256 minimumAmountDue,\n    Terms paymentTerm,\n    uint256 term,\n    string memory additionalTerms,\n    string memory note\n)\n```\n\n#### Parameters\n| Name | Type | Description\n|---|:---:|---|\n| invoiceId | uint256 | The id of the invoice |\n| amount | uint256 | The amount of the invoice |\n| allowPartialPayment | bool | If partial payment is allowed |\n| minimumAmountDue | uint256 | The minimum amount for a payment |\n| paymentTerm | Terms | The type of term of payment |\n| term | uint256 | The term of payment, in days or a timestamp |\n| additionalTerms | string | Additional terms (as a string) |\n| note | string | Additional note (as a string) |\n\n### Validate an invoice\n\nValidates an invoice (only if the invoice is still a draft).\n\n```javascript\nfunction validateInvoice(uint256 invoiceId) public\n```\n\n#### Parameters\n| Name | Type | Description\n|---|:---:|---|\n| invoiceId | uint256 | The id of the invoice |\n\n### Pay an invoice\n\nPays an invoice.\n\n```javascript\nfunction payInvoice(uint256 invoiceId, uint256 amount) public\n```\n\n#### Parameters\n| Name | Type | Description\n|---|:---:|---|\n| invoiceId | uint256 | The id of the invoice |\n| amount | uint256 | The amount used to pay |\n\n### Refund a customer\n\nRefunds a customer.\n\n```javascript\nfunction refundCustomer(\n    uint256 invoiceId,\n    uint256 customer,\n    uint256 amount)\npublic\n```\n\n#### Parameters\n| Name | Type | Description\n|---|:---:|---|\n| invoiceId | uint256 | The id of the invoice |\n| customer | uint256 | The ein of the customer |\n| amount | uint256 | The amount to refund |\n\n### Cancel an invoice\n\nCancels an invoice.\n\n```javascript\nfunction cancelInvoice(uint256 invoiceId) public\n```\n\n#### Parameters\n| Name | Type | Description\n|---|:---:|---|\n| invoiceId | uint256 | The id of the invoice |\n\n### Open a dispute\n\nOpens a dispute.\n\n```javascript\nfunction openDispute(uint256 invoiceId, string memory details)\n```\n\n#### Parameters\n| Name | Type | Description\n|---|:---:|---|\n| invoiceId | uint256 | The id of the invoice |\n| details | string | The details of the dispute |\n\n### Close a dispute\n\nCloses a dispute.\n\n```javascript\nfunction closeDispute(uint256 invoiceId) public\n```\n\n#### Parameters\n| Name | Type | Description\n|---|:---:|---|\n| invoiceId | uint256 | The id of the invoice |\n\n### Get invoice info\n\nReturns the info of an invoice.\n\n```javascript\nfunction getInvoiceInfo(uint256 invoiceId) public\n```\n\n#### Parameters\n| Name | Type | Description\n|---|:---:|---|\n| invoiceId | uint256 | The id of the invoice |\n\n#### Return\n| Name | Type | Description\n|---|:---:|---|\n| id | string | The custom id of the invoice |\n| status | Status | The status of the invoice |\n| date | uint256 | The date of the creation of the invoice |\n| merchant | uint256 | The ein of the merchant |\n| customers | uint256[] | The ein of the customers (in an array) |\n\n### Get invoice details\n\nReturns the details of the invoice.\n\n```javascript\nfunction getInvoiceDetails(uint256 invoiceId) public\n```\n\n#### Parameters\n| Name | Type | Description\n|---|:---:|---|\n| invoiceId | uint256 | The id of the invoice |\n\n#### Return\n| Name | Type | Description\n|---|:---:|---|\n| amount | uint256 | The amount of the invoice |\n| paidAmount | uint256 | The paid amount |\n| refundedAmount | uint256 | The refunded amount |\n| allowPartialPayment | bool | If partial payment is allowed |\n| minimumAmountDue | uint256 | The minimum amount for a payment |\n| paymentTerm | Terms | The type of term of payment |\n| term | uint256 | The term of payment, in days or a timestamp |\n\n### Get additional invoice details\n\nReturns the additional details of the invoice.\n\n```javascript\nfunction getInvoicesAdditionalDetails(uint256 invoiceId) public\n```\n\n#### Parameters\n| Name | Type | Description\n|---|:---:|---|\n| invoiceId | uint256 | The id of the invoice |\n\n#### Return\n| Name | Type | Description\n|---|:---:|---|\n| additionalTerms | string | The additional terms of the invoice |\n| note | string | The note of the invoice |\n\n### Get the invoices of a merchant\n\nReturns the id of all the invoices created by a merchant.\n\n```javascript\nfunction getInvoicesFromMerchant(uint256 ein) public\n```\n\n#### Parameters\n| Name | Type | Description\n|---|:---:|---|\n| ein | uint256 | The ein of the merchant |\n\n#### Return\n| Name | Type | Description\n|---|:---:|---|\n| invoices | uint256[] | The id of all the invoices |\n\n### Get the invoices of a customer\n\nReturns the id of all the invoices linked to a customer.\n\n```javascript\nfunction getInvoicesFromCustomer(uint256 ein) public\n```\n\n#### Parameters\n| Name | Type | Description\n|---|:---:|---|\n| ein | uint256 | The ein of the customer |\n\n#### Return\n| Name | Type | Description\n|---|:---:|---|\n| invoices | uint256[] | The id of all the invoices |\n\n## Testing With Truffle\n- This folder has a suite of tests created through [Truffle](https://github.com/trufflesuite/truffle).\n- To run these tests:\n  - Clone this repo\n  - Run `npm install`\n  - Build dependencies with `npm run build`\n  - Spin up a development blockchain: `npm run chain`\n  - Run the tests with `npm run test-invoicing`\n\n## Copyright \u0026 License\nCopyright 2018 The Hydrogen Technology Corporation under the GNU General Public License v3.0.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclemlak%2Fsnowflakeinvoicing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclemlak%2Fsnowflakeinvoicing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclemlak%2Fsnowflakeinvoicing/lists"}