mirror of
https://github.com/Instadapp/Gelato-automations.git
synced 2024-07-29 22:28:07 +00:00
16 lines
418 B
Solidity
16 lines
418 B
Solidity
// SPDX-License-Identifier: UNLICENSED
|
|
pragma solidity 0.7.4;
|
|
|
|
import {mul as _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));
|
|
}
|