agent_session
Module0x9517…45f6
- Move path
- 0x7b41…cda2::agent_session
- Functions
- 3831 public, 0 entry
- Structs
- 13
- Friend modules
- None
agent_session
Bytecode1642 lines
The on-chain disassembly. Offsets are bytecode positions within each function.
// Move bytecode v7
module 7b4163d17ce18b386ee50929ba48fa0a2ecb60304df4b07e26835aa18617cda2.agent_session {
use 0000000000000000000000000000000000000000000000000000000000000001::option;
use 0000000000000000000000000000000000000000000000000000000000000001::type_name;
use 0000000000000000000000000000000000000000000000000000000000000002::balance;
use 0000000000000000000000000000000000000000000000000000000000000002::clock;
use 0000000000000000000000000000000000000000000000000000000000000002::coin;
use 0000000000000000000000000000000000000000000000000000000000000002::dynamic_field;
use 0000000000000000000000000000000000000000000000000000000000000002::dynamic_object_field;
use 0000000000000000000000000000000000000000000000000000000000000002::event;
use 0000000000000000000000000000000000000000000000000000000000000002::object;
use 0000000000000000000000000000000000000000000000000000000000000002::sui;
use 0000000000000000000000000000000000000000000000000000000000000002::transfer;
use 0000000000000000000000000000000000000000000000000000000000000002::tx_context;
use 7b4163d17ce18b386ee50929ba48fa0a2ecb60304df4b07e26835aa18617cda2::bonding_curve;
use 7b4163d17ce18b386ee50929ba48fa0a2ecb60304df4b07e26835aa18617cda2::enclave_registry;
struct AgentSession has key {
id: UID,
owner: address,
session_address: address,
escrow: Balance<SUI>,
spent: u64,
spend_cap: u64,
expiry_ms: u64,
revoked: bool,
lifetime_spent: u64,
lifetime_cap: u64,
version: u64
}
struct TradeTicket {
session_id: ID,
borrowed: u64,
kind: u8
}
struct SessionOpened has copy, drop {
session_id: ID,
owner: address,
session_address: address,
deposit: u64,
spend_cap: u64,
expiry_ms: u64,
lifetime_cap: u64
}
struct LifetimeCapChanged has copy, drop {
session_id: ID,
old_cap: u64,
new_cap: u64
}
struct SessionMigrated has copy, drop {
session_id: ID,
from_version: u64,
to_version: u64
}
struct SessionToppedUp has copy, drop {
session_id: ID,
amount: u64,
new_escrow: u64
}
struct SessionBuy has copy, drop {
session_id: ID,
sui_spent: u64,
spent_total: u64
}
struct SessionSell has copy, drop {
session_id: ID,
sui_received: u64,
new_escrow: u64
}
struct SessionClosed has copy, drop {
session_id: ID,
refunded: u64
}
struct SessionBuyV2 has copy, drop {
session_id: ID,
sui_spent: u64,
spent_total: u64,
escrow_after: u64,
universal: bool
}
struct SessionSellV2 has copy, drop {
session_id: ID,
sui_received: u64,
spent_total: u64,
escrow_after: u64,
universal: bool
}
struct UniversalTradingToggled has copy, drop {
session_id: ID,
enabled: bool
}
struct SessionAttested has copy, drop {
session_id: ID,
session_address: address,
registry_id: ID
}
open_session(Arg0: Coin<SUI>, Arg1: address, Arg2: u64, Arg3: u64, Arg4: u64, Arg5: &Clock, Arg6: &mut TxContext): AgentSession {
L7: loc0: u64
L8: loc1: u64
L9: loc2: u64
L10: loc3: address
L11: loc4: u64
L12: loc5: AgentSession
B0:
0CopyLoc[3](Arg3: u64)
1LdU64(0)
2Gt
3BrFalse(5)
B1:
4Branch(11)
B2:
5MoveLoc[6](Arg6: &mut TxContext)
6Pop
7MoveLoc[5](Arg5: &Clock)
8Pop
9LdConst[7](u64: 8)
10Abort
B3:
11MoveLoc[5](Arg5: &Clock)
12Call clock::timestamp_ms(&Clock): u64
13StLoc[9](loc2: u64)
14CopyLoc[3](Arg3: u64)
15CopyLoc[9](loc2: u64)
16Gt
17BrFalse(19)
B4:
18Branch(23)
B5:
19MoveLoc[6](Arg6: &mut TxContext)
20Pop
21LdConst[15](u64: 16)
22Abort
B6:
23CopyLoc[3](Arg3: u64)
24MoveLoc[9](loc2: u64)
25LdConst[18](u64: 2592..)
26Add
27Le
28BrFalse(30)
B7:
29Branch(34)
B8:
30MoveLoc[6](Arg6: &mut TxContext)
31Pop
32LdConst[15](u64: 16)
33Abort
B9:
34CopyLoc[2](Arg2: u64)
35LdU64(0)
36Gt
37BrFalse(39)
B10:
38Branch(43)
B11:
39MoveLoc[6](Arg6: &mut TxContext)
40Pop
41LdConst[14](u64: 15)
42Abort
B12:
43CopyLoc[6](Arg6: &mut TxContext)
44FreezeRef
45Call tx_context::sender(&TxContext): address
46StLoc[10](loc3: address)
47ImmBorrowLoc[0](Arg0: Coin<SUI>)
48Call coin::value<SUI>(&Coin<SUI>): u64
49StLoc[8](loc1: u64)
50CopyLoc[4](Arg4: u64)
51LdU64(0)
52Gt
53BrFalse(57)
B13:
54MoveLoc[4](Arg4: u64)
55StLoc[7](loc0: u64)
56Branch(60)
B14:
57CopyLoc[8](loc1: u64)
58Call default_lifetime_cap(u64): u64
59StLoc[7](loc0: u64)
B15:
60MoveLoc[7](loc0: u64)
61StLoc[11](loc4: u64)
62MoveLoc[6](Arg6: &mut TxContext)
63Call object::new(&mut TxContext): UID
64CopyLoc[10](loc3: address)
65CopyLoc[1](Arg1: address)
66MoveLoc[0](Arg0: Coin<SUI>)
67Call coin::into_balance<SUI>(Coin<SUI>): Balance<SUI>
68LdU64(0)
69CopyLoc[2](Arg2: u64)
70CopyLoc[3](Arg3: u64)
71LdFalse
72LdU64(0)
73CopyLoc[11](loc4: u64)
74LdConst[0](u64: 1)
75Pack[0](AgentSession)
76StLoc[12](loc5: AgentSession)
77ImmBorrowLoc[12](loc5: AgentSession)
78Call object::id<AgentSession>(&AgentSession): ID
79MoveLoc[10](loc3: address)
80MoveLoc[1](Arg1: address)
81MoveLoc[8](loc1: u64)
82MoveLoc[2](Arg2: u64)
83MoveLoc[3](Arg3: u64)
84MoveLoc[11](loc4: u64)
85Pack[2](SessionOpened)
86Call event::emit<SessionOpened>(SessionOpened)
87MoveLoc[12](loc5: AgentSession)
88Ret
}
default_lifetime_cap(Arg0: u64): u64 {
L1: loc0: u64
L2: loc1: u128
L3: loc2: u128
B0:
0MoveLoc[0](Arg0: u64)
1CastU128
2LdConst[4](u64: 5)
3CastU128
4Mul
5StLoc[3](loc2: u128)
6LdU128(18446744073709551615)
7StLoc[2](loc1: u128)
8CopyLoc[3](loc2: u128)
9CopyLoc[2](loc1: u128)
10Gt
11BrFalse(16)
B1:
12MoveLoc[2](loc1: u128)
13CastU64
14StLoc[1](loc0: u64)
15Branch(19)
B2:
16MoveLoc[3](loc2: u128)
17CastU64
18StLoc[1](loc0: u64)
B3:
19MoveLoc[1](loc0: u64)
20Ret
}
B0:
0MoveLoc[0](Arg0: Coin<SUI>)
1MoveLoc[1](Arg1: address)
2MoveLoc[2](Arg2: u64)
3MoveLoc[3](Arg3: u64)
4MoveLoc[4](Arg4: u64)
5MoveLoc[5](Arg5: &Clock)
6MoveLoc[6](Arg6: &mut TxContext)
7Call open_session(Coin<SUI>, address, u64, u64, u64, &Clock, &mut TxContext): AgentSession
8Call transfer::share_object<AgentSession>(AgentSession)
9Ret
}
L8: loc0: AgentSession
B0:
0CopyLoc[5](Arg5: &EnclaveRegistry)
1CopyLoc[1](Arg1: address)
2Call enclave_registry::is_registered(&EnclaveRegistry, address): bool
3BrFalse(5)
B1:
4Branch(13)
B2:
5MoveLoc[5](Arg5: &EnclaveRegistry)
6Pop
7MoveLoc[7](Arg7: &mut TxContext)
8Pop
9MoveLoc[6](Arg6: &Clock)
10Pop
11LdConst[11](u64: 12)
12Abort
B3:
13MoveLoc[0](Arg0: Coin<SUI>)
14CopyLoc[1](Arg1: address)
15MoveLoc[2](Arg2: u64)
16MoveLoc[3](Arg3: u64)
17MoveLoc[4](Arg4: u64)
18MoveLoc[6](Arg6: &Clock)
19MoveLoc[7](Arg7: &mut TxContext)
20Call open_session(Coin<SUI>, address, u64, u64, u64, &Clock, &mut TxContext): AgentSession
21StLoc[8](loc0: AgentSession)
22ImmBorrowLoc[8](loc0: AgentSession)
23Call object::id<AgentSession>(&AgentSession): ID
24MoveLoc[1](Arg1: address)
25MoveLoc[5](Arg5: &EnclaveRegistry)
26Call object::id<EnclaveRegistry>(&EnclaveRegistry): ID
27Pack[12](SessionAttested)
28Call event::emit<SessionAttested>(SessionAttested)
29MoveLoc[8](loc0: AgentSession)
30Call transfer::share_object<AgentSession>(AgentSession)
31Ret
}
public top_up_session(Arg0: &mut AgentSession, Arg1: Coin<SUI>, Arg2: &mut TxContext) {
L3: loc0: u64
L4: loc1: u64
L5: loc2: u64
L6: loc3: u128
L7: loc4: u64
L8: loc5: u128
B0:
0CopyLoc[0](Arg0: &mut AgentSession)
1FreezeRef
2Call assert_session_version(&AgentSession)
3MoveLoc[2](Arg2: &mut TxContext)
4FreezeRef
5Call tx_context::sender(&TxContext): address
6CopyLoc[0](Arg0: &mut AgentSession)
7ImmBorrowField[0](AgentSession.owner: address)
8ReadRef
9Eq
10BrFalse(12)
B1:
11Branch(16)
B2:
12MoveLoc[0](Arg0: &mut AgentSession)
13Pop
14LdConst[5](u64: 6)
15Abort
B3:
16CopyLoc[0](Arg0: &mut AgentSession)
17FreezeRef
18Call is_closed(&AgentSession): bool
19Not
20BrFalse(22)
B4:
21Branch(26)
B5:
22MoveLoc[0](Arg0: &mut AgentSession)
23Pop
24LdConst[16](u64: 17)
25Abort
B6:
26ImmBorrowLoc[1](Arg1: Coin<SUI>)
27Call coin::value<SUI>(&Coin<SUI>): u64
28StLoc[5](loc2: u64)
29CopyLoc[0](Arg0: &mut AgentSession)
30MutBorrowField[1](AgentSession.escrow: Balance<SUI>)
31MoveLoc[1](Arg1: Coin<SUI>)
32Call coin::into_balance<SUI>(Coin<SUI>): Balance<SUI>
33Call balance::join<SUI>(&mut Balance<SUI>, Balance<SUI>): u64
34Pop
35CopyLoc[0](Arg0: &mut AgentSession)
36ImmBorrowField[2](AgentSession.lifetime_cap: u64)
37ReadRef
38StLoc[7](loc4: u64)
39CopyLoc[5](loc2: u64)
40Call default_lifetime_cap(u64): u64
41StLoc[4](loc1: u64)
42CopyLoc[7](loc4: u64)
43CastU128
44MoveLoc[4](loc1: u64)
45CastU128
46Add
47StLoc[8](loc5: u128)
48LdU128(18446744073709551615)
49StLoc[6](loc3: u128)
50CopyLoc[8](loc5: u128)
51CopyLoc[6](loc3: u128)
52Gt
53BrFalse(58)
B7:
54MoveLoc[6](loc3: u128)
55CastU64
56StLoc[3](loc0: u64)
57Branch(61)
B8:
58MoveLoc[8](loc5: u128)
59CastU64
60StLoc[3](loc0: u64)
B9:
61MoveLoc[3](loc0: u64)
62CopyLoc[0](Arg0: &mut AgentSession)
63MutBorrowField[2](AgentSession.lifetime_cap: u64)
64WriteRef
65CopyLoc[0](Arg0: &mut AgentSession)
66FreezeRef
67Call object::id<AgentSession>(&AgentSession): ID
68MoveLoc[7](loc4: u64)
69CopyLoc[0](Arg0: &mut AgentSession)
70ImmBorrowField[2](AgentSession.lifetime_cap: u64)
71ReadRef
72Pack[3](LifetimeCapChanged)
73Call event::emit<LifetimeCapChanged>(LifetimeCapChanged)
74CopyLoc[0](Arg0: &mut AgentSession)
75FreezeRef
76Call object::id<AgentSession>(&AgentSession): ID
77MoveLoc[5](loc2: u64)
78MoveLoc[0](Arg0: &mut AgentSession)
79ImmBorrowField[1](AgentSession.escrow: Balance<SUI>)
80Call balance::value<SUI>(&Balance<SUI>): u64
81Pack[5](SessionToppedUp)
82Call event::emit<SessionToppedUp>(SessionToppedUp)
83Ret
}
public set_lifetime_cap(Arg0: &mut AgentSession, Arg1: u64, Arg2: &TxContext) {
L3: loc0: u64
B0:
0CopyLoc[0](Arg0: &mut AgentSession)
1FreezeRef
2Call assert_session_version(&AgentSession)
3MoveLoc[2](Arg2: &TxContext)
4Call tx_context::sender(&TxContext): address
5CopyLoc[0](Arg0: &mut AgentSession)
6ImmBorrowField[0](AgentSession.owner: address)
7ReadRef
8Eq
9BrFalse(11)
B1:
10Branch(15)
B2:
11MoveLoc[0](Arg0: &mut AgentSession)
12Pop
13LdConst[5](u64: 6)
14Abort
B3:
15CopyLoc[1](Arg1: u64)
16CopyLoc[0](Arg0: &mut AgentSession)
17ImmBorrowField[3](AgentSession.lifetime_spent: u64)
18ReadRef
19Ge
20BrFalse(22)
B4:
21Branch(26)
B5:
22MoveLoc[0](Arg0: &mut AgentSession)
23Pop
24LdConst[13](u64: 14)
25Abort
B6:
26CopyLoc[0](Arg0: &mut AgentSession)
27ImmBorrowField[2](AgentSession.lifetime_cap: u64)
28ReadRef
29StLoc[3](loc0: u64)
30CopyLoc[1](Arg1: u64)
31CopyLoc[0](Arg0: &mut AgentSession)
32MutBorrowField[2](AgentSession.lifetime_cap: u64)
33WriteRef
34MoveLoc[0](Arg0: &mut AgentSession)
35FreezeRef
36Call object::id<AgentSession>(&AgentSession): ID
37MoveLoc[3](loc0: u64)
38MoveLoc[1](Arg1: u64)
39Pack[3](LifetimeCapChanged)
40Call event::emit<LifetimeCapChanged>(LifetimeCapChanged)
41Ret
}
assert_can_trade(Arg0: &AgentSession, Arg1: &Clock, Arg2: &TxContext) {
B0:
0MoveLoc[2](Arg2: &TxContext)
1Call tx_context::sender(&TxContext): address
2CopyLoc[0](Arg0: &AgentSession)
3ImmBorrowField[4](AgentSession.session_address: address)
4ReadRef
5Eq
6BrFalse(8)
B1:
7Branch(14)
B2:
8MoveLoc[0](Arg0: &AgentSession)
9Pop
10MoveLoc[1](Arg1: &Clock)
11Pop
12LdConst[0](u64: 1)
13Abort
B3:
14CopyLoc[0](Arg0: &AgentSession)
15ImmBorrowField[5](AgentSession.revoked: bool)
16ReadRef
17Not
18BrFalse(20)
B4:
19Branch(26)
B5:
20MoveLoc[0](Arg0: &AgentSession)
21Pop
22MoveLoc[1](Arg1: &Clock)
23Pop
24LdConst[1](u64: 2)
25Abort
B6:
26MoveLoc[1](Arg1: &Clock)
27Call clock::timestamp_ms(&Clock): u64
28MoveLoc[0](Arg0: &AgentSession)
29ImmBorrowField[6](AgentSession.expiry_ms: u64)
30ReadRef
31Lt
32BrFalse(34)
B7:
33Branch(36)
B8:
34LdConst[2](u64: 3)
35Abort
B9:
36Ret
}
credit_spent(Arg0: &mut AgentSession, Arg1: u64) {
L2: loc0: u64
L3: loc1: u64
B0:
0CopyLoc[1](Arg1: u64)
1CopyLoc[0](Arg0: &mut AgentSession)
2ImmBorrowField[7](AgentSession.spent: u64)
3ReadRef
4Gt
5BrFalse(11)
B1:
6CopyLoc[0](Arg0: &mut AgentSession)
7ImmBorrowField[7](AgentSession.spent: u64)
8ReadRef
9StLoc[2](loc0: u64)
10Branch(13)
B2:
11MoveLoc[1](Arg1: u64)
12StLoc[2](loc0: u64)
B3:
13MoveLoc[2](loc0: u64)
14StLoc[3](loc1: u64)
15CopyLoc[0](Arg0: &mut AgentSession)
16ImmBorrowField[7](AgentSession.spent: u64)
17ReadRef
18MoveLoc[3](loc1: u64)
19Sub
20MoveLoc[0](Arg0: &mut AgentSession)
21MutBorrowField[7](AgentSession.spent: u64)
22WriteRef
23Ret
}
assert_spend_allowed(Arg0: &AgentSession, Arg1: u64) {
B0:
0CopyLoc[0](Arg0: &AgentSession)
1ImmBorrowField[7](AgentSession.spent: u64)
2ReadRef
3CastU128
4CopyLoc[1](Arg1: u64)
5CastU128
6Add
7CopyLoc[0](Arg0: &AgentSession)
8ImmBorrowField[8](AgentSession.spend_cap: u64)
9ReadRef
10CastU128
11Le
12BrFalse(14)
B1:
13Branch(18)
B2:
14MoveLoc[0](Arg0: &AgentSession)
15Pop
16LdConst[3](u64: 4)
17Abort
B3:
18CopyLoc[0](Arg0: &AgentSession)
19ImmBorrowField[3](AgentSession.lifetime_spent: u64)
20ReadRef
21CastU128
22MoveLoc[1](Arg1: u64)
23CastU128
24Add
25MoveLoc[0](Arg0: &AgentSession)
26ImmBorrowField[2](AgentSession.lifetime_cap: u64)
27ReadRef
28CastU128
29Le
30BrFalse(32)
B4:
31Branch(34)
B5:
32LdConst[12](u64: 13)
33Abort
B6:
34Ret
}
assert_session_version(Arg0: &AgentSession) {
B0:
0MoveLoc[0](Arg0: &AgentSession)
1ImmBorrowField[9](AgentSession.version: u64)
2ReadRef
3LdConst[0](u64: 1)
4Eq
5BrFalse(7)
B1:
6Branch(9)
B2:
7LdConst[17](u64: 18)
8Abort
B3:
9Ret
}
public migrate_session(Arg0: &mut AgentSession) {
L1: loc0: u64
B0:
0CopyLoc[0](Arg0: &mut AgentSession)
1ImmBorrowField[9](AgentSession.version: u64)
2ReadRef
3LdConst[0](u64: 1)
4Lt
5BrFalse(7)
B1:
6Branch(11)
B2:
7MoveLoc[0](Arg0: &mut AgentSession)
8Pop
9LdConst[17](u64: 18)
10Abort
B3:
11CopyLoc[0](Arg0: &mut AgentSession)
12ImmBorrowField[9](AgentSession.version: u64)
13ReadRef
14StLoc[1](loc0: u64)
15LdConst[0](u64: 1)
16CopyLoc[0](Arg0: &mut AgentSession)
17MutBorrowField[9](AgentSession.version: u64)
18WriteRef
19MoveLoc[0](Arg0: &mut AgentSession)
20FreezeRef
21Call object::id<AgentSession>(&AgentSession): ID
22MoveLoc[1](loc0: u64)
23LdConst[0](u64: 1)
24Pack[4](SessionMigrated)
25Call event::emit<SessionMigrated>(SessionMigrated)
26Ret
}
park_tokens<Ty0>(Arg0: &mut AgentSession, Arg1: Coin<Ty0>) {
L2: loc0: TypeName
B0:
0ImmBorrowLoc[1](Arg1: Coin<Ty0>)
1Call coin::value<Ty0>(&Coin<Ty0>): u64
2LdU64(0)
3Eq
4BrFalse(10)
B1:
5MoveLoc[0](Arg0: &mut AgentSession)
6Pop
7MoveLoc[1](Arg1: Coin<Ty0>)
8Call coin::destroy_zero<Ty0>(Coin<Ty0>)
9Ret
B2:
10Call type_name::with_defining_ids<Ty0>(): TypeName
11StLoc[2](loc0: TypeName)
12CopyLoc[0](Arg0: &mut AgentSession)
13ImmBorrowField[10](AgentSession.id: UID)
14CopyLoc[2](loc0: TypeName)
15Call dynamic_object_field::exists<TypeName>(&UID, TypeName): bool
16BrFalse(24)
B3:
17MoveLoc[0](Arg0: &mut AgentSession)
18MutBorrowField[10](AgentSession.id: UID)
19MoveLoc[2](loc0: TypeName)
20Call dynamic_object_field::borrow_mut<TypeName, Coin<Ty0>>(&mut UID, TypeName): &mut Coin<Ty0>
21MoveLoc[1](Arg1: Coin<Ty0>)
22Call coin::join<Ty0>(&mut Coin<Ty0>, Coin<Ty0>)
23Branch(29)
B4:
24MoveLoc[0](Arg0: &mut AgentSession)
25MutBorrowField[10](AgentSession.id: UID)
26MoveLoc[2](loc0: TypeName)
27MoveLoc[1](Arg1: Coin<Ty0>)
28Call dynamic_object_field::add<TypeName, Coin<Ty0>>(&mut UID, TypeName, Coin<Ty0>)
B5:
29Ret
}
public buy_with_session<Ty0>(Arg0: &mut AgentSession, Arg1: &mut Curve<Ty0>, Arg2: u64, Arg3: u64, Arg4: &PriceConfig, Arg5: &Clock, Arg6: &mut TxContext) {
L7: loc0: Coin<SUI>
L8: loc1: Coin<SUI>
L9: loc2: u64
L10: loc3: Coin<Ty0>
B0:
0CopyLoc[0](Arg0: &mut AgentSession)
1FreezeRef
2Call assert_session_version(&AgentSession)
3CopyLoc[0](Arg0: &mut AgentSession)
4FreezeRef
5CopyLoc[5](Arg5: &Clock)
6CopyLoc[6](Arg6: &mut TxContext)
7FreezeRef
8Call assert_can_trade(&AgentSession, &Clock, &TxContext)
9CopyLoc[0](Arg0: &mut AgentSession)
10ImmBorrowField[1](AgentSession.escrow: Balance<SUI>)
11Call balance::value<SUI>(&Balance<SUI>): u64
12CopyLoc[2](Arg2: u64)
13Ge
14BrFalse(16)
B1:
15Branch(28)
B2:
16MoveLoc[0](Arg0: &mut AgentSession)
17Pop
18MoveLoc[4](Arg4: &PriceConfig)
19Pop
20MoveLoc[1](Arg1: &mut Curve<Ty0>)
21Pop
22MoveLoc[6](Arg6: &mut TxContext)
23Pop
24MoveLoc[5](Arg5: &Clock)
25Pop
26LdConst[4](u64: 5)
27Abort
B3:
28CopyLoc[0](Arg0: &mut AgentSession)
29FreezeRef
30CopyLoc[2](Arg2: u64)
31Call assert_spend_allowed(&AgentSession, u64)
32CopyLoc[0](Arg0: &mut AgentSession)
33MutBorrowField[1](AgentSession.escrow: Balance<SUI>)
34CopyLoc[2](Arg2: u64)
35Call balance::split<SUI>(&mut Balance<SUI>, u64): Balance<SUI>
36CopyLoc[6](Arg6: &mut TxContext)
37Call coin::from_balance<SUI>(Balance<SUI>, &mut TxContext): Coin<SUI>
38StLoc[7](loc0: Coin<SUI>)
39MoveLoc[1](Arg1: &mut Curve<Ty0>)
40MoveLoc[7](loc0: Coin<SUI>)
41MoveLoc[3](Arg3: u64)
42Call option::none<address>(): Option<address>
43MoveLoc[4](Arg4: &PriceConfig)
44MoveLoc[5](Arg5: &Clock)
45MoveLoc[6](Arg6: &mut TxContext)
46Call bonding_curve::buy<Ty0>(&mut Curve<Ty0>, Coin<SUI>, u64, Option<address>, &PriceConfig, &Clock, &mut TxContext): Coin<Ty0> * Coin<SUI>
47StLoc[8](loc1: Coin<SUI>)
48StLoc[10](loc3: Coin<Ty0>)
49ImmBorrowLoc[8](loc1: Coin<SUI>)
50Call coin::value<SUI>(&Coin<SUI>): u64
51StLoc[9](loc2: u64)
52CopyLoc[0](Arg0: &mut AgentSession)
53MutBorrowField[1](AgentSession.escrow: Balance<SUI>)
54MoveLoc[8](loc1: Coin<SUI>)
55Call coin::into_balance<SUI>(Coin<SUI>): Balance<SUI>
56Call balance::join<SUI>(&mut Balance<SUI>, Balance<SUI>): u64
57Pop
58CopyLoc[0](Arg0: &mut AgentSession)
59MoveLoc[10](loc3: Coin<Ty0>)
60Call park_tokens<Ty0>(&mut AgentSession, Coin<Ty0>)
61CopyLoc[0](Arg0: &mut AgentSession)
62ImmBorrowField[7](AgentSession.spent: u64)
63ReadRef
64CopyLoc[2](Arg2: u64)
65Add
66CopyLoc[0](Arg0: &mut AgentSession)
67MutBorrowField[7](AgentSession.spent: u64)
68WriteRef
69CopyLoc[0](Arg0: &mut AgentSession)
70CopyLoc[9](loc2: u64)
71Call credit_spent(&mut AgentSession, u64)
72CopyLoc[0](Arg0: &mut AgentSession)
73ImmBorrowField[3](AgentSession.lifetime_spent: u64)
74ReadRef
75CopyLoc[2](Arg2: u64)
76CopyLoc[9](loc2: u64)
77Sub
78Add
79CopyLoc[0](Arg0: &mut AgentSession)
80MutBorrowField[3](AgentSession.lifetime_spent: u64)
81WriteRef
82CopyLoc[0](Arg0: &mut AgentSession)
83FreezeRef
84Call object::id<AgentSession>(&AgentSession): ID
85CopyLoc[2](Arg2: u64)
86CopyLoc[9](loc2: u64)
87Sub
88CopyLoc[0](Arg0: &mut AgentSession)
89ImmBorrowField[7](AgentSession.spent: u64)
90ReadRef
91Pack[6](SessionBuy)
92Call event::emit<SessionBuy>(SessionBuy)
93CopyLoc[0](Arg0: &mut AgentSession)
94FreezeRef
95Call object::id<AgentSession>(&AgentSession): ID
96MoveLoc[2](Arg2: u64)
97MoveLoc[9](loc2: u64)
98Sub
99CopyLoc[0](Arg0: &mut AgentSession)
100ImmBorrowField[7](AgentSession.spent: u64)
101ReadRef
102MoveLoc[0](Arg0: &mut AgentSession)
103ImmBorrowField[1](AgentSession.escrow: Balance<SUI>)
104Call balance::value<SUI>(&Balance<SUI>): u64
105LdFalse
106Pack[9](SessionBuyV2)
107Call event::emit<SessionBuyV2>(SessionBuyV2)
108Ret
}
public sell_with_session<Ty0>(Arg0: &mut AgentSession, Arg1: &mut Curve<Ty0>, Arg2: u64, Arg3: u64, Arg4: &Clock, Arg5: &mut TxContext) {
L6: loc0: u64
L7: loc1: TypeName
L8: loc2: Coin<SUI>
L9: loc3: Coin<Ty0>
B0:
0CopyLoc[0](Arg0: &mut AgentSession)
1FreezeRef
2Call assert_session_version(&AgentSession)
3CopyLoc[0](Arg0: &mut AgentSession)
4FreezeRef
5MoveLoc[4](Arg4: &Clock)
6CopyLoc[5](Arg5: &mut TxContext)
7FreezeRef
8Call assert_can_trade(&AgentSession, &Clock, &TxContext)
9Call type_name::with_defining_ids<Ty0>(): TypeName
10StLoc[7](loc1: TypeName)
11CopyLoc[0](Arg0: &mut AgentSession)
12MutBorrowField[10](AgentSession.id: UID)
13MoveLoc[7](loc1: TypeName)
14Call dynamic_object_field::borrow_mut<TypeName, Coin<Ty0>>(&mut UID, TypeName): &mut Coin<Ty0>
15MoveLoc[2](Arg2: u64)
16CopyLoc[5](Arg5: &mut TxContext)
17Call coin::split<Ty0>(&mut Coin<Ty0>, u64, &mut TxContext): Coin<Ty0>
18StLoc[9](loc3: Coin<Ty0>)
19MoveLoc[1](Arg1: &mut Curve<Ty0>)
20MoveLoc[9](loc3: Coin<Ty0>)
21MoveLoc[3](Arg3: u64)
22Call option::none<address>(): Option<address>
23MoveLoc[5](Arg5: &mut TxContext)
24Call bonding_curve::sell<Ty0>(&mut Curve<Ty0>, Coin<Ty0>, u64, Option<address>, &mut TxContext): Coin<SUI>
25StLoc[8](loc2: Coin<SUI>)
26ImmBorrowLoc[8](loc2: Coin<SUI>)
27Call coin::value<SUI>(&Coin<SUI>): u64
28StLoc[6](loc0: u64)
29CopyLoc[0](Arg0: &mut AgentSession)
30MutBorrowField[1](AgentSession.escrow: Balance<SUI>)
31MoveLoc[8](loc2: Coin<SUI>)
32Call coin::into_balance<SUI>(Coin<SUI>): Balance<SUI>
33Call balance::join<SUI>(&mut Balance<SUI>, Balance<SUI>): u64
34Pop
35CopyLoc[0](Arg0: &mut AgentSession)
36CopyLoc[6](loc0: u64)
37Call credit_spent(&mut AgentSession, u64)
38CopyLoc[0](Arg0: &mut AgentSession)
39FreezeRef
40Call object::id<AgentSession>(&AgentSession): ID
41CopyLoc[6](loc0: u64)
42CopyLoc[0](Arg0: &mut AgentSession)
43ImmBorrowField[1](AgentSession.escrow: Balance<SUI>)
44Call balance::value<SUI>(&Balance<SUI>): u64
45Pack[7](SessionSell)
46Call event::emit<SessionSell>(SessionSell)
47CopyLoc[0](Arg0: &mut AgentSession)
48FreezeRef
49Call object::id<AgentSession>(&AgentSession): ID
50MoveLoc[6](loc0: u64)
51CopyLoc[0](Arg0: &mut AgentSession)
52ImmBorrowField[7](AgentSession.spent: u64)
53ReadRef
54MoveLoc[0](Arg0: &mut AgentSession)
55ImmBorrowField[1](AgentSession.escrow: Balance<SUI>)
56Call balance::value<SUI>(&Balance<SUI>): u64
57LdFalse
58Pack[10](SessionSellV2)
59Call event::emit<SessionSellV2>(SessionSellV2)
60Ret
}
public enable_universal_trading(Arg0: &mut AgentSession, Arg1: &TxContext) {
B0:
0CopyLoc[0](Arg0: &mut AgentSession)
1FreezeRef
2Call assert_session_version(&AgentSession)
3MoveLoc[1](Arg1: &TxContext)
4Call tx_context::sender(&TxContext): address
5CopyLoc[0](Arg0: &mut AgentSession)
6ImmBorrowField[0](AgentSession.owner: address)
7ReadRef
8Eq
9BrFalse(11)
B1:
10Branch(15)
B2:
11MoveLoc[0](Arg0: &mut AgentSession)
12Pop
13LdConst[5](u64: 6)
14Abort
B3:
15CopyLoc[0](Arg0: &mut AgentSession)
16ImmBorrowField[10](AgentSession.id: UID)
17LdConst[21](vector<u8>: "uni..)
18Call dynamic_field::exists<vector<u8>>(&UID, vector<u8>): bool
19Not
20BrFalse(26)
B4:
21CopyLoc[0](Arg0: &mut AgentSession)
22MutBorrowField[10](AgentSession.id: UID)
23LdConst[21](vector<u8>: "uni..)
24LdTrue
25Call dynamic_field::add<vector<u8>, bool>(&mut UID, vector<u8>, bool)
B5:
26MoveLoc[0](Arg0: &mut AgentSession)
27FreezeRef
28Call object::id<AgentSession>(&AgentSession): ID
29LdTrue
30Pack[11](UniversalTradingToggled)
31Call event::emit<UniversalTradingToggled>(UniversalTradingToggled)
32Ret
}
public disable_universal_trading(Arg0: &mut AgentSession, Arg1: &TxContext) {
B0:
0CopyLoc[0](Arg0: &mut AgentSession)
1FreezeRef
2Call assert_session_version(&AgentSession)
3MoveLoc[1](Arg1: &TxContext)
4Call tx_context::sender(&TxContext): address
5CopyLoc[0](Arg0: &mut AgentSession)
6ImmBorrowField[0](AgentSession.owner: address)
7ReadRef
8Eq
9BrFalse(11)
B1:
10Branch(15)
B2:
11MoveLoc[0](Arg0: &mut AgentSession)
12Pop
13LdConst[5](u64: 6)
14Abort
B3:
15CopyLoc[0](Arg0: &mut AgentSession)
16ImmBorrowField[10](AgentSession.id: UID)
17LdConst[21](vector<u8>: "uni..)
18Call dynamic_field::exists<vector<u8>>(&UID, vector<u8>): bool
19BrFalse(25)
B4:
20CopyLoc[0](Arg0: &mut AgentSession)
21MutBorrowField[10](AgentSession.id: UID)
22LdConst[21](vector<u8>: "uni..)
23Call dynamic_field::remove<vector<u8>, bool>(&mut UID, vector<u8>): bool
24Pop
B5:
25MoveLoc[0](Arg0: &mut AgentSession)
26FreezeRef
27Call object::id<AgentSession>(&AgentSession): ID
28LdFalse
29Pack[11](UniversalTradingToggled)
30Call event::emit<UniversalTradingToggled>(UniversalTradingToggled)
31Ret
}
public universal_trading_enabled(Arg0: &AgentSession): bool {
B0:
0MoveLoc[0](Arg0: &AgentSession)
1ImmBorrowField[10](AgentSession.id: UID)
2LdConst[21](vector<u8>: "uni..)
3Call dynamic_field::exists<vector<u8>>(&UID, vector<u8>): bool
4Ret
}
public borrow_for_buy(Arg0: &mut AgentSession, Arg1: u64, Arg2: &Clock, Arg3: &mut TxContext): Coin<SUI> * TradeTicket {
L4: loc0: Coin<SUI>
L5: loc1: TradeTicket
B0:
0CopyLoc[0](Arg0: &mut AgentSession)
1FreezeRef
2Call assert_session_version(&AgentSession)
3CopyLoc[0](Arg0: &mut AgentSession)
4FreezeRef
5MoveLoc[2](Arg2: &Clock)
6CopyLoc[3](Arg3: &mut TxContext)
7FreezeRef
8Call assert_can_trade(&AgentSession, &Clock, &TxContext)
9CopyLoc[0](Arg0: &mut AgentSession)
10FreezeRef
11Call universal_trading_enabled(&AgentSession): bool
12BrFalse(14)
B1:
13Branch(20)
B2:
14MoveLoc[0](Arg0: &mut AgentSession)
15Pop
16MoveLoc[3](Arg3: &mut TxContext)
17Pop
18LdConst[10](u64: 11)
19Abort
B3:
20CopyLoc[0](Arg0: &mut AgentSession)
21ImmBorrowField[1](AgentSession.escrow: Balance<SUI>)
22Call balance::value<SUI>(&Balance<SUI>): u64
23CopyLoc[1](Arg1: u64)
24Ge
25BrFalse(27)
B4:
26Branch(33)
B5:
27MoveLoc[0](Arg0: &mut AgentSession)
28Pop
29MoveLoc[3](Arg3: &mut TxContext)
30Pop
31LdConst[4](u64: 5)
32Abort
B6:
33CopyLoc[0](Arg0: &mut AgentSession)
34FreezeRef
35CopyLoc[1](Arg1: u64)
36Call assert_spend_allowed(&AgentSession, u64)
37CopyLoc[0](Arg0: &mut AgentSession)
38ImmBorrowField[7](AgentSession.spent: u64)
39ReadRef
40CopyLoc[1](Arg1: u64)
41Add
42CopyLoc[0](Arg0: &mut AgentSession)
43MutBorrowField[7](AgentSession.spent: u64)
44WriteRef
45CopyLoc[0](Arg0: &mut AgentSession)
46ImmBorrowField[3](AgentSession.lifetime_spent: u64)
47ReadRef
48CopyLoc[1](Arg1: u64)
49Add
50CopyLoc[0](Arg0: &mut AgentSession)
51MutBorrowField[3](AgentSession.lifetime_spent: u64)
52WriteRef
53CopyLoc[0](Arg0: &mut AgentSession)
54MutBorrowField[1](AgentSession.escrow: Balance<SUI>)
55CopyLoc[1](Arg1: u64)
56Call balance::split<SUI>(&mut Balance<SUI>, u64): Balance<SUI>
57MoveLoc[3](Arg3: &mut TxContext)
58Call coin::from_balance<SUI>(Balance<SUI>, &mut TxContext): Coin<SUI>
59StLoc[4](loc0: Coin<SUI>)
60MoveLoc[0](Arg0: &mut AgentSession)
61FreezeRef
62Call object::id<AgentSession>(&AgentSession): ID
63MoveLoc[1](Arg1: u64)
64LdConst[19](u8: 0)
65Pack[1](TradeTicket)
66StLoc[5](loc1: TradeTicket)
67MoveLoc[4](loc0: Coin<SUI>)
68MoveLoc[5](loc1: TradeTicket)
69Ret
}
public settle_buy<Ty0>(Arg0: &mut AgentSession, Arg1: TradeTicket, Arg2: Coin<SUI>, Arg3: Coin<Ty0>, Arg4: &mut TxContext) {
L5: loc0: u64
L6: loc1: u64
L7: loc2: u64
L8: loc3: u64
L9: loc4: u8
L10: loc5: u64
L11: loc6: u64
L12: loc7: u64
B0:
0CopyLoc[0](Arg0: &mut AgentSession)
1FreezeRef
2Call assert_session_version(&AgentSession)
3MoveLoc[1](Arg1: TradeTicket)
4Unpack[1](TradeTicket)
5StLoc[9](loc4: u8)
6StLoc[7](loc2: u64)
7CopyLoc[0](Arg0: &mut AgentSession)
8FreezeRef
9Call object::id<AgentSession>(&AgentSession): ID
10Eq
11BrFalse(13)
B1:
12Branch(17)
B2:
13MoveLoc[0](Arg0: &mut AgentSession)
14Pop
15LdConst[8](u64: 9)
16Abort
B3:
17MoveLoc[9](loc4: u8)
18LdConst[19](u8: 0)
19Eq
20BrFalse(22)
B4:
21Branch(26)
B5:
22MoveLoc[0](Arg0: &mut AgentSession)
23Pop
24LdConst[9](u64: 10)
25Abort
B6:
26ImmBorrowLoc[2](Arg2: Coin<SUI>)
27Call coin::value<SUI>(&Coin<SUI>): u64
28StLoc[10](loc5: u64)
29CopyLoc[0](Arg0: &mut AgentSession)
30MutBorrowField[1](AgentSession.escrow: Balance<SUI>)
31MoveLoc[2](Arg2: Coin<SUI>)
32Call coin::into_balance<SUI>(Coin<SUI>): Balance<SUI>
33Call balance::join<SUI>(&mut Balance<SUI>, Balance<SUI>): u64
34Pop
35CopyLoc[10](loc5: u64)
36CopyLoc[7](loc2: u64)
37Gt
38BrFalse(42)
B7:
39CopyLoc[7](loc2: u64)
40StLoc[5](loc0: u64)
41Branch(44)
B8:
42MoveLoc[10](loc5: u64)
43StLoc[5](loc0: u64)
B9:
44MoveLoc[5](loc0: u64)
45StLoc[8](loc3: u64)
46CopyLoc[0](Arg0: &mut AgentSession)
47CopyLoc[8](loc3: u64)
48Call credit_spent(&mut AgentSession, u64)
49CopyLoc[8](loc3: u64)
50CopyLoc[0](Arg0: &mut AgentSession)
51ImmBorrowField[3](AgentSession.lifetime_spent: u64)
52ReadRef
53Gt
54BrFalse(60)
B10:
55CopyLoc[0](Arg0: &mut AgentSession)
56ImmBorrowField[3](AgentSession.lifetime_spent: u64)
57ReadRef
58StLoc[6](loc1: u64)
59Branch(62)
B11:
60CopyLoc[8](loc3: u64)
61StLoc[6](loc1: u64)
B12:
62MoveLoc[6](loc1: u64)
63StLoc[11](loc6: u64)
64CopyLoc[0](Arg0: &mut AgentSession)
65ImmBorrowField[3](AgentSession.lifetime_spent: u64)
66ReadRef
67MoveLoc[11](loc6: u64)
68Sub
69CopyLoc[0](Arg0: &mut AgentSession)
70MutBorrowField[3](AgentSession.lifetime_spent: u64)
71WriteRef
72CopyLoc[0](Arg0: &mut AgentSession)
73MoveLoc[3](Arg3: Coin<Ty0>)
74Call park_tokens<Ty0>(&mut AgentSession, Coin<Ty0>)
75MoveLoc[7](loc2: u64)
76MoveLoc[8](loc3: u64)
77Sub
78StLoc[12](loc7: u64)
79CopyLoc[0](Arg0: &mut AgentSession)
80FreezeRef
81Call object::id<AgentSession>(&AgentSession): ID
82CopyLoc[12](loc7: u64)
83CopyLoc[0](Arg0: &mut AgentSession)
84ImmBorrowField[7](AgentSession.spent: u64)
85ReadRef
86Pack[6](SessionBuy)
87Call event::emit<SessionBuy>(SessionBuy)
88CopyLoc[0](Arg0: &mut AgentSession)
89FreezeRef
90Call object::id<AgentSession>(&AgentSession): ID
91MoveLoc[12](loc7: u64)
92CopyLoc[0](Arg0: &mut AgentSession)
93ImmBorrowField[7](AgentSession.spent: u64)
94ReadRef
95MoveLoc[0](Arg0: &mut AgentSession)
96ImmBorrowField[1](AgentSession.escrow: Balance<SUI>)
97Call balance::value<SUI>(&Balance<SUI>): u64
98LdTrue
99Pack[9](SessionBuyV2)
100Call event::emit<SessionBuyV2>(SessionBuyV2)
101Ret
}
public borrow_tokens_for_sell<Ty0>(Arg0: &mut AgentSession, Arg1: u64, Arg2: &Clock, Arg3: &mut TxContext): Coin<Ty0> * TradeTicket {
L4: loc0: TypeName
L5: loc1: TradeTicket
L6: loc2: Coin<Ty0>
B0:
0CopyLoc[0](Arg0: &mut AgentSession)
1FreezeRef
2Call assert_session_version(&AgentSession)
3CopyLoc[0](Arg0: &mut AgentSession)
4FreezeRef
5MoveLoc[2](Arg2: &Clock)
6CopyLoc[3](Arg3: &mut TxContext)
7FreezeRef
8Call assert_can_trade(&AgentSession, &Clock, &TxContext)
9CopyLoc[0](Arg0: &mut AgentSession)
10FreezeRef
11Call universal_trading_enabled(&AgentSession): bool
12BrFalse(14)
B1:
13Branch(20)
B2:
14MoveLoc[0](Arg0: &mut AgentSession)
15Pop
16MoveLoc[3](Arg3: &mut TxContext)
17Pop
18LdConst[10](u64: 11)
19Abort
B3:
20Call type_name::with_defining_ids<Ty0>(): TypeName
21StLoc[4](loc0: TypeName)
22CopyLoc[0](Arg0: &mut AgentSession)
23MutBorrowField[10](AgentSession.id: UID)
24MoveLoc[4](loc0: TypeName)
25Call dynamic_object_field::borrow_mut<TypeName, Coin<Ty0>>(&mut UID, TypeName): &mut Coin<Ty0>
26CopyLoc[1](Arg1: u64)
27MoveLoc[3](Arg3: &mut TxContext)
28Call coin::split<Ty0>(&mut Coin<Ty0>, u64, &mut TxContext): Coin<Ty0>
29StLoc[6](loc2: Coin<Ty0>)
30MoveLoc[0](Arg0: &mut AgentSession)
31FreezeRef
32Call object::id<AgentSession>(&AgentSession): ID
33MoveLoc[1](Arg1: u64)
34LdConst[20](u8: 1)
35Pack[1](TradeTicket)
36StLoc[5](loc1: TradeTicket)
37MoveLoc[6](loc2: Coin<Ty0>)
38MoveLoc[5](loc1: TradeTicket)
39Ret
}
public settle_sell<Ty0>(Arg0: &mut AgentSession, Arg1: TradeTicket, Arg2: Coin<SUI>, Arg3: Coin<Ty0>, Arg4: &mut TxContext) {
L5: loc0: u64
L6: loc1: u8
B0:
0CopyLoc[0](Arg0: &mut AgentSession)
1FreezeRef
2Call assert_session_version(&AgentSession)
3MoveLoc[1](Arg1: TradeTicket)
4Unpack[1](TradeTicket)
5StLoc[6](loc1: u8)
6Pop
7CopyLoc[0](Arg0: &mut AgentSession)
8FreezeRef
9Call object::id<AgentSession>(&AgentSession): ID
10Eq
11BrFalse(13)
B1:
12Branch(17)
B2:
13MoveLoc[0](Arg0: &mut AgentSession)
14Pop
15LdConst[8](u64: 9)
16Abort
B3:
17MoveLoc[6](loc1: u8)
18LdConst[20](u8: 1)
19Eq
20BrFalse(22)
B4:
21Branch(26)
B5:
22MoveLoc[0](Arg0: &mut AgentSession)
23Pop
24LdConst[9](u64: 10)
25Abort
B6:
26ImmBorrowLoc[2](Arg2: Coin<SUI>)
27Call coin::value<SUI>(&Coin<SUI>): u64
28StLoc[5](loc0: u64)
29CopyLoc[0](Arg0: &mut AgentSession)
30MutBorrowField[1](AgentSession.escrow: Balance<SUI>)
31MoveLoc[2](Arg2: Coin<SUI>)
32Call coin::into_balance<SUI>(Coin<SUI>): Balance<SUI>
33Call balance::join<SUI>(&mut Balance<SUI>, Balance<SUI>): u64
34Pop
35CopyLoc[0](Arg0: &mut AgentSession)
36CopyLoc[5](loc0: u64)
37Call credit_spent(&mut AgentSession, u64)
38CopyLoc[0](Arg0: &mut AgentSession)
39MoveLoc[3](Arg3: Coin<Ty0>)
40Call park_tokens<Ty0>(&mut AgentSession, Coin<Ty0>)
41CopyLoc[0](Arg0: &mut AgentSession)
42FreezeRef
43Call object::id<AgentSession>(&AgentSession): ID
44CopyLoc[5](loc0: u64)
45CopyLoc[0](Arg0: &mut AgentSession)
46ImmBorrowField[1](AgentSession.escrow: Balance<SUI>)
47Call balance::value<SUI>(&Balance<SUI>): u64
48Pack[7](SessionSell)
49Call event::emit<SessionSell>(SessionSell)
50CopyLoc[0](Arg0: &mut AgentSession)
51FreezeRef
52Call object::id<AgentSession>(&AgentSession): ID
53MoveLoc[5](loc0: u64)
54CopyLoc[0](Arg0: &mut AgentSession)
55ImmBorrowField[7](AgentSession.spent: u64)
56ReadRef
57MoveLoc[0](Arg0: &mut AgentSession)
58ImmBorrowField[1](AgentSession.escrow: Balance<SUI>)
59Call balance::value<SUI>(&Balance<SUI>): u64
60LdTrue
61Pack[10](SessionSellV2)
62Call event::emit<SessionSellV2>(SessionSellV2)
63Ret
}
public revoke_session(Arg0: &mut AgentSession, Arg1: &TxContext) {
B0:
0MoveLoc[1](Arg1: &TxContext)
1Call tx_context::sender(&TxContext): address
2CopyLoc[0](Arg0: &mut AgentSession)
3ImmBorrowField[0](AgentSession.owner: address)
4ReadRef
5Eq
6BrFalse(8)
B1:
7Branch(12)
B2:
8MoveLoc[0](Arg0: &mut AgentSession)
9Pop
10LdConst[5](u64: 6)
11Abort
B3:
12LdTrue
13MoveLoc[0](Arg0: &mut AgentSession)
14MutBorrowField[5](AgentSession.revoked: bool)
15WriteRef
16Ret
}
public close_session(Arg0: &mut AgentSession, Arg1: &mut TxContext): Coin<SUI> {
L2: loc0: u64
L3: loc1: Coin<SUI>
B0:
0CopyLoc[1](Arg1: &mut TxContext)
1FreezeRef
2Call tx_context::sender(&TxContext): address
3CopyLoc[0](Arg0: &mut AgentSession)
4ImmBorrowField[0](AgentSession.owner: address)
5ReadRef
6Eq
7BrFalse(9)
B1:
8Branch(15)
B2:
9MoveLoc[0](Arg0: &mut AgentSession)
10Pop
11MoveLoc[1](Arg1: &mut TxContext)
12Pop
13LdConst[5](u64: 6)
14Abort
B3:
15CopyLoc[0](Arg0: &mut AgentSession)
16FreezeRef
17Call is_closed(&AgentSession): bool
18Not
19BrFalse(21)
B4:
20Branch(27)
B5:
21MoveLoc[0](Arg0: &mut AgentSession)
22Pop
23MoveLoc[1](Arg1: &mut TxContext)
24Pop
25LdConst[16](u64: 17)
26Abort
B6:
27LdTrue
28CopyLoc[0](Arg0: &mut AgentSession)
29MutBorrowField[5](AgentSession.revoked: bool)
30WriteRef
31LdU64(0)
32CopyLoc[0](Arg0: &mut AgentSession)
33MutBorrowField[6](AgentSession.expiry_ms: u64)
34WriteRef
35CopyLoc[0](Arg0: &mut AgentSession)
36ImmBorrowField[1](AgentSession.escrow: Balance<SUI>)
37Call balance::value<SUI>(&Balance<SUI>): u64
38StLoc[2](loc0: u64)
39CopyLoc[0](Arg0: &mut AgentSession)
40MutBorrowField[1](AgentSession.escrow: Balance<SUI>)
41CopyLoc[2](loc0: u64)
42Call balance::split<SUI>(&mut Balance<SUI>, u64): Balance<SUI>
43MoveLoc[1](Arg1: &mut TxContext)
44Call coin::from_balance<SUI>(Balance<SUI>, &mut TxContext): Coin<SUI>
45StLoc[3](loc1: Coin<SUI>)
46MoveLoc[0](Arg0: &mut AgentSession)
47FreezeRef
48Call object::id<AgentSession>(&AgentSession): ID
49MoveLoc[2](loc0: u64)
50Pack[8](SessionClosed)
51Call event::emit<SessionClosed>(SessionClosed)
52MoveLoc[3](loc1: Coin<SUI>)
53Ret
}
public expire_refund(Arg0: &mut AgentSession, Arg1: &Clock, Arg2: &mut TxContext) {
L3: loc0: u64
B0:
0CopyLoc[0](Arg0: &mut AgentSession)
1FreezeRef
2Call is_closed(&AgentSession): bool
3BrFalse(19)
B1:
4MoveLoc[1](Arg1: &Clock)
5Pop
6CopyLoc[0](Arg0: &mut AgentSession)
7ImmBorrowField[1](AgentSession.escrow: Balance<SUI>)
8Call balance::value<SUI>(&Balance<SUI>): u64
9LdU64(0)
10Gt
11BrFalse(13)
B2:
12Branch(33)
B3:
13MoveLoc[0](Arg0: &mut AgentSession)
14Pop
15MoveLoc[2](Arg2: &mut TxContext)
16Pop
17LdConst[16](u64: 17)
18Abort
B4:
19MoveLoc[1](Arg1: &Clock)
20Call clock::timestamp_ms(&Clock): u64
21CopyLoc[0](Arg0: &mut AgentSession)
22ImmBorrowField[6](AgentSession.expiry_ms: u64)
23ReadRef
24Ge
25BrFalse(27)
B5:
26Branch(33)
B6:
27MoveLoc[0](Arg0: &mut AgentSession)
28Pop
29MoveLoc[2](Arg2: &mut TxContext)
30Pop
31LdConst[6](u64: 7)
32Abort
B7:
33LdTrue
34CopyLoc[0](Arg0: &mut AgentSession)
35MutBorrowField[5](AgentSession.revoked: bool)
36WriteRef
37LdU64(0)
38CopyLoc[0](Arg0: &mut AgentSession)
39MutBorrowField[6](AgentSession.expiry_ms: u64)
40WriteRef
41CopyLoc[0](Arg0: &mut AgentSession)
42ImmBorrowField[1](AgentSession.escrow: Balance<SUI>)
43Call balance::value<SUI>(&Balance<SUI>): u64
44StLoc[3](loc0: u64)
45CopyLoc[0](Arg0: &mut AgentSession)
46MutBorrowField[1](AgentSession.escrow: Balance<SUI>)
47CopyLoc[3](loc0: u64)
48Call balance::split<SUI>(&mut Balance<SUI>, u64): Balance<SUI>
49MoveLoc[2](Arg2: &mut TxContext)
50Call coin::from_balance<SUI>(Balance<SUI>, &mut TxContext): Coin<SUI>
51CopyLoc[0](Arg0: &mut AgentSession)
52ImmBorrowField[0](AgentSession.owner: address)
53ReadRef
54Call transfer::public_transfer<Coin<SUI>>(Coin<SUI>, address)
55MoveLoc[0](Arg0: &mut AgentSession)
56FreezeRef
57Call object::id<AgentSession>(&AgentSession): ID
58MoveLoc[3](loc0: u64)
59Pack[8](SessionClosed)
60Call event::emit<SessionClosed>(SessionClosed)
61Ret
}
public sweep_token<Ty0>(Arg0: &mut AgentSession, Arg1: &mut TxContext) {
L2: loc0: TypeName
B0:
0MoveLoc[1](Arg1: &mut TxContext)
1FreezeRef
2Call tx_context::sender(&TxContext): address
3CopyLoc[0](Arg0: &mut AgentSession)
4ImmBorrowField[0](AgentSession.owner: address)
5ReadRef
6Eq
7BrFalse(9)
B1:
8Branch(13)
B2:
9MoveLoc[0](Arg0: &mut AgentSession)
10Pop
11LdConst[5](u64: 6)
12Abort
B3:
13Call type_name::with_defining_ids<Ty0>(): TypeName
14StLoc[2](loc0: TypeName)
15CopyLoc[0](Arg0: &mut AgentSession)
16MutBorrowField[10](AgentSession.id: UID)
17MoveLoc[2](loc0: TypeName)
18Call dynamic_object_field::remove<TypeName, Coin<Ty0>>(&mut UID, TypeName): Coin<Ty0>
19MoveLoc[0](Arg0: &mut AgentSession)
20ImmBorrowField[0](AgentSession.owner: address)
21ReadRef
22Call transfer::public_transfer<Coin<Ty0>>(Coin<Ty0>, address)
23Ret
}
public owner(Arg0: &AgentSession): address {
B0:
0MoveLoc[0](Arg0: &AgentSession)
1ImmBorrowField[0](AgentSession.owner: address)
2ReadRef
3Ret
}
public session_address(Arg0: &AgentSession): address {
B0:
0MoveLoc[0](Arg0: &AgentSession)
1ImmBorrowField[4](AgentSession.session_address: address)
2ReadRef
3Ret
}
public escrow_value(Arg0: &AgentSession): u64 {
B0:
0MoveLoc[0](Arg0: &AgentSession)
1ImmBorrowField[1](AgentSession.escrow: Balance<SUI>)
2Call balance::value<SUI>(&Balance<SUI>): u64
3Ret
}
public spent(Arg0: &AgentSession): u64 {
B0:
0MoveLoc[0](Arg0: &AgentSession)
1ImmBorrowField[7](AgentSession.spent: u64)
2ReadRef
3Ret
}
public spend_cap(Arg0: &AgentSession): u64 {
B0:
0MoveLoc[0](Arg0: &AgentSession)
1ImmBorrowField[8](AgentSession.spend_cap: u64)
2ReadRef
3Ret
}
public expiry_ms(Arg0: &AgentSession): u64 {
B0:
0MoveLoc[0](Arg0: &AgentSession)
1ImmBorrowField[6](AgentSession.expiry_ms: u64)
2ReadRef
3Ret
}
public revoked(Arg0: &AgentSession): bool {
B0:
0MoveLoc[0](Arg0: &AgentSession)
1ImmBorrowField[5](AgentSession.revoked: bool)
2ReadRef
3Ret
}
public is_closed(Arg0: &AgentSession): bool {
B0:
0MoveLoc[0](Arg0: &AgentSession)
1ImmBorrowField[6](AgentSession.expiry_ms: u64)
2ReadRef
3LdU64(0)
4Eq
5Ret
}
public parked_balance<Ty0>(Arg0: &AgentSession): u64 {
L1: loc0: TypeName
B0:
0Call type_name::with_defining_ids<Ty0>(): TypeName
1StLoc[1](loc0: TypeName)
2CopyLoc[0](Arg0: &AgentSession)
3ImmBorrowField[10](AgentSession.id: UID)
4CopyLoc[1](loc0: TypeName)
5Call dynamic_object_field::exists<TypeName>(&UID, TypeName): bool
6Not
7BrFalse(12)
B1:
8MoveLoc[0](Arg0: &AgentSession)
9Pop
10LdU64(0)
11Ret
B2:
12MoveLoc[0](Arg0: &AgentSession)
13ImmBorrowField[10](AgentSession.id: UID)
14MoveLoc[1](loc0: TypeName)
15Call dynamic_object_field::borrow<TypeName, Coin<Ty0>>(&UID, TypeName): &Coin<Ty0>
16Call coin::value<Ty0>(&Coin<Ty0>): u64
17Ret
}
public lifetime_spent(Arg0: &AgentSession): u64 {
B0:
0MoveLoc[0](Arg0: &AgentSession)
1ImmBorrowField[3](AgentSession.lifetime_spent: u64)
2ReadRef
3Ret
}
public lifetime_cap(Arg0: &AgentSession): u64 {
B0:
0MoveLoc[0](Arg0: &AgentSession)
1ImmBorrowField[2](AgentSession.lifetime_cap: u64)
2ReadRef
3Ret
}
public version(Arg0: &AgentSession): u64 {
B0:
0MoveLoc[0](Arg0: &AgentSession)
1ImmBorrowField[9](AgentSession.version: u64)
2ReadRef
3Ret
}
public current_version(): u64 {
B0:
0LdConst[0](u64: 1)
1Ret
}
Constants [
0 => u64: 1
1 => u64: 2
2 => u64: 3
3 => u64: 4
4 => u64: 5
5 => u64: 6
6 => u64: 7
7 => u64: 8
8 => u64: 9
9 => u64: 10
10 => u64: 11
11 => u64: 12
12 => u64: 13
13 => u64: 14
14 => u64: 15
15 => u64: 16
16 => u64: 17
17 => u64: 18
18 => u64: 2592000000
19 => u8: 0
20 => u8: 1
21 => vector<u8>: "universal_trading" // interpreted as UTF8 string
]
}