Skip to content

Instantly share code, notes, and snippets.

View stechu's full-sized avatar
🎯
Focusing

Shumo Chu stechu

🎯
Focusing
View GitHub Profile
### Keybase proof
I hereby claim:
* I am stechu on github.
* I am xerophyte (https://keybase.io/xerophyte) on keybase.
* I have a public key ASACjPBf7vb8veOUfpqgvZN26FAJHUFCswCg6c_w81UNUQo
To claim this, I am signing this object:
@stechu
stechu / periodic_payment.py
Last active February 26, 2020 13:14
Write a Periodic Payment Contract in PyTeal
#!/usr/bin/env python3
from pyteal import *
#template variables
tmpl_fee = Int(1000)
tmpl_period = Int(1000)
tmpl_dur = Int(1000)
tmpl_x = Bytes("base64", "y9OJ5MRLCHQj8GqbikAUKMBI7hom+SOj8dlopNdNHXI=")
tmpl_amt = Int(2000)
periodic_pay_core = And(Txn.type_enum() == Int(1),
Txn.fee() <= tmpl_fee)
periodic_pay_transfer = And(Txn.close_remainder_to() == Global.zero_address(),
Txn.receiver() == tmpl_rcv,
Txn.amount() == tmpl_amt,
Txn.first_valid() % tmpl_period == Int(0),
Txn.last_valid() == tmpl_dur + Txn.first_valid(),
Txn.lease() == tmpl_x)
periodic_pay_close = And(Txn.close_remainder_to() == tmpl_rcv,
Txn.receiver() == Global.zero_address(),
Txn.first_valid() >= tmpl_timeout,
Txn.amount() == Int(0))
txn TypeEnum
int 1
==
txn Fee
int 1000
<=
&&
txn CloseRemainderTo
global ZeroAddress
==
#!/usr/bin/env python3
from pyteal import *
import uuid, params, base64
from algosdk import algod, transaction, account, mnemonic
from periodic_payment import periodic_pay_escrow
#--------- compile & send transaction using Goal and Python SDK ----------
teal_source = periodic_pay_escrow.teal()
Address of Sender/Delgator: B767GZZJI4YEDKZU62INJGFIGSWQHDIH2HP6NRSSWFTFUYMCNU5LN2M53A
5113319
5113000
5114000
Transaction ID: 5UZ4WQEUCF4P5FC2NGDSAREXS3OVVVKBJ2XRU533VYQV7XLIP3WQ
@stechu
stechu / nocturne-v1_attestation.log
Created October 26, 2023 02:48
Attestation for nocturne-v1 MPC Phase 2 Trusted Setup ceremony
Hey, I'm stechu-720571 and I have contributed to the nocturne-v1 MPC Phase2 Trusted Setup ceremony.
The following are my contribution signatures:
Circuit # 1 (canonaddrsigcheck)
Contributor # 22
Contribution Hash: 23792874 1a9d0673 68aa25c9 8170258e
c15afd90 8e8a53c6 7a4a1879 80ad46d7
f87d17bd 172d13c6 bf418777 9de568af
9871301f f3636ec7 06122bc2 7696e968