For example if I have the following code:

sp.record(one = one, two = two, three = three, four = four, five = five)

Would the format of the result be

pair(one pair(two pair(three pair(four five)))) or pair( pair(one two) pair(three pair(four five)) or something else?

What is the rule behind the ordering? And is there a quick way to view it in SmartPy? Thanks

1 Answer 1


The format is called a layout in SmartPy.

Layouts are attached to types and can be determined when you define a sp.TRecord (you can look at templates FA2 and FA1.2 for examples). A default layout is currently computed as a binary tree of alphabetically sorted field names.

To see the computed layout, you can look at the Types tab that shows the types including their layouts.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.