Skip to content

Commit

Permalink
added in hardcoded IOO mantle oracle
Browse files Browse the repository at this point in the history
  • Loading branch information
jpick713 committed May 3, 2024
1 parent f8dcfb2 commit 31eaea7
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,7 @@ contract MysoMantleUsdOracle is ChainlinkBaseWithoutCheck, Ownable {
collToken,
loanToken
);
uint256 loanTokenDecimals = (loanToken == MYSO)
? 18
: IERC20Metadata(loanToken).decimals();
uint256 loanTokenDecimals = (loanToken == MYSO) ? 18 : 6;
collTokenPriceInLoanToken =
(priceOfCollToken * 10 ** loanTokenDecimals) /
priceOfLoanToken;
Expand Down
27 changes: 27 additions & 0 deletions test/peer-to-peer/mainnet-myso-oracle-forked-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -542,5 +542,32 @@ describe('Peer-to-Peer: Myso Recent Forked Mainnet Tests', function () {
)
}
})
it('Should set up myso on mantle IOO price correctly', async function () {
const { lender, team, testnetTokenManager } = await setupTest()

const myso = '0x25bA1ED5DEEA9d8e8add565dA069Ed1eDA397C12'
const usdc = '0x09Bc4E0D864854c6aFB6eB9A9cdF58aC190D0dF9'

// deploy myso oracle
const MysoOracle = await ethers.getContractFactory('MysoMantleUsdOracle')

const mysoOracle = await MysoOracle.connect(lender).deploy(
[],
[],
team.address,
testnetTokenManager.address,
55000000,
ethers.BigNumber.from('660000000000000000'),
1650,
1000
)
await mysoOracle.deployed()

const usdcCollMysoLoanPrice = await mysoOracle.getPrice(usdc, myso)
const mysoCollUsdcLoanPrice = await mysoOracle.getPrice(myso, usdc)

console.log('usdcCollMysoLoanPrice', ethers.utils.formatUnits(usdcCollMysoLoanPrice, 18))
console.log('mysoCollUsdcLoanPrice', ethers.utils.formatUnits(mysoCollUsdcLoanPrice, 6))
})
})
})

0 comments on commit 31eaea7

Please sign in to comment.