Skip to content

Commit

Permalink
Allow deployer product
Browse files Browse the repository at this point in the history
  • Loading branch information
prevostc committed Sep 2, 2024
1 parent 4bfd9bf commit f98acf9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/common/mapping/contract-deployer-initializable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ export function handleContractDeployedInitializableInitialized(event: Initialize
return
}

log.debug("Creating BeefyERC20Product template for {} from contract-deployer", [tokenAddress.toHexString()])

log.error("Creating BeefyERC20Product template for {} from contract-deployer initialize event", [tokenAddress.toHexString()])
fetchAndSaveTokenData(tokenAddress)
BeefyERC20ProductTemplate.create(tokenAddress)
}
10 changes: 6 additions & 4 deletions src/common/mapping/contract-deployer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,14 @@ export function handleContractDeployedWithDeployer(event: ContractDeployedEvent)
}

// if any of the calls return null, this is most likely an initializable contract
if (tokenDecimalsRes.value == null || tokenNameRes.value == null || tokenSymbolRes.value == null) {
log.info("Contract {} is probably innitializable, one of the metadata calls returned null", [address.toHexString()])

const tokenDecimals = tokenDecimalsRes.value
const tokenName = tokenNameRes.value
const tokenSymbol = tokenSymbolRes.value
if (tokenDecimals == 0 || tokenName == "" || tokenSymbol == "") {
log.error("Contract {} is probably innitializable, one of the metadata calls returned null", [address.toHexString()])
ContractDeployerInitializableTemplate.create(address)
} else {
log.debug("Creating BeefyERC20Product template for {} from contract-deployer", [address.toHexString()])
log.error("Creating BeefyERC20Product template for {} from contract-deployer", [address.toHexString()])
fetchAndSaveTokenData(address)
BeefyERC20ProductTemplate.create(address)
}
Expand Down

0 comments on commit f98acf9

Please sign in to comment.