Skip to content

Commit 3cc017e

Browse files
authored
[Solana] improve script (#1282)
* Test * Fix idl * Cleanup * Improve script
1 parent 91c9cae commit 3cc017e

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

target_chains/solana/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ This is because it persists a verified encoded VAA, so guardian signatures will
2424

2525
# Devnet deployment
2626

27-
The program is currently deployed on Devnet with addresses:
27+
The program is currently deployed on Devnet and Eclipse Testnet with addresses:
2828

2929
- `HDwcJBJXjL9FpJ7UBsYBtaDjsBUhuLCUYoz3zr8SWWaQ` for the Wormhole receiver
3030
- `rec5EKMGg6MxZYaMdyBfgwp4d5rB9T1VQH5pJv5LtFJ` for the Pyth receiver

target_chains/solana/cli/src/main.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ use {
1818
pyth_solana_receiver::{
1919
sdk::{
2020
deserialize_accumulator_update_data,
21+
get_treasury_address,
2122
DEFAULT_TREASURY_ID,
2223
},
2324
state::config::DataSource,
@@ -195,9 +196,16 @@ fn main() -> Result<()> {
195196
.data(),
196197
};
197198

199+
// We need to send some rent to the treasury account, otherwise it won't be able to accept incoming transfers
200+
let pay_treasury_rent = system_instruction::transfer(
201+
&payer.pubkey(),
202+
&get_treasury_address(DEFAULT_TREASURY_ID),
203+
Rent::default().minimum_balance(0),
204+
);
205+
198206
process_transaction(
199207
&rpc_client,
200-
vec![initialize_pyth_receiver_instruction],
208+
vec![initialize_pyth_receiver_instruction, pay_treasury_rent],
201209
&vec![&payer],
202210
)?;
203211
}

0 commit comments

Comments
 (0)