2022-11-02 10:03:40 +01:00
|
|
|
global balance:
|
|
|
|
|
// stack: address, retdest
|
2022-10-28 11:15:43 +02:00
|
|
|
%mpt_read_state_trie
|
2022-11-02 10:03:40 +01:00
|
|
|
// stack: account_ptr, retdest
|
|
|
|
|
DUP1 ISZERO %jumpi(retzero) // If the account pointer is null, return 0.
|
2022-10-28 11:15:43 +02:00
|
|
|
%add_const(1)
|
2022-12-06 23:05:47 -08:00
|
|
|
// stack: balance_ptr, retdest
|
2022-10-28 11:15:43 +02:00
|
|
|
%mload_trie_data
|
|
|
|
|
// stack: balance, retdest
|
|
|
|
|
SWAP1 JUMP
|
|
|
|
|
|
2022-11-02 10:03:40 +01:00
|
|
|
retzero:
|
|
|
|
|
%stack (account_ptr, retdest) -> (retdest, 0)
|
|
|
|
|
JUMP
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
global selfbalance:
|
|
|
|
|
// stack: retdest
|
|
|
|
|
%address
|
|
|
|
|
PUSH balance
|
|
|
|
|
// stack: balance, address, retdest
|
|
|
|
|
JUMP
|
|
|
|
|
|