Gelato-automations/deployments/mainnet/ConditionDestVaultWillBeSafe.json
2020-11-29 09:47:38 +01:00

172 lines
59 KiB
JSON

{
"address": "0x071E71b22d2442C8556c7317F1944b5Bb63a6750",
"abi": [
{
"inputs": [
{
"internalType": "address",
"name": "_dsa",
"type": "address"
},
{
"internalType": "uint256",
"name": "_fromVaultId",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "_destVaultId",
"type": "uint256"
},
{
"internalType": "string",
"name": "_destColType",
"type": "string"
}
],
"name": "destVaultWillBeSafe",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_vaultId",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "_wDaiToBorrow",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "_wColToDeposit",
"type": "uint256"
},
{
"internalType": "string",
"name": "_colType",
"type": "string"
}
],
"name": "destVaultWillBeSafeExplicit",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_dsa",
"type": "address"
},
{
"internalType": "uint256",
"name": "_fromVaultId",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "_destVaultId",
"type": "uint256"
},
{
"internalType": "string",
"name": "_destColType",
"type": "string"
}
],
"name": "getConditionData",
"outputs": [
{
"internalType": "bytes",
"name": "",
"type": "bytes"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "_conditionData",
"type": "bytes"
},
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"name": "ok",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
}
],
"transactionHash": "0xffc2a41fa1abbd7a044f9228c8737a39e1785ff37ea97e4b1af20ae44d90d862",
"receipt": {
"to": null,
"from": "0x5B753BF02a42bC73B5846dfd16a8F2e082b99a6a",
"contractAddress": "0x071E71b22d2442C8556c7317F1944b5Bb63a6750",
"transactionIndex": 120,
"gasUsed": "1452357",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"blockHash": "0x596b5e6ec622a8f22e28094355f032e608825d1a6eb270900900f00da7c6e45b",
"transactionHash": "0xffc2a41fa1abbd7a044f9228c8737a39e1785ff37ea97e4b1af20ae44d90d862",
"logs": [],
"blockNumber": 11348203,
"cumulativeGasUsed": "12093406",
"status": 1,
"byzantium": true
},
"args": [],
"solcInputHash": "bf7cd3f181208953a3fd533c358cf962",
"metadata": "{\"compiler\":{\"version\":\"0.7.4+commit.3f05b770\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dsa\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_fromVaultId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_destVaultId\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"_destColType\",\"type\":\"string\"}],\"name\":\"destVaultWillBeSafe\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_vaultId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_wDaiToBorrow\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_wColToDeposit\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"_colType\",\"type\":\"string\"}],\"name\":\"destVaultWillBeSafeExplicit\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dsa\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_fromVaultId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_destVaultId\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"_destColType\",\"type\":\"string\"}],\"name\":\"getConditionData\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_conditionData\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"ok\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/contracts/gelato/conditions/ConditionDestVaultWillBeSafe.sol\":\"ConditionDestVaultWillBeSafe\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@gelatonetwork/core/contracts/conditions/GelatoConditionsStandard.sol\":{\"content\":\"// \\\"SPDX-License-Identifier: UNLICENSED\\\"\\npragma solidity >=0.6.10;\\n\\nimport \\\"./IGelatoCondition.sol\\\";\\n\\nabstract contract GelatoConditionsStandard is IGelatoCondition {\\n string internal constant OK = \\\"OK\\\";\\n}\\n\",\"keccak256\":\"0xa3d9ee5c4398914bbc0fe75fe54e57b73b8a4367caf9a40d9e5fd1ba9d4adb89\",\"license\":\"UNLICENSED\"},\"@gelatonetwork/core/contracts/conditions/IGelatoCondition.sol\":{\"content\":\"// \\\"SPDX-License-Identifier: UNLICENSED\\\"\\npragma solidity >=0.6.10;\\npragma experimental ABIEncoderV2;\\n\\n/// @title IGelatoCondition - solidity interface of GelatoConditionsStandard\\n/// @notice all the APIs of GelatoConditionsStandard\\n/// @dev all the APIs are implemented inside GelatoConditionsStandard\\ninterface IGelatoCondition {\\n\\n /// @notice GelatoCore calls this to verify securely the specified Condition securely\\n /// @dev Be careful only to encode a Task's condition.data as is and not with the\\n /// \\\"ok\\\" selector or _taskReceiptId, since those two things are handled by GelatoCore.\\n /// @param _taskReceiptId This is passed by GelatoCore so we can rely on it as a secure\\n /// source of Task identification.\\n /// @param _conditionData This is the Condition.data field developers must encode their\\n /// Condition's specific parameters in.\\n /// @param _cycleId For Tasks that are executed as part of a cycle.\\n function ok(uint256 _taskReceiptId, bytes calldata _conditionData, uint256 _cycleId)\\n external\\n view\\n returns(string memory);\\n}\",\"keccak256\":\"0xd07607af93227ec5f8c2f5401289937b98c298f0d2398c1ba7410f82a6253964\",\"license\":\"UNLICENSED\"},\"contracts/constants/CDebtBridge.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity 0.7.4;\\n\\nfunction GAS_COSTS_FOR_FULL_REFINANCE() pure returns (uint256[4] memory) {\\n return [uint256(2000000), 2400000, 2850000, 3500000];\\n}\\n\\nuint256 constant PREMIUM = 20;\\nuint256 constant VAULT_CREATION_COST = 150000;\\n\",\"keccak256\":\"0x6f1d97db0c063fb543f009496d5a4bc268b436d19cbc9fa609557220e8a59f38\",\"license\":\"UNLICENSED\"},\"contracts/constants/CGelato.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity 0.7.4;\\n\\nimport {\\n IGelatoGasPriceOracle\\n} from \\\"../interfaces/gelato/IGelatoGasPriceOracle.sol\\\";\\n\\nIGelatoGasPriceOracle constant GELATO_GAS_PRICE_ORACLE = IGelatoGasPriceOracle(\\n 0x169E633A2D1E6c10dD91238Ba11c4A708dfEF37C\\n);\\n\",\"keccak256\":\"0xc74081014a09fb9211119b434c31dc97a3a937b13b45de9f9abcebfb56c7e9ba\",\"license\":\"UNLICENSED\"},\"contracts/constants/CInstaDapp.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity 0.7.4;\\n\\n// InstaDapp\\naddress constant INSTA_MEMORY = 0x8a5419CfC711B2343c17a6ABf4B2bAFaBb06957F;\\n\\n// Connectors\\naddress constant CONNECT_MAKER = 0xac02030d8a8F49eD04b2f52C394D3F901A10F8A9;\\naddress constant CONNECT_COMPOUND = 0x15FdD1e902cAC70786fe7D31013B1a806764B5a2;\\naddress constant INSTA_POOL_V2 = 0xeB4bf86589f808f90EEC8e964dBF16Bd4D284905;\\n\\n// Tokens\\naddress constant ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;\\naddress constant DAI = 0x6B175474E89094C44Da98b954EedeAC495271d0F;\\n\\n// Insta Pool\\naddress constant INSTA_POOL_RESOLVER = 0xa004a5afBa04b74037E9E52bA1f7eb02b5E61509;\\nuint256 constant ROUTE_1_TOLERANCE = 1005e15;\\n\\n// Insta Mapping\\naddress constant INSTA_MAPPING = 0xe81F70Cc7C0D46e12d70efc60607F16bbD617E88;\\n\",\"keccak256\":\"0x0cbe5f37f9df8be40b791e526926ff413816606b8917976693765925bd3b5f27\",\"license\":\"UNLICENSED\"},\"contracts/constants/CMaker.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity 0.7.4;\\n\\naddress constant MCD_MANAGER = 0x5ef30b9986345249bc32d8928B7ee64DE9435E39;\\n\",\"keccak256\":\"0x216362392e679feeaebba65883e7ab77e5a96e1a881f9305d83f3d3881fbddc4\",\"license\":\"UNLICENSED\"},\"contracts/contracts/gelato/conditions/ConditionDestVaultWillBeSafe.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity 0.7.4;\\npragma experimental ABIEncoderV2;\\n\\nimport {\\n GelatoConditionsStandard\\n} from \\\"@gelatonetwork/core/contracts/conditions/GelatoConditionsStandard.sol\\\";\\nimport {\\n _getMakerVaultDebt,\\n _getMakerVaultCollateralBalance,\\n _vaultWillBeSafe,\\n _newVaultWillBeSafe,\\n _isVaultOwner\\n} from \\\"../../../functions/dapps/FMaker.sol\\\";\\nimport {DAI} from \\\"../../../constants/CInstaDapp.sol\\\";\\nimport {\\n _getFlashLoanRoute,\\n _getGasCostMakerToMaker,\\n _getRealisedDebt\\n} from \\\"../../../functions/gelato/FGelatoDebtBridge.sol\\\";\\nimport {_getGelatoExecutorFees} from \\\"../../../functions/gelato/FGelato.sol\\\";\\nimport {GelatoBytes} from \\\"../../../lib/GelatoBytes.sol\\\";\\nimport {sub} from \\\"../../../vendor/DSMath.sol\\\";\\n\\ncontract ConditionDestVaultWillBeSafe is GelatoConditionsStandard {\\n using GelatoBytes for bytes;\\n\\n function getConditionData(\\n address _dsa,\\n uint256 _fromVaultId,\\n uint256 _destVaultId,\\n string calldata _destColType\\n ) public pure virtual returns (bytes memory) {\\n return\\n abi.encodeWithSelector(\\n this.destVaultWillBeSafe.selector,\\n _dsa,\\n _fromVaultId,\\n _destVaultId,\\n _destColType\\n );\\n }\\n\\n function ok(\\n uint256,\\n bytes calldata _conditionData,\\n uint256\\n ) public view virtual override returns (string memory) {\\n (\\n address _dsa,\\n uint256 _fromVaultId,\\n uint256 _destVaultId,\\n string memory _destColType\\n ) = abi.decode(_conditionData[4:], (address, uint256, uint256, string));\\n\\n return\\n destVaultWillBeSafe(_dsa, _fromVaultId, _destVaultId, _destColType);\\n }\\n\\n function destVaultWillBeSafe(\\n address _dsa,\\n uint256 _fromVaultId,\\n uint256 _destVaultId,\\n string memory _destColType\\n ) public view returns (string memory) {\\n _destVaultId = _isVaultOwner(_destVaultId, _dsa) ? _destVaultId : 0;\\n uint256 wDaiToBorrow =\\n _getRealisedDebt(_getMakerVaultDebt(_fromVaultId));\\n uint256 wColToDeposit =\\n sub(\\n _getMakerVaultCollateralBalance(_fromVaultId),\\n _getGelatoExecutorFees(\\n _getGasCostMakerToMaker(\\n _destVaultId == 0,\\n _getFlashLoanRoute(DAI, wDaiToBorrow)\\n )\\n )\\n );\\n\\n return\\n destVaultWillBeSafeExplicit(\\n _destVaultId,\\n wDaiToBorrow,\\n wColToDeposit,\\n _destColType\\n )\\n ? OK\\n : \\\"DestVaultWillNotBeSafe\\\";\\n }\\n\\n function destVaultWillBeSafeExplicit(\\n uint256 _vaultId,\\n uint256 _wDaiToBorrow,\\n uint256 _wColToDeposit,\\n string memory _colType\\n ) public view returns (bool) {\\n return\\n _vaultId == 0\\n ? _newVaultWillBeSafe(_colType, _wDaiToBorrow, _wColToDeposit)\\n : _vaultWillBeSafe(_vaultId, _wDaiToBorrow, _wColToDeposit);\\n }\\n}\\n\",\"keccak256\":\"0x6fb69756be733a73fd60aa2b993dab629bea52252da94bc228cfb7453d374b76\",\"license\":\"UNLICENSED\"},\"contracts/functions/dapps/FMaker.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity 0.7.4;\\n\\nimport {MCD_MANAGER} from \\\"../../constants/CMaker.sol\\\";\\nimport {INSTA_MAPPING} from \\\"../../constants/CInstaDapp.sol\\\";\\nimport {\\n ITokenJoinInterface\\n} from \\\"../../interfaces/dapps/Maker/ITokenJoinInterface.sol\\\";\\nimport {IMcdManager} from \\\"../../interfaces/dapps/Maker/IMcdManager.sol\\\";\\nimport {InstaMapping} from \\\"../../interfaces/InstaDapp/IInstaDapp.sol\\\";\\nimport {IVat} from \\\"../../interfaces/dapps/Maker/IVat.sol\\\";\\nimport {RAY, add, sub, mul} from \\\"../../vendor/DSMath.sol\\\";\\nimport {_stringToBytes32, _convertTo18} from \\\"../../vendor/Convert.sol\\\";\\n\\nfunction _getMakerVaultDebt(uint256 _vaultId) view returns (uint256 wad) {\\n IMcdManager manager = IMcdManager(MCD_MANAGER);\\n\\n (bytes32 ilk, address urn) = _getVaultData(manager, _vaultId);\\n IVat vat = IVat(manager.vat());\\n (, uint256 rate, , , ) = vat.ilks(ilk);\\n (, uint256 art) = vat.urns(ilk, urn);\\n uint256 dai = vat.dai(urn);\\n\\n uint256 rad = sub(mul(art, rate), dai);\\n wad = rad / RAY;\\n\\n wad = mul(wad, RAY) < rad ? wad + 1 : wad;\\n}\\n\\nfunction _getMakerRawVaultDebt(uint256 _vaultId) view returns (uint256 tab) {\\n IMcdManager manager = IMcdManager(MCD_MANAGER);\\n\\n (bytes32 ilk, address urn) = _getVaultData(manager, _vaultId);\\n IVat vat = IVat(manager.vat());\\n (, uint256 rate, , , ) = vat.ilks(ilk);\\n (, uint256 art) = vat.urns(ilk, urn);\\n\\n uint256 rad = mul(art, rate);\\n\\n tab = rad / RAY;\\n tab = mul(tab, RAY) < rad ? tab + 1 : tab;\\n}\\n\\nfunction _getMakerVaultCollateralBalance(uint256 _vaultId)\\n view\\n returns (uint256)\\n{\\n IMcdManager manager = IMcdManager(MCD_MANAGER);\\n\\n IVat vat = IVat(manager.vat());\\n (bytes32 ilk, address urn) = _getVaultData(manager, _vaultId);\\n (uint256 ink, ) = vat.urns(ilk, urn);\\n\\n return ink;\\n}\\n\\nfunction _vaultWillBeSafe(\\n uint256 _vaultId,\\n uint256 _amtToBorrow,\\n uint256 _colToDeposit\\n) view returns (bool) {\\n require(_vaultId != 0, \\\"_vaultWillBeSafe: invalid vault id.\\\");\\n\\n IMcdManager manager = IMcdManager(MCD_MANAGER);\\n\\n (bytes32 ilk, address urn) = _getVaultData(manager, _vaultId);\\n\\n ITokenJoinInterface tokenJoinContract =\\n ITokenJoinInterface(InstaMapping(INSTA_MAPPING).gemJoinMapping(ilk));\\n\\n IVat vat = IVat(manager.vat());\\n (, uint256 rate, uint256 spot, , ) = vat.ilks(ilk);\\n (uint256 ink, uint256 art) = vat.urns(ilk, urn);\\n uint256 dai = vat.dai(urn);\\n\\n uint256 dink = _convertTo18(tokenJoinContract.dec(), _colToDeposit);\\n uint256 dart = _getBorrowAmt(_amtToBorrow, dai, rate);\\n\\n ink = add(ink, dink);\\n art = add(art, dart);\\n\\n uint256 tab = mul(rate, art);\\n\\n return tab <= mul(ink, spot);\\n}\\n\\nfunction _newVaultWillBeSafe(\\n string memory _colType,\\n uint256 _amtToBorrow,\\n uint256 _colToDeposit\\n) view returns (bool) {\\n IMcdManager manager = IMcdManager(MCD_MANAGER);\\n IVat vat = IVat(manager.vat());\\n\\n bytes32 ilk = _stringToBytes32(_colType);\\n\\n (, uint256 rate, uint256 spot, , ) = vat.ilks(ilk);\\n\\n ITokenJoinInterface tokenJoinContract =\\n ITokenJoinInterface(InstaMapping(INSTA_MAPPING).gemJoinMapping(ilk));\\n\\n uint256 ink = _convertTo18(tokenJoinContract.dec(), _colToDeposit);\\n uint256 art = _getBorrowAmt(_amtToBorrow, 0, rate);\\n\\n uint256 tab = mul(rate, art);\\n\\n return tab <= mul(ink, spot);\\n}\\n\\nfunction _getVaultData(IMcdManager manager, uint256 vault)\\n view\\n returns (bytes32 ilk, address urn)\\n{\\n ilk = manager.ilks(vault);\\n urn = manager.urns(vault);\\n}\\n\\nfunction _getBorrowAmt(\\n uint256 _amt,\\n uint256 _dai,\\n uint256 _rate\\n) pure returns (uint256 dart) {\\n dart = sub(mul(_amt, RAY), _dai) / _rate;\\n dart = mul(dart, _rate) < mul(_amt, RAY) ? dart + 1 : dart;\\n}\\n\\nfunction _isVaultOwner(uint256 _vaultId, address _owner) view returns (bool) {\\n if (_vaultId == 0) return false;\\n\\n try IMcdManager(MCD_MANAGER).owns(_vaultId) returns (address owner) {\\n return _owner == owner;\\n } catch Error(string memory error) {\\n revert(string(abi.encodePacked(\\\"FMaker._isVaultOwner:\\\", error)));\\n } catch {\\n revert(\\\"FMaker._isVaultOwner:undefined\\\");\\n }\\n}\\n\",\"keccak256\":\"0xf0717d8116b60ba87e0ea9cd1ce0ec2c105f29cec41c1964d6f3a4b89e372cab\",\"license\":\"UNLICENSED\"},\"contracts/functions/gelato/FGelato.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity 0.7.4;\\n\\nimport {GELATO_GAS_PRICE_ORACLE} from \\\"../../constants/CGelato.sol\\\";\\nimport {mul} from \\\"../../vendor/DSMath.sol\\\";\\n\\nfunction _getGelatoGasPrice() view returns (uint256) {\\n int256 oracleGasPrice = GELATO_GAS_PRICE_ORACLE.latestAnswer();\\n if (oracleGasPrice <= 0) revert(\\\"_getGelatoGasPrice:0orBelow\\\");\\n return uint256(oracleGasPrice);\\n}\\n\\nfunction _getGelatoExecutorFees(uint256 _gas) view returns (uint256) {\\n return mul(_gas, _getGelatoGasPrice());\\n}\\n\",\"keccak256\":\"0x99d0f6c116d772e7c97b5c4eeffa01ae79ad2d53bfa3977a923ba5cfa090dcca\",\"license\":\"UNLICENSED\"},\"contracts/functions/gelato/FGelatoDebtBridge.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity 0.7.4;\\npragma experimental ABIEncoderV2;\\n\\nimport {add, sub, mul, wmul, wdiv} from \\\"../../vendor/DSMath.sol\\\";\\nimport {\\n INSTA_POOL_RESOLVER,\\n ROUTE_1_TOLERANCE\\n} from \\\"../../constants/CInstaDapp.sol\\\";\\nimport {\\n GAS_COSTS_FOR_FULL_REFINANCE,\\n PREMIUM,\\n VAULT_CREATION_COST\\n} from \\\"../../constants/CDebtBridge.sol\\\";\\nimport {\\n IInstaPoolResolver\\n} from \\\"../../interfaces/InstaDapp/resolvers/IInstaPoolResolver.sol\\\";\\n\\nfunction _wCalcCollateralToWithdraw(\\n uint256 _wMinColRatioA,\\n uint256 _wMinColRatioB,\\n uint256 _wColPrice,\\n uint256 _wPricedCol,\\n uint256 _wDebtOnA\\n) pure returns (uint256) {\\n return\\n wdiv(\\n sub(\\n _wPricedCol,\\n wdiv(\\n sub(\\n wmul(_wMinColRatioA, _wPricedCol),\\n wmul(_wMinColRatioA, wmul(_wMinColRatioB, _wDebtOnA))\\n ),\\n sub(_wMinColRatioA, _wMinColRatioB)\\n )\\n ),\\n _wColPrice\\n );\\n}\\n\\nfunction _wCalcDebtToRepay(\\n uint256 _wMinColRatioA,\\n uint256 _wMinColRatioB,\\n uint256 _wPricedCol,\\n uint256 _wDebtOnA\\n) pure returns (uint256) {\\n return\\n sub(\\n _wDebtOnA,\\n wmul(\\n wdiv(1e18, _wMinColRatioA),\\n wdiv(\\n sub(\\n wmul(_wMinColRatioA, _wPricedCol),\\n wmul(_wMinColRatioA, wmul(_wMinColRatioB, _wDebtOnA))\\n ),\\n sub(_wMinColRatioA, _wMinColRatioB)\\n )\\n )\\n );\\n}\\n\\nfunction _getFlashLoanRoute(address _tokenA, uint256 _wTokenADebtToMove)\\n view\\n returns (uint256)\\n{\\n IInstaPoolResolver.RouteData memory rData =\\n IInstaPoolResolver(INSTA_POOL_RESOLVER).getTokenLimit(_tokenA);\\n\\n if (rData.dydx > _wTokenADebtToMove) return 0;\\n if (rData.maker > _wTokenADebtToMove) return 1;\\n if (rData.compound > _wTokenADebtToMove) return 2;\\n if (rData.aave > _wTokenADebtToMove) return 3;\\n revert(\\\"FGelatoDebtBridge._getFlashLoanRoute: illiquid\\\");\\n}\\n\\nfunction _getGasCostMakerToMaker(bool _newVault, uint256 _route)\\n pure\\n returns (uint256)\\n{\\n _checkRouteIndex(_route);\\n return\\n _getGasCostPremium(\\n _newVault\\n ? add(\\n GAS_COSTS_FOR_FULL_REFINANCE()[_route],\\n VAULT_CREATION_COST\\n )\\n : GAS_COSTS_FOR_FULL_REFINANCE()[_route]\\n );\\n}\\n\\nfunction _getGasCostMakerToCompound(uint256 _route) pure returns (uint256) {\\n _checkRouteIndex(_route);\\n return _getGasCostPremium(GAS_COSTS_FOR_FULL_REFINANCE()[_route]);\\n}\\n\\nfunction _getGasCostPremium(uint256 _rawGasCost) pure returns (uint256) {\\n return mul(_rawGasCost, add(100, PREMIUM)) / 100;\\n}\\n\\nfunction _getRealisedDebt(uint256 _debtToMove) pure returns (uint256) {\\n return wmul(_debtToMove, ROUTE_1_TOLERANCE);\\n}\\n\\nfunction _checkRouteIndex(uint256 _route) pure {\\n require(\\n _route <= 4,\\n \\\"FGelatoDebtBridge._getGasCostMakerToMaker: invalid route index\\\"\\n );\\n}\\n\",\"keccak256\":\"0x6a54ab47243c50da6599bed5036ad32f49387ad709127b019a217e1c1335ab2f\",\"license\":\"UNLICENSED\"},\"contracts/interfaces/InstaDapp/IInstaDapp.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity 0.7.4;\\npragma experimental ABIEncoderV2;\\n\\n/// @notice Interface InstaDapp Index\\ninterface IndexInterface {\\n function connectors(uint256 version) external view returns (address);\\n\\n function list() external view returns (address);\\n}\\n\\n/// @notice Interface InstaDapp List\\ninterface ListInterface {\\n function accountID(address _account) external view returns (uint64);\\n}\\n\\n/// @notice Interface InstaDapp InstaMemory\\ninterface MemoryInterface {\\n function setUint(uint256 _id, uint256 _val) external;\\n\\n function getUint(uint256 _id) external returns (uint256);\\n}\\n\\n/// @notice Interface InstaDapp Defi Smart Account wallet\\ninterface AccountInterface {\\n function cast(\\n address[] calldata _targets,\\n bytes[] calldata _datas,\\n address _origin\\n ) external payable returns (bytes32[] memory responses);\\n\\n function version() external view returns (uint256);\\n\\n function isAuth(address user) external view returns (bool);\\n\\n function shield() external view returns (bool);\\n}\\n\\ninterface ConnectorInterface {\\n function connectorID() external view returns (uint256 _type, uint256 _id);\\n\\n function name() external view returns (string memory);\\n}\\n\\ninterface InstaMapping {\\n function gemJoinMapping(bytes32) external view returns (address);\\n}\\n\",\"keccak256\":\"0x09243467e98503c35d8f5b972c5595ee2684f64bf080f46785e7b85aca83562d\",\"license\":\"UNLICENSED\"},\"contracts/interfaces/InstaDapp/resolvers/IInstaPoolResolver.sol\":{\"content\":\"// \\\"SPDX-License-Identifier: UNLICENSED\\\"\\npragma solidity 0.7.4;\\npragma experimental ABIEncoderV2;\\n\\ninterface IInstaPoolResolver {\\n struct RouteData {\\n uint256 dydx;\\n uint256 maker;\\n uint256 compound;\\n uint256 aave;\\n }\\n\\n function getTokenLimit(address token)\\n external\\n view\\n returns (RouteData memory);\\n}\\n\",\"keccak256\":\"0x036703684cf8156fdc57c8d6ed583b2d273688e1dd26cf78c19bf2fbb59c7885\",\"license\":\"UNLICENSED\"},\"contracts/interfaces/dapps/Maker/IMcdManager.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity 0.7.4;\\n\\ninterface IMcdManager {\\n function ilks(uint256) external view returns (bytes32);\\n\\n function urns(uint256) external view returns (address);\\n\\n function vat() external view returns (address);\\n\\n function owns(uint256) external view returns (address);\\n}\\n\",\"keccak256\":\"0x53eec95121b3713ce3b308a5fd41935dad42ebd5b90fd4565677c20f2238dc2e\",\"license\":\"UNLICENSED\"},\"contracts/interfaces/dapps/Maker/ITokenJoinInterface.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity 0.7.4;\\n\\ninterface ITokenJoinInterface {\\n function dec() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x9f4ce4d37db51dfd0c9d536e630a3c5a4df3cfeb46aef16d8e78222c9c66c3de\",\"license\":\"UNLICENSED\"},\"contracts/interfaces/dapps/Maker/IVat.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity 0.7.4;\\n\\ninterface IVat {\\n function ilks(bytes32)\\n external\\n view\\n returns (\\n uint256,\\n uint256,\\n uint256,\\n uint256,\\n uint256\\n );\\n\\n function dai(address) external view returns (uint256);\\n\\n function urns(bytes32, address) external view returns (uint256, uint256);\\n}\\n\",\"keccak256\":\"0xde979af6019a257b13de06e94180a344fe8cd2e7dc0790988b8f6204a01f95e8\",\"license\":\"UNLICENSED\"},\"contracts/interfaces/gelato/IGelatoGasPriceOracle.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity 0.7.4;\\n\\ninterface IGelatoGasPriceOracle {\\n function latestAnswer() external view returns (int256);\\n}\\n\",\"keccak256\":\"0x0fee271af60cac14cba61a365efbaaa6c214965e2ea9ce70c1a2eb62b8d57db5\",\"license\":\"UNLICENSED\"},\"contracts/lib/GelatoBytes.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity 0.7.4;\\n\\nlibrary GelatoBytes {\\n function calldataSliceSelector(bytes calldata _bytes)\\n internal\\n pure\\n returns (bytes4 selector)\\n {\\n selector =\\n _bytes[0] |\\n (bytes4(_bytes[1]) >> 8) |\\n (bytes4(_bytes[2]) >> 16) |\\n (bytes4(_bytes[3]) >> 24);\\n }\\n\\n function memorySliceSelector(bytes memory _bytes)\\n internal\\n pure\\n returns (bytes4 selector)\\n {\\n selector =\\n _bytes[0] |\\n (bytes4(_bytes[1]) >> 8) |\\n (bytes4(_bytes[2]) >> 16) |\\n (bytes4(_bytes[3]) >> 24);\\n }\\n\\n function revertWithError(bytes memory _bytes, string memory _tracingInfo)\\n internal\\n pure\\n {\\n // 68: 32-location, 32-length, 4-ErrorSelector, UTF-8 err\\n if (_bytes.length % 32 == 4) {\\n bytes4 selector;\\n assembly {\\n selector := mload(add(0x20, _bytes))\\n }\\n if (selector == 0x08c379a0) {\\n // Function selector for Error(string)\\n assembly {\\n _bytes := add(_bytes, 68)\\n }\\n revert(string(abi.encodePacked(_tracingInfo, string(_bytes))));\\n } else {\\n revert(\\n string(abi.encodePacked(_tracingInfo, \\\"NoErrorSelector\\\"))\\n );\\n }\\n } else {\\n revert(\\n string(abi.encodePacked(_tracingInfo, \\\"UnexpectedReturndata\\\"))\\n );\\n }\\n }\\n\\n function returnError(bytes memory _bytes, string memory _tracingInfo)\\n internal\\n pure\\n returns (string memory)\\n {\\n // 68: 32-location, 32-length, 4-ErrorSelector, UTF-8 err\\n if (_bytes.length % 32 == 4) {\\n bytes4 selector;\\n assembly {\\n selector := mload(add(0x20, _bytes))\\n }\\n if (selector == 0x08c379a0) {\\n // Function selector for Error(string)\\n assembly {\\n _bytes := add(_bytes, 68)\\n }\\n return string(abi.encodePacked(_tracingInfo, string(_bytes)));\\n } else {\\n return\\n string(abi.encodePacked(_tracingInfo, \\\"NoErrorSelector\\\"));\\n }\\n } else {\\n return\\n string(abi.encodePacked(_tracingInfo, \\\"UnexpectedReturndata\\\"));\\n }\\n }\\n}\\n\",\"keccak256\":\"0x9038c820e041814ca2311bf582f2123171865b36c9438a7c6f85eb99406ec45c\",\"license\":\"UNLICENSED\"},\"contracts/vendor/Convert.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity 0.7.4;\\n\\nimport {mul as _mul} from \\\"./DSMath.sol\\\";\\n\\nfunction _stringToBytes32(string memory str) pure returns (bytes32 result) {\\n require(bytes(str).length != 0, \\\"string-empty\\\");\\n assembly {\\n result := mload(add(str, 32))\\n }\\n}\\n\\nfunction _convertTo18(uint256 _dec, uint256 _amt) pure returns (uint256 amt) {\\n amt = _mul(_amt, 10**(18 - _dec));\\n}\\n\",\"keccak256\":\"0x7feec80ffbcff215032733f837e646f1389aa8052cf9aa2d7a33aac0249a1bc4\",\"license\":\"UNLICENSED\"},\"contracts/vendor/DSMath.sol\":{\"content\":\"// \\\"SPDX-License-Identifier: AGPL-3.0-or-later\\\"\\n/// math.sol -- mixin for inline numerical wizardry\\n\\n// This program is free software: you can redistribute it and/or modify\\n// it under the terms of the GNU General Public License as published by\\n// the Free Software Foundation, either version 3 of the License, or\\n// (at your option) any later version.\\n\\n// This program is distributed in the hope that it will be useful,\\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\\n// GNU General Public License for more details.\\n\\n// You should have received a copy of the GNU General Public License\\n// along with this program. If not, see <http://www.gnu.org/licenses/>.\\n\\npragma solidity 0.7.4;\\n\\nfunction add(uint256 x, uint256 y) pure returns (uint256 z) {\\n require((z = x + y) >= x, \\\"ds-math-add-overflow\\\");\\n}\\n\\nfunction sub(uint256 x, uint256 y) pure returns (uint256 z) {\\n require((z = x - y) <= x, \\\"ds-math-sub-underflow\\\");\\n}\\n\\nfunction mul(uint256 x, uint256 y) pure returns (uint256 z) {\\n require(y == 0 || (z = x * y) / y == x, \\\"ds-math-mul-overflow\\\");\\n}\\n\\nfunction min(uint256 x, uint256 y) pure returns (uint256 z) {\\n return x <= y ? x : y;\\n}\\n\\nfunction max(uint256 x, uint256 y) pure returns (uint256 z) {\\n return x >= y ? x : y;\\n}\\n\\nfunction imin(int256 x, int256 y) pure returns (int256 z) {\\n return x <= y ? x : y;\\n}\\n\\nfunction imax(int256 x, int256 y) pure returns (int256 z) {\\n return x >= y ? x : y;\\n}\\n\\nuint256 constant WAD = 10**18;\\nuint256 constant RAY = 10**27;\\n\\n//rounds to zero if x*y < WAD / 2\\nfunction wmul(uint256 x, uint256 y) pure returns (uint256 z) {\\n z = add(mul(x, y), WAD / 2) / WAD;\\n}\\n\\n//rounds to zero if x*y < WAD / 2\\nfunction rmul(uint256 x, uint256 y) pure returns (uint256 z) {\\n z = add(mul(x, y), RAY / 2) / RAY;\\n}\\n\\n//rounds to zero if x*y < WAD / 2\\nfunction wdiv(uint256 x, uint256 y) pure returns (uint256 z) {\\n z = add(mul(x, WAD), y / 2) / y;\\n}\\n\\n//rounds to zero if x*y < RAY / 2\\nfunction rdiv(uint256 x, uint256 y) pure returns (uint256 z) {\\n z = add(mul(x, RAY), y / 2) / y;\\n}\\n\\n// This famous algorithm is called \\\"exponentiation by squaring\\\"\\n// and calculates x^n with x as fixed-point and n as regular unsigned.\\n//\\n// It's O(log n), instead of O(n) for naive repeated multiplication.\\n//\\n// These facts are why it works:\\n//\\n// If n is even, then x^n = (x^2)^(n/2).\\n// If n is odd, then x^n = x * x^(n-1),\\n// and applying the equation for even x gives\\n// x^n = x * (x^2)^((n-1) / 2).\\n//\\n// Also, EVM division is flooring and\\n// floor[(n-1) / 2] = floor[n / 2].\\n//\\nfunction rpow(uint256 x, uint256 n) pure returns (uint256 z) {\\n z = n % 2 != 0 ? x : RAY;\\n\\n for (n /= 2; n != 0; n /= 2) {\\n x = rmul(x, x);\\n\\n if (n % 2 != 0) {\\n z = rmul(z, x);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xa0b7c69e573cd75641300eaa6f8dffd94d1334b1561079e75aa9e740689f30f7\",\"license\":\"AGPL-3.0-or-later\"}},\"version\":1}",
"bytecode": "0x608060405234801561001057600080fd5b50611952806100206000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c806361d10bf0146100515780636e08865b1461007a578063a99891c51461009a578063cdcd5858146100ad575b600080fd5b61006461005f366004611545565b6100c0565b6040516100719190611753565b60405180910390f35b61008d61008836600461165d565b610120565b6040516100719190611748565b6100646100a836600461160c565b61014c565b6100646100bb3660046114e4565b61018e565b606063cdcd585860e01b86868686866040516024016100e39594939291906116fc565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152905095945050505050565b600084156101385761013385858561026e565b610143565b610143828585610629565b95945050505050565b60606000808083610160876004818b611811565b81019061016d91906114e4565b93509350935093506101818484848461018e565b9998505050505050505050565b606061019a838661086f565b6101a55760006101a7565b825b925060006101bc6101b786610a79565b610cde565b905060006102016101cc87610cf2565b6101fc6101f788156101f2736b175474e89094c44da98b954eedeac495271d0f88610e13565b610f1f565b610f7f565b610f92565b905061020f85838387610120565b6102475760405180604001604052806016815260200175446573745661756c7457696c6c4e6f7442655361666560501b815250610263565b604051806040016040528060028152602001614f4b60f01b8152505b979650505050505050565b6000836102ac5760405162461bcd60e51b81526004018080602001828103825260238152602001806118fa6023913960400191505060405180910390fd5b735ef30b9986345249bc32d8928b7ee64de9435e396000806102ce8388610fe2565b91509150600073e81f70cc7c0d46e12d70efc60607f16bbd617e886001600160a01b0316634445d799846040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561032c57600080fd5b505afa158015610340573d6000803e3d6000fd5b505050506040513d602081101561035657600080fd5b5051604080516336569e7760e01b815290519192506000916001600160a01b038716916336569e77916004808301926020929190829003018186803b15801561039e57600080fd5b505afa1580156103b2573d6000803e3d6000fd5b505050506040513d60208110156103c857600080fd5b505160408051636cb1c69b60e11b815260048101879052905191925060009182916001600160a01b0385169163d9638d369160248082019260a092909190829003018186803b15801561041a57600080fd5b505afa15801561042e573d6000803e3d6000fd5b505050506040513d60a081101561044457600080fd5b50602081015160409182015182516309092f9760e21b8152600481018a90526001600160a01b0389811660248301528451939650919450600093849392881692632424be5c926044808201939291829003018186803b1580156104a657600080fd5b505afa1580156104ba573d6000803e3d6000fd5b505050506040513d60408110156104d057600080fd5b50805160209182015160408051633612d9a360e11b81526001600160a01b038c81166004830152915193965091945060009390891692636c25b346926024808201939291829003018186803b15801561052857600080fd5b505afa15801561053c573d6000803e3d6000fd5b505050506040513d602081101561055257600080fd5b5051604080516359de7d4160e11b815290519192506000916105d1916001600160a01b038b169163b3bcfa8291600480820192602092909190829003018186803b15801561059f57600080fd5b505afa1580156105b3573d6000803e3d6000fd5b505050506040513d60208110156105c957600080fd5b50518e6110d7565b905060006105e08f84896110e9565b90506105ec858361114d565b94506105f8848261114d565b93506000610606888661119c565b9050610612868861119c565b10159c505050505050505050505050509392505050565b600080735ef30b9986345249bc32d8928b7ee64de9435e3990506000816001600160a01b03166336569e776040518163ffffffff1660e01b815260040160206040518083038186803b15801561067e57600080fd5b505afa158015610692573d6000803e3d6000fd5b505050506040513d60208110156106a857600080fd5b5051905060006106b7876111ff565b9050600080836001600160a01b031663d9638d36846040518263ffffffff1660e01b81526004018082815260200191505060a06040518083038186803b15801561070057600080fd5b505afa158015610714573d6000803e3d6000fd5b505050506040513d60a081101561072a57600080fd5b506020808201516040928301518351634445d79960e01b8152600481018890529351919550935060009273e81f70cc7c0d46e12d70efc60607f16bbd617e8892634445d79992602480840193829003018186803b15801561078a57600080fd5b505afa15801561079e573d6000803e3d6000fd5b505050506040513d60208110156107b457600080fd5b5051604080516359de7d4160e11b81529051919250600091610833916001600160a01b0385169163b3bcfa8291600480820192602092909190829003018186803b15801561080157600080fd5b505afa158015610815573d6000803e3d6000fd5b505050506040513d602081101561082b57600080fd5b50518a6110d7565b905060006108438b6000876110e9565b90506000610851868361119c565b905061085d838661119c565b10159c9b505050505050505050505050565b60008261087e57506000610a73565b735ef30b9986345249bc32d8928b7ee64de9435e396001600160a01b0316638161b120846040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b1580156108d657600080fd5b505afa9250505080156108fb57506040513d60208110156108f657600080fd5b505160015b610a625761090761183f565b806109125750610a15565b806040516020018080742326b0b5b2b9172fb4b9ab30bab63a27bbb732b91d60591b81525060150182805190602001908083835b602083106109655780518252601f199092019160209182019101610946565b51815160209384036101000a60001901801990921691161790526040805192909401828103601f190183529384905262461bcd60e51b84526004840181815282516024860152825192965094508493604401925085019080838360005b838110156109da5781810151838201526020016109c2565b50505050905090810190601f168015610a075780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b6040805162461bcd60e51b815260206004820152601e60248201527f464d616b65722e5f69735661756c744f776e65723a756e646566696e65640000604482015290519081900360640190fd5b6001600160a01b0383811691161490505b92915050565b6000735ef30b9986345249bc32d8928b7ee64de9435e398180610a9c8386610fe2565b915091506000836001600160a01b03166336569e776040518163ffffffff1660e01b815260040160206040518083038186803b158015610adb57600080fd5b505afa158015610aef573d6000803e3d6000fd5b505050506040513d6020811015610b0557600080fd5b505160408051636cb1c69b60e11b81526004810186905290519192506000916001600160a01b0384169163d9638d369160248083019260a0929190829003018186803b158015610b5457600080fd5b505afa158015610b68573d6000803e3d6000fd5b505050506040513d60a0811015610b7e57600080fd5b5060200151604080516309092f9760e21b8152600481018790526001600160a01b038681166024830152825193945060009390861692632424be5c9260448082019391829003018186803b158015610bd557600080fd5b505afa158015610be9573d6000803e3d6000fd5b505050506040513d6040811015610bff57600080fd5b5060209081015160408051633612d9a360e11b81526001600160a01b038881166004830152915192945060009391871692636c25b34692602480840193919291829003018186803b158015610c5357600080fd5b505afa158015610c67573d6000803e3d6000fd5b505050506040513d6020811015610c7d57600080fd5b505190506000610c96610c90848661119c565b83610f92565b90506b033b2e3c9fd0803ce80000008104985080610cc08a6b033b2e3c9fd0803ce800000061119c565b10610ccb5788610cd0565b886001015b9a9950505050505050505050565b6000610a7382670df27a2cdf44800061124f565b600080735ef30b9986345249bc32d8928b7ee64de9435e3990506000816001600160a01b03166336569e776040518163ffffffff1660e01b815260040160206040518083038186803b158015610d4757600080fd5b505afa158015610d5b573d6000803e3d6000fd5b505050506040513d6020811015610d7157600080fd5b50519050600080610d828487610fe2565b915091506000836001600160a01b0316632424be5c84846040518363ffffffff1660e01b815260040180838152602001826001600160a01b0316815260200192505050604080518083038186803b158015610ddc57600080fd5b505afa158015610df0573d6000803e3d6000fd5b505050506040513d6040811015610e0657600080fd5b5051979650505050505050565b6000610e1d6113dd565b604051635a860c8760e01b815273a004a5afba04b74037e9e52ba1f7eb02b5e6150990635a860c8790610e549087906004016116e8565b60806040518083038186803b158015610e6c57600080fd5b505afa158015610e80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ea491906115ad565b90508281600001511115610ebc576000915050610a73565b8281602001511115610ed2576001915050610a73565b8281604001511115610ee8576002915050610a73565b8281606001511115610efe576003915050610a73565b60405162461bcd60e51b8152600401610f16906117c3565b60405180910390fd5b6000610f2a82611284565b610f7883610f4f57610f3a6112a8565b8360048110610f4557fe5b6020020151610f73565b610f73610f5a6112a8565b8460048110610f6557fe5b6020020151620249f061114d565b6112e3565b9392505050565b6000610a7382610f8d611305565b61119c565b80820382811115610a73576040805162461bcd60e51b815260206004820152601560248201527464732d6d6174682d7375622d756e646572666c6f7760581b604482015290519081900360640190fd5b600080836001600160a01b0316632c2cb9fd846040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561102957600080fd5b505afa15801561103d573d6000803e3d6000fd5b505050506040513d602081101561105357600080fd5b505160408051632726b07360e01b81526004810186905290519193506001600160a01b03861691632726b07391602480820192602092909190829003018186803b1580156110a057600080fd5b505afa1580156110b4573d6000803e3d6000fd5b505050506040513d60208110156110ca57600080fd5b5051919491935090915050565b6000610f788284601203600a0a61119c565b60008161110b611105866b033b2e3c9fd0803ce800000061119c565b85610f92565b8161111257fe5b04905061112b846b033b2e3c9fd0803ce800000061119c565b611135828461119c565b106111405780611145565b806001015b949350505050565b80820182811015610a73576040805162461bcd60e51b815260206004820152601460248201527364732d6d6174682d6164642d6f766572666c6f7760601b604482015290519081900360640190fd5b60008115806111b7575050808202828282816111b457fe5b04145b610a73576040805162461bcd60e51b815260206004820152601460248201527364732d6d6174682d6d756c2d6f766572666c6f7760601b604482015290519081900360640190fd5b6000815160001415611247576040805162461bcd60e51b815260206004820152600c60248201526b737472696e672d656d70747960a01b604482015290519081900360640190fd5b506020015190565b6000670de0b6b3a7640000611275611267858561119c565b6706f05b59d3b2000061114d565b8161127c57fe5b049392505050565b60048111156112a55760405162461bcd60e51b8152600401610f1690611766565b50565b6112b0611405565b6040518060800160405280621e8480815260200162249f008152602001622b7cd08152602001623567e081525090505b90565b600060646112f783610f8d6064601461114d565b816112fe57fe5b0492915050565b60008073169e633a2d1e6c10dd91238ba11c4a708dfef37c6001600160a01b03166350d25bcd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561135557600080fd5b505afa158015611369573d6000803e3d6000fd5b505050506040513d602081101561137f57600080fd5b50519050600081136113d8576040805162461bcd60e51b815260206004820152601b60248201527f5f67657447656c61746f47617350726963653a306f7242656c6f770000000000604482015290519081900360640190fd5b905090565b6040518060800160405280600081526020016000815260200160008152602001600081525090565b60405180608001604052806004906020820280368337509192915050565b60008083601f840112611434578182fd5b50813567ffffffffffffffff81111561144b578182fd5b60208301915083602082850101111561146357600080fd5b9250929050565b600082601f83011261147a578081fd5b813567ffffffffffffffff8082111561148f57fe5b604051601f8301601f1916810160200182811182821017156114ad57fe5b6040528281529250828483016020018610156114c857600080fd5b8260208601602083013760006020848301015250505092915050565b600080600080608085870312156114f9578384fd5b8435611504816118e4565b93506020850135925060408501359150606085013567ffffffffffffffff81111561152d578182fd5b6115398782880161146a565b91505092959194509250565b60008060008060006080868803121561155c578081fd5b8535611567816118e4565b94506020860135935060408601359250606086013567ffffffffffffffff811115611590578182fd5b61159c88828901611423565b969995985093965092949392505050565b6000608082840312156115be578081fd5b6040516080810181811067ffffffffffffffff821117156115db57fe5b8060405250825181526020830151602082015260408301516040820152606083015160608201528091505092915050565b60008060008060608587031215611621578384fd5b84359350602085013567ffffffffffffffff81111561163e578384fd5b61164a87828801611423565b9598909750949560400135949350505050565b60008060008060808587031215611672578384fd5b843593506020850135925060408501359150606085013567ffffffffffffffff81111561152d578182fd5b60008151808452815b818110156116c2576020818501810151868301820152016116a6565b818111156116d35782602083870101525b50601f01601f19169290920160200192915050565b6001600160a01b0391909116815260200190565b600060018060a01b038716825285602083015284604083015260806060830152826080830152828460a084013781830160a090810191909152601f909201601f19160101949350505050565b901515815260200190565b600060208252610f78602083018461169d565b6020808252603e908201527f4647656c61746f446562744272696467652e5f676574476173436f73744d616b60408201527f6572546f4d616b65723a20696e76616c696420726f75746520696e6465780000606082015260800190565b6020808252602e908201527f4647656c61746f446562744272696467652e5f676574466c6173684c6f616e5260408201526d1bdd5d194e881a5b1b1a5c5d5a5960921b606082015260800190565b60008085851115611820578182fd5b8386111561182c578182fd5b5050820193919092039150565b60e01c90565b600060443d101561184f576112e0565b600481823e6308c379a06118638251611839565b1461186d576112e0565b6040513d600319016004823e80513d67ffffffffffffffff816024840111818411171561189d57505050506112e0565b828401925082519150808211156118b757505050506112e0565b503d830160208284010111156118cf575050506112e0565b601f01601f1916810160200160405291505090565b6001600160a01b03811681146112a557600080fdfe5f7661756c7457696c6c4265536166653a20696e76616c6964207661756c742069642ea264697066735822122060a8ef4125dea0e12655501bf65f66ace60d838b0c5982b607a17fbaa4f7881b64736f6c63430007040033",
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061004c5760003560e01c806361d10bf0146100515780636e08865b1461007a578063a99891c51461009a578063cdcd5858146100ad575b600080fd5b61006461005f366004611545565b6100c0565b6040516100719190611753565b60405180910390f35b61008d61008836600461165d565b610120565b6040516100719190611748565b6100646100a836600461160c565b61014c565b6100646100bb3660046114e4565b61018e565b606063cdcd585860e01b86868686866040516024016100e39594939291906116fc565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152905095945050505050565b600084156101385761013385858561026e565b610143565b610143828585610629565b95945050505050565b60606000808083610160876004818b611811565b81019061016d91906114e4565b93509350935093506101818484848461018e565b9998505050505050505050565b606061019a838661086f565b6101a55760006101a7565b825b925060006101bc6101b786610a79565b610cde565b905060006102016101cc87610cf2565b6101fc6101f788156101f2736b175474e89094c44da98b954eedeac495271d0f88610e13565b610f1f565b610f7f565b610f92565b905061020f85838387610120565b6102475760405180604001604052806016815260200175446573745661756c7457696c6c4e6f7442655361666560501b815250610263565b604051806040016040528060028152602001614f4b60f01b8152505b979650505050505050565b6000836102ac5760405162461bcd60e51b81526004018080602001828103825260238152602001806118fa6023913960400191505060405180910390fd5b735ef30b9986345249bc32d8928b7ee64de9435e396000806102ce8388610fe2565b91509150600073e81f70cc7c0d46e12d70efc60607f16bbd617e886001600160a01b0316634445d799846040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561032c57600080fd5b505afa158015610340573d6000803e3d6000fd5b505050506040513d602081101561035657600080fd5b5051604080516336569e7760e01b815290519192506000916001600160a01b038716916336569e77916004808301926020929190829003018186803b15801561039e57600080fd5b505afa1580156103b2573d6000803e3d6000fd5b505050506040513d60208110156103c857600080fd5b505160408051636cb1c69b60e11b815260048101879052905191925060009182916001600160a01b0385169163d9638d369160248082019260a092909190829003018186803b15801561041a57600080fd5b505afa15801561042e573d6000803e3d6000fd5b505050506040513d60a081101561044457600080fd5b50602081015160409182015182516309092f9760e21b8152600481018a90526001600160a01b0389811660248301528451939650919450600093849392881692632424be5c926044808201939291829003018186803b1580156104a657600080fd5b505afa1580156104ba573d6000803e3d6000fd5b505050506040513d60408110156104d057600080fd5b50805160209182015160408051633612d9a360e11b81526001600160a01b038c81166004830152915193965091945060009390891692636c25b346926024808201939291829003018186803b15801561052857600080fd5b505afa15801561053c573d6000803e3d6000fd5b505050506040513d602081101561055257600080fd5b5051604080516359de7d4160e11b815290519192506000916105d1916001600160a01b038b169163b3bcfa8291600480820192602092909190829003018186803b15801561059f57600080fd5b505afa1580156105b3573d6000803e3d6000fd5b505050506040513d60208110156105c957600080fd5b50518e6110d7565b905060006105e08f84896110e9565b90506105ec858361114d565b94506105f8848261114d565b93506000610606888661119c565b9050610612868861119c565b10159c505050505050505050505050509392505050565b600080735ef30b9986345249bc32d8928b7ee64de9435e3990506000816001600160a01b03166336569e776040518163ffffffff1660e01b815260040160206040518083038186803b15801561067e57600080fd5b505afa158015610692573d6000803e3d6000fd5b505050506040513d60208110156106a857600080fd5b5051905060006106b7876111ff565b9050600080836001600160a01b031663d9638d36846040518263ffffffff1660e01b81526004018082815260200191505060a06040518083038186803b15801561070057600080fd5b505afa158015610714573d6000803e3d6000fd5b505050506040513d60a081101561072a57600080fd5b506020808201516040928301518351634445d79960e01b8152600481018890529351919550935060009273e81f70cc7c0d46e12d70efc60607f16bbd617e8892634445d79992602480840193829003018186803b15801561078a57600080fd5b505afa15801561079e573d6000803e3d6000fd5b505050506040513d60208110156107b457600080fd5b5051604080516359de7d4160e11b81529051919250600091610833916001600160a01b0385169163b3bcfa8291600480820192602092909190829003018186803b15801561080157600080fd5b505afa158015610815573d6000803e3d6000fd5b505050506040513d602081101561082b57600080fd5b50518a6110d7565b905060006108438b6000876110e9565b90506000610851868361119c565b905061085d838661119c565b10159c9b505050505050505050505050565b60008261087e57506000610a73565b735ef30b9986345249bc32d8928b7ee64de9435e396001600160a01b0316638161b120846040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b1580156108d657600080fd5b505afa9250505080156108fb57506040513d60208110156108f657600080fd5b505160015b610a625761090761183f565b806109125750610a15565b806040516020018080742326b0b5b2b9172fb4b9ab30bab63a27bbb732b91d60591b81525060150182805190602001908083835b602083106109655780518252601f199092019160209182019101610946565b51815160209384036101000a60001901801990921691161790526040805192909401828103601f190183529384905262461bcd60e51b84526004840181815282516024860152825192965094508493604401925085019080838360005b838110156109da5781810151838201526020016109c2565b50505050905090810190601f168015610a075780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b6040805162461bcd60e51b815260206004820152601e60248201527f464d616b65722e5f69735661756c744f776e65723a756e646566696e65640000604482015290519081900360640190fd5b6001600160a01b0383811691161490505b92915050565b6000735ef30b9986345249bc32d8928b7ee64de9435e398180610a9c8386610fe2565b915091506000836001600160a01b03166336569e776040518163ffffffff1660e01b815260040160206040518083038186803b158015610adb57600080fd5b505afa158015610aef573d6000803e3d6000fd5b505050506040513d6020811015610b0557600080fd5b505160408051636cb1c69b60e11b81526004810186905290519192506000916001600160a01b0384169163d9638d369160248083019260a0929190829003018186803b158015610b5457600080fd5b505afa158015610b68573d6000803e3d6000fd5b505050506040513d60a0811015610b7e57600080fd5b5060200151604080516309092f9760e21b8152600481018790526001600160a01b038681166024830152825193945060009390861692632424be5c9260448082019391829003018186803b158015610bd557600080fd5b505afa158015610be9573d6000803e3d6000fd5b505050506040513d6040811015610bff57600080fd5b5060209081015160408051633612d9a360e11b81526001600160a01b038881166004830152915192945060009391871692636c25b34692602480840193919291829003018186803b158015610c5357600080fd5b505afa158015610c67573d6000803e3d6000fd5b505050506040513d6020811015610c7d57600080fd5b505190506000610c96610c90848661119c565b83610f92565b90506b033b2e3c9fd0803ce80000008104985080610cc08a6b033b2e3c9fd0803ce800000061119c565b10610ccb5788610cd0565b886001015b9a9950505050505050505050565b6000610a7382670df27a2cdf44800061124f565b600080735ef30b9986345249bc32d8928b7ee64de9435e3990506000816001600160a01b03166336569e776040518163ffffffff1660e01b815260040160206040518083038186803b158015610d4757600080fd5b505afa158015610d5b573d6000803e3d6000fd5b505050506040513d6020811015610d7157600080fd5b50519050600080610d828487610fe2565b915091506000836001600160a01b0316632424be5c84846040518363ffffffff1660e01b815260040180838152602001826001600160a01b0316815260200192505050604080518083038186803b158015610ddc57600080fd5b505afa158015610df0573d6000803e3d6000fd5b505050506040513d6040811015610e0657600080fd5b5051979650505050505050565b6000610e1d6113dd565b604051635a860c8760e01b815273a004a5afba04b74037e9e52ba1f7eb02b5e6150990635a860c8790610e549087906004016116e8565b60806040518083038186803b158015610e6c57600080fd5b505afa158015610e80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ea491906115ad565b90508281600001511115610ebc576000915050610a73565b8281602001511115610ed2576001915050610a73565b8281604001511115610ee8576002915050610a73565b8281606001511115610efe576003915050610a73565b60405162461bcd60e51b8152600401610f16906117c3565b60405180910390fd5b6000610f2a82611284565b610f7883610f4f57610f3a6112a8565b8360048110610f4557fe5b6020020151610f73565b610f73610f5a6112a8565b8460048110610f6557fe5b6020020151620249f061114d565b6112e3565b9392505050565b6000610a7382610f8d611305565b61119c565b80820382811115610a73576040805162461bcd60e51b815260206004820152601560248201527464732d6d6174682d7375622d756e646572666c6f7760581b604482015290519081900360640190fd5b600080836001600160a01b0316632c2cb9fd846040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561102957600080fd5b505afa15801561103d573d6000803e3d6000fd5b505050506040513d602081101561105357600080fd5b505160408051632726b07360e01b81526004810186905290519193506001600160a01b03861691632726b07391602480820192602092909190829003018186803b1580156110a057600080fd5b505afa1580156110b4573d6000803e3d6000fd5b505050506040513d60208110156110ca57600080fd5b5051919491935090915050565b6000610f788284601203600a0a61119c565b60008161110b611105866b033b2e3c9fd0803ce800000061119c565b85610f92565b8161111257fe5b04905061112b846b033b2e3c9fd0803ce800000061119c565b611135828461119c565b106111405780611145565b806001015b949350505050565b80820182811015610a73576040805162461bcd60e51b815260206004820152601460248201527364732d6d6174682d6164642d6f766572666c6f7760601b604482015290519081900360640190fd5b60008115806111b7575050808202828282816111b457fe5b04145b610a73576040805162461bcd60e51b815260206004820152601460248201527364732d6d6174682d6d756c2d6f766572666c6f7760601b604482015290519081900360640190fd5b6000815160001415611247576040805162461bcd60e51b815260206004820152600c60248201526b737472696e672d656d70747960a01b604482015290519081900360640190fd5b506020015190565b6000670de0b6b3a7640000611275611267858561119c565b6706f05b59d3b2000061114d565b8161127c57fe5b049392505050565b60048111156112a55760405162461bcd60e51b8152600401610f1690611766565b50565b6112b0611405565b6040518060800160405280621e8480815260200162249f008152602001622b7cd08152602001623567e081525090505b90565b600060646112f783610f8d6064601461114d565b816112fe57fe5b0492915050565b60008073169e633a2d1e6c10dd91238ba11c4a708dfef37c6001600160a01b03166350d25bcd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561135557600080fd5b505afa158015611369573d6000803e3d6000fd5b505050506040513d602081101561137f57600080fd5b50519050600081136113d8576040805162461bcd60e51b815260206004820152601b60248201527f5f67657447656c61746f47617350726963653a306f7242656c6f770000000000604482015290519081900360640190fd5b905090565b6040518060800160405280600081526020016000815260200160008152602001600081525090565b60405180608001604052806004906020820280368337509192915050565b60008083601f840112611434578182fd5b50813567ffffffffffffffff81111561144b578182fd5b60208301915083602082850101111561146357600080fd5b9250929050565b600082601f83011261147a578081fd5b813567ffffffffffffffff8082111561148f57fe5b604051601f8301601f1916810160200182811182821017156114ad57fe5b6040528281529250828483016020018610156114c857600080fd5b8260208601602083013760006020848301015250505092915050565b600080600080608085870312156114f9578384fd5b8435611504816118e4565b93506020850135925060408501359150606085013567ffffffffffffffff81111561152d578182fd5b6115398782880161146a565b91505092959194509250565b60008060008060006080868803121561155c578081fd5b8535611567816118e4565b94506020860135935060408601359250606086013567ffffffffffffffff811115611590578182fd5b61159c88828901611423565b969995985093965092949392505050565b6000608082840312156115be578081fd5b6040516080810181811067ffffffffffffffff821117156115db57fe5b8060405250825181526020830151602082015260408301516040820152606083015160608201528091505092915050565b60008060008060608587031215611621578384fd5b84359350602085013567ffffffffffffffff81111561163e578384fd5b61164a87828801611423565b9598909750949560400135949350505050565b60008060008060808587031215611672578384fd5b843593506020850135925060408501359150606085013567ffffffffffffffff81111561152d578182fd5b60008151808452815b818110156116c2576020818501810151868301820152016116a6565b818111156116d35782602083870101525b50601f01601f19169290920160200192915050565b6001600160a01b0391909116815260200190565b600060018060a01b038716825285602083015284604083015260806060830152826080830152828460a084013781830160a090810191909152601f909201601f19160101949350505050565b901515815260200190565b600060208252610f78602083018461169d565b6020808252603e908201527f4647656c61746f446562744272696467652e5f676574476173436f73744d616b60408201527f6572546f4d616b65723a20696e76616c696420726f75746520696e6465780000606082015260800190565b6020808252602e908201527f4647656c61746f446562744272696467652e5f676574466c6173684c6f616e5260408201526d1bdd5d194e881a5b1b1a5c5d5a5960921b606082015260800190565b60008085851115611820578182fd5b8386111561182c578182fd5b5050820193919092039150565b60e01c90565b600060443d101561184f576112e0565b600481823e6308c379a06118638251611839565b1461186d576112e0565b6040513d600319016004823e80513d67ffffffffffffffff816024840111818411171561189d57505050506112e0565b828401925082519150808211156118b757505050506112e0565b503d830160208284010111156118cf575050506112e0565b601f01601f1916810160200160405291505090565b6001600160a01b03811681146112a557600080fdfe5f7661756c7457696c6c4265536166653a20696e76616c6964207661756c742069642ea264697066735822122060a8ef4125dea0e12655501bf65f66ace60d838b0c5982b607a17fbaa4f7881b64736f6c63430007040033",
"devdoc": {
"kind": "dev",
"methods": {},
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
},
"storageLayout": {
"storage": [],
"types": null
}
}