Skip to content

Commit adc96c5

Browse files
committed
feat: If a link to a token is sent to an oracle account where the oracle does not have that link price,
1 parent a694ab0 commit adc96c5

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

models/aggregated_block_feed/base_price_feed/call_and_process.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ func (mdl *BasePriceFeed) GetUnderlyingCalls(blockNum int64) (calls []multicall.
112112
}
113113
if tokenDetails != nil {
114114
pod := mdl.Repo.GetRedStonemgr().GetPodSignWithRedstoneToken(int64(mdl.Repo.SetAndGetBlock(blockNum).Timestamp), *tokenDetails)
115-
log.Info(pod.CallData)
115+
// log.Info(pod.CallData)
116116
update, err := updateABI.Pack("updatePrice", pod.CallData)
117117
log.CheckFatal(err)
118118
calls = append(calls, multicall.Multicall2Call{

repository/token.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ func (repo *Repository) getValueInCurrency(blockNum int64, oracle schemas.PriceO
6666
BlockNumber: big.NewInt(blockNum),
6767
}
6868
currencyAddr := repo.GetUSD()
69-
if oracle.Hex().Hex() == "0x6385892aCB085eaa24b745a712C9e682d80FF681" && token == "0x514910771AF9Ca656af840dff83E8264EcF986CA" && currency == "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48" && blockNum == 23465629 {
69+
if oracle.Hex().Hex() == "0x6385892aCB085eaa24b745a712C9e682d80FF681" && token == "0x514910771AF9Ca656af840dff83E8264EcF986CA" &&
70+
(currency == "USD" || currency == "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48") && blockNum == 23465629 {
7071
return 21.432 * utils.GetFloat64Decimal(amount, repo.GetToken(token).Decimals) // link token price and amount for usd conversion
7172
}
7273
if currency != "USD" {

0 commit comments

Comments
 (0)