-
Notifications
You must be signed in to change notification settings - Fork 426
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add operator to create listing * Begin on freeze message * Added more tests and fixes * Tests for freeze * Freeze + cancel scaffold * Happy path cancel tests * Rename to cancel frozen credits * Relase credits scaffold * Happy path tests for release credits * Add tests for release credits * Added tests for cancel frozen credits * Clean up and finish * Add retire info to buy and release messages * Fix failing e2e test
- Loading branch information
1 parent
7810f84
commit f9be465
Showing
13 changed files
with
2,096 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,32 @@ | ||
# CosmWasm workspace | ||
|
||
This workspace contains contracts and libraries meant to be used on EmpowerChain. | ||
This workspace contains contracts and libraries meant to be used on EmpowerChain. | ||
|
||
## Pre-requisites | ||
You need to install and set up the normal CosmWasm toolchain (including cosmwasm-check). | ||
|
||
## Build | ||
|
||
To build: | ||
```bash | ||
$ cargo build | ||
``` | ||
|
||
To build wasm: | ||
```bash | ||
$ cargo wasm | ||
``` | ||
|
||
## Test | ||
|
||
To run the tests: | ||
```bash | ||
$ cargo test | ||
``` | ||
|
||
## Generate schema | ||
|
||
To generate schema: | ||
```bash | ||
$ cargo schema | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,32 @@ | ||
# Plastic Credit Marketplace | ||
|
||
The plastic credit marketplace is cosmwasm smart contract built on top of the EmpowerChain `plasticcredit` module. | ||
It allows users to list and buy plastic credits. | ||
It allows users to list and buy plastic credits. | ||
|
||
## Listings | ||
|
||
The plastic credit marketplace functions by storing a list of `Listing` objects in the state. | ||
Anyone who has a plastic credit can create a listing by using the `CreateListing` message. | ||
|
||
It allows anyone to buy a listing by using the `BuyCredits` message. | ||
They can then buy as many credits as they want (up to the amount listed, and given the correct amount of funds are sent with the message) | ||
|
||
## Operators | ||
|
||
TODO | ||
|
||
Each listing has an optional `operator` field, which allows the operator set to freeze any number of credits in the listing | ||
for the purpose of finishing a transaction off-chain. For instance, for off-chain payments the operator is given the ability to | ||
freeze the credits as a way to escrow the credits. When the payment has been settled off-chain the operator (or the seller) | ||
can then release the credits to the buyer. | ||
|
||
## Fee split | ||
|
||
The plastic credit marketplace uses the `fee-splitter` package to allow for the marketplace to set up a fee structure. | ||
The fee is a percentage of the listing price, and can be split between any number of parties. | ||
|
||
A typical setup might be that the developer, or the deployer of the contract, gets a small fee, as well as the chain it runs on. | ||
For instance, it could be set up like this: | ||
- A total 5% fee for each listing | ||
- 75% of the fee goes to the developer | ||
- 25% of the fee goes to the chain |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.