{"id":26716589,"url":"https://github.com/67p/kredits-contracts","last_synced_at":"2025-04-14T01:40:21.178Z","repository":{"id":30404615,"uuid":"124804465","full_name":"67P/kredits-contracts","owner":"67P","description":":warning: [MOVED] Smart contracts and JS API for Kosmos Kredits","archived":false,"fork":false,"pushed_at":"2025-01-20T20:39:40.000Z","size":4497,"stargazers_count":4,"open_issues_count":1,"forks_count":4,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-03-27T15:51:52.717Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://gitea.kosmos.org/kredits/contracts","language":"JavaScript","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/67P.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":"2018-03-11T22:11:45.000Z","updated_at":"2025-01-20T20:39:43.000Z","dependencies_parsed_at":"2024-06-21T07:11:13.048Z","dependency_job_id":"4a5d30bb-ab6c-4b61-947b-3689aefb6178","html_url":"https://github.com/67P/kredits-contracts","commit_stats":{"total_commits":467,"total_committers":8,"mean_commits":58.375,"dds":"0.43468950749464663","last_synced_commit":"d6bbc441f83d570ac0ae08d53e2a181608dd4b8f"},"previous_names":["67p/truffle-kredits"],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/67P%2Fkredits-contracts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/67P%2Fkredits-contracts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/67P%2Fkredits-contracts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/67P%2Fkredits-contracts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/67P","download_url":"https://codeload.github.com/67P/kredits-contracts/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248809038,"owners_count":21164893,"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","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":[],"created_at":"2025-03-27T15:37:54.323Z","updated_at":"2025-04-14T01:40:21.157Z","avatar_url":"https://github.com/67P.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![npm](https://img.shields.io/npm/v/@kredits/contracts.svg)](https://www.npmjs.com/package/@kredits/contracts)\n[![Build Status](https://drone.kosmos.org/api/badges/kredits/contracts/status.svg)](https://drone.kosmos.org/kredits/contracts)\n\n# Kredits Contracts\n\nThis repository contains the Solidity smart contracts and the JavaScript API\nwrapper for [Kosmos Kredits](https://wiki.kosmos.org/Kredits).\n\n## Development\n\n### Installation\n\n#### App dependencies\n\nAll requirements are defined in `package.json`.\n\n    $ npm install\n\n### Local development chain\n\nWe use [hardhat](https://hardhat.org/) as development environment for the\nsmart contracts.\n\nTo run a local development chain run:\n\n    $ npm run devchain # or: hardhat node --network hardhat\n\n### Bootstrap\n\n1. Run an EVM node and ipfs\n\n        $ npm run devchain\n        $ ipfs daemon\n\n2. Compile contracts and build ABIs\n\n        (compiled artifacts will be in `/artifacts`)\n        $ npm run build\n\n3. Deploy new upgradable contract proxies\n\n        $ npm run deploy:dao\n\n4. Execute seeds to create demo contributors, contributions, etc. (optional)\n\n        $ npm run seeds\n\n**Step 2-4 is also summarized in `npm run bootstrap`**\n\n5. Show contract addresses\n\n        $ cat lib/addresses.json\n\n## Fund a local development account\n\nIf you need to fund development accounts with devchain coins:\n\n    $ npm run fund # or hardhat fund --network localhost\n\n## Specs / Testing\n\nWith a local development chain running:\n\n    $ hardhat test\n\nIf you add or change contract code, please make sure to add and/or adapt tests\naccordingly. Don't worry, it's easy! You can use existing tests as a template\nfor new ones.\n\n## Contract architecture\n\nWe use the [OpenZeppelin hardhat\nproxy](https://www.npmjs.com/package/@openzeppelin/hardhat-upgrades) for\ndeploying and managing upgradeable contracts. (see `scripts/create-proxy.js`)\n\nEach contract is independent and is connected to its dependencies by storing\nthe addresses of the other contracts.\n\n## Helper scripts\n\n`scripts/` contains some helper scripts to interact with the contracts from the\nCLI. _At some point these should be moved into a real nice CLI._\n\nTo run these scripts use `hardhat run`. For example: `hardhat run\nscripts/list-contributors.js --network localhost`. (NOTE: add `--network\nlocalhost` or the network you want to use)\n\nSome scripts are also defined as npm script, see `package.json`.\n\n### repl/console\n\nSimilar to cli.js but only provides a REPL with an initialized `kredits`\ninstance.\n\n    $ hardhat console --network localhost\n\n### add-{contributor, contribution, proposal}.js\n\nScript to add a new entries to the contracts using the JS wrapper\n\n    $ hardhat run scripts/add-{contributor, contribution, proposal}.js --network localhost\n\n### list-{contributors, contributions, proposals}.js\n\nList contract entries\n\n    $ hardhat run scripts/list-{contributors, contributions, proposals}.js --network localhost\n\n### seeds.js\n\nRun seeds defined in `config/seeds.js`.\n\n    $ npm run seeds\n\n### Get the contract addresses\n\nAll contract addresses are stored in `lib/addresses.json`\n\n    $ cat lib/addresses.json\n\n## Upgradeable contracts\n\nWe use OpenZeppelin for an upgradeable contracts:\n[https://www.npmjs.com/package/@openzeppelin/hardhat-upgrades](https://www.npmjs.com/package/@openzeppelin/hardhat-upgrades)\n\nRefer to the OpenZeppelin README and `scripts/create-proxy.js`\n\n[OpenZeppelin Step by Step guide](https://forum.openzeppelin.com/t/openzeppelin-upgrades-step-by-step-tutorial-for-hardhat/3580)\n\nFor an upgrade example checkout `scripts/upgrade-example.js`\n\n\n## Deployment to other networks\n\nDeployable networks are configured in the `hardhat.config.js`.\n\nTo deploy to those networks provide the `--network` argument to the hardhat\ncommands, e.g. `--network rsk`.\n\nPlease note that some npm scripts combine multiple hardhat commands. In those\ncases the hardhat commands needs to be run manually with the `--network`\nargument. (=\u003e don't use `npm run bootstrap`)\n\nSet a `DEPLOY_KEY` environment variable with the private key (HEX) which will\nbe used as a root/deploy account\n\nTypical deployment flow:\n\n    $ npm run build\n    $ hardhat run scripts/create-proxy.js --network rsk\n    # OR with deploy key:\n    $ DEPLOY_KEY=0xsomething hardhat run scripts/create-proxy.js --network rsk\n    $ # commit the new addresses in the addresses.json file if needed\n\nTo run the console on one of the non localhost networks you can also just pass\non the --network argument.\n\n    $ hardhat console --network rsk\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F67p%2Fkredits-contracts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F67p%2Fkredits-contracts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F67p%2Fkredits-contracts/lists"}