@@ -9,28 +9,26 @@ use pyth_lazer::state;
9
9
use pyth_lazer::admin;
10
10
use sui::bcs;
11
11
use sui::ecdsa_k1::secp256k1_ecrecover;
12
- use sui::transfer;
13
- use sui::tx_context::{Self , TxContext };
14
-
15
- fun init (ctx: &mut TxContext ) {
16
- let s = state::new (ctx);
17
- transfer::public_share_object (s);
18
- let cap = admin::mint (ctx);
19
- transfer::public_transfer (cap, tx_context::sender (ctx));
20
- }
21
12
22
13
const SECP256K1_SIG_LEN : u32 = 65 ;
23
14
const UPDATE_MESSAGE_MAGIC : u32 = 1296547300 ;
24
15
const PAYLOAD_MAGIC : u32 = 2479346549 ;
25
16
26
17
27
18
// TODO:
28
- // initializer
29
- // administration -> admin cap, upgrade cap, governance?
30
- // storage module -> trusted signers, update fee?, treasury?
31
19
// error handling
32
20
// standalone verify signature function
33
21
22
+ /// Initializes the module. Called at publish time.
23
+ /// Creates and shares the singular State object.
24
+ /// Creates the singular AdminCapability and transfers it to the deployer.
25
+ fun init (ctx: &mut TxContext ) {
26
+ let s = state::new (ctx);
27
+ transfer::public_share_object (s);
28
+ let cap = admin::mint (ctx);
29
+ transfer::public_transfer (cap, tx_context::sender (ctx));
30
+ }
31
+
34
32
/// Parse the Lazer update message and validate the signature.
35
33
///
36
34
/// The parsing logic is based on the Lazer rust protocol definition defined here:
0 commit comments