Skip to content

Commit

Permalink
Fix issue related to wUSDM token
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinNagpal committed Nov 26, 2024
1 parent baa2f33 commit be93d68
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions deployments/relations.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { RelationConfigMap } from '../plugins/deployment_manager/RelationConfig';
import {RelationConfigMap} from '../plugins/deployment_manager/RelationConfig';

const tokenAddressesToSymbols = {
'0x57F5E098CaD7A3D1Eed53991D4d66C45C9AF7812': 'wUSDM'
};

const relationConfigMap: RelationConfigMap = {
comptrollerV2: {
Expand All @@ -19,7 +23,7 @@ const relationConfigMap: RelationConfigMap = {
},
baseTokenPriceFeed: {
field: async (comet) => comet.baseTokenPriceFeed(),
alias: async (_, { baseToken }) => `${await baseToken[0].symbol()}:priceFeed`,
alias: async (_, {baseToken}) => `${await baseToken[0].symbol()}:priceFeed`,
},
assets: {
field: async (comet) => {
Expand All @@ -31,7 +35,10 @@ const relationConfigMap: RelationConfigMap = {
})
);
},
alias: async (token) => token.symbol(),
alias: async (token) => {
console.log(token.address);
return token.symbol?.() || tokenAddressesToSymbols[token.address] || token.address;
},
},
assetPriceFeeds: {
field: async (comet) => {
Expand All @@ -43,7 +50,13 @@ const relationConfigMap: RelationConfigMap = {
})
);
},
alias: async (_, { assets }, i) => `${await assets[i].symbol()}:priceFeed`,
alias: async (_, {assets}, i) => {
const asset = assets[i];
if(tokenAddressesToSymbols[asset.address]){
return `${tokenAddressesToSymbols[asset.address]}:priceFeed`;
}
return `${await asset.symbol()}:priceFeed`;
},
},
cometAdmin: {
field: {
Expand Down Expand Up @@ -71,7 +84,7 @@ const relationConfigMap: RelationConfigMap = {
}
},
cometFactory: {
field: async (configurator, { comet }) => configurator.factory(comet[0].address),
field: async (configurator, {comet}) => configurator.factory(comet[0].address),
}
}
},
Expand Down Expand Up @@ -129,7 +142,7 @@ const relationConfigMap: RelationConfigMap = {
rewards: {
relations: {
rewardToken: {
field: async (rewards, { comet }) => {
field: async (rewards, {comet}) => {
const rewardToken = (await rewards.rewardConfig(comet[0].address)).token;
return rewardToken !== '0x0000000000000000000000000000000000000000' ? rewardToken : null;
},
Expand Down

0 comments on commit be93d68

Please sign in to comment.