mirror of
https://github.com/d0zingcat/ore.git
synced 2026-05-13 15:09:57 +00:00
016e2d1b3fd58cba9ff924bd0df40e4a2128e4a6
ORE
Mine. Trade. Win.
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 you acquire, the greater your chances of generating the best hash and winning the block reward. Will you hit the motherlode?
API
Consts– Program constants.Error– Custom program errors.Event– Custom program events.Instruction– Declared instructions and arguments.
Instructions
User
Claim- Claims miner rewards.Close- Closes a block account.Initialize- Initializes the program.Log– Logs events as non-truncatable data.Mine- Submits hashes for scoring.Open- Opens a new block.Reset– Resets the hashpower market for the next block.Swap- Executes a buy or sell in the hashpower market.
Admin
SetAdmin- Re-assigns the admin authority.SetFeeCollector- Updates the fee collection address.SetFeeRate- Updates the fee charged per swap.
State
Block- A round in the game.Config- Global program configuration.Market- Hashpower market.Miner- Tracks a miner state and history.Treasury- The mint authority of the ORE token.
Block lifecycle
Opena block with an upcoming ID.Resetto move the market forward, and begin trading.Swapto trade hashpower in the market for the current block.- Trading ends automatically once the end slot is reached.
Resetto move market forward again, and record the slot hash for the ended block.Mineto submit the best hash within your available nonce range.Closeto return rent and transfer block reward to the winning miner for claiming.Claimto claim block reward.
Tests
To run the test suite, use the Solana toolchain:
cargo test-sbf
For line coverage, use llvm-cov:
cargo llvm-cov
Description
Languages
Rust
99.5%
Shell
0.5%