-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
script: deploy Aggregate Router & Katana Governance logic
- Loading branch information
1 parent
f568dd5
commit 9ab198e
Showing
11 changed files
with
143 additions
and
21 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 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,7 @@ | ||
deploy-testnet: | ||
op run --env-file="./.env" -- \ | ||
forge script DeployKatanaOperationTestnet -f ronin-testnet | ||
|
||
deploy-testnet-broadcast: | ||
op run --env-file="./.env" -- \ | ||
forge script DeployKatanaOperationTestnet -f ronin-testnet --verify --verifier sourcify --verifier-url https://sourcify.roninchain.com/server/ --legacy --broadcast |
Submodule foundry-deployment-kit
deleted from
2f48f7
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,38 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.17; | ||
|
||
import { Script, console } from "forge-std/Script.sol"; | ||
import { RouterParameters } from "@katana/operation-contracts/aggregate-router/base/RouterImmutables.sol"; | ||
import { AggregateRouter } from "@katana/operation-contracts/aggregate-router/AggregateRouter.sol"; | ||
|
||
abstract contract DeployAggregateRouter is Script { | ||
RouterParameters public params; | ||
|
||
address public router; | ||
|
||
function setUp() public virtual { | ||
assert(params.permit2 != address(0)); | ||
assert(params.weth9 != address(0)); | ||
assert(params.v2Factory != address(0)); | ||
assert(params.v3Factory != address(0)); | ||
assert(params.pairInitCodeHash != bytes32(0)); | ||
assert(params.poolInitCodeHash != bytes32(0)); | ||
|
||
logParams(); | ||
} | ||
|
||
function run() public virtual { | ||
vm.broadcast(); | ||
router = address(new AggregateRouter(params)); | ||
console.log("Aggregate Router deployed:", router); | ||
} | ||
|
||
function logParams() internal view virtual { | ||
console.log("permit2:", params.permit2); | ||
console.log("WRON:", params.weth9); | ||
console.log("v2Factory:", params.v2Factory); | ||
console.log("v3Factory:", params.v3Factory); | ||
console.log("pairInitCodeHash:", vm.toString(params.pairInitCodeHash)); | ||
console.log("poolInitCodeHash:", vm.toString(params.poolInitCodeHash)); | ||
} | ||
} |
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,38 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.17; | ||
|
||
import { Script, console } from "forge-std/Script.sol"; | ||
import { ITransparentUpgradeableProxy } from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; | ||
import { KatanaGovernance } from "@katana/operation-contracts/governance/KatanaGovernance.sol"; | ||
import { DeployAggregateRouter } from "./DeployAggregateRouter.s.sol"; | ||
|
||
abstract contract UpgradeKatanaGovernance is DeployAggregateRouter { | ||
address public nonfungiblePositionManager; | ||
address public katanaGovernanceProxy; | ||
address public proxyAdmin; | ||
|
||
address public katanaGovernanceLogic; | ||
|
||
function setUp() public virtual override { | ||
require(nonfungiblePositionManager != address(0)); | ||
require(katanaGovernanceProxy != address(0)); | ||
require(proxyAdmin != address(0)); | ||
|
||
super.setUp(); | ||
} | ||
|
||
function run() public override { | ||
super.run(); | ||
|
||
vm.broadcast(); | ||
katanaGovernanceLogic = address(new KatanaGovernance(nonfungiblePositionManager)); | ||
console.log("Katana Governance (logic) deployed:", katanaGovernanceLogic); | ||
|
||
console.log("Please upgrade to Katana Governance (logic) using ProxyAdmin", proxyAdmin); | ||
console.log("Data:", vm.toString(abi.encodeCall(KatanaGovernance.initializeV2, (router)))); | ||
} | ||
|
||
function logParams() internal view override { | ||
console.log("nonfungiblePositionManager:", nonfungiblePositionManager); | ||
} | ||
} |
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,28 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.17; | ||
|
||
import { RouterParameters } from "@katana/operation-contracts/aggregate-router/base/RouterImmutables.sol"; | ||
import { UpgradeKatanaGovernance } from "../UpgradeKatanaGovernance.s.sol"; | ||
|
||
contract DeployKatanaOperationMainnet is UpgradeKatanaGovernance { | ||
function setUp() public override { | ||
params = RouterParameters({ | ||
permit2: 0x000000000022D473030F116dDEE9F6B43aC78BA3, | ||
weth9: 0xe514d9DEB7966c8BE0ca922de8a064264eA6bcd4, // WRON | ||
governance: 0x2C1726346d83cBF848bD3C2B208ec70d32a9E44a, | ||
v2Factory: 0xB255D6A720BB7c39fee173cE22113397119cB930, // KatanaV2Factory | ||
v3Factory: address(0), // TODO: To be deployed | ||
pairInitCodeHash: 0xe85772d2fe4ad93037659afaee57751696456eb5dd99987e43f3cf11c6e255a2, | ||
poolInitCodeHash: 0x97ee45181a4d14c00cdcc956fefebfa98f8c8744e3fe6d83e1861dc77ff40a99 | ||
}); | ||
|
||
proxyAdmin = 0xA3e7d085E65CB0B916f6717da876b7bE5cC92f03; // Proxy Admin | ||
|
||
nonfungiblePositionManager = address(0); // TODO: To be deployed | ||
katanaGovernanceProxy = 0x2C1726346d83cBF848bD3C2B208ec70d32a9E44a; | ||
|
||
vm.rememberKey(vm.envUint("MAINNET_PK")); | ||
|
||
super.setUp(); | ||
} | ||
} |
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,28 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.17; | ||
|
||
import { RouterParameters } from "@katana/operation-contracts/aggregate-router/base/RouterImmutables.sol"; | ||
import { UpgradeKatanaGovernance } from "../UpgradeKatanaGovernance.s.sol"; | ||
|
||
contract DeployKatanaOperationTestnet is UpgradeKatanaGovernance { | ||
function setUp() public override { | ||
params = RouterParameters({ | ||
permit2: 0x000000000022D473030F116dDEE9F6B43aC78BA3, | ||
weth9: 0xA959726154953bAe111746E265E6d754F48570E6, | ||
governance: 0x247F12836A421CDC5e22B93Bf5A9AAa0f521f986, | ||
v2Factory: 0x86587380C4c815Ba0066c90aDB2B45CC9C15E72c, | ||
v3Factory: 0x249F235bB9Fed56131B7E44Fe453E71b422B0A42, | ||
pairInitCodeHash: 0x1cc97ead4d6949b7a6ecb28652b21159b9fd5608ae51a1960224099caab07dca, | ||
poolInitCodeHash: 0x97ee45181a4d14c00cdcc956fefebfa98f8c8744e3fe6d83e1861dc77ff40a99 | ||
}); | ||
|
||
proxyAdmin = 0x505d91E8fd2091794b45b27f86C045529fa92CD7; | ||
|
||
nonfungiblePositionManager = 0x131A3C134EB0a957A69775A122e3688EdF8Ce05A; | ||
katanaGovernanceProxy = 0x247F12836A421CDC5e22B93Bf5A9AAa0f521f986; | ||
|
||
vm.rememberKey(vm.envUint("TESTNET_PK")); | ||
|
||
super.setUp(); | ||
} | ||
} |
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