Skip to content

Commit

Permalink
fix: do not index a misdeployed instance on goerli (#37)
Browse files Browse the repository at this point in the history
* fix: do not index a misdeployed instance on goerli

* feat: utils to check address in an array
  • Loading branch information
gauthiermyr authored Dec 1, 2023
1 parent 581bb15 commit 62c79ae
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/ProxyFactory.mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
checkChannel
} from './utils/IntegrationChannel.utils';
import { Address, BigInt } from '@graphprotocol/graph-ts';
import { externalEntityUUID } from './utils/utils';
import { addressInArray, externalEntityUUID } from './utils/utils';
import { getOrCreateRewardSummaries } from './utils/rewards';
import { getOrCreateTUPProxy } from './TUPProxy.mapping';

Expand All @@ -36,6 +36,10 @@ export function handleDeployedProxy(event: DeployedProxy): void {
channel.equals(CHANNEL_LIQUID_20_A_vPOOL_BYTES32) ||
channel.equals(CHANNEL_LIQUID_20_C_vPOOL_BYTES32)
) {
//check is only for a goerli failed instance
if (addressInArray(event.params.proxy, [Address.fromString('0xd32e4d4cbde76738a766f5413323d8a52838e145')])) {
return;
}
ERC20Template.create(event.params.proxy);
ERC20_1_0_0_rc4Template.create(event.params.proxy);

Expand Down
9 changes: 9 additions & 0 deletions src/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -931,3 +931,12 @@ export function createERC20ExitSystemEvent(

systemEvent.save();
}

export function addressInArray(address: Address, array: Array<Address>): boolean {
for (let i = 0; i < array.length; i++) {
if (address.equals(array[i])) {
return true;
}
}
return false;
}

0 comments on commit 62c79ae

Please sign in to comment.