@glowlabs-org/utils 0.2.137 → 0.2.139

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var farmsRouter = require('./farms-router-BFFs_D4v.js');
3
+ var farmsRouter = require('./farms-router-D1kQ7pOC.js');
4
4
  var viem = require('viem');
5
5
  require('ethers');
6
6
 
@@ -1,3 +1,3 @@
1
- export type ContractKeys = "USDC" | "FORWARDER" | "FOUNDATION_WALLET" | "GLW" | "USDG" | "USDG_REDEMPTION" | "IMPACT_CATALYST" | "AUDIT_FEE_WALLET" | "UNISWAP_V2_ROUTER" | "UNISWAP_V2_FACTORY" | "USDG_UNISWAP" | "GLW_UNISWAP" | "OFFCHAIN_FRACTIONS" | "COUNTERFACTUAL_HOLDER_FACTORY" | "FOUNDATION_HUB_MANAGER_WALLET" | "FOUNDATION_REWARDS_WALLET";
1
+ export type ContractKeys = "USDC" | "FORWARDER" | "FOUNDATION_WALLET" | "GLW" | "USDG" | "USDG_REDEMPTION" | "IMPACT_CATALYST" | "AUDIT_FEE_WALLET" | "UNISWAP_V2_ROUTER" | "UNISWAP_V2_FACTORY" | "USDG_UNISWAP" | "GLW_UNISWAP" | "OFFCHAIN_FRACTIONS" | "COUNTERFACTUAL_HOLDER_FACTORY" | "FOUNDATION_HUB_MANAGER_WALLET" | "FOUNDATION_REWARDS_WALLET" | "ENDOWMENT_WALLET";
2
2
  export declare const getAddresses: (CHAIN_ID: number) => Record<ContractKeys, `0x${string}`>;
3
3
  export declare const DECIMALS_BY_TOKEN: Record<"USDC" | "USDG" | "GCTL" | "SGCTL" | "GLW", number>;
@@ -247,7 +247,7 @@ const ERC20_ABI = [
247
247
 
248
248
  // Contract-specific addresses
249
249
  const mainnetAddresses = {
250
- AUDIT_FEE_WALLET: "0x3ff5af3333ddc6048d98849ec5e67868494693c9",
250
+ AUDIT_FEE_WALLET: "0x3ff5af3333ddc6048d98849ec5e67868494693c9", //aka GVE wallet
251
251
  IMPACT_CATALYST: "0x552Fbb4E0269fd5036daf72Ec006AAF6C958F4Fa",
252
252
  USDG_REDEMPTION: "0x1c2cA537757e1823400F857EdBe72B55bbAe0F08",
253
253
  USDG: "0xe010ec500720bE9EF3F82129E7eD2Ee1FB7955F2",
@@ -255,14 +255,15 @@ const mainnetAddresses = {
255
255
  USDC: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
256
256
  USDG_UNISWAP: "0xe010ec500720bE9EF3F82129E7eD2Ee1FB7955F2",
257
257
  GLW_UNISWAP: "0xf4fbC617A5733EAAF9af08E1Ab816B103388d8B6",
258
- FORWARDER: "0xD487240a9Cc032Dc5CC092F2Bbe2C19aCD583eef",
259
- OFFCHAIN_FRACTIONS: "0x1Eca5C4391f10097C3232a0672e83c60A7dab7cD", // TODO: change to mainnet address
260
- COUNTERFACTUAL_HOLDER_FACTORY: "0x52ad78446eb4066F729034825cE9765997C297a7", // TODO: change to mainnet address
258
+ FORWARDER: "0x1519a8fE33acf8C164578789629146278541506A",
259
+ OFFCHAIN_FRACTIONS: "0x80EA852448c2807BeAe321deC7c603990209F7db",
260
+ COUNTERFACTUAL_HOLDER_FACTORY: "0x5bB7eC88cA80146FF47019079Cf0330532A1157F",
261
261
  FOUNDATION_HUB_MANAGER_WALLET: "0x5252FdA14A149c01EA5A1D6514a9c1369E4C70b4", // TODO: change to mainnet address
262
- FOUNDATION_WALLET: "0xc5174BBf649a92F9941e981af68AaA14Dd814F85", // TODO: change to mainnet address
263
- FOUNDATION_REWARDS_WALLET: "0x5252FdA14A149c01EA5A1D6514a9c1369E4C70b4", // TODO: change to mainnet address
262
+ FOUNDATION_WALLET: "0x77040BbBD506F5e5a7D65f6917416Bae6C78B9fa",
263
+ FOUNDATION_REWARDS_WALLET: "0x6972B05A0c80064fBE8a10CBc2a2FBCF6fb47D6a",
264
264
  UNISWAP_V2_ROUTER: "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D",
265
265
  UNISWAP_V2_FACTORY: "0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f",
266
+ ENDOWMENT_WALLET: "0x868D99B4a6e81b4683D10ea5665f13579A9d1607",
266
267
  };
267
268
  const sepoliaAddresses = {
268
269
  AUDIT_FEE_WALLET: "0x3ff5af3333ddc6048d98849ec5e67868494693c9",
@@ -281,6 +282,7 @@ const sepoliaAddresses = {
281
282
  FOUNDATION_REWARDS_WALLET: "0x5252FdA14A149c01EA5A1D6514a9c1369E4C70b4",
282
283
  UNISWAP_V2_ROUTER: "0xeE567Fe1712Faf6149d80dA1E6934E354124CfE3",
283
284
  UNISWAP_V2_FACTORY: "0xF62c03E08ada871A0bEb309762E260a7a6a880E6",
285
+ ENDOWMENT_WALLET: "0x868D99B4a6e81b4683D10ea5665f13579A9d1607",
284
286
  };
285
287
  const getAddresses = (CHAIN_ID) => {
286
288
  switch (CHAIN_ID) {
@@ -547,7 +549,7 @@ function useForwarder(signer, CHAIN_ID) {
547
549
  throw new Error(`Unsupported currency for forwarding: ${currency}`);
548
550
  }
549
551
  // Determine sendToCounterfactualWallet based on currency
550
- const sendToCounterfactualWallet = currency === "GLW" || currency === "USDG";
552
+ const sendToCounterfactualWallet = true;
551
553
  // Run a static call first to surface any revert reason (ethers v6)
552
554
  try {
553
555
  if (!isAuditFees && currency === "USDC") {
@@ -741,8 +743,6 @@ function useForwarder(signer, CHAIN_ID) {
741
743
  }
742
744
  // Construct the appropriate message for this forward type
743
745
  const message = constructForwardMessage(params);
744
- // Determine sendToCounterfactualWallet based on currency
745
- const sendToCounterfactualWallet = currency === "GLW" || currency === "USDG";
746
746
  // Get token address
747
747
  let tokenAddress;
748
748
  switch (currency) {
@@ -766,12 +766,12 @@ function useForwarder(signer, CHAIN_ID) {
766
766
  const estimatedGas = !isAuditFees && currency === "USDC"
767
767
  ? await forwarderContract
768
768
  .getFunction("swapUSDCAndForwardUSDG")
769
- .estimateGas(amount, ADDRESSES.FOUNDATION_WALLET, sendToCounterfactualWallet, message)
769
+ .estimateGas(amount, ADDRESSES.FOUNDATION_WALLET, true, message)
770
770
  : await forwarderContract
771
771
  .getFunction("forward")
772
772
  .estimateGas(tokenAddress, isAuditFees
773
773
  ? ADDRESSES.AUDIT_FEE_WALLET
774
- : ADDRESSES.FOUNDATION_WALLET, amount, sendToCounterfactualWallet, message);
774
+ : ADDRESSES.FOUNDATION_WALLET, amount, true, message);
775
775
  const estimatedCost = estimatedGas * gasPrice;
776
776
  if (ethPriceInUSD) {
777
777
  const estimatedCostInEth = viem.formatEther(estimatedCost);
@@ -3719,4 +3719,4 @@ exports.regionMetadata = regionMetadata;
3719
3719
  exports.usStates = usStates;
3720
3720
  exports.useForwarder = useForwarder;
3721
3721
  exports.useOffchainFractions = useOffchainFractions;
3722
- //# sourceMappingURL=farms-router-BFFs_D4v.js.map
3722
+ //# sourceMappingURL=farms-router-D1kQ7pOC.js.map