2020-11-23 07:17:25 +00:00
|
|
|
// SPDX-License-Identifier: UNLICENSED
|
|
|
|
pragma solidity 0.7.4;
|
|
|
|
|
2020-11-23 09:56:20 +00:00
|
|
|
import {mul as _mul} from "./DSMath.sol";
|
2020-11-23 07:17:25 +00:00
|
|
|
|
2020-11-23 09:56:20 +00:00
|
|
|
function _stringToBytes32(string memory str) pure returns (bytes32 result) {
|
|
|
|
require(bytes(str).length != 0, "string-empty");
|
|
|
|
assembly {
|
|
|
|
result := mload(add(str, 32))
|
2020-11-23 07:17:25 +00:00
|
|
|
}
|
2020-11-23 09:56:20 +00:00
|
|
|
}
|
2020-11-23 07:17:25 +00:00
|
|
|
|
2020-11-23 09:56:20 +00:00
|
|
|
function _convertTo18(uint256 _dec, uint256 _amt) pure returns (uint256 amt) {
|
|
|
|
amt = _mul(_amt, 10**(18 - _dec));
|
|
|
|
}
|