assume_native_balance

Declares an exact native-token balance used to evaluate a PROGRAM offline.

Example

Local

1
WITH actors AS (
2
SELECT
3
'0x1000000000000000000000000000000000000001'::ADDRESS AS sender,
4
'0x2000000000000000000000000000000000000002'::ADDRESS AS writer
5
),
6
authored AS (
7
SELECT [
8
-- Funds the one-Wei transfer in step zero.
9
assume_native_balance(sender, 1000000::UINT256, 'funds step value transfer'::VARCHAR),
10
-- Supplies the transaction context consumed by step zero.
11
assume_nonce(sender, 0::UBIGINT, 'step sender nonce'::VARCHAR),
12
assume_no_code(sender, 'step sender is an EOA'::VARCHAR),
13
assume_native_balance(writer, 0::UINT256, 'receives step value'::VARCHAR),
14
assume_nonce(writer, 0::UBIGINT, 'call target nonce'::VARCHAR),
15
-- This runtime consumes calldata and stores its first word.
16
assume_code(writer, '0x60003560005500'::BYTES, 'step code stores calldata word'::VARCHAR),
17
assume_storage(
18
writer,
19
'0x0000000000000000000000000000000000000000000000000000000000000000'::BYTES32,
20
'0x0000000000000000000000000000000000000000000000000000000000000000'::BYTES32,
21
'step writes slot zero'::VARCHAR
22
)
23
] AS assumptions,
24
execute_call(
25
sender,
26
writer,
27
'0x000000000000000000000000000000000000000000000000000000000000002a'::BYTES,
28
1::UINT256,
29
100000::UBIGINT
30
) AS step
31
FROM actors
32
),
33
candidate AS (
34
SELECT program(assumptions, [step]) AS program, assumptions
35
FROM authored
36
)
37
SELECT
38
len(assumptions)::INTEGER AS assumption_count,
39
program IS NOT NULL AS runnable
40
FROM candidate;
41
-- => [{"assumption_count":7,"runnable":"true"}]
Notebook ready in readonly mode.

API reference

Exact signatures with descriptions, requirements, inputs, returns, and examples.

assume_native_balance(ADDRESS, UINT256, VARCHAR) #

Declares an exact native-token balance used to evaluate a PROGRAM offline.

Inputs

Name Type Use
address ADDRESS

Required typed SQL value committed to the authored assumption.

required positional
amount UINT256

Required typed SQL value committed to the authored assumption.

required positional
reason VARCHAR

Required valid UTF-8 audit reason; committed to the assumption manifest, not its semantic root.

required positional

Returns

Name Type
assumption ASSUMPTION

Typed ASSUMPTION authoring value. Returns one canonical typed value. Construction does not execute EVM code, contact RPC, or publish evidence.

Guidance

Behavior and consumption

Authors one typed value for later PROGRAM assembly or run consumption; it does not execute or publish.

Validation and failure timing

SQL types bind first; widths, ABI selection, duplicates, empty programs, and selectors validate when the constructor executes.

Determinism, network, and side effects

Construction is deterministic and offline: no RPC, chain mutation, or evidence write.

Use and do not use

Use it to author PROGRAM input, not as proof of execution or future success.

Related functions

Category and tags

Category
Simulation
Tag
Simulate