示例#1
0
 def fn_mixed_annotations_0_with_ret(a: pt.ScratchVar, b: pt.Expr,
                                     c: pt.abi.Byte, *,
                                     output: pt.abi.Uint64) -> pt.Expr:
     return pt.Seq(
         a.store(c.get() * pt.Int(0x0FF1CE) * b),
         output.set(a.load()),
     )
示例#2
0
def many_args(
    _a: pt.abi.Uint64,
    _b: pt.abi.Uint64,
    _c: pt.abi.Uint64,
    _d: pt.abi.Uint64,
    _e: pt.abi.Uint64,
    _f: pt.abi.Uint64,
    _g: pt.abi.Uint64,
    _h: pt.abi.Uint64,
    _i: pt.abi.Uint64,
    _j: pt.abi.Uint64,
    _k: pt.abi.Uint64,
    _l: pt.abi.Uint64,
    _m: pt.abi.Uint64,
    _n: pt.abi.Uint64,
    _o: pt.abi.Uint64,
    _p: pt.abi.Uint64,
    _q: pt.abi.Uint64,
    _r: pt.abi.Uint64,
    _s: pt.abi.Uint64,
    _t: pt.abi.Uint64,
    *,
    output: pt.abi.Uint64,
) -> pt.Expr:
    return output.set(_t.get())
示例#3
0
def multiple_txn(
    appl: pt.abi.ApplicationCallTransaction,
    axfer: pt.abi.AssetTransferTransaction,
    pay: pt.abi.PaymentTransaction,
    any_txn: pt.abi.Transaction,
    *,
    output: pt.abi.Uint64,
):
    return output.set(
        appl.get().fee() + axfer.get().fee() + pay.get().fee() + any_txn.get().fee()
    )
示例#4
0
 def fn_0arg_uint64_ret(*, output: pt.abi.Uint64) -> pt.Expr:
     return output.set(1)
示例#5
0
 def fn_ret_add(a: pt.abi.Uint64, b: pt.abi.Uint32, *,
                output: pt.abi.Uint64) -> pt.Expr:
     return output.set(a.get() + b.get() + pt.Int(0xA190))
示例#6
0
 def fn_1arg_1ret(a: pt.abi.Uint64, *, output: pt.abi.Uint64) -> pt.Expr:
     return output.set(a)
示例#7
0
def mod(a: pt.abi.Uint64, b: pt.abi.Uint64, *, output: pt.abi.Uint64) -> pt.Expr:
    return output.set(a.get() % b.get())
示例#8
0
def div(a: pt.abi.Uint64, b: pt.abi.Uint64, *, output: pt.abi.Uint64) -> pt.Expr:
    return output.set(a.get() / b.get())
示例#9
0
def sub(a: pt.abi.Uint64, b: pt.abi.Uint64, *, output: pt.abi.Uint64) -> pt.Expr:
    """replace me"""
    return output.set(a.get() - b.get())
示例#10
0
def txn_amount(t: pt.abi.PaymentTransaction, *, output: pt.abi.Uint64):
    return output.set(t.get().amount())
示例#11
0
def not_registrable(lhs: pt.abi.Uint64, rhs: pt.Expr, *, output: pt.abi.Uint64):
    return output.set(lhs.get() * rhs)
示例#12
0
def eine_constant(*, output: pt.abi.Uint64):
    return output.set(1)
示例#13
0
def add(a: pt.abi.Uint64, b: pt.abi.Uint64, *, output: pt.abi.Uint64) -> pt.Expr:
    """add takes 2 integers a,b and adds them, returning the sum"""
    return output.set(a.get() + b.get())
示例#14
0
def fn_2mixed_arg_1ret(a: pt.abi.Uint64, b: pt.ScratchVar, *,
                       output: pt.abi.Uint64) -> pt.Expr:
    return pt.Seq(b.store(a.encode()), output.set(a))
示例#15
0
def fn_1tt_arg_uint64_ret(x, *, output: pt.abi.Uint64) -> pt.Expr:
    return output.set(1)