mirror of
https://github.com/d0zingcat/ore.git
synced 2026-05-13 15:09:57 +00:00
Merge branch 'hardhat/one-boost' into hardhat/one
This commit is contained in:
209
Cargo.lock
generated
209
Cargo.lock
generated
@@ -238,12 +238,6 @@ dependencies = [
|
||||
"rand 0.8.5",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "array-const-fn-init"
|
||||
version = "0.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8bcb85e548c05d407fa6faff46b750ba287714ef32afc0f5e15b4641ffd6affb"
|
||||
|
||||
[[package]]
|
||||
name = "arrayref"
|
||||
version = "0.3.9"
|
||||
@@ -423,15 +417,6 @@ dependencies = [
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "blake2"
|
||||
version = "0.10.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe"
|
||||
dependencies = [
|
||||
"digest 0.10.7",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "blake3"
|
||||
version = "1.6.1"
|
||||
@@ -1070,46 +1055,6 @@ dependencies = [
|
||||
"syn 2.0.100",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "drillx"
|
||||
version = "2.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "73445e14825c4360b5aa367bd599ca563e5c9e126bbda6375064d737696fd777"
|
||||
dependencies = [
|
||||
"equix",
|
||||
"serde",
|
||||
"sha3",
|
||||
"solana-program",
|
||||
"strum",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "dynasm"
|
||||
version = "2.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "33dc03612f42465a8ed7f5e354bc2b79ba54cedefa81d5bd3a064f1835adaba8"
|
||||
dependencies = [
|
||||
"bitflags 1.3.2",
|
||||
"byteorder",
|
||||
"lazy_static",
|
||||
"proc-macro-error",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 1.0.109",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "dynasmrt"
|
||||
version = "2.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f7dccc31a678058996aef614f6bd418ced384da70f284e83e2b7bf29b27b6a28"
|
||||
dependencies = [
|
||||
"byteorder",
|
||||
"dynasm",
|
||||
"fnv",
|
||||
"memmap2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "eager"
|
||||
version = "0.1.0"
|
||||
@@ -1198,19 +1143,6 @@ version = "1.0.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
|
||||
|
||||
[[package]]
|
||||
name = "equix"
|
||||
version = "0.1.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b3e45c3367b4177f7b3512daf285f19cb3f0eed6d4c1e5d9bc37e4c1026c5644"
|
||||
dependencies = [
|
||||
"arrayvec",
|
||||
"hashx",
|
||||
"num-traits",
|
||||
"thiserror 1.0.69",
|
||||
"visibility",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "event-listener"
|
||||
version = "2.5.3"
|
||||
@@ -1289,12 +1221,6 @@ dependencies = [
|
||||
"typenum",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fixed-capacity-vec"
|
||||
version = "1.0.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6b31a14f5ee08ed1a40e1252b35af18bed062e3f39b69aab34decde36bc43e40"
|
||||
|
||||
[[package]]
|
||||
name = "flate2"
|
||||
version = "1.1.1"
|
||||
@@ -1576,39 +1502,12 @@ version = "0.15.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289"
|
||||
|
||||
[[package]]
|
||||
name = "hashx"
|
||||
version = "0.1.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "44a3b158f726cbff305571b9882f9638ce8cf146dde935a5bd43e115d8d6b6a0"
|
||||
dependencies = [
|
||||
"arrayvec",
|
||||
"blake2",
|
||||
"dynasmrt",
|
||||
"fixed-capacity-vec",
|
||||
"hex",
|
||||
"rand_core 0.6.4",
|
||||
"thiserror 1.0.69",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "heck"
|
||||
version = "0.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
|
||||
|
||||
[[package]]
|
||||
name = "hermit-abi"
|
||||
version = "0.5.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f154ce46856750ed433c8649605bf7ed2de3bc35fd9d2a9f30cddd873c80cb08"
|
||||
|
||||
[[package]]
|
||||
name = "hex"
|
||||
version = "0.4.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
|
||||
|
||||
[[package]]
|
||||
name = "histogram"
|
||||
version = "0.6.9"
|
||||
@@ -2436,26 +2335,6 @@ dependencies = [
|
||||
"vcpkg",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ore-api"
|
||||
version = "3.6.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "90933d4deaa73a1c73201d8a1aed50ce88211718370ceb0408ead479cb77e227"
|
||||
dependencies = [
|
||||
"array-const-fn-init",
|
||||
"bytemuck",
|
||||
"const-crypto",
|
||||
"drillx",
|
||||
"mpl-token-metadata",
|
||||
"num_enum",
|
||||
"solana-program",
|
||||
"spl-associated-token-account",
|
||||
"spl-token 4.0.2",
|
||||
"static_assertions",
|
||||
"steel",
|
||||
"thiserror 1.0.69",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ore-api"
|
||||
version = "3.7.0"
|
||||
@@ -2472,26 +2351,6 @@ dependencies = [
|
||||
"thiserror 1.0.69",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ore-boost-api"
|
||||
version = "4.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0b6c68dc61ee91b269520653f607038bb7f6ebf053385b0a896d4e272bc9f485"
|
||||
dependencies = [
|
||||
"array-const-fn-init",
|
||||
"bytemuck",
|
||||
"const-crypto",
|
||||
"fixed",
|
||||
"num_enum",
|
||||
"ore-api 3.6.0",
|
||||
"solana-program",
|
||||
"spl-associated-token-account",
|
||||
"spl-token 4.0.2",
|
||||
"static_assertions",
|
||||
"steel",
|
||||
"thiserror 1.0.69",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ore-cli"
|
||||
version = "3.7.0"
|
||||
@@ -2500,7 +2359,7 @@ dependencies = [
|
||||
"base64 0.22.1",
|
||||
"bincode",
|
||||
"bytemuck",
|
||||
"ore-api 3.7.0",
|
||||
"ore-api",
|
||||
"serde_json",
|
||||
"solana-account-decoder",
|
||||
"solana-client",
|
||||
@@ -2518,8 +2377,7 @@ version = "3.7.0"
|
||||
dependencies = [
|
||||
"bincode",
|
||||
"mpl-token-metadata",
|
||||
"ore-api 3.7.0",
|
||||
"ore-boost-api",
|
||||
"ore-api",
|
||||
"rand 0.8.5",
|
||||
"solana-nostd-keccak",
|
||||
"solana-program",
|
||||
@@ -2675,30 +2533,6 @@ dependencies = [
|
||||
"toml_edit",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "proc-macro-error"
|
||||
version = "1.0.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c"
|
||||
dependencies = [
|
||||
"proc-macro-error-attr",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 1.0.109",
|
||||
"version_check",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "proc-macro-error-attr"
|
||||
version = "1.0.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"version_check",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "proc-macro2"
|
||||
version = "1.0.94"
|
||||
@@ -5302,12 +5136,6 @@ version = "1.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3"
|
||||
|
||||
[[package]]
|
||||
name = "static_assertions"
|
||||
version = "1.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
|
||||
|
||||
[[package]]
|
||||
name = "steel"
|
||||
version = "4.0.2"
|
||||
@@ -5330,28 +5158,6 @@ version = "0.11.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"
|
||||
|
||||
[[package]]
|
||||
name = "strum"
|
||||
version = "0.26.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06"
|
||||
dependencies = [
|
||||
"strum_macros",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "strum_macros"
|
||||
version = "0.26.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be"
|
||||
dependencies = [
|
||||
"heck",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"rustversion",
|
||||
"syn 2.0.100",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "subtle"
|
||||
version = "2.6.1"
|
||||
@@ -5792,17 +5598,6 @@ version = "0.9.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
|
||||
|
||||
[[package]]
|
||||
name = "visibility"
|
||||
version = "0.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d674d135b4a8c1d7e813e2f8d1c9a58308aee4a680323066025e53132218bd91"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.100",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "void"
|
||||
version = "1.0.2"
|
||||
|
||||
@@ -23,7 +23,6 @@ const-crypto = "0.1.0"
|
||||
mpl-token-metadata = "5.1"
|
||||
num_enum = "0.7.2"
|
||||
ore-api = { path = "./api" }
|
||||
ore-boost-api = "4.0.0-alpha"
|
||||
solana-account-decoder = "^2.1"
|
||||
solana-nostd-keccak = "0.1.3"
|
||||
solana-program = "^2.1"
|
||||
|
||||
@@ -85,8 +85,5 @@ pub const ORE_LIQUIDITY: u64 = ONE_ORE * 100;
|
||||
/// The minimum difficulty required for payout.
|
||||
pub const NUGGET_DIFFICULTY: u64 = 10;
|
||||
|
||||
// The difficulty threshold for the motherlode payout.
|
||||
// pub const MOTHERLOAD_DIFFICULTY: u64 = 35;
|
||||
|
||||
// The fee to open a block.
|
||||
// pub const OPEN_FEE: u64 = ONE_ORE / 100;
|
||||
/// The address of the boost reserve token account.
|
||||
pub const BOOST_RESERVE_TOKEN: Pubkey = pubkey!("11111111111111111111111111111111"); // TODO: change this
|
||||
|
||||
@@ -21,7 +21,6 @@ default = []
|
||||
bincode.workspace = true
|
||||
mpl-token-metadata.workspace = true
|
||||
ore-api.workspace = true
|
||||
ore-boost-api.workspace = true
|
||||
solana-nostd-keccak.workspace = true
|
||||
solana-program.workspace = true
|
||||
spl-token.workspace = true
|
||||
|
||||
@@ -8,7 +8,7 @@ use steel::*;
|
||||
pub fn process_reset(accounts: &[AccountInfo<'_>], _data: &[u8]) -> ProgramResult {
|
||||
// Load accounts.
|
||||
let clock = Clock::get()?;
|
||||
let [signer_info, block_prev_info, block_next_info, config_info, market_info, mint_info, treasury_info, treasury_tokens_info, vault_info, system_program, token_program, ore_program, slot_hashes_sysvar] =
|
||||
let [signer_info, block_prev_info, block_next_info, config_info, market_info, mint_info, reserve_tokens_info, treasury_info, treasury_tokens_info, vault_info, system_program, token_program, ore_program, slot_hashes_sysvar] =
|
||||
accounts
|
||||
else {
|
||||
return Err(ProgramError::NotEnoughAccountKeys);
|
||||
@@ -20,6 +20,10 @@ pub fn process_reset(accounts: &[AccountInfo<'_>], _data: &[u8]) -> ProgramResul
|
||||
.as_account_mut::<Market>(&ore_api::ID)?
|
||||
.assert_mut(|m| m.block_id == block_next.id - 1)?;
|
||||
let ore_mint = mint_info.has_address(&MINT_ADDRESS)?.as_mint()?;
|
||||
reserve_tokens_info
|
||||
.has_address(&BOOST_RESERVE_TOKEN)?
|
||||
.as_token_account()?
|
||||
.assert(|t| t.mint() == MINT_ADDRESS)?;
|
||||
treasury_info.as_account::<Treasury>(&ore_api::ID)?;
|
||||
treasury_tokens_info
|
||||
.is_writable()?
|
||||
@@ -107,6 +111,16 @@ pub fn process_reset(accounts: &[AccountInfo<'_>], _data: &[u8]) -> ProgramResul
|
||||
block_next.start_slot = clock.slot;
|
||||
block_next.end_slot = clock.slot + config.block_duration;
|
||||
|
||||
// Mint tokens to the boost reserve.
|
||||
mint_to_signed(
|
||||
mint_info,
|
||||
reserve_tokens_info,
|
||||
treasury_info,
|
||||
token_program,
|
||||
ONE_ORE / 2,
|
||||
&[TREASURY],
|
||||
)?;
|
||||
|
||||
// Emit event.
|
||||
program_log(
|
||||
&[market_info.clone(), ore_program.clone()],
|
||||
|
||||
Reference in New Issue
Block a user