mirror of
https://github.com/d0zingcat/ore.git
synced 2026-06-03 15:11:20 +00:00
cleanup
This commit is contained in:
@@ -215,8 +215,6 @@ pub fn bury(signer: Pubkey, min_amount_out: u64) -> Instruction {
|
|||||||
let treasury_address = TREASURY_ADDRESS;
|
let treasury_address = TREASURY_ADDRESS;
|
||||||
let treasury_ore_address = get_associated_token_address(&treasury_address, &TOKEN_A_MINT);
|
let treasury_ore_address = get_associated_token_address(&treasury_address, &TOKEN_A_MINT);
|
||||||
let treasury_sol_address = get_associated_token_address(&treasury_address, &TOKEN_B_MINT);
|
let treasury_sol_address = get_associated_token_address(&treasury_address, &TOKEN_B_MINT);
|
||||||
println!("treasury_sol_address: {}", treasury_sol_address);
|
|
||||||
println!("treasury_ore_address: {}", treasury_ore_address);
|
|
||||||
Instruction {
|
Instruction {
|
||||||
program_id: crate::ID,
|
program_id: crate::ID,
|
||||||
accounts: vec![
|
accounts: vec![
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ use solana_sdk::{
|
|||||||
transaction::Transaction,
|
transaction::Transaction,
|
||||||
};
|
};
|
||||||
use spl_associated_token_account::get_associated_token_address;
|
use spl_associated_token_account::get_associated_token_address;
|
||||||
|
use spl_token::ui_amount_to_amount;
|
||||||
use steel::{AccountDeserialize, Clock, Discriminator};
|
use steel::{AccountDeserialize, Clock, Discriminator};
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
@@ -174,12 +175,13 @@ async fn bury(
|
|||||||
rpc: &RpcClient,
|
rpc: &RpcClient,
|
||||||
payer: &solana_sdk::signer::keypair::Keypair,
|
payer: &solana_sdk::signer::keypair::Keypair,
|
||||||
) -> Result<(), anyhow::Error> {
|
) -> Result<(), anyhow::Error> {
|
||||||
let amount = std::env::var("AMOUNT").expect("Missing AMOUNT env var");
|
let amount_str = std::env::var("AMOUNT").expect("Missing AMOUNT env var");
|
||||||
let amount = u64::from_str(&amount).expect("Invalid AMOUNT");
|
let amount_f64 = f64::from_str(&amount_str).expect("Invalid AMOUNT");
|
||||||
|
let amount_u64 = ui_amount_to_amount(amount_f64, TOKEN_DECIMALS);
|
||||||
let wrap_ix = ore_api::sdk::wrap(payer.pubkey());
|
let wrap_ix = ore_api::sdk::wrap(payer.pubkey());
|
||||||
let bury_ix = ore_api::sdk::bury(payer.pubkey(), amount);
|
let bury_ix = ore_api::sdk::bury(payer.pubkey(), amount_u64);
|
||||||
// submit_transaction(rpc, payer, &[ix]).await?;
|
submit_transaction(rpc, payer, &[wrap_ix, bury_ix]).await?;
|
||||||
simulate_transaction(rpc, payer, &[wrap_ix, bury_ix]).await;
|
// simulate_transaction(rpc, payer, &[wrap_ix, bury_ix]).await;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user