Merge branch 'master' into hardhat

* master:
  Formatting
This commit is contained in:
bumi 2022-07-14 16:00:20 +02:00
commit d0fd1a3971

View File

@ -2,8 +2,8 @@
# Kredits Contracts # Kredits Contracts
This repository contains the Solidity smart contracts and the JavaScript API wrapper for [Kosmos This repository contains the Solidity smart contracts and the JavaScript API
Kredits](https://wiki.kosmos.org/Kredits). wrapper for [Kosmos Kredits](https://wiki.kosmos.org/Kredits).
## Development ## Development
@ -58,18 +58,23 @@ If you need to fund development accounts with devchain coins:
## Contract architecture ## Contract architecture
We use the [OpenZeppelin hardhat proxy](https://www.npmjs.com/package/@openzeppelin/hardhat-upgrades) for deploying and managing upgradeable contracts. (see `scripts/create-proxy.js`) We use the [OpenZeppelin hardhat
proxy](https://www.npmjs.com/package/@openzeppelin/hardhat-upgrades) for
deploying and managing upgradeable contracts. (see `scripts/create-proxy.js`)
Each contract is independent and is connected to its dependencies by storing the addresses of the other contracts. Each contract is independent and is connected to its dependencies by storing
the addresses of the other contracts.
## Helper scripts ## Helper scripts
`scripts/` contains some helper scripts to interact with the contracts from the `scripts/` contains some helper scripts to interact with the contracts from the
CLI. _At some point these should be moved into a real nice CLI._ CLI. _At some point these should be moved into a real nice CLI._
To run these scripts use `hardhat run`. For example: `hardhat run scripts/list-contributors.js --network localhost`. (NOTE: add `--network localhost` or the network you want to use) To run these scripts use `hardhat run`. For example: `hardhat run
scripts/list-contributors.js --network localhost`. (NOTE: add `--network
localhost` or the network you want to use)
Some scripts are also defined as npm script, see package.json. Some scripts are also defined as npm script, see `package.json`.
### repl/console ### repl/console
@ -104,7 +109,8 @@ All contract addresses are stored in `lib/addresses.json`
## Upgradeable contracts ## Upgradeable contracts
We use OpenZeppelin for an upgradeable contracts: [https://www.npmjs.com/package/@openzeppelin/hardhat-upgrades](https://www.npmjs.com/package/@openzeppelin/hardhat-upgrades) We use OpenZeppelin for an upgradeable contracts:
[https://www.npmjs.com/package/@openzeppelin/hardhat-upgrades](https://www.npmjs.com/package/@openzeppelin/hardhat-upgrades)
Refer to the OpenZeppelin README and `scripts/create-proxy.js` Refer to the OpenZeppelin README and `scripts/create-proxy.js`
@ -125,19 +131,15 @@ Set a `DEPLOY_KEY` environment variable with the private key (HEX) which will be
Typical deployment flow: Typical deployment flow:
```js $ npm run build
npm run build $ hardhat run scripts/create-proxy.js --network rsk
hardhat run scripts/create-proxy.js --network rsk # OR with deploy key:
// OR with deploy key: $ DEPLOY_KEY=0xsomething hardhat run scripts/create-proxy.js --network rsk
DEPLOY_KEY=0xsomething hardhat run scripts/create-proxy.js --network rsk $ # commit the new addresses in the addresses.json file if needed
// commit the new addresses in the addresses.json file if needed
```
To run the console on one of the non localhost networks you can also just pass on the --network argument. To run the console on one of the non localhost networks you can also just pass on the --network argument.
```js $ hardhat console --network rsk
hardhat console --network rsk
```
## Known Issues ## Known Issues