Skip to content

Commit

Permalink
Feat: FixSeiDVN (#16)
Browse files Browse the repository at this point in the history
* fix(Sei): Nethermind => Horizen DVN

* refactor: re-label dvns as horizen, l0

* feat: FixSeiDVN

* chore: text formatting

* docs: goal of FixSeiDVN

* docs: Sei msig

* refactor: FixSeiDVN => FixDVNs

* fix: mode => sei dvn

* chore: fmt to text
  • Loading branch information
pegahcarter authored Jul 9, 2024
1 parent 52a2592 commit ad4daa9
Show file tree
Hide file tree
Showing 8 changed files with 274 additions and 23 deletions.
9 changes: 8 additions & 1 deletion OPERATIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,11 @@
# 2024.07.01
- `DeployFrxEthFpi()`
- Deploy Sei: frxEth, FPI
- Destinations: Ethereum, Base, Blast, Metis
- Destinations: Ethereum, Base, Blast, Metis

# 2024.07.02
- `FixDVNs()`
- modify the Sei configured DVNs to use the Horizen DVN instead of the Nethermind DVN

# 2024.07.03

9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
- [`Metis`](https://metissafe.tech/home?safe=metis-andromeda:0xF4A4F32732F9B2fB84Ee28c58616946F3bF80F7d)
- [`Base`](https://app.safe.global/home?safe=base:0xCBfd4Ef00a8cf91Fd1e1Fe97dC05910772c15E53)
- [`Mode`](https://safe.optimism.io/home?safe=mode:0x6336CFA6eDBeC2A459d869031DB77fC2770Eaa66)
- [`Sei`](https://sei-safe.protofire.io/home?safe=sei:0x0357D02fc95320b990322d3ff69204c3D251171b)


### Legacy (non-upgradeable) OFTs
Expand All @@ -39,9 +40,6 @@
- `frxETH` : `0xF010a7c8877043681D59AD125EbF575633505942`
- `FPI`: `0xE41228a455700cAF09E551805A8aB37caa39D08c`

### TODO
Mode => Sei

### Proxy (upgradeable) OFTs
- Chain: Mode, Sei
- Admin: `ProxyAdmin` (owned by chain-respective msig)
Expand All @@ -53,6 +51,11 @@ Mode => Sei
- `frxETH`: `0x43eDD7f3831b08FE70B7555ddD373C8bF65a9050`
- `FPI` : `0xEed9DE5E41b53D1C8fAB8AAB4b0e446F828c1483`

### TODO
- Mode => Sei (all six assets)
- Sei
- Send to, from Sei

## New Chain Deployment
- Ensure `PK_OFT_DEPLOYER` and `PK_CONFIG_DEPLOYER` are the private keys for `0x9C9dD956b413cdBD81690c9394a6B4D22afe6745` and `0x0990be6dB8c785FBbF9deD8bAEc612A10CaE814b, respectively.
- Modify `.env` `RPC_URL` to the new chain RPC
Expand Down
4 changes: 2 additions & 2 deletions scripts/BaseL0Script.sol
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ contract BaseL0Script is Script {
string RPC;
uint256 chainid;
address delegate;
address dvn1;
address dvn2;
address dvnHorizen;
address dvnL0;
uint256 eid;
address endpoint;
address receiveLib302;
Expand Down
10 changes: 5 additions & 5 deletions scripts/DeployFraxOFTProtocol/DeployFraxOFTProtocol.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -330,12 +330,12 @@ contract DeployFraxOFTProtocol is BaseL0Script {
address[] memory requiredDVNs = new address[](2);

// sort in ascending order (as spec'd in UlnConfig)
if (uint160(_connectedConfig.dvn1) < uint160(_connectedConfig.dvn2)) {
requiredDVNs[0] = _connectedConfig.dvn1;
requiredDVNs[1] = _connectedConfig.dvn2;
if (uint160(_connectedConfig.dvnHorizen) < uint160(_connectedConfig.dvnL0)) {
requiredDVNs[0] = _connectedConfig.dvnHorizen;
requiredDVNs[1] = _connectedConfig.dvnL0;
} else {
requiredDVNs[0] = _connectedConfig.dvn2;
requiredDVNs[1] = _connectedConfig.dvn1;
requiredDVNs[0] = _connectedConfig.dvnL0;
requiredDVNs[1] = _connectedConfig.dvnHorizen;
}
ulnConfig.requiredDVNs = requiredDVNs;

Expand Down
75 changes: 75 additions & 0 deletions scripts/FixDVNs/FixDVNs.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
// SPDX-License-Identifier: ISC
pragma solidity ^0.8.19;

import "../DeployFraxOFTProtocol/DeployFraxOFTProtocol.s.sol";

/*
Re-set the DVNs of a chain based on the L0Config
*/

contract FixDVNs is DeployFraxOFTProtocol {
using OptionsBuilder for bytes;
using stdJson for string;
using Strings for uint256;

/// @dev override to alter file save location
modifier simulateAndWriteTxs(L0Config memory _config) override {
// Clear out arrays
delete enforcedOptionsParams;
delete setConfigParams;
delete serializedTxs;

vm.createSelectFork(_config.RPC);
chainid = _config.chainid;
vm.startPrank(_config.delegate);
_;
vm.stopPrank();

// create filename and save
string memory root = vm.projectRoot();
root = string.concat(root, "/scripts/FixDVNs/txs/");
string memory filename = string.concat(_config.chainid.toString(), "-fixed.json");
string memory filepath = string.concat(root, filename);
new SafeTxUtil().writeTxs(serializedTxs, filepath);
}

function setUp() public override {
super.setUp();
}

function run() public override {
// deploySource();
setupSource();
// setupDestinations();
}

/// @dev simulating the active config delegate to create the new DVN txs
function setupSource() public override simulateAndWriteTxs(activeConfig) {
// // TODO: this will break if proxyOFT addrs are not the pre-determined addrs verified in postDeployChecks()
// setEnforcedOptions({
// _connectedOfts: proxyOfts,
// _configs: configs
// });

setDVNs({
_connectedConfig: activeConfig,
_connectedOfts: proxyOfts,
_configs: configs
});

// /// @dev legacy, non-upgradeable OFTs
// setPeers({
// _connectedOfts: proxyOfts,
// _peerOfts: legacyOfts,
// _configs: legacyConfigs
// });
// /// @dev Upgradeable OFTs maintaining the same address cross-chain.
// setPeers({
// _connectedOfts: proxyOfts,
// _peerOfts: proxyOfts,
// _configs: proxyConfigs
// });

// setPriviledgedRoles();
}
}
83 changes: 83 additions & 0 deletions scripts/FixDVNs/txs/1329-fixed.json

Large diffs are not rendered by default.

Loading

0 comments on commit ad4daa9

Please sign in to comment.