-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:lifinance/contracts into fixAction
- Loading branch information
Showing
67 changed files
with
2,202 additions
and
2,256 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,4 +92,4 @@ | |
"LiFiDEXAggregator": "" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -128,4 +128,4 @@ | |
"TokenWrapper": "0xF63b27AE2Dc887b88f82E2Cc597d07fBB2E78E70" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# EmergencyPauseFacet | ||
|
||
## How it works | ||
|
||
The EmergencyPauseFacet is an admin-only facet. Its purpose is to provide a fast yet secure way to respond to suspicious transactions and smart contract activity by either pausing the whole diamond or by removing one specific facet. This can be done from a non-multisig account (i.e.: the 'PauserWallet') to ensure fast execution. The unpausing of the contract as well as adding any new facets is still only possible through the multisig owner wallet for added security. | ||
|
||
## Public Methods | ||
|
||
- `function removeFacet(address _facetAddress)` | ||
- Removes the given facet from the diamond | ||
- `function pauseDiamond()` | ||
- Pauses the diamond by redirecting all function selectors to EmergencyPauseFacet | ||
- `function unpauseDiamond(address[] calldata _blacklist)` | ||
- Unpauses the diamond by reactivating all formerly registered facets, except for the facets in '\_blacklist' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.17; | ||
|
||
import { DeployScriptBase } from "./utils/DeployScriptBase.sol"; | ||
import { stdJson } from "forge-std/Script.sol"; | ||
import { EmergencyPauseFacet } from "lifi/Facets/EmergencyPauseFacet.sol"; | ||
|
||
contract DeployScript is DeployScriptBase { | ||
using stdJson for string; | ||
|
||
constructor() DeployScriptBase("EmergencyPauseFacet") {} | ||
|
||
function run() | ||
public | ||
returns (EmergencyPauseFacet deployed, bytes memory constructorArgs) | ||
{ | ||
constructorArgs = getConstructorArgs(); | ||
|
||
deployed = EmergencyPauseFacet( | ||
deploy(type(EmergencyPauseFacet).creationCode) | ||
); | ||
} | ||
|
||
function getConstructorArgs() internal override returns (bytes memory) { | ||
string memory path = string.concat(root, "/config/global.json"); | ||
string memory json = vm.readFile(path); | ||
|
||
address pauserWallet = json.readAddress(".pauserWallet"); | ||
|
||
return abi.encode(pauserWallet); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.17; | ||
|
||
import { UpdateScriptBase } from "./utils/UpdateScriptBase.sol"; | ||
import { stdJson } from "forge-std/StdJson.sol"; | ||
import { EmergencyPauseFacet } from "lifi/Facets/EmergencyPauseFacet.sol"; | ||
|
||
contract DeployScript is UpdateScriptBase { | ||
using stdJson for string; | ||
|
||
function run() | ||
public | ||
returns (address[] memory facets, bytes memory cutData) | ||
{ | ||
return update("EmergencyPauseFacet"); | ||
} | ||
} |
Oops, something went wrong.