algo/audit: Fix KS-RL-02 @ gusc1a-ossdev-jsl5

This commit is contained in:
Josh Siegel 2022-07-26 15:06:17 +00:00 committed by jumpsiegel
parent 3a0a39a961
commit 44ceda5e10
1 changed files with 4 additions and 1 deletions

View File

@ -213,7 +213,6 @@ def getCoreContracts( genTeal, approve_name, clear_name,
# What is the target of this governance message? # What is the target of this governance message?
tchain.store(Extract(Txn.application_args[1], off.load() + Int(1), Int(2))), tchain.store(Extract(Txn.application_args[1], off.load() + Int(1), Int(2))),
# Needs to point at us or to all chains # Needs to point at us or to all chains
MagicAssert(Or(tchain.load() == Bytes("base16", "0008"), tchain.load() == Bytes("base16", "0000"))),
a.store(Btoi(Extract(Txn.application_args[1], off.load(), Int(1)))), a.store(Btoi(Extract(Txn.application_args[1], off.load(), Int(1)))),
Cond( Cond(
@ -222,6 +221,8 @@ def getCoreContracts( genTeal, approve_name, clear_name,
# #
# In the case of Algorand, it contains the hash of the program that we are allowed to upgrade ourselves to. We would then run the upgrade program itself # In the case of Algorand, it contains the hash of the program that we are allowed to upgrade ourselves to. We would then run the upgrade program itself
# to perform the actual upgrade # to perform the actual upgrade
MagicAssert(tchain.load() == Bytes("base16", "0008")),
off.store(off.load() + Int(3)), off.store(off.load() + Int(3)),
App.globalPut(Bytes("validUpdateApproveHash"), Extract(Txn.application_args[1], off.load(), Int(32))) App.globalPut(Bytes("validUpdateApproveHash"), Extract(Txn.application_args[1], off.load(), Int(32)))
@ -231,6 +232,8 @@ def getCoreContracts( genTeal, approve_name, clear_name,
# This should point at all chains # This should point at all chains
MagicAssert(Or(tchain.load() == Bytes("base16", "0008"), tchain.load() == Bytes("base16", "0000"))),
# move off to point at the NewGuardianSetIndex and grab it # move off to point at the NewGuardianSetIndex and grab it
off.store(off.load() + Int(3)), off.store(off.load() + Int(3)),
v.store(Extract(Txn.application_args[1], off.load(), Int(4))), v.store(Extract(Txn.application_args[1], off.load(), Int(4))),