From ec691b386767fdb17814d529ae6a73416246fc0d Mon Sep 17 00:00:00 2001 From: Petrovska Date: Fri, 8 Sep 2023 16:14:13 +0200 Subject: [PATCH 1/4] feat: add tests after ownership is transfer to assert behaviours --- .../1277/mint_controller_admin_update.py | 49 +++++++++++++++++-- 1 file changed, 46 insertions(+), 3 deletions(-) diff --git a/scripts/issue/1277/mint_controller_admin_update.py b/scripts/issue/1277/mint_controller_admin_update.py index 3f2a505e..0f246826 100644 --- a/scripts/issue/1277/mint_controller_admin_update.py +++ b/scripts/issue/1277/mint_controller_admin_update.py @@ -1,17 +1,60 @@ +from brownie import accounts + from great_ape_safe import GreatApeSafe from helpers.addresses import r -def main(): +def main(verify_future_state=True): safe = GreatApeSafe(r.badger_wallets.dev_multisig) # contracts controller = safe.contract(r.GatedMiniMeController) timelock_gov = safe.contract(r.governance_timelock) + # tkns + badger = safe.contract(r.treasury_tokens.BADGER) + dai = safe.contract(r.treasury_tokens.DAI) + controller.transferOwnership(timelock_gov) - # guardian setup - timelock_gov.setGuardian(r.badger_wallets.techops_multisig) + if verify_future_state: + tl_gov = accounts.at(r.governance_timelock, force=True) + + # mint + controller.mint(100e18, {"from": tl_gov}) + + assert badger.balanceOf(tl_gov) == 100e18 + + # claim tokens + bal_in_minime = dai.balanceOf(badger) + + controller.claimTokens(r.treasury_tokens.DAI, {"from": tl_gov}) + + assert dai.balanceOf(tl_gov) == bal_in_minime + + # disable minting + controller.disableMinting({"from": tl_gov}) + + assert controller.mintingEnabled() == False + + # transfer ownership + controller.transferOwnership( + r.badger_wallets.treasury_vault_multisig, {"from": tl_gov} + ) + + assert controller.owner() == r.badger_wallets.treasury_vault_multisig + + # erc20 basic samples + holder_one = accounts.at(r.badger_wallets.treasury_vault_multisig, force=True) + holder_two = accounts.at(r.badger_wallets.treasury_ops_multisig, force=True) + + # check basic transfer and balance updates + holder_one_bal_before = badger.balanceOf(holder_one) + holder_two_bal_before = badger.balanceOf(holder_two) + + badger.transfer(holder_two, 5e18, {"from": holder_one}) + + assert badger.balanceOf(holder_two) == holder_two_bal_before + 5e18 + assert badger.balanceOf(holder_one) == holder_one_bal_before - 5e18 safe.post_safe_tx() From 535cc3f3783ae58fde5ffb447044cac79ac3a20e Mon Sep 17 00:00:00 2001 From: sajanrajdev Date: Fri, 8 Sep 2023 15:21:40 +0100 Subject: [PATCH 2/4] chore: add latest votium data --- data/Votium | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/Votium b/data/Votium index 6605c1c8..458c6c4e 160000 --- a/data/Votium +++ b/data/Votium @@ -1 +1 @@ -Subproject commit 6605c1c8ca5fdbe6f09a9d5d07b4fc7a3cddc5c6 +Subproject commit 458c6c4eeefbdd9d01c4433741be4e628b4ee067 From 9d395197e27acd43b4b0994f0e974deedb3a3953 Mon Sep 17 00:00:00 2001 From: sajanrajdev Date: Fri, 8 Sep 2023 15:25:16 +0100 Subject: [PATCH 3/4] Revert "chore: add latest votium data" This reverts commit 535cc3f3783ae58fde5ffb447044cac79ac3a20e. --- data/Votium | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/Votium b/data/Votium index 458c6c4e..6605c1c8 160000 --- a/data/Votium +++ b/data/Votium @@ -1 +1 @@ -Subproject commit 458c6c4eeefbdd9d01c4433741be4e628b4ee067 +Subproject commit 6605c1c8ca5fdbe6f09a9d5d07b4fc7a3cddc5c6 From 0b4b0d1679e05ea7999db4bac834d0b9f933a31c Mon Sep 17 00:00:00 2001 From: Petrovska Date: Mon, 11 Sep 2023 14:49:44 +0200 Subject: [PATCH 4/4] feat: add insight for minted tkn transfer --- .../1277/mint_controller_admin_update.py | 29 +++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/scripts/issue/1277/mint_controller_admin_update.py b/scripts/issue/1277/mint_controller_admin_update.py index 0f246826..28232e21 100644 --- a/scripts/issue/1277/mint_controller_admin_update.py +++ b/scripts/issue/1277/mint_controller_admin_update.py @@ -1,4 +1,6 @@ -from brownie import accounts +from brownie import accounts, chain + +from eth_abi import encode_abi from great_ape_safe import GreatApeSafe from helpers.addresses import r @@ -25,6 +27,26 @@ def main(verify_future_state=True): assert badger.balanceOf(tl_gov) == 100e18 + # ensure tokens can be move from tl + badgerBalBefore = badger.balanceOf(safe) + + calldata = encode_abi( + ["address", "uint256"], + [safe.address, int(100e18)], + ) + eta = chain.time() + int(3 * 60 * 60 * 24) + + timelock_gov.queueTransaction( + badger, 0, "transfer(address,uint256)", calldata, eta + ) + + chain.mine(timestamp=eta + 1) + timelock_gov.executeTransaction( + badger, 0, "transfer(address,uint256)", calldata, eta + ) + + assert badger.balanceOf(safe) == badgerBalBefore + 100e18 + # claim tokens bal_in_minime = dai.balanceOf(badger) @@ -57,4 +79,7 @@ def main(verify_future_state=True): assert badger.balanceOf(holder_two) == holder_two_bal_before + 5e18 assert badger.balanceOf(holder_one) == holder_one_bal_before - 5e18 - safe.post_safe_tx() + if not verify_future_state: + safe.post_safe_tx() + else: + safe.post_safe_tx(skip_preview=True)