Skip to content
This repository was archived by the owner on Nov 10, 2023. It is now read-only.

Conversation

@juampibermani
Copy link
Contributor

@juampibermani juampibermani commented Aug 19, 2021

What it solves

Resolves #2397

How this PR fixes it

We display a table containing the transaction guard information with a button to delete the transaction guard

Creating the PR as draft since i'm not sure how ModulePair works and how to set a transaction guard

How to test it

⚠️ Adding a guard could lock the safe if this isn't done correctly. Usually you would deploy a guard for yourself and have some handling mechanism. For the Guard we were provided for testing purposes, is owner by shared QA testing account, so can be handled by this account. This guard will prevent any operation within a Safe unless explicitly enabled in the Guard.

⚠️ In order to be able to remove the Guard you need to enable in the guard the possibility for the safe to execute transactions to itself.

1.- Make sure you have access to TestOwner key or check with Liliy
2.- Use the transaction builder to create a transaction using setGuard method of your safe configuring this safe Guard 0x4f8a82d73729A33E0165aDeF3450A7F85f007528
3.- After correctly enabling the guard test that now its showed under Settings -> Advanced
4.- Check that currently you can't execute any transactions with your safe. Try a send funds or any settings change and you won't be able to do anything
5.- When you are ready you can go here and add your safeAddress to "allowTarget" function and submit the transaction so it's stored in the Guard
6.- BONUS try to enable and disable some functions at different points in the guard and check that the safe behaves as expected. To remove the guard make sure that "allowTarget" contains your safeAddress and you will be able to remove the Guard

@juampibermani juampibermani added this to the 3.13.0 milestone Aug 19, 2021
@github-actions
Copy link

github-actions bot commented Aug 19, 2021

CLA Assistant Lite All Contributors have signed the CLA.

@github-actions
Copy link

github-actions bot commented Aug 19, 2021

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 2 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

@juampibermani juampibermani marked this pull request as ready for review August 24, 2021 16:15
@juampibermani
Copy link
Contributor Author

@juampibermani juampibermani added the Blocked 🤷 Blocked by external dependencies label Aug 24, 2021
@katspaugh katspaugh modified the milestones: 3.13.0, 3.14.0 Aug 26, 2021
@dasanra
Copy link
Collaborator

dasanra commented Aug 26, 2021

@juampibermani published the updated library version, should be unbloked now
c49f2c0

@github-actions
Copy link

@github-actions
Copy link

@github-actions
Copy link

@github-actions
Copy link

E2E Tests Passed
Check the results here: https://github.com/gnosis/safe-react-e2e-tests/actions/runs/1169832649

}}
</EditableTxParameters>
</Modal>
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a lot of code duplication from the Review modal. For this PR it's fine but we should definitely think of a way to reuse the same code for tx popups.

@katspaugh katspaugh requested a review from mmv08 August 26, 2021 09:25
.
</InfoText>

{!guard ? <NoTransactionGuardLegend /> : <TransactionGuard address={guard} />}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: I'd put NoTransactionGuardLegend inside the TransactionGuard component. If we keep implementing the same logic inside this component for each field we have, it might get dirty

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll change this when we improve the reuse of components for modules and guard

return (
<>
<TableContainer>
<Table columns={columns} data={[address]} defaultFixed disablePagination label="Modules" noBorder>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know it was written on the ticket, but we don't really need a table there. It makes things complicated. There's only one transaction guard per safe, so it will always use 1 row.

This is not required, but you can think about how we can remove it if you want.

@dasanra dasanra removed the Blocked 🤷 Blocked by external dependencies label Aug 26, 2021
@github-actions
Copy link

E2E Tests Passed
Check the results here: https://github.com/gnosis/safe-react-e2e-tests/actions/runs/1170213422

@github-actions
Copy link

E2E Tests Passed
Check the results here: https://github.com/gnosis/safe-react-e2e-tests/actions/runs/1171228493

@github-actions
Copy link

E2E Tests Passed
Check the results here: https://github.com/gnosis/safe-react-e2e-tests/actions/runs/1174566162

@github-actions
Copy link

E2E Tests Passed
Check the results here: https://github.com/gnosis/safe-react-e2e-tests/actions/runs/1174623186

@github-actions
Copy link

E2E Tests Passed
Check the results here: https://github.com/gnosis/safe-react-e2e-tests/actions/runs/1174651866

@francovenica
Copy link
Contributor

Safe and env :https://pr2662--safereact.review.gnosisdev.com/rinkeby/app/#/safes/0x6E94311ab6964E53aa319Dc106836fBE8aEB142D/transactions

According of what Dani told me, the scope of the ticket is make sure that the user is able to setUp the guard, that is registered as one (not as a random module) and that can be deleted.

We tested using the guard in the description 0x4f8a82d73729A33E0165aDeF3450A7F85f007528, which owner is this MM account 0xF2CeA96575d6b10f51d9aF3b10e3e4E5738aa6bd

Test steps done:
Created a safe
Enable the guard using the method "setGuard" using the ABI of the MasterCopy for 1.3.0. This guard in particular blocks any type of tx that is not directed to a whitelisted address.
As this point trying to delete the module will fail, since the address of the safe itself is not whitelisted
in Etherescan I used the owner of the guard and used the method "allowTarget" to set the safe itself.
With this the safe was able to delete the guard
I was able to enable the guard once again, now whitelisting a test contract 0x49d4450977E2c95362C13D3a31a09311E0Ea26A6
Tried to use that test contract to execute a dummy tx. It worked fine

Looks good to me

@github-actions
Copy link

github-actions bot commented Sep 2, 2021

E2E Tests Passed
Check the results here: https://github.com/gnosis/safe-react-e2e-tests/actions/runs/1194672825

@katspaugh katspaugh merged commit a2d229d into dev Sep 13, 2021
@katspaugh katspaugh deleted the feature/2397-display-guard-information-in-settings branch September 13, 2021 09:13
@github-actions github-actions bot locked and limited conversation to collaborators Sep 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Display guard information in settings

7 participants