@staticmethod<EOL><INDENT>def _serialize_uint(value, size=<NUM_LIT:32>, padding=<NUM_LIT:0>):<DEDENT>
if size <= <NUM_LIT:0> or size > <NUM_LIT:32>:<EOL><INDENT>raise ValueError<EOL><DEDENT>from .account import EVMAccount  <EOL>if not isinstance(value, (int, BitVec, EVMAccount)):<EOL><INDENT>raise ValueError<EOL><DEDENT>if issymbolic(value):<EOL><INDENT>bytes = ArrayVariable(index_bits=<NUM_LIT>, index_max=<NUM_LIT:32>, value_bits=<NUM_LIT:8>, name='<STR_LIT>'.format(uuid.uuid1()))<EOL>if value.size <= size * <NUM_LIT:8>:<EOL><INDENT>value = Operators.ZEXTEND(value, size * <NUM_LIT:8>)<EOL><DEDENT>else:<EOL><INDENT>value = Operators.EXTRACT(value, <NUM_LIT:0>, size * <NUM_LIT:8>)<EOL><DEDENT>bytes = ArrayProxy(bytes.write_BE(padding, value, size))<EOL><DEDENT>else:<EOL><INDENT>value = int(value)<EOL>bytes = bytearray()<EOL>for _ in range(padding):<EOL><INDENT>bytes.append(<NUM_LIT:0>)<EOL><DEDENT>for position in reversed(range(size)):<EOL><INDENT>bytes.append(Operators.EXTRACT(value, position * <NUM_LIT:8>, <NUM_LIT:8>))<EOL><DEDENT><DEDENT>assert len(bytes) == size + padding<EOL>return bytes<EOL>
Translates a python integral or a BitVec into a 32 byte string, MSB first