Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save gists-immunefi/6ce3f26b703a73dc3306e642149720b2 to your computer and use it in GitHub Desktop.
Save gists-immunefi/6ce3f26b703a73dc3306e642149720b2 to your computer and use it in GitHub Desktop.
// 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