File tree 1 file changed +7
-0
lines changed
solana/programs/example-native-token-transfers/src/instructions
1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,9 @@ pub struct TransferOwnership<'info> {
53
53
}
54
54
55
55
pub fn transfer_ownership ( ctx : Context < TransferOwnership > ) -> Result < ( ) > {
56
+ // Missing ownership check is OK here: new_owner is not expected to interact with this
57
+ // instruction. Instead, they call [`claim_ownership`]. The whole intention of new_owner
58
+ // is that it could be an arbitrary account.
56
59
ctx. accounts . config . pending_owner = Some ( ctx. accounts . new_owner . key ( ) ) ;
57
60
58
61
// TODO: only transfer authority when the authority is not already the upgrade lock
@@ -218,6 +221,8 @@ pub struct RegisterTransceiver<'info> {
218
221
pub system_program : Program < ' info , System > ,
219
222
}
220
223
224
+ #[ allow( unknown_lints) ]
225
+ #[ allow( missing_owner_check) ]
221
226
pub fn register_transceiver ( ctx : Context < RegisterTransceiver > ) -> Result < ( ) > {
222
227
let id = ctx. accounts . config . next_transceiver_id ;
223
228
ctx. accounts . config . next_transceiver_id += 1 ;
@@ -226,6 +231,8 @@ pub fn register_transceiver(ctx: Context<RegisterTransceiver>) -> Result<()> {
226
231
. set_inner ( RegisteredTransceiver {
227
232
bump : ctx. bumps . registered_transceiver ,
228
233
id,
234
+ // Missing ownership check is OK here: Transceiver is intended to be an arbitrary
235
+ // program.
229
236
transceiver_address : ctx. accounts . transceiver . key ( ) ,
230
237
} ) ;
231
238
You can’t perform that action at this time.
0 commit comments