-
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.
Merge pull request #10 from ronin-chain/feature/innovation-zone
feat: innovation zone
- Loading branch information
Showing
27 changed files
with
740 additions
and
54 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,71 @@ | ||
| Contract | Size (B) | Margin (B) | | ||
|------------------------------------|----------|------------| | ||
| Address | 86 | 24,490 | | ||
| AddressStringUtil | 86 | 24,490 | | ||
| AuthorizationLib | 86 | 24,490 | | ||
| Base64 | 86 | 24,490 | | ||
| BeaconProxy | 785 | 23,791 | | ||
| BitMath | 86 | 24,490 | | ||
| BytesLib | 86 | 24,490 | | ||
| CallbackValidation | 86 | 24,490 | | ||
| ChainId | 86 | 24,490 | | ||
| ERC20 | 2,578 | 21,998 | | ||
| ERC20Mock | 3,518 | 21,058 | | ||
| ERC721 | 6,650 | 17,926 | | ||
| EnumerableMap | 86 | 24,490 | | ||
| EnumerableSet | 86 | 24,490 | | ||
| FixedPoint128 | 86 | 24,490 | | ||
| FixedPoint96 | 86 | 24,490 | | ||
| FullMath | 86 | 24,490 | | ||
| HexStrings | 86 | 24,490 | | ||
| KatanaGovernanceMock | 2,346 | 22,230 | | ||
| KatanaInterfaceMulticall | 1,334 | 23,242 | | ||
| KatanaV2Library | 86 | 24,490 | | ||
| KatanaV2LibraryTestnet | 86 | 24,490 | | ||
| KatanaV3Factory | 2,945 | 21,631 | | ||
| KatanaV3FactoryProxy | 5,541 | 19,035 | | ||
| KatanaV3Pool | 22,864 | 1,712 | | ||
| KatanaV3PoolDeployer | 288 | 24,288 | | ||
| KatanaV3PoolProxy | 1,248 | 23,328 | | ||
| KatanaV3PoolProxyBytecode | 2,931 | 21,645 | | ||
| LiquidityAmounts | 86 | 24,490 | | ||
| LiquidityMath | 86 | 24,490 | | ||
| LowGasSafeMath | 86 | 24,490 | | ||
| MixedRouteQuoterV1 | 7,328 | 17,248 | | ||
| MixedRouteQuoterV1Testnet | 7,328 | 17,248 | | ||
| NFTDescriptor | 23,833 | 743 | | ||
| NFTSVG | 86 | 24,490 | | ||
| NonfungiblePositionManager | 24,381 | 195 | | ||
| NonfungibleTokenPositionDescriptor | 5,219 | 19,357 | | ||
| Oracle | 86 | 24,490 | | ||
| OracleLibrary | 86 | 24,490 | | ||
| PairFlash | 5,510 | 19,066 | | ||
| Path | 86 | 24,490 | | ||
| PoolAddress | 86 | 24,490 | | ||
| PoolTicksCounter | 86 | 24,490 | | ||
| Position | 86 | 24,490 | | ||
| PositionKey | 86 | 24,490 | | ||
| PositionValue | 86 | 24,490 | | ||
| Quoter | 3,944 | 20,632 | | ||
| QuoterV2 | 7,103 | 17,473 | | ||
| SafeCast | 86 | 24,490 | | ||
| SafeERC20Namer | 86 | 24,490 | | ||
| SafeMath | 86 | 24,490 | | ||
| SignedSafeMath | 86 | 24,490 | | ||
| SqrtPriceMath | 86 | 24,490 | | ||
| SqrtPriceMathPartial | 86 | 24,490 | | ||
| Strings | 86 | 24,490 | | ||
| SwapMath | 86 | 24,490 | | ||
| SwapRouter | 10,213 | 14,363 | | ||
| Tick | 86 | 24,490 | | ||
| TickBitmap | 86 | 24,490 | | ||
| TickLens | 1,349 | 23,227 | | ||
| TickMath | 86 | 24,490 | | ||
| TokenRatioSortOrder | 86 | 24,490 | | ||
| TransferHelper | 86 | 24,490 | | ||
| TransparentUpgradeableProxy | 2,107 | 22,469 | | ||
| UnsafeMath | 86 | 24,490 | | ||
| UpgradeableBeacon | 1,208 | 23,368 | | ||
| UpgradeableProxy | 738 | 23,838 | | ||
| V3Migrator | 6,084 | 18,492 | | ||
|
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,40 @@ | ||
// 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 public proxyAdmin; | ||
address public governance; | ||
address public treasury; | ||
|
||
address public factory; | ||
|
||
function setUp() public virtual { | ||
require(proxyAdmin != address(0)); | ||
require(governance != address(0)); | ||
require(treasury != address(0)); | ||
logParams(); | ||
} | ||
|
||
function run() public virtual { | ||
vm.startBroadcast(); | ||
|
||
address factoryImplementation = address(new KatanaV3Factory()); | ||
factory = address( | ||
new KatanaV3FactoryProxy( | ||
factoryImplementation, proxyAdmin, abi.encodeWithSelector(KatanaV3Factory.initialize.selector, governance, treasury) | ||
) | ||
); | ||
console.log("KatanaV3Factory deployed:", factory); | ||
|
||
vm.stopBroadcast(); | ||
} | ||
|
||
function logParams() internal virtual { | ||
console.log("governance:", governance); | ||
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,74 @@ | ||
// 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 { QuoterV2 } from "@katana/v3-contracts/periphery/lens/QuoterV2.sol"; | ||
import { KatanaInterfaceMulticall } from "@katana/v3-contracts/periphery/lens/KatanaInterfaceMulticall.sol"; | ||
import { DeployKatanaV3Core } from "./DeployKatanaV3Core.s.sol"; | ||
|
||
abstract contract DeployKatanaV3Periphery is DeployKatanaV3Core { | ||
address public wron; | ||
address public factoryV2; | ||
|
||
address public tokenDescriptor; | ||
address public nonfungiblePositionManager; | ||
address public v3migrator; | ||
address public tickLens; | ||
address public quoterV2; | ||
address public 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, | ||
proxyAdmin, | ||
abi.encodeWithSelector(NonfungiblePositionManager.initialize.selector) | ||
) | ||
); | ||
require(NonfungiblePositionManager(payable(nonfungiblePositionManager)).governance() == governance, "governance mismatch"); | ||
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); | ||
|
||
quoterV2 = address(new QuoterV2(factory, wron)); | ||
console.log("QuoterV2 deployed:", quoterV2); | ||
|
||
katanaInterfaceMulticall = address(new KatanaInterfaceMulticall()); | ||
console.log("KatanaInterfaceMulticall deployed:", katanaInterfaceMulticall); | ||
|
||
vm.stopBroadcast(); | ||
} | ||
|
||
function logParams() internal virtual override { | ||
super.logParams(); | ||
|
||
console.log("WRON:", wron); | ||
console.log("factoryV2:", factoryV2); | ||
} | ||
} |
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,31 @@ | ||
// 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"; | ||
import { MixedRouteQuoterV1 } from "@katana/v3-contracts/periphery/lens/MixedRouteQuoterV1.sol"; | ||
import { KatanaGovernanceMock } from "@katana/v3-contracts/external/KatanaGovernanceMock.sol"; | ||
import { ERC20Mock } from "@openzeppelin/contracts/mocks/ERC20Mock.sol"; | ||
|
||
contract DeployKatanaV3Local is DeployKatanaV3Periphery { | ||
address mixedRouteQuoterV1; | ||
|
||
function setUp() public override { | ||
proxyAdmin = makeAddr("ProxyAdmin"); | ||
governance = address(new KatanaGovernanceMock(address(0), address(0), true)); | ||
treasury = makeAddr("RoninTreasury"); | ||
wron = address(new ERC20Mock("Wrapped Ronin", "WRON", address(this), 10 ** 9 * 10 ** 9)); | ||
factoryV2 = makeAddr("KatanaV2Factory"); | ||
|
||
super.setUp(); | ||
} | ||
|
||
function run() public override { | ||
super.run(); | ||
|
||
vm.broadcast(); | ||
mixedRouteQuoterV1 = address(new MixedRouteQuoterV1(factory, factoryV2, wron)); | ||
console.log("MixedRouteQuoterV1 deployed:", mixedRouteQuoterV1); | ||
} | ||
} |
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,31 @@ | ||
// 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"; | ||
import { MixedRouteQuoterV1 } from "@katana/v3-contracts/periphery/lens/MixedRouteQuoterV1.sol"; | ||
|
||
contract DeployKatanaV3Mainnet is DeployKatanaV3Periphery { | ||
address mixedRouteQuoterV1; | ||
|
||
function setUp() public override { | ||
proxyAdmin = 0xA3e7d085E65CB0B916f6717da876b7bE5cC92f03; // Proxy Admin | ||
governance = 0x2C1726346d83cBF848bD3C2B208ec70d32a9E44a; // Governance Proxy | ||
treasury = 0x22cEfc91E9b7c0f3890eBf9527EA89053490694e; // Ronin Treasury | ||
wron = 0xe514d9DEB7966c8BE0ca922de8a064264eA6bcd4; // WRON | ||
factoryV2 = 0xB255D6A720BB7c39fee173cE22113397119cB930; // Katana V2 Factory | ||
|
||
vm.rememberKey(vm.envUint("MAINNET_PK")); | ||
|
||
super.setUp(); | ||
} | ||
|
||
function run() public override { | ||
super.run(); | ||
|
||
vm.broadcast(); | ||
mixedRouteQuoterV1 = address(new MixedRouteQuoterV1(factory, factoryV2, wron)); | ||
console.log("MixedRouteQuoterV1 deployed:", mixedRouteQuoterV1); | ||
} | ||
} |
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,31 @@ | ||
// 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"; | ||
import { MixedRouteQuoterV1Testnet } from "@katana/v3-contracts/periphery/lens/MixedRouteQuoterV1Testnet.sol"; | ||
|
||
contract DeployKatanaV3Testnet is DeployKatanaV3Periphery { | ||
address mixedRouteQuoterV1Testnet; | ||
|
||
function setUp() public override { | ||
proxyAdmin = 0x505d91E8fd2091794b45b27f86C045529fa92CD7; | ||
governance = 0x247F12836A421CDC5e22B93Bf5A9AAa0f521f986; | ||
treasury = 0x968D0Cd7343f711216817E617d3f92a23dC91c07; | ||
wron = 0xA959726154953bAe111746E265E6d754F48570E6; | ||
factoryV2 = 0x86587380C4c815Ba0066c90aDB2B45CC9C15E72c; | ||
|
||
vm.rememberKey(vm.envUint("TESTNET_PK")); | ||
|
||
super.setUp(); | ||
} | ||
|
||
function run() public override { | ||
super.run(); | ||
|
||
vm.broadcast(); | ||
mixedRouteQuoterV1Testnet = address(new MixedRouteQuoterV1Testnet(factory, factoryV2, wron)); | ||
console.log("MixedRouteQuoterV1Testnet deployed:", mixedRouteQuoterV1Testnet); | ||
} | ||
} |
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
Oops, something went wrong.