mirror of
https://github.com/Instadapp/Gelato-automations.git
synced 2024-07-29 22:28:07 +00:00
29 lines
740 B
Solidity
29 lines
740 B
Solidity
// SPDX-License-Identifier: UNLICENSED
|
|
pragma solidity 0.7.4;
|
|
|
|
library GelatoString {
|
|
function startsWithOK(string memory _str) internal pure returns (bool) {
|
|
if (
|
|
bytes(_str).length >= 2 &&
|
|
bytes(_str)[0] == "O" &&
|
|
bytes(_str)[1] == "K"
|
|
) return true;
|
|
return false;
|
|
}
|
|
|
|
function revertWithInfo(string memory _error, string memory _tracingInfo)
|
|
internal
|
|
pure
|
|
{
|
|
revert(string(abi.encodePacked(_tracingInfo, _error)));
|
|
}
|
|
|
|
function returnWithInfo(string memory _error, string memory _tracingInfo)
|
|
internal
|
|
pure
|
|
returns (string memory)
|
|
{
|
|
return string(abi.encodePacked(_tracingInfo, _error));
|
|
}
|
|
}
|