algo/patch2: optins cannot have arguments
This commit is contained in:
parent
d3d68fde26
commit
d724d42cf1
|
@ -984,14 +984,14 @@ def approve_token_bridge(seed_amt: int, tmpl_sig: TmplSig, devMode: bool):
|
||||||
# Check that we're paying it
|
# Check that we're paying it
|
||||||
algo_seed.type_enum() == TxnType.Payment,
|
algo_seed.type_enum() == TxnType.Payment,
|
||||||
algo_seed.amount() == Int(seed_amt),
|
algo_seed.amount() == Int(seed_amt),
|
||||||
|
algo_seed.receiver() == optin.sender(),
|
||||||
|
|
||||||
# Check that its an opt in to us
|
# Check that its an opt in to us
|
||||||
optin.type_enum() == TxnType.ApplicationCall,
|
optin.type_enum() == TxnType.ApplicationCall,
|
||||||
optin.on_completion() == OnComplete.OptIn,
|
optin.on_completion() == OnComplete.OptIn,
|
||||||
|
|
||||||
optin.application_id() == Global.current_application_id(),
|
optin.application_id() == Global.current_application_id(),
|
||||||
|
optin.rekey_to() == Global.current_application_address(),
|
||||||
algo_seed.receiver() == optin.sender(),
|
optin.application_args.length() == Int(0)
|
||||||
optin.rekey_to() == Global.current_application_address()
|
|
||||||
)
|
)
|
||||||
|
|
||||||
return Seq(
|
return Seq(
|
||||||
|
|
|
@ -127,14 +127,14 @@ def getCoreContracts( genTeal, approve_name, clear_name,
|
||||||
# Check that we're paying it
|
# Check that we're paying it
|
||||||
algo_seed.type_enum() == TxnType.Payment,
|
algo_seed.type_enum() == TxnType.Payment,
|
||||||
algo_seed.amount() == Int(seed_amt),
|
algo_seed.amount() == Int(seed_amt),
|
||||||
|
algo_seed.receiver() == optin.sender(),
|
||||||
# Check that its an opt in to us
|
# Check that its an opt in to us
|
||||||
optin.type_enum() == TxnType.ApplicationCall,
|
optin.type_enum() == TxnType.ApplicationCall,
|
||||||
optin.on_completion() == OnComplete.OptIn,
|
optin.on_completion() == OnComplete.OptIn,
|
||||||
# Not strictly necessary since we wouldn't be seeing this unless it was us, but...
|
# Not strictly necessary since we wouldn't be seeing this unless it was us, but...
|
||||||
optin.application_id() == Global.current_application_id(),
|
optin.application_id() == Global.current_application_id(),
|
||||||
|
optin.rekey_to() == Global.current_application_address(),
|
||||||
algo_seed.receiver() == optin.sender(),
|
optin.application_args.length() == Int(0)
|
||||||
optin.rekey_to() == Global.current_application_address()
|
|
||||||
)
|
)
|
||||||
|
|
||||||
return Seq(
|
return Seq(
|
||||||
|
@ -460,6 +460,9 @@ def getCoreContracts( genTeal, approve_name, clear_name,
|
||||||
# What signatures did this verifySigs check?
|
# What signatures did this verifySigs check?
|
||||||
s.store(Gtxn[i.load()].application_args[1]),
|
s.store(Gtxn[i.load()].application_args[1]),
|
||||||
|
|
||||||
|
# Make sure we bail earlier on incorrect arguments...
|
||||||
|
MagicAssert(Len(s.load()) > Int(0)),
|
||||||
|
|
||||||
# Look at the vaa and confirm those were the expected signatures we should have been checking
|
# Look at the vaa and confirm those were the expected signatures we should have been checking
|
||||||
# at this point in the process
|
# at this point in the process
|
||||||
MagicAssert(Extract(Txn.application_args[1], off.load(), Len(s.load())) == s.load()),
|
MagicAssert(Extract(Txn.application_args[1], off.load(), Len(s.load())) == s.load()),
|
||||||
|
|
Loading…
Reference in New Issue