-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8f6708f
commit 52a6f94
Showing
6 changed files
with
130 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
deploy-testnet: | ||
op run --env-file="./.env" -- \ | ||
forge script DeployKatanaV3Testnet -f ronin-testnet | ||
|
||
deploy-testnet-broadcast: | ||
op run --env-file="./.env" -- \ | ||
forge script DeployKatanaV3Testnet -f ronin-testnet --verify --verifier sourcify --verifier-url https://sourcify.roninchain.com/server/ --legacy --broadcast |
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,35 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.7.6; | ||
|
||
import { Script, console } from "forge-std/Script.sol"; | ||
import { KatanaV3Factory } from "@katana/v3-contracts/core/KatanaV3Factory.sol"; | ||
import { KatanaV3FactoryProxy } from "@katana/v3-contracts/core/KatanaV3FactoryProxy.sol"; | ||
|
||
abstract contract DeployKatanaV3Core is Script { | ||
address owner; | ||
address treasury; | ||
|
||
address factory; | ||
|
||
function setUp() public virtual { | ||
require(owner != address(0)); | ||
require(treasury != address(0)); | ||
logParams(); | ||
} | ||
|
||
function run() public virtual { | ||
vm.broadcast(); | ||
address factoryImplementation = address(new KatanaV3Factory()); | ||
factory = address( | ||
new KatanaV3FactoryProxy( | ||
factoryImplementation, owner, abi.encodeWithSelector(KatanaV3Factory.initialize.selector, owner, treasury) | ||
) | ||
); | ||
console.log("KatanaV3FactoryProxy deployed:", factory); | ||
} | ||
|
||
function logParams() internal virtual { | ||
console.log("owner:", owner); | ||
console.log("treasury:", treasury); | ||
} | ||
} |
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,67 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.7.6; | ||
|
||
import { Script, console } from "forge-std/Script.sol"; | ||
import { TransparentUpgradeableProxy } from "@openzeppelin/contracts/proxy/TransparentUpgradeableProxy.sol"; | ||
import { NonfungibleTokenPositionDescriptor } from | ||
"@katana/v3-contracts/periphery/NonfungibleTokenPositionDescriptor.sol"; | ||
import { NonfungiblePositionManager } from "@katana/v3-contracts/periphery/NonfungiblePositionManager.sol"; | ||
import { V3Migrator } from "@katana/v3-contracts/periphery/V3Migrator.sol"; | ||
import { TickLens } from "@katana/v3-contracts/periphery/lens/TickLens.sol"; | ||
import { MixedRouteQuoterV1 } from "@katana/v3-contracts/periphery/lens/MixedRouteQuoterV1.sol"; | ||
import { KatanaInterfaceMulticall } from "@katana/v3-contracts/periphery/lens/KatanaInterfaceMulticall.sol"; | ||
import { DeployKatanaV3Core } from "./DeployKatanaV3Core.s.sol"; | ||
|
||
abstract contract DeployKatanaV3Periphery is DeployKatanaV3Core { | ||
address wron; | ||
address factoryV2; | ||
|
||
address tokenDescriptor; | ||
address nonfungiblePositionManager; | ||
address v3migrator; | ||
address tickLens; | ||
address mixedRouteQuoterV1; | ||
address katanaInterfaceMulticall; | ||
|
||
function setUp() public virtual override { | ||
require(wron != address(0)); | ||
require(factoryV2 != address(0)); | ||
|
||
super.setUp(); | ||
} | ||
|
||
function run() public virtual override { | ||
super.run(); | ||
|
||
vm.startBroadcast(); | ||
|
||
tokenDescriptor = address(new NonfungibleTokenPositionDescriptor(wron, "RON")); | ||
console.log("NonfungibleTokenPositionDescriptor deployed:", tokenDescriptor); | ||
|
||
address nonfungiblePositionManagerImplementation = | ||
address(new NonfungiblePositionManager(factory, wron, tokenDescriptor)); | ||
nonfungiblePositionManager = | ||
address(new TransparentUpgradeableProxy(nonfungiblePositionManagerImplementation, owner, "")); | ||
console.log("NonfungiblePositionManager deployed:", nonfungiblePositionManager); | ||
|
||
v3migrator = address(new V3Migrator(factory, wron, nonfungiblePositionManager)); | ||
console.log("V3Migrator deployed:", v3migrator); | ||
|
||
tickLens = address(new TickLens()); | ||
console.log("TickLens deployed:", tickLens); | ||
|
||
mixedRouteQuoterV1 = address(new MixedRouteQuoterV1(factory, factoryV2, wron)); | ||
console.log("MixedRouteQuoterV1 deployed:", mixedRouteQuoterV1); | ||
|
||
katanaInterfaceMulticall = address(new KatanaInterfaceMulticall()); | ||
console.log("KatanaInterfaceMulticall deployed:", katanaInterfaceMulticall); | ||
|
||
vm.stopBroadcast(); | ||
} | ||
|
||
function logParams() internal virtual override { | ||
super.logParams(); | ||
|
||
console.log("WRON:", wron); | ||
} | ||
} |
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,19 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.7.6; | ||
|
||
import { Script } from "forge-std/Script.sol"; | ||
import { console } from "forge-std/console.sol"; | ||
import { DeployKatanaV3Periphery } from "../DeployKatanaV3Periphery.s.sol"; | ||
|
||
contract DeployKatanaV3Testnet is DeployKatanaV3Periphery { | ||
function setUp() public override { | ||
owner = 0x247F12836A421CDC5e22B93Bf5A9AAa0f521f986; | ||
treasury = 0x968D0Cd7343f711216817E617d3f92a23dC91c07; | ||
wron = 0xA959726154953bAe111746E265E6d754F48570E6; | ||
factoryV2 = 0x86587380C4c815Ba0066c90aDB2B45CC9C15E72c; | ||
|
||
vm.rememberKey(vm.envUint("TESTNET_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