pyth
Module0x5530…e2c0
- Move path
- 0x5530…e2c0::pyth
- Functions
- 1912 public, 1 entry
- Structs
- 0
- Friend modules
- None
pyth
- accumulator4
- batch_price_attestation6
- contract_upgrade6
- data_source7
- deserialize7
- event2
- governance6
- governance_action8
- governance_instruction6
- hot_potato_vector6
- i646
- merkle_tree8
- migrate2
- price5
- price_feed5
- price_identifier2
- price_info16
- price_status4
- pyth19
- set4
- set_data_sources2
- set_fee_recipient2
- set_governance_data_source2
- set_stale_price_threshold2
- set_update_fee3
- setup2
- state30
- version_control2
Bytecode683 lines
The on-chain disassembly. Offsets are bytecode positions within each function.
// Move bytecode v6
module 55300367a2d40813727ccac4ecee977a39fb9cdb46f2e6b2c354b9798f5de2c0.pyth {
use 55300367a2d40813727ccac4ecee977a39fb9cdb46f2e6b2c354b9798f5de2c0::accumulator;
use 55300367a2d40813727ccac4ecee977a39fb9cdb46f2e6b2c354b9798f5de2c0::batch_price_attestation;
use 55300367a2d40813727ccac4ecee977a39fb9cdb46f2e6b2c354b9798f5de2c0::data_source;
use 55300367a2d40813727ccac4ecee977a39fb9cdb46f2e6b2c354b9798f5de2c0::event;
use 55300367a2d40813727ccac4ecee977a39fb9cdb46f2e6b2c354b9798f5de2c0::hot_potato_vector;
use 55300367a2d40813727ccac4ecee977a39fb9cdb46f2e6b2c354b9798f5de2c0::price;
use 55300367a2d40813727ccac4ecee977a39fb9cdb46f2e6b2c354b9798f5de2c0::price_feed;
use 55300367a2d40813727ccac4ecee977a39fb9cdb46f2e6b2c354b9798f5de2c0::price_identifier;
use 55300367a2d40813727ccac4ecee977a39fb9cdb46f2e6b2c354b9798f5de2c0::price_info;
use 55300367a2d40813727ccac4ecee977a39fb9cdb46f2e6b2c354b9798f5de2c0::setup;
use 55300367a2d40813727ccac4ecee977a39fb9cdb46f2e6b2c354b9798f5de2c0::state;
use 0000000000000000000000000000000000000000000000000000000000000001::vector;
use 0000000000000000000000000000000000000000000000000000000000000002::clock;
use 0000000000000000000000000000000000000000000000000000000000000002::coin;
use 0000000000000000000000000000000000000000000000000000000000000002::object;
use 0000000000000000000000000000000000000000000000000000000000000002::package;
use 0000000000000000000000000000000000000000000000000000000000000002::sui;
use 0000000000000000000000000000000000000000000000000000000000000002::transfer;
use 0000000000000000000000000000000000000000000000000000000000000002::tx_context;
use 99de5c967d8206ef4b75c0afab3df2a59eb02b05c282821db803831008ac25b4::bytes32;
use 99de5c967d8206ef4b75c0afab3df2a59eb02b05c282821db803831008ac25b4::cursor;
use 99de5c967d8206ef4b75c0afab3df2a59eb02b05c282821db803831008ac25b4::external_address;
use 99de5c967d8206ef4b75c0afab3df2a59eb02b05c282821db803831008ac25b4::vaa;
entry public init_pyth(Arg0: DeployerCap, Arg1: UpgradeCap, Arg2: u64, Arg3: u64, Arg4: vector<u8>, Arg5: vector<u64>, Arg6: vector<vector<u8>>, Arg7: u64, Arg8: &mut TxContext) {
B0:
0MoveLoc[0](Arg0: DeployerCap)
1MoveLoc[1](Arg1: UpgradeCap)
2MoveLoc[2](Arg2: u64)
3MoveLoc[7](Arg7: u64)
4MoveLoc[3](Arg3: u64)
5MoveLoc[4](Arg4: vector<u8>)
6Call bytes32::from_bytes(vector<u8>): Bytes32
7Call external_address::new(Bytes32): ExternalAddress
8Call data_source::new(u64, ExternalAddress): DataSource
9MoveLoc[5](Arg5: vector<u64>)
10MoveLoc[6](Arg6: vector<vector<u8>>)
11Call parse_data_sources(vector<u64>, vector<vector<u8>>): vector<DataSource>
12MoveLoc[8](Arg8: &mut TxContext)
13Call setup::init_and_share_state(DeployerCap, UpgradeCap, u64, u64, DataSource, vector<DataSource>, &mut TxContext)
14Call event::emit_pyth_initialization_event()
15Ret
}
parse_data_sources(Arg0: vector<u64>, Arg1: vector<vector<u8>>): vector<DataSource> {
L2: loc0: u64
L3: loc1: vector<DataSource>
B0:
0ImmBorrowLoc[0](Arg0: vector<u64>)
1VecLen(20)
2ImmBorrowLoc[1](Arg1: vector<vector<u8>>)
3VecLen(24)
4Eq
5BrFalse(7)
B1:
6Branch(9)
B2:
7LdConst[0](u64: 0)
8Abort
B3:
9VecPack(28, 0)
10StLoc[3](loc1: vector<DataSource>)
11LdU64(0)
12StLoc[2](loc0: u64)
B4:
13CopyLoc[2](loc0: u64)
14ImmBorrowLoc[0](Arg0: vector<u64>)
15VecLen(20)
16Lt
17BrFalse(37)
B5:
18Branch(19)
B6:
19MutBorrowLoc[3](loc1: vector<DataSource>)
20ImmBorrowLoc[0](Arg0: vector<u64>)
21CopyLoc[2](loc0: u64)
22VecImmBorrow(20)
23ReadRef
24ImmBorrowLoc[1](Arg1: vector<vector<u8>>)
25CopyLoc[2](loc0: u64)
26VecImmBorrow(24)
27ReadRef
28Call bytes32::from_bytes(vector<u8>): Bytes32
29Call external_address::new(Bytes32): ExternalAddress
30Call data_source::new(u64, ExternalAddress): DataSource
31VecPushBack(28)
32MoveLoc[2](loc0: u64)
33LdU64(1)
34Add
35StLoc[2](loc0: u64)
36Branch(13)
B7:
37MoveLoc[3](loc1: vector<DataSource>)
38Ret
}
public create_price_feeds_using_accumulator(Arg0: &mut State, Arg1: vector<u8>, Arg2: VAA, Arg3: &Clock, Arg4: &mut TxContext) {
L5: loc0: DataSource
L6: loc1: Cursor<u8>
L7: loc2: LatestOnly
L8: loc3: vector<PriceInfo>
B0:
0CopyLoc[0](Arg0: &mut State)
1FreezeRef
2Call state::assert_latest_only(&State): LatestOnly
3StLoc[7](loc2: LatestOnly)
4CopyLoc[0](Arg0: &mut State)
5ImmBorrowLoc[2](Arg2: VAA)
6Call vaa::emitter_chain(&VAA): u16
7CastU64
8ImmBorrowLoc[2](Arg2: VAA)
9Call vaa::emitter_address(&VAA): ExternalAddress
10Call data_source::new(u64, ExternalAddress): DataSource
11StLoc[5](loc0: DataSource)
12FreezeRef
13MoveLoc[5](loc0: DataSource)
14Call state::is_valid_data_source(&State, DataSource): bool
15BrFalse(17)
B1:
16Branch(25)
B2:
17MoveLoc[0](Arg0: &mut State)
18Pop
19MoveLoc[4](Arg4: &mut TxContext)
20Pop
21MoveLoc[3](Arg3: &Clock)
22Pop
23LdConst[1](u64: 1)
24Abort
B3:
25MoveLoc[1](Arg1: vector<u8>)
26Call cursor::new<u8>(vector<u8>): Cursor<u8>
27StLoc[6](loc1: Cursor<u8>)
28MutBorrowLoc[6](loc1: Cursor<u8>)
29MoveLoc[2](Arg2: VAA)
30Call vaa::take_payload(VAA): vector<u8>
31MoveLoc[3](Arg3: &Clock)
32Call accumulator::parse_and_verify_accumulator_message(&mut Cursor<u8>, vector<u8>, &Clock): vector<PriceInfo>
33StLoc[8](loc3: vector<PriceInfo>)
34ImmBorrowLoc[7](loc2: LatestOnly)
35MoveLoc[0](Arg0: &mut State)
36MoveLoc[8](loc3: vector<PriceInfo>)
37MoveLoc[4](Arg4: &mut TxContext)
38Call create_and_share_price_feeds_using_verified_price_infos(&LatestOnly, &mut State, vector<PriceInfo>, &mut TxContext)
39MoveLoc[6](loc1: Cursor<u8>)
40Call cursor::take_rest<u8>(Cursor<u8>): vector<u8>
41Pop
42Ret
}
public create_price_feeds(Arg0: &mut State, Arg1: vector<VAA>, Arg2: &Clock, Arg3: &mut TxContext) {
L4: loc0: DataSource
L5: loc1: LatestOnly
L6: loc2: vector<PriceInfo>
L7: loc3: VAA
B0:
0CopyLoc[0](Arg0: &mut State)
1FreezeRef
2Call state::assert_latest_only(&State): LatestOnly
3StLoc[5](loc1: LatestOnly)
B1:
4ImmBorrowLoc[1](Arg1: vector<VAA>)
5Call vector::is_empty<VAA>(&vector<VAA>): bool
6Not
7BrFalse(45)
B2:
8Branch(9)
B3:
9MutBorrowLoc[1](Arg1: vector<VAA>)
10VecPopBack(39)
11StLoc[7](loc3: VAA)
12CopyLoc[0](Arg0: &mut State)
13ImmBorrowLoc[7](loc3: VAA)
14Call vaa::emitter_chain(&VAA): u16
15CastU64
16ImmBorrowLoc[7](loc3: VAA)
17Call vaa::emitter_address(&VAA): ExternalAddress
18Call data_source::new(u64, ExternalAddress): DataSource
19StLoc[4](loc0: DataSource)
20FreezeRef
21MoveLoc[4](loc0: DataSource)
22Call state::is_valid_data_source(&State, DataSource): bool
23BrFalse(25)
B4:
24Branch(33)
B5:
25MoveLoc[0](Arg0: &mut State)
26Pop
27MoveLoc[3](Arg3: &mut TxContext)
28Pop
29MoveLoc[2](Arg2: &Clock)
30Pop
31LdConst[1](u64: 1)
32Abort
B6:
33MoveLoc[7](loc3: VAA)
34Call vaa::take_payload(VAA): vector<u8>
35CopyLoc[2](Arg2: &Clock)
36Call batch_price_attestation::deserialize(vector<u8>, &Clock): BatchPriceAttestation
37Call batch_price_attestation::destroy(BatchPriceAttestation): vector<PriceInfo>
38StLoc[6](loc2: vector<PriceInfo>)
39ImmBorrowLoc[5](loc1: LatestOnly)
40CopyLoc[0](Arg0: &mut State)
41MoveLoc[6](loc2: vector<PriceInfo>)
42CopyLoc[3](Arg3: &mut TxContext)
43Call create_and_share_price_feeds_using_verified_price_infos(&LatestOnly, &mut State, vector<PriceInfo>, &mut TxContext)
44Branch(4)
B7:
45MoveLoc[0](Arg0: &mut State)
46Pop
47MoveLoc[3](Arg3: &mut TxContext)
48Pop
49MoveLoc[2](Arg2: &Clock)
50Pop
51MoveLoc[1](Arg1: vector<VAA>)
52VecUnpack(39, 0)
53Ret
}
L4: loc0: PriceIdentifier
L5: loc1: PriceInfo
L6: loc2: ID
L7: loc3: PriceInfoObject
L8: loc4: PriceIdentifier
B0:
0ImmBorrowLoc[2](Arg2: vector<PriceInfo>)
1Call vector::is_empty<PriceInfo>(&vector<PriceInfo>): bool
2Not
3BrFalse(36)
B1:
4Branch(5)
B2:
5MutBorrowLoc[2](Arg2: vector<PriceInfo>)
6VecPopBack(47)
7StLoc[5](loc1: PriceInfo)
8CopyLoc[1](Arg1: &mut State)
9ImmBorrowLoc[5](loc1: PriceInfo)
10Call price_info::get_price_feed(&PriceInfo): &PriceFeed
11Call price_feed::get_price_identifier(&PriceFeed): PriceIdentifier
12StLoc[4](loc0: PriceIdentifier)
13FreezeRef
14MoveLoc[4](loc0: PriceIdentifier)
15Call state::price_feed_object_exists(&State, PriceIdentifier): bool
16Not
17BrFalse(35)
B3:
18CopyLoc[5](loc1: PriceInfo)
19CopyLoc[3](Arg3: &mut TxContext)
20Call price_info::new_price_info_object(PriceInfo, &mut TxContext): PriceInfoObject
21StLoc[7](loc3: PriceInfoObject)
22ImmBorrowLoc[5](loc1: PriceInfo)
23Call price_info::get_price_identifier(&PriceInfo): PriceIdentifier
24StLoc[8](loc4: PriceIdentifier)
25ImmBorrowLoc[7](loc3: PriceInfoObject)
26Call price_info::uid_to_inner(&PriceInfoObject): ID
27StLoc[6](loc2: ID)
28CopyLoc[0](Arg0: &LatestOnly)
29CopyLoc[1](Arg1: &mut State)
30MoveLoc[8](loc4: PriceIdentifier)
31MoveLoc[6](loc2: ID)
32Call state::register_price_info_object(&LatestOnly, &mut State, PriceIdentifier, ID)
33MoveLoc[7](loc3: PriceInfoObject)
34Call transfer::public_share_object<PriceInfoObject>(PriceInfoObject)
B4:
35Branch(0)
B5:
36MoveLoc[1](Arg1: &mut State)
37Pop
38MoveLoc[0](Arg0: &LatestOnly)
39Pop
40MoveLoc[3](Arg3: &mut TxContext)
41Pop
42Ret
}
public create_authenticated_price_infos_using_accumulator(Arg0: &State, Arg1: vector<u8>, Arg2: VAA, Arg3: &Clock): HotPotatoVector<PriceInfo> {
L4: loc0: Cursor<u8>
L5: loc1: vector<PriceInfo>
B0:
0CopyLoc[0](Arg0: &State)
1Call state::assert_latest_only(&State): LatestOnly
2Pop
3MoveLoc[0](Arg0: &State)
4ImmBorrowLoc[2](Arg2: VAA)
5Call vaa::emitter_chain(&VAA): u16
6CastU64
7ImmBorrowLoc[2](Arg2: VAA)
8Call vaa::emitter_address(&VAA): ExternalAddress
9Call data_source::new(u64, ExternalAddress): DataSource
10Call state::is_valid_data_source(&State, DataSource): bool
11BrFalse(13)
B1:
12Branch(17)
B2:
13MoveLoc[3](Arg3: &Clock)
14Pop
15LdConst[1](u64: 1)
16Abort
B3:
17MoveLoc[1](Arg1: vector<u8>)
18Call cursor::new<u8>(vector<u8>): Cursor<u8>
19StLoc[4](loc0: Cursor<u8>)
20MutBorrowLoc[4](loc0: Cursor<u8>)
21MoveLoc[2](Arg2: VAA)
22Call vaa::take_payload(VAA): vector<u8>
23MoveLoc[3](Arg3: &Clock)
24Call accumulator::parse_and_verify_accumulator_message(&mut Cursor<u8>, vector<u8>, &Clock): vector<PriceInfo>
25StLoc[5](loc1: vector<PriceInfo>)
26MoveLoc[4](loc0: Cursor<u8>)
27Call cursor::destroy_empty<u8>(Cursor<u8>)
28MoveLoc[5](loc1: vector<PriceInfo>)
29Call hot_potato_vector::new<PriceInfo>(vector<PriceInfo>): HotPotatoVector<PriceInfo>
30Ret
}
public create_price_infos_hot_potato(Arg0: &State, Arg1: vector<VAA>, Arg2: &Clock): HotPotatoVector<PriceInfo> {
L3: loc0: PriceInfo
L4: loc1: VAA
L5: loc2: vector<PriceInfo>
L6: loc3: vector<PriceInfo>
B0:
0CopyLoc[0](Arg0: &State)
1Call state::assert_latest_only(&State): LatestOnly
2Pop
3VecPack(47, 0)
4StLoc[6](loc3: vector<PriceInfo>)
B1:
5ImmBorrowLoc[1](Arg1: vector<VAA>)
6VecLen(39)
7LdU64(0)
8Neq
9BrFalse(50)
B2:
10Branch(11)
B3:
11MutBorrowLoc[1](Arg1: vector<VAA>)
12VecPopBack(39)
13StLoc[4](loc1: VAA)
14CopyLoc[0](Arg0: &State)
15ImmBorrowLoc[4](loc1: VAA)
16Call vaa::emitter_chain(&VAA): u16
17CastU64
18ImmBorrowLoc[4](loc1: VAA)
19Call vaa::emitter_address(&VAA): ExternalAddress
20Call data_source::new(u64, ExternalAddress): DataSource
21Call state::is_valid_data_source(&State, DataSource): bool
22BrFalse(24)
B4:
23Branch(30)
B5:
24MoveLoc[0](Arg0: &State)
25Pop
26MoveLoc[2](Arg2: &Clock)
27Pop
28LdConst[1](u64: 1)
29Abort
B6:
30MoveLoc[4](loc1: VAA)
31Call vaa::take_payload(VAA): vector<u8>
32CopyLoc[2](Arg2: &Clock)
33Call batch_price_attestation::deserialize(vector<u8>, &Clock): BatchPriceAttestation
34Call batch_price_attestation::destroy(BatchPriceAttestation): vector<PriceInfo>
35StLoc[5](loc2: vector<PriceInfo>)
B7:
36ImmBorrowLoc[5](loc2: vector<PriceInfo>)
37VecLen(47)
38LdU64(0)
39Neq
40BrFalse(49)
B8:
41Branch(42)
B9:
42MutBorrowLoc[5](loc2: vector<PriceInfo>)
43VecPopBack(47)
44StLoc[3](loc0: PriceInfo)
45MutBorrowLoc[6](loc3: vector<PriceInfo>)
46MoveLoc[3](loc0: PriceInfo)
47VecPushBack(47)
48Branch(36)
B10:
49Branch(5)
B11:
50MoveLoc[0](Arg0: &State)
51Pop
52MoveLoc[2](Arg2: &Clock)
53Pop
54MoveLoc[1](Arg1: vector<VAA>)
55VecUnpack(39, 0)
56MoveLoc[6](loc3: vector<PriceInfo>)
57Call hot_potato_vector::new<PriceInfo>(vector<PriceInfo>): HotPotatoVector<PriceInfo>
58Ret
}
public update_single_price_feed(Arg0: &State, Arg1: HotPotatoVector<PriceInfo>, Arg2: &mut PriceInfoObject, Arg3: Coin<SUI>, Arg4: &Clock): HotPotatoVector<PriceInfo> {
L5: loc0: &PriceInfo
L6: loc1: bool
L7: loc2: u64
L8: loc3: LatestOnly
B0:
0CopyLoc[0](Arg0: &State)
1Call state::assert_latest_only(&State): LatestOnly
2StLoc[8](loc3: LatestOnly)
3MoveLoc[0](Arg0: &State)
4Call state::get_base_update_fee(&State): u64
5ImmBorrowLoc[3](Arg3: Coin<SUI>)
6Call coin::value<SUI>(&Coin<SUI>): u64
7Le
8BrFalse(10)
B1:
9Branch(16)
B2:
10MoveLoc[2](Arg2: &mut PriceInfoObject)
11Pop
12MoveLoc[4](Arg4: &Clock)
13Pop
14LdConst[2](u64: 2)
15Abort
B3:
16CopyLoc[2](Arg2: &mut PriceInfoObject)
17MoveLoc[3](Arg3: Coin<SUI>)
18Call price_info::deposit_fee_coins(&mut PriceInfoObject, Coin<SUI>)
19LdU64(0)
20StLoc[7](loc2: u64)
21LdFalse
22StLoc[6](loc1: bool)
B4:
23CopyLoc[7](loc2: u64)
24ImmBorrowLoc[1](Arg1: HotPotatoVector<PriceInfo>)
25Call hot_potato_vector::length<PriceInfo>(&HotPotatoVector<PriceInfo>): u64
26Lt
27BrFalse(53)
B5:
28Branch(29)
B6:
29ImmBorrowLoc[1](Arg1: HotPotatoVector<PriceInfo>)
30CopyLoc[7](loc2: u64)
31Call hot_potato_vector::borrow<PriceInfo>(&HotPotatoVector<PriceInfo>, u64): &PriceInfo
32StLoc[5](loc0: &PriceInfo)
33CopyLoc[5](loc0: &PriceInfo)
34CopyLoc[2](Arg2: &mut PriceInfoObject)
35FreezeRef
36Call has_same_price_identifier(&PriceInfo, &PriceInfoObject): bool
37BrFalse(46)
B7:
38LdTrue
39StLoc[6](loc1: bool)
40MoveLoc[8](loc3: LatestOnly)
41MoveLoc[5](loc0: &PriceInfo)
42MoveLoc[2](Arg2: &mut PriceInfoObject)
43MoveLoc[4](Arg4: &Clock)
44Call update_cache(LatestOnly, &PriceInfo, &mut PriceInfoObject, &Clock)
45Branch(53)
B8:
46MoveLoc[5](loc0: &PriceInfo)
47Pop
48MoveLoc[7](loc2: u64)
49LdU64(1)
50Add
51StLoc[7](loc2: u64)
52Branch(23)
B9:
53MoveLoc[6](loc1: bool)
54LdFalse
55Eq
56BrFalse(59)
B10:
57LdConst[5](u64: 5)
58Abort
B11:
59MoveLoc[1](Arg1: HotPotatoVector<PriceInfo>)
60Ret
}
has_same_price_identifier(Arg0: &PriceInfo, Arg1: &PriceInfoObject): bool {
L2: loc0: PriceIdentifier
L3: loc1: PriceIdentifier
L4: loc2: PriceInfo
B0:
0MoveLoc[1](Arg1: &PriceInfoObject)
1Call price_info::get_price_info_from_price_info_object(&PriceInfoObject): PriceInfo
2StLoc[4](loc2: PriceInfo)
3ImmBorrowLoc[4](loc2: PriceInfo)
4Call price_info::get_price_identifier(&PriceInfo): PriceIdentifier
5StLoc[2](loc0: PriceIdentifier)
6MoveLoc[0](Arg0: &PriceInfo)
7Call price_info::get_price_identifier(&PriceInfo): PriceIdentifier
8StLoc[3](loc1: PriceIdentifier)
9MoveLoc[2](loc0: PriceIdentifier)
10MoveLoc[3](loc1: PriceIdentifier)
11Eq
12Ret
}
public(friend) update_cache(Arg0: LatestOnly, Arg1: &PriceInfo, Arg2: &mut PriceInfoObject, Arg3: &Clock) {
B0:
0CopyLoc[1](Arg1: &PriceInfo)
1CopyLoc[2](Arg2: &mut PriceInfoObject)
2FreezeRef
3Call has_same_price_identifier(&PriceInfo, &PriceInfoObject): bool
4BrFalse(6)
B1:
5Branch(14)
B2:
6MoveLoc[1](Arg1: &PriceInfo)
7Pop
8MoveLoc[2](Arg2: &mut PriceInfoObject)
9Pop
10MoveLoc[3](Arg3: &Clock)
11Pop
12LdConst[4](u64: 4)
13Abort
B3:
14CopyLoc[1](Arg1: &PriceInfo)
15CopyLoc[2](Arg2: &mut PriceInfoObject)
16FreezeRef
17Call is_fresh_update(&PriceInfo, &PriceInfoObject): bool
18BrFalse(31)
B4:
19CopyLoc[1](Arg1: &PriceInfo)
20Call price_info::get_price_feed(&PriceInfo): &PriceFeed
21Call price_feed::from(&PriceFeed): PriceFeed
22MoveLoc[3](Arg3: &Clock)
23Call clock::timestamp_ms(&Clock): u64
24LdU64(1000)
25Div
26Call event::emit_price_feed_update(PriceFeed, u64)
27MoveLoc[2](Arg2: &mut PriceInfoObject)
28MoveLoc[1](Arg1: &PriceInfo)
29Call price_info::update_price_info_object(&mut PriceInfoObject, &PriceInfo)
30Branch(37)
B5:
31MoveLoc[1](Arg1: &PriceInfo)
32Pop
33MoveLoc[2](Arg2: &mut PriceInfoObject)
34Pop
35MoveLoc[3](Arg3: &Clock)
36Pop
B6:
37Ret
}
is_fresh_update(Arg0: &PriceInfo, Arg1: &PriceInfoObject): bool {
L2: loc0: Price
L3: loc1: Price
L4: loc2: PriceInfo
L5: loc3: u64
L6: loc4: u64
B0:
0MoveLoc[0](Arg0: &PriceInfo)
1Call price_info::get_price_feed(&PriceInfo): &PriceFeed
2Call price_feed::get_price(&PriceFeed): Price
3StLoc[2](loc0: Price)
4ImmBorrowLoc[2](loc0: Price)
5Call price::get_timestamp(&Price): u64
6StLoc[6](loc4: u64)
7MoveLoc[1](Arg1: &PriceInfoObject)
8Call price_info::get_price_info_from_price_info_object(&PriceInfoObject): PriceInfo
9StLoc[4](loc2: PriceInfo)
10ImmBorrowLoc[4](loc2: PriceInfo)
11Call price_info::get_price_feed(&PriceInfo): &PriceFeed
12Call price_feed::get_price(&PriceFeed): Price
13StLoc[3](loc1: Price)
14ImmBorrowLoc[3](loc1: Price)
15Call price::get_timestamp(&Price): u64
16StLoc[5](loc3: u64)
17MoveLoc[6](loc4: u64)
18MoveLoc[5](loc3: u64)
19Gt
20Ret
}
public price_feed_exists(Arg0: &State, Arg1: PriceIdentifier): bool {
B0:
0MoveLoc[0](Arg0: &State)
1MoveLoc[1](Arg1: PriceIdentifier)
2Call state::price_feed_object_exists(&State, PriceIdentifier): bool
3Ret
}
public get_price(Arg0: &State, Arg1: &PriceInfoObject, Arg2: &Clock): Price {
B0:
0MoveLoc[1](Arg1: &PriceInfoObject)
1MoveLoc[2](Arg2: &Clock)
2MoveLoc[0](Arg0: &State)
3Call state::get_stale_price_threshold_secs(&State): u64
4Call get_price_no_older_than(&PriceInfoObject, &Clock, u64): Price
5Ret
}
public get_price_no_older_than(Arg0: &PriceInfoObject, Arg1: &Clock, Arg2: u64): Price {
L3: loc0: Price
B0:
0MoveLoc[0](Arg0: &PriceInfoObject)
1Call get_price_unsafe(&PriceInfoObject): Price
2StLoc[3](loc0: Price)
3ImmBorrowLoc[3](loc0: Price)
4MoveLoc[1](Arg1: &Clock)
5MoveLoc[2](Arg2: u64)
6Call check_price_is_fresh(&Price, &Clock, u64)
7MoveLoc[3](loc0: Price)
8Ret
}
public get_price_unsafe(Arg0: &PriceInfoObject): Price {
L1: loc0: PriceInfo
B0:
0MoveLoc[0](Arg0: &PriceInfoObject)
1Call price_info::get_price_info_from_price_info_object(&PriceInfoObject): PriceInfo
2StLoc[1](loc0: PriceInfo)
3ImmBorrowLoc[1](loc0: PriceInfo)
4Call price_info::get_price_feed(&PriceInfo): &PriceFeed
5Call price_feed::get_price(&PriceFeed): Price
6Ret
}
abs_diff(Arg0: u64, Arg1: u64): u64 {
B0:
0CopyLoc[0](Arg0: u64)
1CopyLoc[1](Arg1: u64)
2Gt
3BrFalse(8)
B1:
4MoveLoc[0](Arg0: u64)
5MoveLoc[1](Arg1: u64)
6Sub
7Ret
B2:
8MoveLoc[1](Arg1: u64)
9MoveLoc[0](Arg0: u64)
10Sub
11Ret
}
public get_stale_price_threshold_secs(Arg0: &State): u64 {
B0:
0MoveLoc[0](Arg0: &State)
1Call state::get_stale_price_threshold_secs(&State): u64
2Ret
}
check_price_is_fresh(Arg0: &Price, Arg1: &Clock, Arg2: u64) {
B0:
0MoveLoc[1](Arg1: &Clock)
1Call clock::timestamp_ms(&Clock): u64
2LdU64(1000)
3Div
4MoveLoc[0](Arg0: &Price)
5Call price::get_timestamp(&Price): u64
6Call abs_diff(u64, u64): u64
7MoveLoc[2](Arg2: u64)
8Lt
9BrFalse(11)
B1:
10Branch(13)
B2:
11LdConst[3](u64: 3)
12Abort
B3:
13Ret
}
public get_total_update_fee(Arg0: &State, Arg1: u64): u64 {
B0:
0MoveLoc[0](Arg0: &State)
1Call state::get_base_update_fee(&State): u64
2MoveLoc[1](Arg1: u64)
3Mul
4Ret
}
Constants [
0 => u64: 0
1 => u64: 1
2 => u64: 2
3 => u64: 3
4 => u64: 4
5 => u64: 5
]
}