Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
NIC619 committed Sep 11, 2021
1 parent f1590cf commit ac04040
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ Duties of each role:

## Detect and response conditions

- If `setAllowance` sets allowance for unexpected address(es), `pause` the contract immediately
- we would have to maintain the expected address(es) in the `Autotask` scritps
- remeber to update the expected address(es) before doing actual upgrade otherwise it would accidentally `pause` the contract once you upgrade
- If `setAllowance` sets allowance of unexpected token(s), `pause` the contract immediately
- we would have to maintain the expected token(s) in the `Autotask` scritps
- remeber to update the expected token(s) before doing actual upgrade otherwise it would accidentally `pause` the contract once you upgrade
- If `setImportantParam` is set to unexpected values, `pause` the contract immediately
- the same as above, we have to maintain the expected values
- If `upgradeChild` upgrade child contract to an unexpected address, `pause` the contract immediately
Expand Down Expand Up @@ -126,7 +126,11 @@ After contracts are deployed, go set up `Sentinel` and `Autotask` instances.
- `npx hardhat run scripts/upgradeProxyImpl/upgradeTo_UpgradeProxyImplementation.ts --network kovan`
- invoke failed internal function call
- `npx hardhat run scripts/upgradeProxyImpl/fail/fail_internal_upgrade_UpgradeProxyImplementation.ts --network kovan`

- Scripts to trigger sentinel, for example
- trigger by `setAllowance` of unexpected token(s)
- `npx hardhat run scripts/allowance/trigger_sentinel/invalid_token_addr_setAllowance.ts --network kovan`
- trigger by `upgradeChild` to unexpected address(es)
- `npx hardhat run scripts/maintenance/trigger_sentinel/invalid_child_upgradeChild.ts --network kovan`
___

## Deployed contract addresses
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { ethers } from "hardhat"
import { default as prompts } from "prompts"
import { defaultInvalidAllowanceTokenAddr, defaultValidAllowanceTokenAddr, getContractAndOperators } from "../../utils"
import { defaultInvalidAllowanceTokenAddr, getContractAndOperators } from "../../utils"

async function main() {
const [OneRoleAccessControl, , lessSecuredOperator, ] = await getContractAndOperators("OneRoleAccessControl")
Expand Down
6 changes: 4 additions & 2 deletions setupAutotask.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
2. Hit the `Secrets` button and then the `New secret` button to add secrets like private key or RPC api key
- Note that saving private key as secrets in Autotask is not 100% safe since you might accidentally print out these secrets during debugging of `Autotask` script
- as Openzeppelin suggested, you should use the `Relayer` service to control your EOA
- Note that the `sentinel` referred here in `Autotask` scripts refers to the role `sentinel` in our settings, not the `Sentinel` service

![](./imgs/autotask_secrets1.png)
![](./imgs/autotask_secrets2.png)
Expand All @@ -18,14 +19,15 @@
- `pause` contract [script](./scripts/autotask/pause/OneRoleAccessControl.js) for `OneRoleAccessControl` contract
- `pause` contract [script](./scripts/autotask/pause/UpgradeProxyImplementation.js) for `UpgradeProxyImplementation` contract
- Note that these javscritp scripts are compiled from its original one written in typescript
- everytime after you update, for example, OneRoleAccessControl [script](./scripts/autotask/pause/OneRoleAccessControl.ts), you have to run `npx tsc scripts/autotask/pause/OneRoleAccessControl.ts` and copy-paste the compiled OneRoleAccessControl.js scripts to `Code` section in your Autotask instance
- everytime you modify any of these scripts, e.g., [OneRoleAccessControl.ts](./scripts/autotask/pause/OneRoleAccessControl.ts), you have to run `npx tsc scripts/autotask/pause/OneRoleAccessControl.ts` and copy-paste the compiled OneRoleAccessControl.js scripts to `Code` section in your Autotask instance

![](./imgs/autotask_create2.png)

6. You are all set, go invoke functions and see if scripts are executed as expected.

___

- You can see the history of execution (`Runs history`) or edit the code/settings in instance's info page.
- In instance's info page, you can see the history of execution (`Runs history`) or edit the code/settings.

![](./imgs/autotask_instance_info.png)

Expand Down
2 changes: 1 addition & 1 deletion setupSentinel.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@

5. Last, create notifications and set notification thresholds
- for example, using [Slack webhook](https://api.slack.com/messaging/webhooks)
- you can use the default threshold valus which will send notification on every matched event/function call
- you can use the default threshold values which will send notification on every matched event/function call

![](./imgs/sentinel_notifications.png)

0 comments on commit ac04040

Please sign in to comment.