Skip to content

Commit

Permalink
Multistep (#27)
Browse files Browse the repository at this point in the history
* generic factory not working

* run postSetup
  • Loading branch information
daopunk authored Jan 9, 2024
1 parent ca5a467 commit 1b9f854
Show file tree
Hide file tree
Showing 6 changed files with 392 additions and 332 deletions.
160 changes: 160 additions & 0 deletions broadcast/DeployFactories.s.sol/421614/run-1704405632.json

Large diffs are not rendered by default.

160 changes: 160 additions & 0 deletions broadcast/DeployFactories.s.sol/421614/run-1704405654.json

Large diffs are not rendered by default.

377 changes: 52 additions & 325 deletions broadcast/DeployFactories.s.sol/421614/run-latest.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion script/Common.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ abstract contract Common is Script {
uint256 _basePrice,
uint256 _quotePrice,
address _pool
) internal returns (uint160 _sqrtPriceX96) {
) internal view returns (uint160 _sqrtPriceX96) {
address _token0 = IAlgebraPool(_pool).token0();
bytes32 _symbol = keccak256(abi.encodePacked(IERC20Metadata(_token0).symbol()));
uint256 _price;
Expand Down
13 changes: 8 additions & 5 deletions script/Registry.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pragma solidity 0.7.6;
address constant TEST_GOVERNOR = 0x37c5B029f9c3691B3d47cb024f84E5E257aEb0BB;

// Registry of protocol deployment
address constant SEPOLIA_SYSTEM_COIN = 0x94beB5fC16824338Eaa538c3c857D7f7fFf4B2Ce;
address constant SEPOLIA_SYSTEM_COIN = 0xFEE6D2833274CDDFfDb641DCa990733c6917598B;
address constant SEPOLIA_WETH = 0x980B62Da83eFf3D4576C647993b0c1D7faf17c73;

// Testnet Params
Expand All @@ -23,14 +23,17 @@ address constant RELAYER_DATA = 0x1F17CB9B80192E5C6E9BbEdAcc5F722a4e93f16e;
address constant ROUTER = 0x2a004eA6266eA1A340D1a7D78F1e0F4e9Ae2e685;

// Camelot Relayer
address constant CAMELOT_RELAYER_FACTORY = 0x6C87b6e2E651cc4ebcE3Ba782037898dDDB445bF; // from pre-deployment
address constant RELAYER_ONE = 0xa430DD704aC39756fbA7C26FEAF9A220741c05b0;
address constant CAMELOT_RELAYER_FACTORY = 0x92Bfb4D96f0b8dcA8F6e5E0fc4713DEa8243d9D6; // from pre-deployment
address constant RELAYER_ONE = 0xa430DD704aC39756fbA7C26FEAF9A220741c05b0; // DEX pool relayer
address constant CAMELOT_RELAYER = address(0); // post setup

// Chainlink Relayer
address constant CHAINLINK_RELAYER_FACTORY = 0x253c08EeB065F8940A8277901c91Ab4931d19044; // from pre-deployment
address constant CHAINLINK_RELAYER_FACTORY = 0x321D55f347095cdA4Ec8d10B63cD099396D1eb29; // from pre-deployment
address constant CHAINLINK_RELAYER = address(0); // post setup

// Denominated Oracle
address constant DENOMINATED_ORACLE_FACTORY = 0xD2823Cf1F062b2E92Fc33cd733a359fEFBA607dC; // from pre-deployment
address constant DENOMINATED_ORACLE_FACTORY = 0xaF3A59b1794d0E51197CED02AEb87E14DEf07aCf; // from pre-deployment
address constant SYSTEM_ORACLE = address(0); // post setup

// Chainlink feeds
address constant SEPOLIA_CHAINLINK_ETH_USD_FEED = 0xd30e2101a97dcbAeBCBC04F14C3f624E67A35165;
Expand Down
12 changes: 11 additions & 1 deletion script/dexrelayer/CallResult.s.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.7.6;
pragma abicoder v2;

import '@script/Registry.s.sol';
import {Script} from 'forge-std/Script.sol';
import {Test} from 'forge-std/Test.sol';
import {IAlgebraPool} from '@algebra-core/interfaces/IAlgebraPool.sol';
import {ICamelotRelayer} from '@interfaces/oracles/ICamelotRelayer.sol';
import {Data} from '@contracts/for-test/Data.sol';
Expand All @@ -13,7 +15,7 @@ import {Data} from '@contracts/for-test/Data.sol';
// SIMULATE
// source .env && forge script CallResult --with-gas-price 2000000000 -vvvvv --rpc-url $ARB_SEPOLIA_RPC

contract CallResult is Script {
contract CallResult is Script, Test {
Data public data = Data(RELAYER_DATA);

ICamelotRelayer public relayer = data.camelotRelayer();
Expand All @@ -30,6 +32,14 @@ contract CallResult is Script {
bool unlocked
) = getGlobalState(IAlgebraPool(relayer.algebraPool()));

emit log_named_uint('Price :', price);
emit log_named_uint('Fee :', fee);
emit log_named_uint('TimePntIndex:', timepointIndex);
emit log_named_uint('CommunityFee:', communityFee);
emit log_named_int('Tick :', tick);
emit log_named_int('PrevInitTick:', prevInitializedTick);
assertTrue(unlocked);

relayer.getResultWithValidity();
vm.stopBroadcast();
}
Expand Down

0 comments on commit 1b9f854

Please sign in to comment.