Created
June 5, 2023 18:54
-
-
Save gists-immunefi/6ce3f26b703a73dc3306e642149720b2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// takes a numeraire amount, calculates the raw amount of eurs, transfers it in and returns the corresponding raw amount | |
function intakeNumeraire(int128 _amount) | |
external | |
override | |
returns (uint256 amount_) | |
{ | |
uint256 _rate = getRate(); | |
amount_ = (_amount.mulu(10**tokenDecimals) * 10**oracleDecimals) / _rate; | |
require(amount_ > 0, "intakeNumeraire/zero-amount!"); | |
token.safeTransferFrom(msg.sender, address(this), amount_); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment