Skip to content
/ citycoins Public template
forked from citycoins/contracts

CityCoins give communities the power to improve and program their cities.

License

Notifications You must be signed in to change notification settings

loganlenz/citycoins

 
 

Repository files navigation

CityCoins

Contract Tests codecov.io Discord Chat

Introduction

CityCoins give communities the power to improve and program their cities.

Contributing

PRs are welcome! Please see the open issues and comment if interested, or submit a PR for review.

All code submitted should be thoroughly commented and tested where applicable.

Testing

Contracts are tested via clarinet using typescript.

To test the contract using clarinet, first install the tool to make it available on your system.

Several commands are available to help with testing via npm:

  • to run the prepare script: npm run clarinet:prepare
  • to run all tests: npm test, npm run test, npm run clarinet:test
  • to run individual tests: npm run test:auth npm run test:core npm run test:token
  • to run specific clarinet functions npm run clarinet:check npm run clarinet:codecov npm run console, npm run clarinet:console

A bash script is provided to prepare the tests as part of clarinet:prepare, and executes the following steps:

  1. copies all contract files from ./contracts to ./contracts/clarinet
  2. modifies address used in impl-trait by replacing it with a different address. e.g. (impl-trait 'SP3FBR2AGK5H9QBDH3EEN6DF8EK8JY7RX8QJ5SVTE.sip-10-ft-standard.ft-trait) is converted to: (impl-trait 'ST1HTBVD3JG9C05J7HBJTHGR0GGW7KXW28M5JS8QE.sip-10-ft-standard.ft-trait)
  3. appends code stored in ./contracts/test_addons at the end of contract file with the same name e.g. ./contracts/test_addons/citycoin-core-v1.clar is added to ./contracts/citycoin-core-v1.clar

Note: clarinet:test, clarinet:check, and clarinet:console automatically execute clarinet:prepare.

Definitions, Resources, and Links

CityCoins v1.0.0 Audit

CoinFabrik completed an audit on v1.0.0 of the protocol on March 14, 2022.

The resulting audit report is available in this repo, as well as the CityCoins developer responses.

CityCoins Resources

Additional Resources

Some quick definitions and additional resources related to the technology behind the project.

  • Stacks Blockchain: Stacks makes Bitcoin programmable, enabling decentralized apps and smart contracts that inherit all of Bitcoin’s powers.
  • Proof of Transfer (PoX): The consensus mechanism for the Stacks blockchain, which the CityCoins protocol is based on.
  • Clarity Language: A smart contract language developed by Blockstack (now Hiro) and Algorand, designed to be more safe, secure, and predictable.
  • Smart Contract: A computer program or a transaction protocol which is intended to automatically execute, control or document legally relevant events and actions according to the terms of a contract or an agreement.
  • Fungible Token: Digital assets that can be sent, received, combined, and divided.

References

About

CityCoins give communities the power to improve and program their cities.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Clarity 59.3%
  • TypeScript 40.5%
  • Shell 0.2%