mirror of
https://github.com/Instadapp/Gelato-automations.git
synced 2024-07-29 22:28:07 +00:00
19 lines
475 B
Solidity
19 lines
475 B
Solidity
|
// SPDX-License-Identifier: UNLICENSED
|
||
|
pragma solidity 0.7.4;
|
||
|
|
||
|
import {RAY, add, sub, mul} from "./DSMath.sol";
|
||
|
|
||
|
function _stringToBytes32(string memory str)
|
||
|
pure
|
||
|
returns (bytes32 result)
|
||
|
{
|
||
|
require(bytes(str).length != 0, "string-empty");
|
||
|
assembly {
|
||
|
result := mload(add(str, 32))
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function _convertTo18(uint256 _dec, uint256 _amt)
|
||
|
pure returns (uint256 amt) {
|
||
|
amt = mul(_amt, 10**(18 - _dec));
|
||
|
}
|