My purpose is to mint token A by taking B token as collateral with the value 1B = A*4000. I have overridden _convertToShares & _convertToAssets as below. Is it right and safe to do like this? Thanks
function _convertToShares(uint256 assets, Math.Rounding rounding) internal view virtual override returns (uint256) {
rounding = Math.Rounding.Up;
return assets*4000;
}
function _convertToAssets(uint256 shares, Math.Rounding rounding) internal view virtual override returns (uint256) {
rounding = Math.Rounding.Up;
return shares/4000;
}