mirror of
https://github.com/d0zingcat/ore.git
synced 2026-05-20 15:10:32 +00:00
61 lines
2.0 KiB
Markdown
61 lines
2.0 KiB
Markdown
# ORE
|
||
|
||
**Mine blocks. Trade hashpower. Earn rewards.**
|
||
|
||
## Summary
|
||
|
||
ORE is a cryptocurrency mining and trading game. Miners compete to earn block rewards by buying and selling hashpower in an open market. The more hashpower a miner has, the greater their chances of finding the best hash and winning the block reward.
|
||
|
||
Rewards and
|
||
|
||
|
||
## API
|
||
- [`Consts`](api/src/consts.rs) – Program constants.
|
||
- [`Error`](api/src/error.rs) – Custom program errors.
|
||
- [`Event`](api/src/error.rs) – Custom program events.
|
||
- [`Instruction`](api/src/instruction.rs) – Declared instructions and arguments.
|
||
|
||
## Instructions
|
||
|
||
#### User
|
||
- [`Claim`](program/src/claim.rs) - Claims miner rewards.
|
||
- [`Close`](program/src/close.rs) - Closes a block account.
|
||
- [`Initialize`](program/src/initialize.rs) - Initializes the program.
|
||
- [`Log`](program/src/log.rs) – Logs events as non-truncatable data.
|
||
- [`Mine`](program/src/mine.rs) - Submits hashes for scoring.
|
||
- [`Open`](program/src/open.rs) - Opens a new block.
|
||
- [`Reset`](program/src/reset.rs) – Resets the hashpower market for the next block.
|
||
- [`Swap`](program/src/swap.rs) - Executes a buy or sell in the hashpower market.
|
||
|
||
#### Admin
|
||
- [`SetAdmin`](program/src/set_admin.rs) - Re-assigns the admin authority.
|
||
- [`SetFeeCollector`](program/src/set_admin.rs) - Updates the fee collection address.
|
||
- [`SetFeeRate`](program/src/set_admin.rs) - Updates the fee charged per swap.
|
||
|
||
## State
|
||
- [`Block`](api/src/state/block.rs) - A round in the game.
|
||
- [`Config`](api/src/state/config.rs) - Global program configuration.
|
||
- [`Market`](api/src/state/market.rs) - Hashpower market.
|
||
- [`Miner`](api/src/state/miner.rs) - Tracks a miner state and history.
|
||
- [`Treasury`](api/src/state/treasury.rs) - The mint authority of the ORE token.
|
||
|
||
## Block lifecycle
|
||
|
||
- Open a block with an upcoming ID.
|
||
- Reset the market to move it forward to the next ID.
|
||
|
||
|
||
## Tests
|
||
|
||
To run the test suite, use the Solana toolchain:
|
||
|
||
```
|
||
cargo test-sbf
|
||
```
|
||
|
||
For line coverage, use llvm-cov:
|
||
|
||
```
|
||
cargo llvm-cov
|
||
```
|