Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
olegkron committed Nov 17, 2024
1 parent 4e1d434 commit f705ac3
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 17 deletions.
6 changes: 0 additions & 6 deletions contracts/ChildPool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,11 @@ contract ChildPool is CCIPReceiver, ChildPoolStorage {
uint32 private constant CCIP_SEND_GAS_LIMIT = 300_000;

/* IMMUTABLE VARIABLES */
///@notice immutable variable to store Orchestrator Proxy
address private immutable i_infraProxy;
///@notice Child Pool proxy address
address private immutable i_childProxy;
///@notice Chainlink Link Token interface
LinkTokenInterface private immutable i_linkToken;
///@notice immutable variable to store the USDC address.
IERC20 private immutable i_USDC;
///@notice Contract Owner
address private immutable i_owner;
//@@notice messenger addresses
address private immutable i_msgr0;
address private immutable i_msgr1;
address private immutable i_msgr2;
Expand Down
6 changes: 0 additions & 6 deletions contracts/InfraOrchestrator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,11 @@ contract InfraOrchestrator is
uint16 internal constant INTEGRATOR_FEE_DIVISOR = 10000;

/* IMMUTABLE VARIABLES */
///@notice the address of Functions router
address internal immutable i_functionsRouter;
///@notice variable to store the DexSwap address
address internal immutable i_dexSwap;
///@notice variable to store the Concero address
address internal immutable i_conceroBridge;
///@notice variable to store the ConceroPool address
address internal immutable i_pool;
///@notice variable to store the immutable Proxy Address
address internal immutable i_proxy;
///@notice ID of the deployed chain on getChain() function
Chain internal immutable i_chainIndex;

constructor(
Expand Down
6 changes: 4 additions & 2 deletions contracts/ParentPool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -738,14 +738,16 @@ contract ParentPool is IParentPool, CCIPReceiver, ParentPoolCommon, ParentPoolSt
uint256 amountToDistributePerPool = ((_amountToDistributeUSDC * PRECISION_HANDLER) /
(childPoolsCount + 1)) / PRECISION_HANDLER;

uint64[] memory poolChainSelectors = s_poolChainSelectors;

for (uint256 i; i < childPoolsCount; ) {
bytes32 ccipMessageId = _ccipSend(
s_poolChainSelectors[i],
poolChainSelectors[i],
amountToDistributePerPool,
_ccipTxType
);

_addDepositOnTheWay(ccipMessageId, s_poolChainSelectors[i], amountToDistributePerPool);
_addDepositOnTheWay(ccipMessageId, poolChainSelectors[i], amountToDistributePerPool);

unchecked {
++i;
Expand Down
2 changes: 0 additions & 2 deletions contracts/ParentPoolCLFCLA.sol
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,12 @@ contract ParentPoolCLFCLA is
using SafeERC20 for IERC20;

/* CONSTANT VARIABLES */
///@notice JS Code for Chainlink Functions
uint256 internal constant CCIP_ESTIMATED_TIME_TO_COMPLETE = 30 minutes;
uint32 internal constant CL_FUNCTIONS_CALLBACK_GAS_LIMIT = 2_000_000;
string internal constant JS_CODE =
"try { const [b, o, f] = bytesArgs; const u = 'https://raw.githubusercontent.com/ethers-io/ethers.js/v6.10.0/dist/ethers.umd.min.js'; const q = 'https://raw.githubusercontent.com/concero/contracts-ccip/' + 'master' + `/packages/hardhat/tasks/CLFScripts/dist/pool/${f === '0x02' ? 'collectLiquidity' : f === '0x01' ? 'distributeLiquidity' : 'getTotalBalance'}.min.js`; const [t, p] = await Promise.all([fetch(u), fetch(q)]); const [e, c] = await Promise.all([t.text(), p.text()]); const g = async s => { return ( '0x' + Array.from(new Uint8Array(await crypto.subtle.digest('SHA-256', new TextEncoder().encode(s)))) .map(v => ('0' + v.toString(16)).slice(-2).toLowerCase()) .join('') ); }; const r = await g(c); const x = await g(e); if (r === b.toLowerCase() && x === o.toLowerCase()) { const ethers = new Function(e + '; return ethers;')(); return await eval(c); } throw new Error(`${r}!=${b}||${x}!=${o}`); } catch (e) { throw new Error(e.message.slice(0, 255));}";

/* IMMUTABLE VARIABLES */
///@notice Chainlink Function Don ID
bytes32 private immutable i_clfDonId;
uint64 private immutable i_clfSubId;

Expand Down
1 change: 0 additions & 1 deletion contracts/ParentPoolCommon.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ contract ParentPoolCommon {
uint256 internal constant PRECISION_HANDLER = 10_000_000_000; // 10 ** 10
uint8 internal constant MAX_DEPOSITS_ON_THE_WAY_COUNT = 150;
/*CHANGE-IN-PRODUCTION-TO-597_600*/
// uint256 private constant WITHDRAWAL_COOLDOWN_SECONDS = 597_600;
uint256 internal constant WITHDRAWAL_COOLDOWN_SECONDS = 60;

/* IMMUTABLE VARIABLES */
Expand Down

0 comments on commit f705ac3

Please sign in to comment.