Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ops/deploy many #33

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@ This repository contains all of the contracts and deployment code used to manage
- [`Solana`](https://app.squads.so/squads/FSRTW4KPGifKL8yKcZ8mfoR9mKtAjwZiTHbHwgix8AQo)
- [`Ink`](https://app.safe.global/home?safe=ink:0x91eBC17cD330DD694225133455583FBCA54b8eC8)
- [`Sonic`](https://app.safe.global/home?safe=sonic:0x87c7A1ef67c67cd57CBF101522a0c3B19D2C3aAc)
- [`Arbitrum`](https://app.safe.global/home?safe=arb1:0x3da490b19F300E7cb2280426C8aD536dB2df445c)
- [`Optimism`](https://app.safe.global/home?safe=oeth:0x419e672d625f998dd07a7ecf2E06B896F8717cb2)
- [`Polygon`](https://app.safe.global/home?safe=matic:0xDbf59edA454679bB157b3B048Ba54C4D762b559E)

### Proxy (upgradeable) OFTs
- Chain: `Mode`, `Sei`, `Fraxtal`, `X-Layer`, `Ink`, `Sonic`
- Chain: `Mode`, `Sei`, `Fraxtal` (except for (s)frxUSD), `X-Layer`, `Ink`, `Sonic`, `Arbitrum`, `Optimism`, `Polygon`
- Admin: `ProxyAdmin` (owned by chain-respective msig)
- OFTs
- `frxUSD`: `0x80eede496655fb9047dd39d9f418d5483ed600df`
Expand Down Expand Up @@ -91,12 +94,12 @@ TODO: automatically save as strings.
- Submit each newly crafted json to the respective `DESTINATION_CHAIN_ID` msig.

## TODO
- Ink, Sonic
- Configure source/destination (s)frxUSD peers for Xlayer, Sei, Mode
- Configure source/destination Fraxtal (s)frxUSD peer to predetermined OFT
- Ink, Sonic, Arbitrum, Optimism, Polygon
- Configure source/destination (s)frxUSD peers for Xlayer, Sei, Mode, Solana
- Sonic
- Set up DVNs
- Execute msig txs
- Set up DVNs for each chain
- Solana
- Configure for Ink, Sonic, Arbitrum, Optimism, Polygon

## 1) Developing Contracts

Expand Down
4,993 changes: 4,993 additions & 0 deletions broadcast/1_DeployArbitrum.s.sol/42161/dry-run/run-1736190564.json

Large diffs are not rendered by default.

4,993 changes: 4,993 additions & 0 deletions broadcast/1_DeployArbitrum.s.sol/42161/dry-run/run-1736195123.json

Large diffs are not rendered by default.

4,993 changes: 4,993 additions & 0 deletions broadcast/1_DeployArbitrum.s.sol/42161/dry-run/run-1736196417.json

Large diffs are not rendered by default.

4,993 changes: 4,993 additions & 0 deletions broadcast/1_DeployArbitrum.s.sol/42161/dry-run/run-latest.json

Large diffs are not rendered by default.

15,028 changes: 15,028 additions & 0 deletions broadcast/1_DeployArbitrum.s.sol/42161/run-1736205798.json

Large diffs are not rendered by default.

15,028 changes: 15,028 additions & 0 deletions broadcast/1_DeployArbitrum.s.sol/42161/run-latest.json

Large diffs are not rendered by default.

5,427 changes: 5,427 additions & 0 deletions broadcast/2_DeployOptimism.s.sol/10/dry-run/run-1736387036.json

Large diffs are not rendered by default.

5,427 changes: 5,427 additions & 0 deletions broadcast/2_DeployOptimism.s.sol/10/dry-run/run-latest.json

Large diffs are not rendered by default.

7,812 changes: 7,812 additions & 0 deletions broadcast/2_DeployOptimism.s.sol/10/run-1736388079.json

Large diffs are not rendered by default.

7,812 changes: 7,812 additions & 0 deletions broadcast/2_DeployOptimism.s.sol/10/run-latest.json

Large diffs are not rendered by default.

10,452 changes: 10,452 additions & 0 deletions broadcast/2a_SetupOptimism.s.sol/10/run-1736388861.json

Large diffs are not rendered by default.

15,351 changes: 15,351 additions & 0 deletions broadcast/2a_SetupOptimism.s.sol/10/run-1736389391.json

Large diffs are not rendered by default.

15,351 changes: 15,351 additions & 0 deletions broadcast/2a_SetupOptimism.s.sol/10/run-latest.json

Large diffs are not rendered by default.

5,861 changes: 5,861 additions & 0 deletions broadcast/3_DeployPolygon.s.sol/137/dry-run/run-1736455796.json

Large diffs are not rendered by default.

5,861 changes: 5,861 additions & 0 deletions broadcast/3_DeployPolygon.s.sol/137/dry-run/run-latest.json

Large diffs are not rendered by default.

7,366 changes: 7,366 additions & 0 deletions broadcast/3_DeployPolygon.s.sol/137/run-1736457071.json

Large diffs are not rendered by default.

7,366 changes: 7,366 additions & 0 deletions broadcast/3_DeployPolygon.s.sol/137/run-latest.json

Large diffs are not rendered by default.

5,455 changes: 5,455 additions & 0 deletions broadcast/3a_ResumeDeployPolygon.s.sol/137/dry-run/run-1736460576.json

Large diffs are not rendered by default.

5,455 changes: 5,455 additions & 0 deletions broadcast/3a_ResumeDeployPolygon.s.sol/137/dry-run/run-latest.json

Large diffs are not rendered by default.

7,448 changes: 7,448 additions & 0 deletions broadcast/3a_ResumeDeployPolygon.s.sol/137/run-1736466712.json

Large diffs are not rendered by default.

7,448 changes: 7,448 additions & 0 deletions broadcast/3a_ResumeDeployPolygon.s.sol/137/run-latest.json

Large diffs are not rendered by default.

19,056 changes: 19,056 additions & 0 deletions broadcast/3b_SetupPolygon.s.sol/137/run-1736467530.json

Large diffs are not rendered by default.

19,113 changes: 19,113 additions & 0 deletions broadcast/3b_SetupPolygon.s.sol/137/run-1736467605.json

Large diffs are not rendered by default.

19,113 changes: 19,113 additions & 0 deletions broadcast/3b_SetupPolygon.s.sol/137/run-latest.json

Large diffs are not rendered by default.

30 changes: 25 additions & 5 deletions scripts/BaseL0Script.sol
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ contract BaseL0Script is Script {
string public json;

function version() public virtual pure returns (uint256, uint256, uint256) {
return (1, 2, 2);
return (1, 2, 4);
}

modifier broadcastAs(uint256 privateKey) {
Expand All @@ -118,6 +118,9 @@ contract BaseL0Script is Script {
// store for later referencing
simulateConfig = _simulateConfig;

// if we're simulating fraxtal, overwrite the proxy (s)frxUSD OFTs to the standalone lockboxes. Otherwise, use the re-usable addrs
_overwriteFrxUsdAddrs();

// Simulate fork as delegate (aka msig) as we're crafting txs within the modified function
vm.createSelectFork(_simulateConfig.RPC);
vm.startPrank(_simulateConfig.delegate);
Expand All @@ -128,6 +131,23 @@ contract BaseL0Script is Script {
new SafeTxUtil().writeTxs(serializedTxs, filename());
}

// Configure (s)frxUSD addresses to the standalone fraxtal lockboxes, otherwise re-usable OFTs
function _overwriteFrxUsdAddrs() public virtual {
// skip overwrite if there are no proxyOfts to write to
if (proxyOfts.length != 6) return;

/// @dev see setUp() to reference array positioning
if (simulateConfig.chainid == 252) {
// https://github.com/FraxFinance/frax-oft-upgradeable?tab=readme-ov-file#fraxtal-standalone-frxusdsfrxusd-lockboxes
proxyOfts[1] = 0x88Aa7854D3b2dAA5e37E7Ce73A1F39669623a361; // sfrxUSD
proxyOfts[3] = 0x96A394058E2b84A89bac9667B19661Ed003cF5D4; // frxUSD
} else {
// https://github.com/FraxFinance/frax-oft-upgradeable?tab=readme-ov-file#proxy-upgradeable-ofts
proxyOfts[1] = 0x5Bff88cA1442c2496f7E475E9e7786383Bc070c0;
proxyOfts[3] = 0x80Eede496655FB9047dd39d9f418d5483ED600df;
}
}

function filename() public view virtual returns (string memory) {
string memory root = vm.projectRoot();
root = string.concat(root, '/scripts/DeployFraxOFTProtocol/txs/');
Expand All @@ -144,18 +164,18 @@ contract BaseL0Script is Script {

/// @dev: this array maintains the same token order as proxyOfts and the addrs are confirmed on eth mainnet, blast, base, and metis.
legacyOfts.push(0x23432452B720C80553458496D4D9d7C5003280d0); // fxs
legacyOfts.push(0xe4796cCB6bB5DE2290C417Ac337F2b66CA2E770E); // sFRAX
legacyOfts.push(0xe4796cCB6bB5DE2290C417Ac337F2b66CA2E770E); // sfrxUSD
legacyOfts.push(0x1f55a02A049033E3419a8E2975cF3F572F4e6E9A); // sfrxETH
legacyOfts.push(0x909DBdE1eBE906Af95660033e478D59EFe831fED); // FRAX
legacyOfts.push(0x909DBdE1eBE906Af95660033e478D59EFe831fED); // frxUSD
legacyOfts.push(0xF010a7c8877043681D59AD125EbF575633505942); // frxETH
legacyOfts.push(0x6Eca253b102D41B6B69AC815B9CC6bD47eF1979d); // FPI
numOfts = legacyOfts.length;

// aray of semi-pre-determined upgradeable OFTs
expectedProxyOfts.push(0x64445f0aecC51E94aD52d8AC56b7190e764E561a); // fxs
expectedProxyOfts.push(0x5Bff88cA1442c2496f7E475E9e7786383Bc070c0); // sFRAX
expectedProxyOfts.push(0x5Bff88cA1442c2496f7E475E9e7786383Bc070c0); // sfrxUSD
expectedProxyOfts.push(0x3Ec3849C33291a9eF4c5dB86De593EB4A37fDe45); // sfrxETH
expectedProxyOfts.push(0x80Eede496655FB9047dd39d9f418d5483ED600df); // FRAX
expectedProxyOfts.push(0x80Eede496655FB9047dd39d9f418d5483ED600df); // frxUSD
expectedProxyOfts.push(0x43eDD7f3831b08FE70B7555ddD373C8bF65a9050); // frxETH
expectedProxyOfts.push(0x90581eCa9469D8D7F5D3B60f4715027aDFCf7927); // FPI
}
Expand Down
16 changes: 7 additions & 9 deletions scripts/DeployFraxOFTProtocol/DeployFraxOFTProtocol.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ contract DeployFraxOFTProtocol is BaseL0Script {
using Strings for uint256;

function version() public virtual override pure returns (uint256, uint256, uint256) {
return (1, 2, 4);
return (1, 2, 5);
}

function setUp() public virtual override {
Expand Down Expand Up @@ -46,8 +46,7 @@ contract DeployFraxOFTProtocol is BaseL0Script {
// skip if destination == source
if (proxyConfigs[i].eid == broadcastConfig.eid) continue;
setupDestination({
_connectedConfig: proxyConfigs[i],
_connectedOfts: proxyOfts
_connectedConfig: proxyConfigs[i]
});
}
}
Expand All @@ -57,23 +56,22 @@ contract DeployFraxOFTProtocol is BaseL0Script {
}

function setupDestination(
L0Config memory _connectedConfig,
address[] memory _connectedOfts
L0Config memory _connectedConfig
) public virtual simulateAndWriteTxs(_connectedConfig) {
setEvmEnforcedOptions({
_connectedOfts: _connectedOfts,
_connectedOfts: proxyOfts,
_configs: broadcastConfigArray
});

setEvmPeers({
_connectedOfts: _connectedOfts,
_peerOfts: proxyOfts,
_connectedOfts: proxyOfts,
_peerOfts: expectedProxyOfts,
_configs: broadcastConfigArray
});

setDVNs({
_connectedConfig: _connectedConfig,
_connectedOfts: _connectedOfts,
_connectedOfts: proxyOfts,
_configs: broadcastConfigArray
});
}
Expand Down
10 changes: 10 additions & 0 deletions scripts/DeployFraxOFTProtocol/txs/10-1329.json

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions scripts/DeployFraxOFTProtocol/txs/10-146-fix.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"chainId": 146,
"createdAt": 1736441296000,
"meta": {
"description": "",
"name": "Transactions Batch"
},
"transactions": [
{
"data": "0x3400288b000000000000000000000000000000000000000000000000000000000000759f0000000000000000000000005bff88ca1442c2496f7e475e9e7786383bc070c0",
"operation": "0",
"to": "0x5Bff88cA1442c2496f7E475E9e7786383Bc070c0",
"value": "0"
},
{
"data": "0x3400288b000000000000000000000000000000000000000000000000000000000000759f00000000000000000000000080eede496655fb9047dd39d9f418d5483ed600df",
"operation": "0",
"to": "0x80Eede496655FB9047dd39d9f418d5483ED600df",
"value": "0"
}
],
"version": "1.0"
}
10 changes: 10 additions & 0 deletions scripts/DeployFraxOFTProtocol/txs/10-146.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"chainId": 146,
"createdAt": 1736389336000,
"meta": {
"description": "",
"name": "Transactions Batch"
},
"transactions": [{"data":"0xb98bd07000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000759f00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000001600030100110100000000000000000000000000030d4000000000000000000000000000000000000000000000000000000000000000000000000000000000759f0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000160003010011010000000000000000000000000003d09000000000000000000000","operation":"0","to":"0x64445f0aecC51E94aD52d8AC56b7190e764E561a","value":"0"},{"data":"0xb98bd07000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000759f00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000001600030100110100000000000000000000000000030d4000000000000000000000000000000000000000000000000000000000000000000000000000000000759f0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000160003010011010000000000000000000000000003d09000000000000000000000","operation":"0","to":"0x5Bff88cA1442c2496f7E475E9e7786383Bc070c0","value":"0"},{"data":"0xb98bd07000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000759f00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000001600030100110100000000000000000000000000030d4000000000000000000000000000000000000000000000000000000000000000000000000000000000759f0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000160003010011010000000000000000000000000003d09000000000000000000000","operation":"0","to":"0x3Ec3849C33291a9eF4c5dB86De593EB4A37fDe45","value":"0"},{"data":"0xb98bd07000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000759f00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000001600030100110100000000000000000000000000030d4000000000000000000000000000000000000000000000000000000000000000000000000000000000759f0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000160003010011010000000000000000000000000003d09000000000000000000000","operation":"0","to":"0x80Eede496655FB9047dd39d9f418d5483ED600df","value":"0"},{"data":"0xb98bd07000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000759f00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000001600030100110100000000000000000000000000030d4000000000000000000000000000000000000000000000000000000000000000000000000000000000759f0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000160003010011010000000000000000000000000003d09000000000000000000000","operation":"0","to":"0x43eDD7f3831b08FE70B7555ddD373C8bF65a9050","value":"0"},{"data":"0xb98bd07000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000759f00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000001600030100110100000000000000000000000000030d4000000000000000000000000000000000000000000000000000000000000000000000000000000000759f0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000160003010011010000000000000000000000000003d09000000000000000000000","operation":"0","to":"0x90581eCa9469D8D7F5D3B60f4715027aDFCf7927","value":"0"},{"data":"0x3400288b000000000000000000000000000000000000000000000000000000000000759f00000000000000000000000064445f0aecc51e94ad52d8ac56b7190e764e561a","operation":"0","to":"0x64445f0aecC51E94aD52d8AC56b7190e764E561a","value":"0"},{"data":"0x3400288b000000000000000000000000000000000000000000000000000000000000759f0000000000000000000000003ec3849c33291a9ef4c5db86de593eb4a37fde45","operation":"0","to":"0x3Ec3849C33291a9eF4c5dB86De593EB4A37fDe45","value":"0"},{"data":"0x3400288b000000000000000000000000000000000000000000000000000000000000759f00000000000000000000000043edd7f3831b08fe70b7555ddd373c8bf65a9050","operation":"0","to":"0x43eDD7f3831b08FE70B7555ddD373C8bF65a9050","value":"0"},{"data":"0x3400288b000000000000000000000000000000000000000000000000000000000000759f00000000000000000000000090581eca9469d8d7f5d3b60f4715027adfcf7927","operation":"0","to":"0x90581eCa9469D8D7F5D3B60f4715027aDFCf7927","value":"0"}],
"version": "1.0"
}
10 changes: 10 additions & 0 deletions scripts/DeployFraxOFTProtocol/txs/10-196.json

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions scripts/DeployFraxOFTProtocol/txs/10-252.json

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions scripts/DeployFraxOFTProtocol/txs/10-34443.json

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions scripts/DeployFraxOFTProtocol/txs/10-42161.json

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions scripts/DeployFraxOFTProtocol/txs/10-57073.json

Large diffs are not rendered by default.

Loading