Skip to content

Commit

Permalink
fix: mapping of PoolManager to escrow addresses (#263)
Browse files Browse the repository at this point in the history
* fix: mapping of PoolManager to escrow addresses

* fix: add celo to escrow config
  • Loading branch information
filo87 authored Nov 6, 2024
1 parent a4e6c91 commit d09dfc0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 21 deletions.
8 changes: 2 additions & 6 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,14 +242,10 @@ export const tinlakePools = [
]

export const escrows = {
// PoolManager Contract Address: Escrow Address
'0x78E9e622A57f70F1E0Ec652A4931E4e278e58142': '0xd595E1483c507E74E2E6A3dE8e7D08d8f6F74936', //PoolManagerV1 (ETH,BASE)
'0x91808B5E2F6d7483D41A681034D7c9DbB64B9E29': '0x0000000005F458Fd6ba9EEb5f365D83b7dA913dD', //PoolManagerV2 (ETH)
'0x5c8657b827a138D52a4e3f03683A28B1FaD86893': '0x1AB6cD0c08120215E241a6108ae7458c995E1694', //PoolManagerV1 (SEPOLIA)
'0x7f192F34499DdB2bE06c4754CFf2a21c4B056994': '0x0000000005F458Fd6ba9EEb5f365D83b7dA913dD', //PoolManagerV2 (BASE)
}

export const userEscrows = {
'1': '0x9fc3A3bcEdc1CaB14EfC1B7ef45dFBDd3d17c9d7', // Ethereum mainnet
'8453': '0x9fc3A3bcEdc1CaB14EfC1B7ef45dFBDd3d17c9d7', // Base mainnet
'11155111': '0x80EFf9C87f48c50BF9c6c3998D26174410647621', // Ethereum sepolia
'0xa3Ce97352C1469884EEF3547Ec9362329FE78Cf0': '0x9EDf9FC14DDBEE68CE1a69827b09794367180717', //PoolManager V2 (CELO)
}
20 changes: 5 additions & 15 deletions src/mappings/handlers/evmHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,11 @@ async function _handleEvmDeployTranche(event: DeployTrancheLog): Promise<void> {
// TODO: fetch escrow from poolManager
//const poolManager = PoolManagerAbi__factory.connect(poolManagerAddress, ethApi)
//const escrowAddress = await poolManager.escrow()
if (!(tokenAddress in escrows)) throw new Error(`Escrow address for token ${tokenAddress} missing in config!`)
const escrowAddress: string = escrows[tokenAddress]

// TODO: fetch escrow from investmentManager
//const investmentManagerAddress = await poolManager.investmentManager()
//const investmentManager = InvestmentManagerAbi__factory.connect(investmentManagerAddress, ethApi)
//const userEscrowAddress = await investmentManager.userEscrow()
//const userEscrowAddress = userEscrows[chainId]

await currency.initTrancheDetails(
tranche.poolId,
tranche.trancheId,
tokenAddress,
escrowAddress
)
if (!(poolManagerAddress in escrows))
throw new Error(`Escrow address for PoolManager ${poolManagerAddress} missing in config!`)
const escrowAddress: string = escrows[poolManagerAddress]

await currency.initTrancheDetails(tranche.poolId, tranche.trancheId, tokenAddress, escrowAddress)
await currency.save()

await createTrancheTrackerDatasource({ address: tokenAddress })
Expand Down

0 comments on commit d09dfc0

Please sign in to comment.