Files
ore/README.md
2025-07-18 11:09:06 -07:00

61 lines
2.0 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 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
```